35582
|
1 |
header {*Lebesgue Integration*}
|
|
2 |
|
|
3 |
theory Lebesgue
|
|
4 |
imports Measure Borel
|
|
5 |
begin
|
|
6 |
|
|
7 |
text{*From the HOL4 Hurd/Coble Lebesgue integration, translated by Armin Heller and Johannes Hoelzl.*}
|
|
8 |
|
|
9 |
definition
|
|
10 |
"pos_part f = (\<lambda>x. max 0 (f x))"
|
|
11 |
|
|
12 |
definition
|
|
13 |
"neg_part f = (\<lambda>x. - min 0 (f x))"
|
|
14 |
|
|
15 |
definition
|
|
16 |
"nonneg f = (\<forall>x. 0 \<le> f x)"
|
|
17 |
|
|
18 |
lemma nonneg_pos_part[intro!]:
|
|
19 |
fixes f :: "'c \<Rightarrow> 'd\<Colon>{linorder,zero}"
|
|
20 |
shows "nonneg (pos_part f)"
|
|
21 |
unfolding nonneg_def pos_part_def by auto
|
|
22 |
|
|
23 |
lemma nonneg_neg_part[intro!]:
|
|
24 |
fixes f :: "'c \<Rightarrow> 'd\<Colon>{linorder,ordered_ab_group_add}"
|
|
25 |
shows "nonneg (neg_part f)"
|
|
26 |
unfolding nonneg_def neg_part_def min_def by auto
|
|
27 |
|
35692
|
28 |
lemma (in measure_space)
|
|
29 |
assumes "f \<in> borel_measurable M"
|
|
30 |
shows pos_part_borel_measurable: "pos_part f \<in> borel_measurable M"
|
|
31 |
and neg_part_borel_measurable: "neg_part f \<in> borel_measurable M"
|
|
32 |
using assms
|
|
33 |
proof -
|
|
34 |
{ fix a :: real
|
|
35 |
{ assume asm: "0 \<le> a"
|
|
36 |
from asm have pp: "\<And> w. (pos_part f w \<le> a) = (f w \<le> a)" unfolding pos_part_def by auto
|
|
37 |
have "{w | w. w \<in> space M \<and> f w \<le> a} \<in> sets M"
|
|
38 |
unfolding pos_part_def using assms borel_measurable_le_iff by auto
|
|
39 |
hence "{w . w \<in> space M \<and> pos_part f w \<le> a} \<in> sets M" using pp by auto }
|
|
40 |
moreover have "a < 0 \<Longrightarrow> {w \<in> space M. pos_part f w \<le> a} \<in> sets M"
|
|
41 |
unfolding pos_part_def using empty_sets by auto
|
|
42 |
ultimately have "{w . w \<in> space M \<and> pos_part f w \<le> a} \<in> sets M"
|
|
43 |
using le_less_linear by auto
|
|
44 |
} hence pos: "pos_part f \<in> borel_measurable M" using borel_measurable_le_iff by auto
|
|
45 |
{ fix a :: real
|
|
46 |
{ assume asm: "0 \<le> a"
|
|
47 |
from asm have pp: "\<And> w. (neg_part f w \<le> a) = (f w \<ge> - a)" unfolding neg_part_def by auto
|
|
48 |
have "{w | w. w \<in> space M \<and> f w \<ge> - a} \<in> sets M"
|
|
49 |
unfolding neg_part_def using assms borel_measurable_ge_iff by auto
|
|
50 |
hence "{w . w \<in> space M \<and> neg_part f w \<le> a} \<in> sets M" using pp by auto }
|
|
51 |
moreover have "a < 0 \<Longrightarrow> {w \<in> space M. neg_part f w \<le> a} = {}" unfolding neg_part_def by auto
|
|
52 |
moreover hence "a < 0 \<Longrightarrow> {w \<in> space M. neg_part f w \<le> a} \<in> sets M" by (simp only: empty_sets)
|
|
53 |
ultimately have "{w . w \<in> space M \<and> neg_part f w \<le> a} \<in> sets M"
|
|
54 |
using le_less_linear by auto
|
|
55 |
} hence neg: "neg_part f \<in> borel_measurable M" using borel_measurable_le_iff by auto
|
|
56 |
from pos neg show "pos_part f \<in> borel_measurable M" and "neg_part f \<in> borel_measurable M" by auto
|
|
57 |
qed
|
|
58 |
|
|
59 |
lemma (in measure_space) pos_part_neg_part_borel_measurable_iff:
|
|
60 |
"f \<in> borel_measurable M \<longleftrightarrow>
|
|
61 |
pos_part f \<in> borel_measurable M \<and> neg_part f \<in> borel_measurable M"
|
|
62 |
proof -
|
|
63 |
{ fix x
|
|
64 |
have "f x = pos_part f x - neg_part f x"
|
|
65 |
unfolding pos_part_def neg_part_def unfolding max_def min_def
|
|
66 |
by auto }
|
|
67 |
hence "(\<lambda> x. f x) = (\<lambda> x. pos_part f x - neg_part f x)" by auto
|
|
68 |
hence "f = (\<lambda> x. pos_part f x - neg_part f x)" by blast
|
|
69 |
from pos_part_borel_measurable[of f] neg_part_borel_measurable[of f]
|
|
70 |
borel_measurable_diff_borel_measurable[of "pos_part f" "neg_part f"]
|
|
71 |
this
|
|
72 |
show ?thesis by auto
|
|
73 |
qed
|
|
74 |
|
35582
|
75 |
context measure_space
|
|
76 |
begin
|
|
77 |
|
35692
|
78 |
section "Simple discrete step function"
|
|
79 |
|
35582
|
80 |
definition
|
|
81 |
"pos_simple f =
|
|
82 |
{ (s :: nat set, a, x).
|
|
83 |
finite s \<and> nonneg f \<and> nonneg x \<and> a ` s \<subseteq> sets M \<and>
|
|
84 |
(\<forall>t \<in> space M. (\<exists>!i\<in>s. t\<in>a i) \<and> (\<forall>i\<in>s. t \<in> a i \<longrightarrow> f t = x i)) }"
|
|
85 |
|
|
86 |
definition
|
|
87 |
"pos_simple_integral \<equiv> \<lambda>(s, a, x). \<Sum> i \<in> s. x i * measure M (a i)"
|
|
88 |
|
|
89 |
definition
|
|
90 |
"psfis f = pos_simple_integral ` (pos_simple f)"
|
|
91 |
|
|
92 |
lemma pos_simpleE[consumes 1]:
|
|
93 |
assumes ps: "(s, a, x) \<in> pos_simple f"
|
|
94 |
obtains "finite s" and "nonneg f" and "nonneg x"
|
|
95 |
and "a ` s \<subseteq> sets M" and "(\<Union>i\<in>s. a i) = space M"
|
|
96 |
and "disjoint_family_on a s"
|
|
97 |
and "\<And>t. t \<in> space M \<Longrightarrow> (\<exists>!i. i \<in> s \<and> t \<in> a i)"
|
|
98 |
and "\<And>t i. \<lbrakk> t \<in> space M ; i \<in> s ; t \<in> a i \<rbrakk> \<Longrightarrow> f t = x i"
|
|
99 |
proof
|
|
100 |
show "finite s" and "nonneg f" and "nonneg x"
|
|
101 |
and as_in_M: "a ` s \<subseteq> sets M"
|
|
102 |
and *: "\<And>t. t \<in> space M \<Longrightarrow> (\<exists>!i. i \<in> s \<and> t \<in> a i)"
|
|
103 |
and **: "\<And>t i. \<lbrakk> t \<in> space M ; i \<in> s ; t \<in> a i \<rbrakk> \<Longrightarrow> f t = x i"
|
|
104 |
using ps unfolding pos_simple_def by auto
|
|
105 |
|
|
106 |
thus t: "(\<Union>i\<in>s. a i) = space M"
|
|
107 |
proof safe
|
|
108 |
fix x assume "x \<in> space M"
|
|
109 |
from *[OF this] show "x \<in> (\<Union>i\<in>s. a i)" by auto
|
|
110 |
next
|
|
111 |
fix t i assume "i \<in> s"
|
|
112 |
hence "a i \<in> sets M" using as_in_M by auto
|
|
113 |
moreover assume "t \<in> a i"
|
|
114 |
ultimately show "t \<in> space M" using sets_into_space by blast
|
|
115 |
qed
|
|
116 |
|
|
117 |
show "disjoint_family_on a s" unfolding disjoint_family_on_def
|
|
118 |
proof safe
|
|
119 |
fix i j and t assume "i \<in> s" "t \<in> a i" and "j \<in> s" "t \<in> a j" and "i \<noteq> j"
|
|
120 |
with t * show "t \<in> {}" by auto
|
|
121 |
qed
|
|
122 |
qed
|
|
123 |
|
|
124 |
lemma pos_simple_cong:
|
|
125 |
assumes "nonneg f" and "nonneg g" and "\<And>t. t \<in> space M \<Longrightarrow> f t = g t"
|
|
126 |
shows "pos_simple f = pos_simple g"
|
|
127 |
unfolding pos_simple_def using assms by auto
|
|
128 |
|
|
129 |
lemma psfis_cong:
|
|
130 |
assumes "nonneg f" and "nonneg g" and "\<And>t. t \<in> space M \<Longrightarrow> f t = g t"
|
|
131 |
shows "psfis f = psfis g"
|
|
132 |
unfolding psfis_def using pos_simple_cong[OF assms] by simp
|
|
133 |
|
35692
|
134 |
lemma psfis_0: "0 \<in> psfis (\<lambda>x. 0)"
|
|
135 |
unfolding psfis_def pos_simple_def pos_simple_integral_def
|
|
136 |
by (auto simp: nonneg_def
|
|
137 |
intro: image_eqI[where x="({0}, (\<lambda>i. space M), (\<lambda>i. 0))"])
|
|
138 |
|
35582
|
139 |
lemma pos_simple_setsum_indicator_fn:
|
|
140 |
assumes ps: "(s, a, x) \<in> pos_simple f"
|
|
141 |
and "t \<in> space M"
|
|
142 |
shows "(\<Sum>i\<in>s. x i * indicator_fn (a i) t) = f t"
|
|
143 |
proof -
|
|
144 |
from assms obtain i where *: "i \<in> s" "t \<in> a i"
|
|
145 |
and "finite s" and xi: "x i = f t" by (auto elim!: pos_simpleE)
|
|
146 |
|
|
147 |
have **: "(\<Sum>i\<in>s. x i * indicator_fn (a i) t) =
|
|
148 |
(\<Sum>j\<in>s. if j \<in> {i} then x i else 0)"
|
|
149 |
unfolding indicator_fn_def using assms *
|
|
150 |
by (auto intro!: setsum_cong elim!: pos_simpleE)
|
|
151 |
show ?thesis unfolding ** setsum_cases[OF `finite s`] xi
|
|
152 |
using `i \<in> s` by simp
|
|
153 |
qed
|
|
154 |
|
35692
|
155 |
lemma pos_simple_common_partition:
|
35582
|
156 |
assumes psf: "(s, a, x) \<in> pos_simple f"
|
|
157 |
assumes psg: "(s', b, y) \<in> pos_simple g"
|
|
158 |
obtains z z' c k where "(k, c, z) \<in> pos_simple f" "(k, c, z') \<in> pos_simple g"
|
|
159 |
proof -
|
|
160 |
(* definitions *)
|
|
161 |
|
|
162 |
def k == "{0 ..< card (s \<times> s')}"
|
|
163 |
have fs: "finite s" "finite s'" "finite k" unfolding k_def
|
|
164 |
using psf psg unfolding pos_simple_def by auto
|
|
165 |
hence "finite (s \<times> s')" by simp
|
|
166 |
then obtain p where p: "p ` k = s \<times> s'" "inj_on p k"
|
|
167 |
using ex_bij_betw_nat_finite[of "s \<times> s'"] unfolding bij_betw_def k_def by blast
|
|
168 |
def c == "\<lambda> i. a (fst (p i)) \<inter> b (snd (p i))"
|
|
169 |
def z == "\<lambda> i. x (fst (p i))"
|
|
170 |
def z' == "\<lambda> i. y (snd (p i))"
|
|
171 |
|
|
172 |
have "finite k" unfolding k_def by simp
|
|
173 |
|
|
174 |
have "nonneg z" and "nonneg z'"
|
|
175 |
using psf psg unfolding z_def z'_def pos_simple_def nonneg_def by auto
|
|
176 |
|
|
177 |
have ck_subset_M: "c ` k \<subseteq> sets M"
|
|
178 |
proof
|
|
179 |
fix x assume "x \<in> c ` k"
|
|
180 |
then obtain j where "j \<in> k" and "x = c j" by auto
|
|
181 |
hence "p j \<in> s \<times> s'" using p(1) by auto
|
|
182 |
hence "a (fst (p j)) \<in> sets M" (is "?a \<in> _")
|
|
183 |
and "b (snd (p j)) \<in> sets M" (is "?b \<in> _")
|
|
184 |
using psf psg unfolding pos_simple_def by auto
|
|
185 |
thus "x \<in> sets M" unfolding `x = c j` c_def using Int by simp
|
|
186 |
qed
|
|
187 |
|
|
188 |
{ fix t assume "t \<in> space M"
|
|
189 |
hence ex1s: "\<exists>!i\<in>s. t \<in> a i" and ex1s': "\<exists>!i\<in>s'. t \<in> b i"
|
|
190 |
using psf psg unfolding pos_simple_def by auto
|
|
191 |
then obtain j j' where j: "j \<in> s" "t \<in> a j" and j': "j' \<in> s'" "t \<in> b j'"
|
|
192 |
by auto
|
|
193 |
then obtain i :: nat where i: "(j,j') = p i" and "i \<in> k" using p by auto
|
|
194 |
have "\<exists>!i\<in>k. t \<in> c i"
|
|
195 |
proof (rule ex1I[of _ i])
|
|
196 |
show "\<And>x. x \<in> k \<Longrightarrow> t \<in> c x \<Longrightarrow> x = i"
|
|
197 |
proof -
|
|
198 |
fix l assume "l \<in> k" "t \<in> c l"
|
|
199 |
hence "p l \<in> s \<times> s'" and t_in: "t \<in> a (fst (p l))" "t \<in> b (snd (p l))"
|
|
200 |
using p unfolding c_def by auto
|
|
201 |
hence "fst (p l) \<in> s" and "snd (p l) \<in> s'" by auto
|
|
202 |
with t_in j j' ex1s ex1s' have "p l = (j, j')" by (cases "p l", auto)
|
|
203 |
thus "l = i"
|
|
204 |
using `(j, j') = p i` p(2)[THEN inj_onD] `l \<in> k` `i \<in> k` by auto
|
|
205 |
qed
|
|
206 |
|
|
207 |
show "i \<in> k \<and> t \<in> c i"
|
|
208 |
using `i \<in> k` `t \<in> a j` `t \<in> b j'` c_def i[symmetric] by auto
|
|
209 |
qed auto
|
|
210 |
} note ex1 = this
|
|
211 |
|
|
212 |
show thesis
|
|
213 |
proof (rule that)
|
|
214 |
{ fix t i assume "t \<in> space M" and "i \<in> k"
|
|
215 |
hence "p i \<in> s \<times> s'" using p(1) by auto
|
|
216 |
hence "fst (p i) \<in> s" by auto
|
|
217 |
moreover
|
|
218 |
assume "t \<in> c i"
|
|
219 |
hence "t \<in> a (fst (p i))" unfolding c_def by auto
|
|
220 |
ultimately have "f t = z i" using psf `t \<in> space M`
|
|
221 |
unfolding z_def pos_simple_def by auto
|
|
222 |
}
|
|
223 |
thus "(k, c, z) \<in> pos_simple f"
|
|
224 |
using psf `finite k` `nonneg z` ck_subset_M ex1
|
|
225 |
unfolding pos_simple_def by auto
|
|
226 |
|
|
227 |
{ fix t i assume "t \<in> space M" and "i \<in> k"
|
|
228 |
hence "p i \<in> s \<times> s'" using p(1) by auto
|
|
229 |
hence "snd (p i) \<in> s'" by auto
|
|
230 |
moreover
|
|
231 |
assume "t \<in> c i"
|
|
232 |
hence "t \<in> b (snd (p i))" unfolding c_def by auto
|
|
233 |
ultimately have "g t = z' i" using psg `t \<in> space M`
|
|
234 |
unfolding z'_def pos_simple_def by auto
|
|
235 |
}
|
|
236 |
thus "(k, c, z') \<in> pos_simple g"
|
|
237 |
using psg `finite k` `nonneg z'` ck_subset_M ex1
|
|
238 |
unfolding pos_simple_def by auto
|
|
239 |
qed
|
|
240 |
qed
|
|
241 |
|
35692
|
242 |
lemma pos_simple_integral_equal:
|
35582
|
243 |
assumes psx: "(s, a, x) \<in> pos_simple f"
|
|
244 |
assumes psy: "(s', b, y) \<in> pos_simple f"
|
|
245 |
shows "pos_simple_integral (s, a, x) = pos_simple_integral (s', b, y)"
|
|
246 |
unfolding pos_simple_integral_def
|
|
247 |
proof simp
|
|
248 |
have "(\<Sum>i\<in>s. x i * measure M (a i)) =
|
|
249 |
(\<Sum>i\<in>s. (\<Sum>j \<in> s'. x i * measure M (a i \<inter> b j)))" (is "?left = _")
|
|
250 |
using psy psx unfolding setsum_right_distrib[symmetric]
|
|
251 |
by (auto intro!: setsum_cong measure_setsum_split elim!: pos_simpleE)
|
|
252 |
also have "... = (\<Sum>i\<in>s. (\<Sum>j \<in> s'. y j * measure M (a i \<inter> b j)))"
|
|
253 |
proof (rule setsum_cong, simp, rule setsum_cong, simp_all)
|
|
254 |
fix i j assume i: "i \<in> s" and j: "j \<in> s'"
|
|
255 |
hence "a i \<in> sets M" using psx by (auto elim!: pos_simpleE)
|
|
256 |
|
|
257 |
show "measure M (a i \<inter> b j) = 0 \<or> x i = y j"
|
|
258 |
proof (cases "a i \<inter> b j = {}")
|
|
259 |
case True thus ?thesis using empty_measure by simp
|
|
260 |
next
|
|
261 |
case False then obtain t where t: "t \<in> a i" "t \<in> b j" by auto
|
|
262 |
hence "t \<in> space M" using `a i \<in> sets M` sets_into_space by auto
|
|
263 |
with psx psy t i j have "x i = f t" and "y j = f t"
|
|
264 |
unfolding pos_simple_def by auto
|
|
265 |
thus ?thesis by simp
|
|
266 |
qed
|
|
267 |
qed
|
|
268 |
also have "... = (\<Sum>j\<in>s'. (\<Sum>i\<in>s. y j * measure M (a i \<inter> b j)))"
|
|
269 |
by (subst setsum_commute) simp
|
|
270 |
also have "... = (\<Sum>i\<in>s'. y i * measure M (b i))" (is "?sum_sum = ?right")
|
|
271 |
proof (rule setsum_cong)
|
|
272 |
fix j assume "j \<in> s'"
|
|
273 |
have "y j * measure M (b j) = (\<Sum>i\<in>s. y j * measure M (b j \<inter> a i))"
|
|
274 |
using psx psy `j \<in> s'` unfolding setsum_right_distrib[symmetric]
|
|
275 |
by (auto intro!: measure_setsum_split elim!: pos_simpleE)
|
|
276 |
thus "(\<Sum>i\<in>s. y j * measure M (a i \<inter> b j)) = y j * measure M (b j)"
|
|
277 |
by (auto intro!: setsum_cong arg_cong[where f="measure M"])
|
|
278 |
qed simp
|
|
279 |
finally show "?left = ?right" .
|
|
280 |
qed
|
|
281 |
|
35692
|
282 |
lemma psfis_present:
|
35582
|
283 |
assumes "A \<in> psfis f"
|
|
284 |
assumes "B \<in> psfis g"
|
|
285 |
obtains z z' c k where
|
|
286 |
"A = pos_simple_integral (k, c, z)"
|
|
287 |
"B = pos_simple_integral (k, c, z')"
|
|
288 |
"(k, c, z) \<in> pos_simple f"
|
|
289 |
"(k, c, z') \<in> pos_simple g"
|
|
290 |
using assms
|
|
291 |
proof -
|
|
292 |
from assms obtain s a x s' b y where
|
|
293 |
ps: "(s, a, x) \<in> pos_simple f" "(s', b, y) \<in> pos_simple g" and
|
|
294 |
A: "A = pos_simple_integral (s, a, x)" and
|
|
295 |
B: "B = pos_simple_integral (s', b, y)"
|
|
296 |
unfolding psfis_def pos_simple_integral_def by auto
|
|
297 |
|
|
298 |
guess z z' c k using pos_simple_common_partition[OF ps] . note part = this
|
|
299 |
show thesis
|
|
300 |
proof (rule that[of k c z z', OF _ _ part])
|
|
301 |
show "A = pos_simple_integral (k, c, z)"
|
|
302 |
unfolding A by (rule pos_simple_integral_equal[OF ps(1) part(1)])
|
|
303 |
show "B = pos_simple_integral (k, c, z')"
|
|
304 |
unfolding B by (rule pos_simple_integral_equal[OF ps(2) part(2)])
|
|
305 |
qed
|
|
306 |
qed
|
|
307 |
|
35692
|
308 |
lemma pos_simple_integral_add:
|
35582
|
309 |
assumes "(s, a, x) \<in> pos_simple f"
|
|
310 |
assumes "(s', b, y) \<in> pos_simple g"
|
|
311 |
obtains s'' c z where
|
|
312 |
"(s'', c, z) \<in> pos_simple (\<lambda>x. f x + g x)"
|
|
313 |
"(pos_simple_integral (s, a, x) +
|
|
314 |
pos_simple_integral (s', b, y) =
|
|
315 |
pos_simple_integral (s'', c, z))"
|
|
316 |
using assms
|
|
317 |
proof -
|
|
318 |
guess z z' c k
|
|
319 |
by (rule pos_simple_common_partition[OF `(s, a, x) \<in> pos_simple f ` `(s', b, y) \<in> pos_simple g`])
|
|
320 |
note kczz' = this
|
|
321 |
have x: "pos_simple_integral (s, a, x) = pos_simple_integral (k, c, z)"
|
|
322 |
by (rule pos_simple_integral_equal) (fact, fact)
|
|
323 |
have y: "pos_simple_integral (s', b, y) = pos_simple_integral (k, c, z')"
|
|
324 |
by (rule pos_simple_integral_equal) (fact, fact)
|
|
325 |
|
|
326 |
have "pos_simple_integral (k, c, (\<lambda> x. z x + z' x))
|
|
327 |
= (\<Sum> x \<in> k. (z x + z' x) * measure M (c x))"
|
|
328 |
unfolding pos_simple_integral_def by auto
|
|
329 |
also have "\<dots> = (\<Sum> x \<in> k. z x * measure M (c x) + z' x * measure M (c x))" using real_add_mult_distrib by auto
|
|
330 |
also have "\<dots> = (\<Sum> x \<in> k. z x * measure M (c x)) + (\<Sum> x \<in> k. z' x * measure M (c x))" using setsum_addf by auto
|
|
331 |
also have "\<dots> = pos_simple_integral (k, c, z) + pos_simple_integral (k, c, z')" unfolding pos_simple_integral_def by auto
|
|
332 |
finally have ths: "pos_simple_integral (s, a, x) + pos_simple_integral (s', b, y) =
|
|
333 |
pos_simple_integral (k, c, (\<lambda> x. z x + z' x))" using x y by auto
|
|
334 |
show ?thesis
|
|
335 |
apply (rule that[of k c "(\<lambda> x. z x + z' x)", OF _ ths])
|
|
336 |
using kczz' unfolding pos_simple_def nonneg_def by (auto intro!: add_nonneg_nonneg)
|
|
337 |
qed
|
|
338 |
|
|
339 |
lemma psfis_add:
|
|
340 |
assumes "a \<in> psfis f" "b \<in> psfis g"
|
|
341 |
shows "a + b \<in> psfis (\<lambda>x. f x + g x)"
|
|
342 |
using assms pos_simple_integral_add
|
|
343 |
unfolding psfis_def by auto blast
|
|
344 |
|
|
345 |
lemma pos_simple_integral_mono_on_mspace:
|
|
346 |
assumes f: "(s, a, x) \<in> pos_simple f"
|
|
347 |
assumes g: "(s', b, y) \<in> pos_simple g"
|
|
348 |
assumes mono: "\<And> x. x \<in> space M \<Longrightarrow> f x \<le> g x"
|
|
349 |
shows "pos_simple_integral (s, a, x) \<le> pos_simple_integral (s', b, y)"
|
|
350 |
using assms
|
|
351 |
proof -
|
|
352 |
guess z z' c k by (rule pos_simple_common_partition[OF f g])
|
|
353 |
note kczz' = this
|
|
354 |
(* w = z and w' = z' except where c _ = {} or undef *)
|
|
355 |
def w == "\<lambda> i. if i \<notin> k \<or> c i = {} then 0 else z i"
|
|
356 |
def w' == "\<lambda> i. if i \<notin> k \<or> c i = {} then 0 else z' i"
|
|
357 |
{ fix i
|
|
358 |
have "w i \<le> w' i"
|
|
359 |
proof (cases "i \<notin> k \<or> c i = {}")
|
|
360 |
case False hence "i \<in> k" "c i \<noteq> {}" by auto
|
|
361 |
then obtain v where v: "v \<in> c i" and "c i \<in> sets M"
|
|
362 |
using kczz'(1) unfolding pos_simple_def by blast
|
|
363 |
hence "v \<in> space M" using sets_into_space by blast
|
|
364 |
with mono[OF `v \<in> space M`] kczz' `i \<in> k` `v \<in> c i`
|
|
365 |
have "z i \<le> z' i" unfolding pos_simple_def by simp
|
|
366 |
thus ?thesis unfolding w_def w'_def using False by auto
|
|
367 |
next
|
|
368 |
case True thus ?thesis unfolding w_def w'_def by auto
|
|
369 |
qed
|
|
370 |
} note w_mn = this
|
|
371 |
|
|
372 |
(* some technical stuff for the calculation*)
|
|
373 |
have "\<And> i. i \<in> k \<Longrightarrow> c i \<in> sets M" using kczz' unfolding pos_simple_def by auto
|
|
374 |
hence "\<And> i. i \<in> k \<Longrightarrow> measure M (c i) \<ge> 0" using positive by auto
|
|
375 |
hence w_mono: "\<And> i. i \<in> k \<Longrightarrow> w i * measure M (c i) \<le> w' i * measure M (c i)"
|
|
376 |
using mult_right_mono w_mn by blast
|
|
377 |
|
|
378 |
{ fix i have "\<lbrakk>i \<in> k ; z i \<noteq> w i\<rbrakk> \<Longrightarrow> measure M (c i) = 0"
|
|
379 |
unfolding w_def by (cases "c i = {}") auto }
|
|
380 |
hence zw: "\<And> i. i \<in> k \<Longrightarrow> z i * measure M (c i) = w i * measure M (c i)" by auto
|
|
381 |
|
|
382 |
{ fix i have "i \<in> k \<Longrightarrow> z i * measure M (c i) = w i * measure M (c i)"
|
|
383 |
unfolding w_def by (cases "c i = {}") simp_all }
|
|
384 |
note zw = this
|
|
385 |
|
|
386 |
{ fix i have "i \<in> k \<Longrightarrow> z' i * measure M (c i) = w' i * measure M (c i)"
|
|
387 |
unfolding w'_def by (cases "c i = {}") simp_all }
|
|
388 |
note z'w' = this
|
|
389 |
|
|
390 |
(* the calculation *)
|
|
391 |
have "pos_simple_integral (s, a, x) = pos_simple_integral (k, c, z)"
|
|
392 |
using f kczz'(1) by (rule pos_simple_integral_equal)
|
|
393 |
also have "\<dots> = (\<Sum> i \<in> k. z i * measure M (c i))"
|
|
394 |
unfolding pos_simple_integral_def by auto
|
|
395 |
also have "\<dots> = (\<Sum> i \<in> k. w i * measure M (c i))"
|
|
396 |
using setsum_cong2[of k, OF zw] by auto
|
|
397 |
also have "\<dots> \<le> (\<Sum> i \<in> k. w' i * measure M (c i))"
|
|
398 |
using setsum_mono[OF w_mono, of k] by auto
|
|
399 |
also have "\<dots> = (\<Sum> i \<in> k. z' i * measure M (c i))"
|
|
400 |
using setsum_cong2[of k, OF z'w'] by auto
|
|
401 |
also have "\<dots> = pos_simple_integral (k, c, z')"
|
|
402 |
unfolding pos_simple_integral_def by auto
|
|
403 |
also have "\<dots> = pos_simple_integral (s', b, y)"
|
|
404 |
using kczz'(2) g by (rule pos_simple_integral_equal)
|
|
405 |
finally show "pos_simple_integral (s, a, x) \<le> pos_simple_integral (s', b, y)"
|
|
406 |
by simp
|
|
407 |
qed
|
|
408 |
|
|
409 |
lemma pos_simple_integral_mono:
|
|
410 |
assumes a: "(s, a, x) \<in> pos_simple f" "(s', b, y) \<in> pos_simple g"
|
|
411 |
assumes "\<And> z. f z \<le> g z"
|
|
412 |
shows "pos_simple_integral (s, a, x) \<le> pos_simple_integral (s', b, y)"
|
|
413 |
using assms pos_simple_integral_mono_on_mspace by auto
|
|
414 |
|
|
415 |
lemma psfis_mono:
|
|
416 |
assumes "a \<in> psfis f" "b \<in> psfis g"
|
|
417 |
assumes "\<And> x. x \<in> space M \<Longrightarrow> f x \<le> g x"
|
|
418 |
shows "a \<le> b"
|
|
419 |
using assms pos_simple_integral_mono_on_mspace unfolding psfis_def by auto
|
|
420 |
|
|
421 |
lemma pos_simple_fn_integral_unique:
|
|
422 |
assumes "(s, a, x) \<in> pos_simple f" "(s', b, y) \<in> pos_simple f"
|
|
423 |
shows "pos_simple_integral (s, a, x) = pos_simple_integral (s', b, y)"
|
|
424 |
using assms real_le_antisym real_le_refl pos_simple_integral_mono by metis
|
|
425 |
|
|
426 |
lemma psfis_unique:
|
|
427 |
assumes "a \<in> psfis f" "b \<in> psfis f"
|
|
428 |
shows "a = b"
|
|
429 |
using assms real_le_antisym real_le_refl psfis_mono by metis
|
|
430 |
|
|
431 |
lemma pos_simple_integral_indicator:
|
|
432 |
assumes "A \<in> sets M"
|
|
433 |
obtains s a x where
|
|
434 |
"(s, a, x) \<in> pos_simple (indicator_fn A)"
|
|
435 |
"measure M A = pos_simple_integral (s, a, x)"
|
|
436 |
using assms
|
|
437 |
proof -
|
|
438 |
def s == "{0, 1} :: nat set"
|
|
439 |
def a == "\<lambda> i :: nat. if i = 0 then A else space M - A"
|
|
440 |
def x == "\<lambda> i :: nat. if i = 0 then 1 else (0 :: real)"
|
|
441 |
have eq: "pos_simple_integral (s, a, x) = measure M A"
|
|
442 |
unfolding s_def a_def x_def pos_simple_integral_def by auto
|
|
443 |
have "(s, a, x) \<in> pos_simple (indicator_fn A)"
|
|
444 |
unfolding pos_simple_def indicator_fn_def s_def a_def x_def nonneg_def
|
|
445 |
using assms sets_into_space by auto
|
|
446 |
from that[OF this] eq show thesis by auto
|
|
447 |
qed
|
|
448 |
|
|
449 |
lemma psfis_indicator:
|
|
450 |
assumes "A \<in> sets M"
|
|
451 |
shows "measure M A \<in> psfis (indicator_fn A)"
|
|
452 |
using pos_simple_integral_indicator[OF assms]
|
|
453 |
unfolding psfis_def image_def by auto
|
|
454 |
|
|
455 |
lemma pos_simple_integral_mult:
|
|
456 |
assumes f: "(s, a, x) \<in> pos_simple f"
|
|
457 |
assumes "0 \<le> z"
|
|
458 |
obtains s' b y where
|
|
459 |
"(s', b, y) \<in> pos_simple (\<lambda>x. z * f x)"
|
|
460 |
"pos_simple_integral (s', b, y) = z * pos_simple_integral (s, a, x)"
|
|
461 |
using assms that[of s a "\<lambda>i. z * x i"]
|
|
462 |
by (simp add: pos_simple_def pos_simple_integral_def setsum_right_distrib algebra_simps nonneg_def mult_nonneg_nonneg)
|
|
463 |
|
|
464 |
lemma psfis_mult:
|
|
465 |
assumes "r \<in> psfis f"
|
|
466 |
assumes "0 \<le> z"
|
|
467 |
shows "z * r \<in> psfis (\<lambda>x. z * f x)"
|
|
468 |
using assms
|
|
469 |
proof -
|
|
470 |
from assms obtain s a x
|
|
471 |
where sax: "(s, a, x) \<in> pos_simple f"
|
|
472 |
and r: "r = pos_simple_integral (s, a, x)"
|
|
473 |
unfolding psfis_def image_def by auto
|
|
474 |
obtain s' b y where
|
|
475 |
"(s', b, y) \<in> pos_simple (\<lambda>x. z * f x)"
|
|
476 |
"z * pos_simple_integral (s, a, x) = pos_simple_integral (s', b, y)"
|
|
477 |
using pos_simple_integral_mult[OF sax `0 \<le> z`, of thesis] by auto
|
|
478 |
thus ?thesis using r unfolding psfis_def image_def by auto
|
|
479 |
qed
|
|
480 |
|
|
481 |
lemma psfis_setsum_image:
|
|
482 |
assumes "finite P"
|
|
483 |
assumes "\<And>i. i \<in> P \<Longrightarrow> a i \<in> psfis (f i)"
|
|
484 |
shows "(setsum a P) \<in> psfis (\<lambda>t. \<Sum>i \<in> P. f i t)"
|
|
485 |
using assms
|
|
486 |
proof (induct P)
|
|
487 |
case empty
|
|
488 |
let ?s = "{0 :: nat}"
|
|
489 |
let ?a = "\<lambda> i. if i = (0 :: nat) then space M else {}"
|
|
490 |
let ?x = "\<lambda> (i :: nat). (0 :: real)"
|
|
491 |
have "(?s, ?a, ?x) \<in> pos_simple (\<lambda> t. (0 :: real))"
|
|
492 |
unfolding pos_simple_def image_def nonneg_def by auto
|
|
493 |
moreover have "(\<Sum> i \<in> ?s. ?x i * measure M (?a i)) = 0" by auto
|
|
494 |
ultimately have "0 \<in> psfis (\<lambda> t. 0)"
|
|
495 |
unfolding psfis_def image_def pos_simple_integral_def nonneg_def
|
|
496 |
by (auto intro!:bexI[of _ "(?s, ?a, ?x)"])
|
|
497 |
thus ?case by auto
|
|
498 |
next
|
|
499 |
case (insert x P) note asms = this
|
|
500 |
have "finite P" by fact
|
|
501 |
have "x \<notin> P" by fact
|
|
502 |
have "(\<And>i. i \<in> P \<Longrightarrow> a i \<in> psfis (f i)) \<Longrightarrow>
|
|
503 |
setsum a P \<in> psfis (\<lambda>t. \<Sum>i\<in>P. f i t)" by fact
|
|
504 |
have "setsum a (insert x P) = a x + setsum a P" using `finite P` `x \<notin> P` by auto
|
|
505 |
also have "\<dots> \<in> psfis (\<lambda> t. f x t + (\<Sum> i \<in> P. f i t))"
|
|
506 |
using asms psfis_add by auto
|
|
507 |
also have "\<dots> = psfis (\<lambda> t. \<Sum> i \<in> insert x P. f i t)"
|
|
508 |
using `x \<notin> P` `finite P` by auto
|
|
509 |
finally show ?case by simp
|
|
510 |
qed
|
|
511 |
|
|
512 |
lemma psfis_intro:
|
|
513 |
assumes "a ` P \<subseteq> sets M" and "nonneg x" and "finite P"
|
|
514 |
shows "(\<Sum>i\<in>P. x i * measure M (a i)) \<in> psfis (\<lambda>t. \<Sum>i\<in>P. x i * indicator_fn (a i) t)"
|
|
515 |
using assms psfis_mult psfis_indicator
|
|
516 |
unfolding image_def nonneg_def
|
|
517 |
by (auto intro!:psfis_setsum_image)
|
|
518 |
|
|
519 |
lemma psfis_nonneg: "a \<in> psfis f \<Longrightarrow> nonneg f"
|
|
520 |
unfolding psfis_def pos_simple_def by auto
|
|
521 |
|
|
522 |
lemma pos_psfis: "r \<in> psfis f \<Longrightarrow> 0 \<le> r"
|
|
523 |
unfolding psfis_def pos_simple_integral_def image_def pos_simple_def nonneg_def
|
|
524 |
using positive[unfolded positive_def] by (auto intro!:setsum_nonneg mult_nonneg_nonneg)
|
|
525 |
|
|
526 |
lemma psfis_borel_measurable:
|
|
527 |
assumes "a \<in> psfis f"
|
|
528 |
shows "f \<in> borel_measurable M"
|
|
529 |
using assms
|
|
530 |
proof -
|
|
531 |
from assms obtain s a' x where sa'x: "(s, a', x) \<in> pos_simple f" and sa'xa: "pos_simple_integral (s, a', x) = a"
|
|
532 |
and fs: "finite s"
|
|
533 |
unfolding psfis_def pos_simple_integral_def image_def
|
|
534 |
by (auto elim:pos_simpleE)
|
|
535 |
{ fix w assume "w \<in> space M"
|
|
536 |
hence "(f w \<le> a) = ((\<Sum> i \<in> s. x i * indicator_fn (a' i) w) \<le> a)"
|
|
537 |
using pos_simple_setsum_indicator_fn[OF sa'x, of w] by simp
|
|
538 |
} hence "\<And> w. (w \<in> space M \<and> f w \<le> a) = (w \<in> space M \<and> (\<Sum> i \<in> s. x i * indicator_fn (a' i) w) \<le> a)"
|
|
539 |
by auto
|
|
540 |
{ fix i assume "i \<in> s"
|
|
541 |
hence "indicator_fn (a' i) \<in> borel_measurable M"
|
|
542 |
using borel_measurable_indicator using sa'x[unfolded pos_simple_def] by auto
|
|
543 |
hence "(\<lambda> w. x i * indicator_fn (a' i) w) \<in> borel_measurable M"
|
|
544 |
using affine_borel_measurable[of "\<lambda> w. indicator_fn (a' i) w" 0 "x i"]
|
|
545 |
real_mult_commute by auto }
|
|
546 |
from borel_measurable_setsum_borel_measurable[OF fs this] affine_borel_measurable
|
|
547 |
have "(\<lambda> w. (\<Sum> i \<in> s. x i * indicator_fn (a' i) w)) \<in> borel_measurable M" by auto
|
|
548 |
from borel_measurable_cong[OF pos_simple_setsum_indicator_fn[OF sa'x]] this
|
|
549 |
show ?thesis by simp
|
|
550 |
qed
|
|
551 |
|
|
552 |
lemma psfis_mono_conv_mono:
|
|
553 |
assumes mono: "mono_convergent u f (space M)"
|
|
554 |
and ps_u: "\<And>n. x n \<in> psfis (u n)"
|
|
555 |
and "x ----> y"
|
|
556 |
and "r \<in> psfis s"
|
|
557 |
and f_upper_bound: "\<And>t. t \<in> space M \<Longrightarrow> s t \<le> f t"
|
|
558 |
shows "r <= y"
|
|
559 |
proof (rule field_le_mult_one_interval)
|
|
560 |
fix z :: real assume "0 < z" and "z < 1"
|
|
561 |
hence "0 \<le> z" by auto
|
|
562 |
let "?B' n" = "{w \<in> space M. z * s w <= u n w}"
|
|
563 |
|
|
564 |
have "incseq x" unfolding incseq_def
|
|
565 |
proof safe
|
|
566 |
fix m n :: nat assume "m \<le> n"
|
|
567 |
show "x m \<le> x n"
|
|
568 |
proof (rule psfis_mono[OF `x m \<in> psfis (u m)` `x n \<in> psfis (u n)`])
|
|
569 |
fix t assume "t \<in> space M"
|
|
570 |
with mono_convergentD[OF mono this] `m \<le> n` show "u m t \<le> u n t"
|
|
571 |
unfolding incseq_def by auto
|
|
572 |
qed
|
|
573 |
qed
|
|
574 |
|
|
575 |
from `r \<in> psfis s`
|
|
576 |
obtain s' a x' where r: "r = pos_simple_integral (s', a, x')"
|
|
577 |
and ps_s: "(s', a, x') \<in> pos_simple s"
|
|
578 |
unfolding psfis_def by auto
|
|
579 |
|
|
580 |
{ fix t i assume "i \<in> s'" "t \<in> a i"
|
|
581 |
hence "t \<in> space M" using ps_s by (auto elim!: pos_simpleE) }
|
|
582 |
note t_in_space = this
|
|
583 |
|
|
584 |
{ fix n
|
|
585 |
from psfis_borel_measurable[OF `r \<in> psfis s`]
|
|
586 |
psfis_borel_measurable[OF ps_u]
|
|
587 |
have "?B' n \<in> sets M"
|
|
588 |
by (auto intro!:
|
|
589 |
borel_measurable_leq_borel_measurable
|
|
590 |
borel_measurable_times_borel_measurable
|
|
591 |
borel_measurable_const) }
|
|
592 |
note B'_in_M = this
|
|
593 |
|
|
594 |
{ fix n have "(\<lambda>i. a i \<inter> ?B' n) ` s' \<subseteq> sets M" using B'_in_M ps_s
|
|
595 |
by (auto intro!: Int elim!: pos_simpleE) }
|
|
596 |
note B'_inter_a_in_M = this
|
|
597 |
|
|
598 |
let "?sum n" = "(\<Sum>i\<in>s'. x' i * measure M (a i \<inter> ?B' n))"
|
|
599 |
{ fix n
|
|
600 |
have "z * ?sum n \<le> x n"
|
|
601 |
proof (rule psfis_mono[OF _ ps_u])
|
|
602 |
have *: "\<And>i t. indicator_fn (?B' n) t * (x' i * indicator_fn (a i) t) =
|
|
603 |
x' i * indicator_fn (a i \<inter> ?B' n) t" unfolding indicator_fn_def by auto
|
|
604 |
have ps': "?sum n \<in> psfis (\<lambda>t. indicator_fn (?B' n) t * (\<Sum>i\<in>s'. x' i * indicator_fn (a i) t))"
|
|
605 |
unfolding setsum_right_distrib * using B'_in_M ps_s
|
|
606 |
by (auto intro!: psfis_intro Int elim!: pos_simpleE)
|
|
607 |
also have "... = psfis (\<lambda>t. indicator_fn (?B' n) t * s t)" (is "psfis ?l = psfis ?r")
|
|
608 |
proof (rule psfis_cong)
|
|
609 |
show "nonneg ?l" using psfis_nonneg[OF ps'] .
|
|
610 |
show "nonneg ?r" using psfis_nonneg[OF `r \<in> psfis s`] unfolding nonneg_def indicator_fn_def by auto
|
|
611 |
fix t assume "t \<in> space M"
|
|
612 |
show "?l t = ?r t" unfolding pos_simple_setsum_indicator_fn[OF ps_s `t \<in> space M`] ..
|
|
613 |
qed
|
|
614 |
finally show "z * ?sum n \<in> psfis (\<lambda>t. z * ?r t)" using psfis_mult[OF _ `0 \<le> z`] by simp
|
|
615 |
next
|
|
616 |
fix t assume "t \<in> space M"
|
|
617 |
show "z * (indicator_fn (?B' n) t * s t) \<le> u n t"
|
|
618 |
using psfis_nonneg[OF ps_u] unfolding nonneg_def indicator_fn_def by auto
|
|
619 |
qed }
|
|
620 |
hence *: "\<exists>N. \<forall>n\<ge>N. z * ?sum n \<le> x n" by (auto intro!: exI[of _ 0])
|
|
621 |
|
|
622 |
show "z * r \<le> y" unfolding r pos_simple_integral_def
|
|
623 |
proof (rule LIMSEQ_le[OF mult_right.LIMSEQ `x ----> y` *],
|
|
624 |
simp, rule LIMSEQ_setsum, rule mult_right.LIMSEQ)
|
|
625 |
fix i assume "i \<in> s'"
|
|
626 |
from psfis_nonneg[OF `r \<in> psfis s`, unfolded nonneg_def]
|
|
627 |
have "\<And>t. 0 \<le> s t" by simp
|
|
628 |
|
|
629 |
have *: "(\<Union>j. a i \<inter> ?B' j) = a i"
|
|
630 |
proof (safe, simp, safe)
|
|
631 |
fix t assume "t \<in> a i"
|
|
632 |
thus "t \<in> space M" using t_in_space[OF `i \<in> s'`] by auto
|
|
633 |
show "\<exists>j. z * s t \<le> u j t"
|
|
634 |
proof (cases "s t = 0")
|
|
635 |
case True thus ?thesis
|
|
636 |
using psfis_nonneg[OF ps_u] unfolding nonneg_def by auto
|
|
637 |
next
|
|
638 |
case False with `0 \<le> s t`
|
|
639 |
have "0 < s t" by auto
|
|
640 |
hence "z * s t < 1 * s t" using `0 < z` `z < 1`
|
|
641 |
by (auto intro!: mult_strict_right_mono simp del: mult_1_left)
|
|
642 |
also have "... \<le> f t" using f_upper_bound `t \<in> space M` by auto
|
|
643 |
finally obtain b where "\<And>j. b \<le> j \<Longrightarrow> z * s t < u j t" using `t \<in> space M`
|
|
644 |
using mono_conv_outgrow[of "\<lambda>n. u n t" "f t" "z * s t"]
|
|
645 |
using mono_convergentD[OF mono] by auto
|
|
646 |
from this[of b] show ?thesis by (auto intro!: exI[of _ b])
|
|
647 |
qed
|
|
648 |
qed
|
|
649 |
|
|
650 |
show "(\<lambda>n. measure M (a i \<inter> ?B' n)) ----> measure M (a i)"
|
|
651 |
proof (safe intro!:
|
|
652 |
monotone_convergence[of "\<lambda>n. a i \<inter> ?B' n", unfolded comp_def *])
|
|
653 |
fix n show "a i \<inter> ?B' n \<in> sets M"
|
|
654 |
using B'_inter_a_in_M[of n] `i \<in> s'` by auto
|
|
655 |
next
|
|
656 |
fix j t assume "t \<in> space M" and "z * s t \<le> u j t"
|
|
657 |
thus "z * s t \<le> u (Suc j) t"
|
|
658 |
using mono_convergentD(1)[OF mono, unfolded incseq_def,
|
|
659 |
rule_format, of t j "Suc j"]
|
|
660 |
by auto
|
|
661 |
qed
|
|
662 |
qed
|
|
663 |
qed
|
|
664 |
|
35692
|
665 |
section "Continuous posititve integration"
|
|
666 |
|
|
667 |
definition
|
|
668 |
"nnfis f = { y. \<exists>u x. mono_convergent u f (space M) \<and>
|
|
669 |
(\<forall>n. x n \<in> psfis (u n)) \<and> x ----> y }"
|
|
670 |
|
35582
|
671 |
lemma psfis_nnfis:
|
|
672 |
"a \<in> psfis f \<Longrightarrow> a \<in> nnfis f"
|
|
673 |
unfolding nnfis_def mono_convergent_def incseq_def
|
|
674 |
by (auto intro!: exI[of _ "\<lambda>n. f"] exI[of _ "\<lambda>n. a"] LIMSEQ_const)
|
|
675 |
|
35748
|
676 |
lemma nnfis_0: "0 \<in> nnfis (\<lambda> x. 0)"
|
|
677 |
by (rule psfis_nnfis[OF psfis_0])
|
|
678 |
|
35582
|
679 |
lemma nnfis_times:
|
|
680 |
assumes "a \<in> nnfis f" and "0 \<le> z"
|
|
681 |
shows "z * a \<in> nnfis (\<lambda>t. z * f t)"
|
|
682 |
proof -
|
|
683 |
obtain u x where "mono_convergent u f (space M)" and
|
|
684 |
"\<And>n. x n \<in> psfis (u n)" "x ----> a"
|
|
685 |
using `a \<in> nnfis f` unfolding nnfis_def by auto
|
|
686 |
with `0 \<le> z`show ?thesis unfolding nnfis_def mono_convergent_def incseq_def
|
|
687 |
by (auto intro!: exI[of _ "\<lambda>n w. z * u n w"] exI[of _ "\<lambda>n. z * x n"]
|
|
688 |
LIMSEQ_mult LIMSEQ_const psfis_mult mult_mono1)
|
|
689 |
qed
|
|
690 |
|
|
691 |
lemma nnfis_add:
|
|
692 |
assumes "a \<in> nnfis f" and "b \<in> nnfis g"
|
|
693 |
shows "a + b \<in> nnfis (\<lambda>t. f t + g t)"
|
|
694 |
proof -
|
|
695 |
obtain u x w y
|
|
696 |
where "mono_convergent u f (space M)" and
|
|
697 |
"\<And>n. x n \<in> psfis (u n)" "x ----> a" and
|
|
698 |
"mono_convergent w g (space M)" and
|
|
699 |
"\<And>n. y n \<in> psfis (w n)" "y ----> b"
|
|
700 |
using `a \<in> nnfis f` `b \<in> nnfis g` unfolding nnfis_def by auto
|
|
701 |
thus ?thesis unfolding nnfis_def mono_convergent_def incseq_def
|
|
702 |
by (auto intro!: exI[of _ "\<lambda>n a. u n a + w n a"] exI[of _ "\<lambda>n. x n + y n"]
|
|
703 |
LIMSEQ_add LIMSEQ_const psfis_add add_mono)
|
|
704 |
qed
|
|
705 |
|
|
706 |
lemma nnfis_mono:
|
|
707 |
assumes nnfis: "a \<in> nnfis f" "b \<in> nnfis g"
|
|
708 |
and mono: "\<And>t. t \<in> space M \<Longrightarrow> f t \<le> g t"
|
|
709 |
shows "a \<le> b"
|
|
710 |
proof -
|
|
711 |
obtain u x w y where
|
|
712 |
mc: "mono_convergent u f (space M)" "mono_convergent w g (space M)" and
|
|
713 |
psfis: "\<And>n. x n \<in> psfis (u n)" "\<And>n. y n \<in> psfis (w n)" and
|
|
714 |
limseq: "x ----> a" "y ----> b" using nnfis unfolding nnfis_def by auto
|
|
715 |
show ?thesis
|
|
716 |
proof (rule LIMSEQ_le_const2[OF limseq(1)], rule exI[of _ 0], safe)
|
|
717 |
fix n
|
|
718 |
show "x n \<le> b"
|
|
719 |
proof (rule psfis_mono_conv_mono[OF mc(2) psfis(2) limseq(2) psfis(1)])
|
|
720 |
fix t assume "t \<in> space M"
|
|
721 |
from mono_convergent_le[OF mc(1) this] mono[OF this]
|
|
722 |
show "u n t \<le> g t" by (rule order_trans)
|
|
723 |
qed
|
|
724 |
qed
|
|
725 |
qed
|
|
726 |
|
|
727 |
lemma nnfis_unique:
|
|
728 |
assumes a: "a \<in> nnfis f" and b: "b \<in> nnfis f"
|
|
729 |
shows "a = b"
|
|
730 |
using nnfis_mono[OF a b] nnfis_mono[OF b a]
|
|
731 |
by (auto intro!: real_le_antisym[of a b])
|
|
732 |
|
|
733 |
lemma psfis_equiv:
|
|
734 |
assumes "a \<in> psfis f" and "nonneg g"
|
|
735 |
and "\<And>t. t \<in> space M \<Longrightarrow> f t = g t"
|
|
736 |
shows "a \<in> psfis g"
|
|
737 |
using assms unfolding psfis_def pos_simple_def by auto
|
|
738 |
|
|
739 |
lemma psfis_mon_upclose:
|
|
740 |
assumes "\<And>m. a m \<in> psfis (u m)"
|
|
741 |
shows "\<exists>c. c \<in> psfis (mon_upclose n u)"
|
|
742 |
proof (induct n)
|
|
743 |
case 0 thus ?case unfolding mon_upclose.simps using assms ..
|
|
744 |
next
|
|
745 |
case (Suc n)
|
|
746 |
then obtain sn an xn where ps: "(sn, an, xn) \<in> pos_simple (mon_upclose n u)"
|
|
747 |
unfolding psfis_def by auto
|
|
748 |
obtain ss as xs where ps': "(ss, as, xs) \<in> pos_simple (u (Suc n))"
|
|
749 |
using assms[of "Suc n"] unfolding psfis_def by auto
|
|
750 |
from pos_simple_common_partition[OF ps ps'] guess x x' a s .
|
|
751 |
hence "(s, a, upclose x x') \<in> pos_simple (mon_upclose (Suc n) u)"
|
|
752 |
by (simp add: upclose_def pos_simple_def nonneg_def max_def)
|
|
753 |
thus ?case unfolding psfis_def by auto
|
|
754 |
qed
|
|
755 |
|
|
756 |
text {* Beppo-Levi monotone convergence theorem *}
|
|
757 |
lemma nnfis_mon_conv:
|
|
758 |
assumes mc: "mono_convergent f h (space M)"
|
|
759 |
and nnfis: "\<And>n. x n \<in> nnfis (f n)"
|
|
760 |
and "x ----> z"
|
|
761 |
shows "z \<in> nnfis h"
|
|
762 |
proof -
|
|
763 |
have "\<forall>n. \<exists>u y. mono_convergent u (f n) (space M) \<and> (\<forall>m. y m \<in> psfis (u m)) \<and>
|
|
764 |
y ----> x n"
|
|
765 |
using nnfis unfolding nnfis_def by auto
|
|
766 |
from choice[OF this] guess u ..
|
|
767 |
from choice[OF this] guess y ..
|
|
768 |
hence mc_u: "\<And>n. mono_convergent (u n) (f n) (space M)"
|
|
769 |
and psfis: "\<And>n m. y n m \<in> psfis (u n m)" and "\<And>n. y n ----> x n"
|
|
770 |
by auto
|
|
771 |
|
|
772 |
let "?upclose n" = "mon_upclose n (\<lambda>m. u m n)"
|
|
773 |
|
|
774 |
have "\<exists>c. \<forall>n. c n \<in> psfis (?upclose n)"
|
|
775 |
by (safe intro!: choice psfis_mon_upclose) (rule psfis)
|
|
776 |
then guess c .. note c = this[rule_format]
|
|
777 |
|
|
778 |
show ?thesis unfolding nnfis_def
|
|
779 |
proof (safe intro!: exI)
|
|
780 |
show mc_upclose: "mono_convergent ?upclose h (space M)"
|
|
781 |
by (rule mon_upclose_mono_convergent[OF mc_u mc])
|
|
782 |
show psfis_upclose: "\<And>n. c n \<in> psfis (?upclose n)"
|
|
783 |
using c .
|
|
784 |
|
|
785 |
{ fix n m :: nat assume "n \<le> m"
|
|
786 |
hence "c n \<le> c m"
|
|
787 |
using psfis_mono[OF c c]
|
|
788 |
using mono_convergentD(1)[OF mc_upclose, unfolded incseq_def]
|
|
789 |
by auto }
|
|
790 |
hence "incseq c" unfolding incseq_def by auto
|
|
791 |
|
|
792 |
{ fix n
|
|
793 |
have c_nnfis: "c n \<in> nnfis (?upclose n)" using c by (rule psfis_nnfis)
|
|
794 |
from nnfis_mono[OF c_nnfis nnfis]
|
|
795 |
mon_upclose_le_mono_convergent[OF mc_u]
|
|
796 |
mono_convergentD(1)[OF mc]
|
|
797 |
have "c n \<le> x n" by fast }
|
|
798 |
note c_less_x = this
|
|
799 |
|
|
800 |
{ fix n
|
|
801 |
note c_less_x[of n]
|
|
802 |
also have "x n \<le> z"
|
|
803 |
proof (rule incseq_le)
|
|
804 |
show "x ----> z" by fact
|
|
805 |
from mono_convergentD(1)[OF mc]
|
|
806 |
show "incseq x" unfolding incseq_def
|
|
807 |
by (auto intro!: nnfis_mono[OF nnfis nnfis])
|
|
808 |
qed
|
|
809 |
finally have "c n \<le> z" . }
|
|
810 |
note c_less_z = this
|
|
811 |
|
|
812 |
have "convergent c"
|
|
813 |
proof (rule Bseq_mono_convergent[unfolded incseq_def[symmetric]])
|
|
814 |
show "Bseq c"
|
|
815 |
using pos_psfis[OF c] c_less_z
|
|
816 |
by (auto intro!: BseqI'[of _ z])
|
|
817 |
show "incseq c" by fact
|
|
818 |
qed
|
|
819 |
then obtain l where l: "c ----> l" unfolding convergent_def by auto
|
|
820 |
|
|
821 |
have "l \<le> z" using c_less_x l
|
|
822 |
by (auto intro!: LIMSEQ_le[OF _ `x ----> z`])
|
|
823 |
moreover have "z \<le> l"
|
|
824 |
proof (rule LIMSEQ_le_const2[OF `x ----> z`], safe intro!: exI[of _ 0])
|
|
825 |
fix n
|
|
826 |
have "l \<in> nnfis h"
|
|
827 |
unfolding nnfis_def using l mc_upclose psfis_upclose by auto
|
|
828 |
from nnfis this mono_convergent_le[OF mc]
|
|
829 |
show "x n \<le> l" by (rule nnfis_mono)
|
|
830 |
qed
|
|
831 |
ultimately have "l = z" by (rule real_le_antisym)
|
|
832 |
thus "c ----> z" using `c ----> l` by simp
|
|
833 |
qed
|
|
834 |
qed
|
|
835 |
|
|
836 |
lemma nnfis_pos_on_mspace:
|
|
837 |
assumes "a \<in> nnfis f" and "x \<in>space M"
|
|
838 |
shows "0 \<le> f x"
|
|
839 |
using assms
|
|
840 |
proof -
|
|
841 |
from assms[unfolded nnfis_def] guess u y by auto note uy = this
|
35748
|
842 |
hence "\<And> n. 0 \<le> u n x"
|
35582
|
843 |
unfolding nnfis_def psfis_def pos_simple_def nonneg_def mono_convergent_def
|
|
844 |
by auto
|
|
845 |
thus "0 \<le> f x" using uy[rule_format]
|
|
846 |
unfolding nnfis_def psfis_def pos_simple_def nonneg_def mono_convergent_def
|
|
847 |
using incseq_le[of "\<lambda> n. u n x" "f x"] real_le_trans
|
|
848 |
by fast
|
|
849 |
qed
|
|
850 |
|
|
851 |
lemma nnfis_borel_measurable:
|
|
852 |
assumes "a \<in> nnfis f"
|
|
853 |
shows "f \<in> borel_measurable M"
|
|
854 |
using assms unfolding nnfis_def
|
|
855 |
apply auto
|
|
856 |
apply (rule mono_convergent_borel_measurable)
|
|
857 |
using psfis_borel_measurable
|
|
858 |
by auto
|
|
859 |
|
|
860 |
lemma borel_measurable_mon_conv_psfis:
|
|
861 |
assumes f_borel: "f \<in> borel_measurable M"
|
|
862 |
and nonneg: "\<And>t. t \<in> space M \<Longrightarrow> 0 \<le> f t"
|
|
863 |
shows"\<exists>u x. mono_convergent u f (space M) \<and> (\<forall>n. x n \<in> psfis (u n))"
|
|
864 |
proof (safe intro!: exI)
|
|
865 |
let "?I n" = "{0<..<n * 2^n}"
|
|
866 |
let "?A n i" = "{w \<in> space M. real (i :: nat) / 2^(n::nat) \<le> f w \<and> f w < real (i + 1) / 2^n}"
|
|
867 |
let "?u n t" = "\<Sum>i\<in>?I n. real i / 2^n * indicator_fn (?A n i) t"
|
|
868 |
let "?x n" = "\<Sum>i\<in>?I n. real i / 2^n * measure M (?A n i)"
|
|
869 |
|
|
870 |
let "?w n t" = "if f t < real n then real (natfloor (f t * 2^n)) / 2^n else 0"
|
|
871 |
|
|
872 |
{ fix t n assume t: "t \<in> space M"
|
|
873 |
have "?u n t = ?w n t" (is "_ = (if _ then real ?i / _ else _)")
|
|
874 |
proof (cases "f t < real n")
|
|
875 |
case True
|
|
876 |
with nonneg t
|
|
877 |
have i: "?i < n * 2^n"
|
|
878 |
by (auto simp: real_of_nat_power[symmetric]
|
|
879 |
intro!: less_natfloor mult_nonneg_nonneg)
|
|
880 |
|
|
881 |
hence t_in_A: "t \<in> ?A n ?i"
|
|
882 |
unfolding divide_le_eq less_divide_eq
|
|
883 |
using nonneg t True
|
|
884 |
by (auto intro!: real_natfloor_le
|
|
885 |
real_natfloor_gt_diff_one[unfolded diff_less_eq]
|
|
886 |
simp: real_of_nat_Suc zero_le_mult_iff)
|
|
887 |
|
|
888 |
hence *: "real ?i / 2^n \<le> f t"
|
|
889 |
"f t < real (?i + 1) / 2^n" by auto
|
|
890 |
{ fix j assume "t \<in> ?A n j"
|
|
891 |
hence "real j / 2^n \<le> f t"
|
|
892 |
and "f t < real (j + 1) / 2^n" by auto
|
|
893 |
with * have "j \<in> {?i}" unfolding divide_le_eq less_divide_eq
|
|
894 |
by auto }
|
|
895 |
hence *: "\<And>j. t \<in> ?A n j \<longleftrightarrow> j \<in> {?i}" using t_in_A by auto
|
|
896 |
|
|
897 |
have "?u n t = real ?i / 2^n"
|
|
898 |
unfolding indicator_fn_def if_distrib *
|
|
899 |
setsum_cases[OF finite_greaterThanLessThan]
|
|
900 |
using i by (cases "?i = 0") simp_all
|
|
901 |
thus ?thesis using True by auto
|
|
902 |
next
|
|
903 |
case False
|
|
904 |
have "?u n t = (\<Sum>i \<in> {0 <..< n*2^n}. 0)"
|
|
905 |
proof (rule setsum_cong)
|
|
906 |
fix i assume "i \<in> {0 <..< n*2^n}"
|
|
907 |
hence "i + 1 \<le> n * 2^n" by simp
|
|
908 |
hence "real (i + 1) \<le> real n * 2^n"
|
|
909 |
unfolding real_of_nat_le_iff[symmetric]
|
|
910 |
by (auto simp: real_of_nat_power[symmetric])
|
|
911 |
also have "... \<le> f t * 2^n"
|
|
912 |
using False by (auto intro!: mult_nonneg_nonneg)
|
|
913 |
finally have "t \<notin> ?A n i"
|
|
914 |
by (auto simp: divide_le_eq less_divide_eq)
|
|
915 |
thus "real i / 2^n * indicator_fn (?A n i) t = 0"
|
|
916 |
unfolding indicator_fn_def by auto
|
|
917 |
qed simp
|
|
918 |
thus ?thesis using False by auto
|
|
919 |
qed }
|
|
920 |
note u_at_t = this
|
|
921 |
|
|
922 |
show "mono_convergent ?u f (space M)" unfolding mono_convergent_def
|
|
923 |
proof safe
|
|
924 |
fix t assume t: "t \<in> space M"
|
|
925 |
{ fix m n :: nat assume "m \<le> n"
|
|
926 |
hence *: "(2::real)^n = 2^m * 2^(n - m)" unfolding class_semiring.mul_pwr by auto
|
|
927 |
have "real (natfloor (f t * 2^m) * natfloor (2^(n-m))) \<le> real (natfloor (f t * 2 ^ n))"
|
|
928 |
apply (subst *)
|
|
929 |
apply (subst class_semiring.mul_a)
|
|
930 |
apply (subst real_of_nat_le_iff)
|
|
931 |
apply (rule le_mult_natfloor)
|
|
932 |
using nonneg[OF t] by (auto intro!: mult_nonneg_nonneg)
|
|
933 |
hence "real (natfloor (f t * 2^m)) * 2^n \<le> real (natfloor (f t * 2^n)) * 2^m"
|
|
934 |
apply (subst *)
|
|
935 |
apply (subst (3) class_semiring.mul_c)
|
|
936 |
apply (subst class_semiring.mul_a)
|
|
937 |
by (auto intro: mult_right_mono simp: natfloor_power real_of_nat_power[symmetric]) }
|
|
938 |
thus "incseq (\<lambda>n. ?u n t)" unfolding u_at_t[OF t] unfolding incseq_def
|
|
939 |
by (auto simp add: le_divide_eq divide_le_eq less_divide_eq)
|
|
940 |
|
|
941 |
show "(\<lambda>i. ?u i t) ----> f t" unfolding u_at_t[OF t]
|
|
942 |
proof (rule LIMSEQ_I, safe intro!: exI)
|
|
943 |
fix r :: real and n :: nat
|
|
944 |
let ?N = "natfloor (1/r) + 1"
|
|
945 |
assume "0 < r" and N: "max ?N (natfloor (f t) + 1) \<le> n"
|
|
946 |
hence "?N \<le> n" by auto
|
|
947 |
|
|
948 |
have "1 / r < real (natfloor (1/r) + 1)" using real_natfloor_add_one_gt
|
|
949 |
by (simp add: real_of_nat_Suc)
|
|
950 |
also have "... < 2^?N" by (rule two_realpow_gt)
|
|
951 |
finally have less_r: "1 / 2^?N < r" using `0 < r`
|
|
952 |
by (auto simp: less_divide_eq divide_less_eq algebra_simps)
|
|
953 |
|
|
954 |
have "f t < real (natfloor (f t) + 1)" using real_natfloor_add_one_gt[of "f t"] by auto
|
|
955 |
also have "... \<le> real n" unfolding real_of_nat_le_iff using N by auto
|
|
956 |
finally have "f t < real n" .
|
|
957 |
|
|
958 |
have "real (natfloor (f t * 2^n)) \<le> f t * 2^n"
|
|
959 |
using nonneg[OF t] by (auto intro!: real_natfloor_le mult_nonneg_nonneg)
|
|
960 |
hence less: "real (natfloor (f t * 2^n)) / 2^n \<le> f t" unfolding divide_le_eq by auto
|
|
961 |
|
|
962 |
have "f t * 2 ^ n - 1 < real (natfloor (f t * 2^n))" using real_natfloor_gt_diff_one .
|
|
963 |
hence "f t - real (natfloor (f t * 2^n)) / 2^n < 1 / 2^n"
|
|
964 |
by (auto simp: less_divide_eq divide_less_eq algebra_simps)
|
|
965 |
also have "... \<le> 1 / 2^?N" using `?N \<le> n`
|
|
966 |
by (auto intro!: divide_left_mono mult_pos_pos simp del: power_Suc)
|
|
967 |
also have "... < r" using less_r .
|
|
968 |
finally show "norm (?w n t - f t) < r" using `f t < real n` less by auto
|
|
969 |
qed
|
|
970 |
qed
|
|
971 |
|
|
972 |
fix n
|
|
973 |
show "?x n \<in> psfis (?u n)"
|
|
974 |
proof (rule psfis_intro)
|
|
975 |
show "?A n ` ?I n \<subseteq> sets M"
|
|
976 |
proof safe
|
|
977 |
fix i :: nat
|
|
978 |
from Int[OF
|
|
979 |
f_borel[unfolded borel_measurable_less_iff, rule_format, of "real (i+1) / 2^n"]
|
|
980 |
f_borel[unfolded borel_measurable_ge_iff, rule_format, of "real i / 2^n"]]
|
|
981 |
show "?A n i \<in> sets M"
|
|
982 |
by (metis Collect_conj_eq Int_commute Int_left_absorb Int_left_commute)
|
|
983 |
qed
|
|
984 |
show "nonneg (\<lambda>i :: nat. real i / 2 ^ n)"
|
|
985 |
unfolding nonneg_def by (auto intro!: divide_nonneg_pos)
|
|
986 |
qed auto
|
|
987 |
qed
|
|
988 |
|
|
989 |
lemma nnfis_dom_conv:
|
|
990 |
assumes borel: "f \<in> borel_measurable M"
|
|
991 |
and nnfis: "b \<in> nnfis g"
|
|
992 |
and ord: "\<And>t. t \<in> space M \<Longrightarrow> f t \<le> g t"
|
|
993 |
and nonneg: "\<And>t. t \<in> space M \<Longrightarrow> 0 \<le> f t"
|
|
994 |
shows "\<exists>a. a \<in> nnfis f \<and> a \<le> b"
|
|
995 |
proof -
|
|
996 |
obtain u x where mc_f: "mono_convergent u f (space M)" and
|
|
997 |
psfis: "\<And>n. x n \<in> psfis (u n)"
|
|
998 |
using borel_measurable_mon_conv_psfis[OF borel nonneg] by auto
|
|
999 |
|
|
1000 |
{ fix n
|
|
1001 |
{ fix t assume t: "t \<in> space M"
|
|
1002 |
note mono_convergent_le[OF mc_f this, of n]
|
|
1003 |
also note ord[OF t]
|
|
1004 |
finally have "u n t \<le> g t" . }
|
|
1005 |
from nnfis_mono[OF psfis_nnfis[OF psfis] nnfis this]
|
|
1006 |
have "x n \<le> b" by simp }
|
|
1007 |
note x_less_b = this
|
|
1008 |
|
|
1009 |
have "convergent x"
|
|
1010 |
proof (safe intro!: Bseq_mono_convergent)
|
|
1011 |
from x_less_b pos_psfis[OF psfis]
|
|
1012 |
show "Bseq x" by (auto intro!: BseqI'[of _ b])
|
|
1013 |
|
|
1014 |
fix n m :: nat assume *: "n \<le> m"
|
|
1015 |
show "x n \<le> x m"
|
|
1016 |
proof (rule psfis_mono[OF `x n \<in> psfis (u n)` `x m \<in> psfis (u m)`])
|
|
1017 |
fix t assume "t \<in> space M"
|
|
1018 |
from mc_f[THEN mono_convergentD(1), unfolded incseq_def, OF this]
|
|
1019 |
show "u n t \<le> u m t" using * by auto
|
|
1020 |
qed
|
|
1021 |
qed
|
|
1022 |
then obtain a where "x ----> a" unfolding convergent_def by auto
|
|
1023 |
with LIMSEQ_le_const2[OF `x ----> a`] x_less_b mc_f psfis
|
|
1024 |
show ?thesis unfolding nnfis_def by auto
|
|
1025 |
qed
|
|
1026 |
|
|
1027 |
lemma the_nnfis[simp]: "a \<in> nnfis f \<Longrightarrow> (THE a. a \<in> nnfis f) = a"
|
|
1028 |
by (auto intro: the_equality nnfis_unique)
|
|
1029 |
|
|
1030 |
lemma nnfis_cong:
|
|
1031 |
assumes cong: "\<And>x. x \<in> space M \<Longrightarrow> f x = g x"
|
|
1032 |
shows "nnfis f = nnfis g"
|
|
1033 |
proof -
|
|
1034 |
{ fix f g :: "'a \<Rightarrow> real" assume cong: "\<And>x. x \<in> space M \<Longrightarrow> f x = g x"
|
|
1035 |
fix x assume "x \<in> nnfis f"
|
|
1036 |
then guess u y unfolding nnfis_def by safe note x = this
|
|
1037 |
hence "mono_convergent u g (space M)"
|
|
1038 |
unfolding mono_convergent_def using cong by auto
|
|
1039 |
with x(2,3) have "x \<in> nnfis g" unfolding nnfis_def by auto }
|
|
1040 |
from this[OF cong] this[OF cong[symmetric]]
|
|
1041 |
show ?thesis by safe
|
|
1042 |
qed
|
|
1043 |
|
35692
|
1044 |
section "Lebesgue Integral"
|
|
1045 |
|
|
1046 |
definition
|
|
1047 |
"integrable f \<longleftrightarrow> (\<exists>x. x \<in> nnfis (pos_part f)) \<and> (\<exists>y. y \<in> nnfis (neg_part f))"
|
|
1048 |
|
|
1049 |
definition
|
|
1050 |
"integral f = (THE i :: real. i \<in> nnfis (pos_part f)) - (THE j. j \<in> nnfis (neg_part f))"
|
|
1051 |
|
35582
|
1052 |
lemma integral_cong:
|
|
1053 |
assumes cong: "\<And>x. x \<in> space M \<Longrightarrow> f x = g x"
|
|
1054 |
shows "integral f = integral g"
|
|
1055 |
proof -
|
|
1056 |
have "nnfis (pos_part f) = nnfis (pos_part g)"
|
|
1057 |
using cong by (auto simp: pos_part_def intro!: nnfis_cong)
|
|
1058 |
moreover
|
|
1059 |
have "nnfis (neg_part f) = nnfis (neg_part g)"
|
|
1060 |
using cong by (auto simp: neg_part_def intro!: nnfis_cong)
|
|
1061 |
ultimately show ?thesis
|
|
1062 |
unfolding integral_def by auto
|
|
1063 |
qed
|
|
1064 |
|
|
1065 |
lemma nnfis_integral:
|
|
1066 |
assumes "a \<in> nnfis f"
|
|
1067 |
shows "integrable f" and "integral f = a"
|
|
1068 |
proof -
|
|
1069 |
have a: "a \<in> nnfis (pos_part f)"
|
|
1070 |
using assms nnfis_pos_on_mspace[OF assms]
|
|
1071 |
by (auto intro!: nnfis_mon_conv[of "\<lambda>i. f" _ "\<lambda>i. a"]
|
|
1072 |
LIMSEQ_const simp: mono_convergent_def pos_part_def incseq_def max_def)
|
|
1073 |
|
|
1074 |
have "\<And>t. t \<in> space M \<Longrightarrow> neg_part f t = 0"
|
|
1075 |
unfolding neg_part_def min_def
|
|
1076 |
using nnfis_pos_on_mspace[OF assms] by auto
|
|
1077 |
hence 0: "0 \<in> nnfis (neg_part f)"
|
|
1078 |
by (auto simp: nnfis_def mono_convergent_def psfis_0 incseq_def
|
|
1079 |
intro!: LIMSEQ_const exI[of _ "\<lambda> x n. 0"] exI[of _ "\<lambda> n. 0"])
|
|
1080 |
|
|
1081 |
from 0 a show "integrable f" "integral f = a"
|
|
1082 |
unfolding integrable_def integral_def by auto
|
|
1083 |
qed
|
|
1084 |
|
|
1085 |
lemma nnfis_minus_nnfis_integral:
|
|
1086 |
assumes "a \<in> nnfis f" and "b \<in> nnfis g"
|
|
1087 |
shows "integrable (\<lambda>t. f t - g t)" and "integral (\<lambda>t. f t - g t) = a - b"
|
|
1088 |
proof -
|
|
1089 |
have borel: "(\<lambda>t. f t - g t) \<in> borel_measurable M" using assms
|
|
1090 |
by (blast intro:
|
|
1091 |
borel_measurable_diff_borel_measurable nnfis_borel_measurable)
|
|
1092 |
|
|
1093 |
have "\<exists>x. x \<in> nnfis (pos_part (\<lambda>t. f t - g t)) \<and> x \<le> a + b"
|
|
1094 |
(is "\<exists>x. x \<in> nnfis ?pp \<and> _")
|
|
1095 |
proof (rule nnfis_dom_conv)
|
|
1096 |
show "?pp \<in> borel_measurable M"
|
35692
|
1097 |
using borel by (rule pos_part_borel_measurable neg_part_borel_measurable)
|
35582
|
1098 |
show "a + b \<in> nnfis (\<lambda>t. f t + g t)" using assms by (rule nnfis_add)
|
|
1099 |
fix t assume "t \<in> space M"
|
|
1100 |
with assms nnfis_add assms[THEN nnfis_pos_on_mspace[OF _ this]]
|
|
1101 |
show "?pp t \<le> f t + g t" unfolding pos_part_def by auto
|
|
1102 |
show "0 \<le> ?pp t" using nonneg_pos_part[of "\<lambda>t. f t - g t"]
|
|
1103 |
unfolding nonneg_def by auto
|
|
1104 |
qed
|
|
1105 |
then obtain x where x: "x \<in> nnfis ?pp" by auto
|
|
1106 |
moreover
|
|
1107 |
have "\<exists>x. x \<in> nnfis (neg_part (\<lambda>t. f t - g t)) \<and> x \<le> a + b"
|
|
1108 |
(is "\<exists>x. x \<in> nnfis ?np \<and> _")
|
|
1109 |
proof (rule nnfis_dom_conv)
|
|
1110 |
show "?np \<in> borel_measurable M"
|
35692
|
1111 |
using borel by (rule pos_part_borel_measurable neg_part_borel_measurable)
|
35582
|
1112 |
show "a + b \<in> nnfis (\<lambda>t. f t + g t)" using assms by (rule nnfis_add)
|
|
1113 |
fix t assume "t \<in> space M"
|
|
1114 |
with assms nnfis_add assms[THEN nnfis_pos_on_mspace[OF _ this]]
|
|
1115 |
show "?np t \<le> f t + g t" unfolding neg_part_def by auto
|
|
1116 |
show "0 \<le> ?np t" using nonneg_neg_part[of "\<lambda>t. f t - g t"]
|
|
1117 |
unfolding nonneg_def by auto
|
|
1118 |
qed
|
|
1119 |
then obtain y where y: "y \<in> nnfis ?np" by auto
|
|
1120 |
ultimately show "integrable (\<lambda>t. f t - g t)"
|
|
1121 |
unfolding integrable_def by auto
|
|
1122 |
|
|
1123 |
from x and y
|
|
1124 |
have "a + y \<in> nnfis (\<lambda>t. f t + ?np t)"
|
|
1125 |
and "b + x \<in> nnfis (\<lambda>t. g t + ?pp t)" using assms by (auto intro: nnfis_add)
|
|
1126 |
moreover
|
|
1127 |
have "\<And>t. f t + ?np t = g t + ?pp t"
|
|
1128 |
unfolding pos_part_def neg_part_def by auto
|
|
1129 |
ultimately have "a - b = x - y"
|
|
1130 |
using nnfis_unique by (auto simp: algebra_simps)
|
|
1131 |
thus "integral (\<lambda>t. f t - g t) = a - b"
|
|
1132 |
unfolding integral_def
|
|
1133 |
using the_nnfis[OF x] the_nnfis[OF y] by simp
|
|
1134 |
qed
|
|
1135 |
|
|
1136 |
lemma integral_borel_measurable:
|
|
1137 |
"integrable f \<Longrightarrow> f \<in> borel_measurable M"
|
|
1138 |
unfolding integrable_def
|
|
1139 |
by (subst pos_part_neg_part_borel_measurable_iff)
|
|
1140 |
(auto intro: nnfis_borel_measurable)
|
|
1141 |
|
|
1142 |
lemma integral_indicator_fn:
|
|
1143 |
assumes "a \<in> sets M"
|
|
1144 |
shows "integral (indicator_fn a) = measure M a"
|
|
1145 |
and "integrable (indicator_fn a)"
|
|
1146 |
using psfis_indicator[OF assms, THEN psfis_nnfis]
|
|
1147 |
by (auto intro!: nnfis_integral)
|
|
1148 |
|
|
1149 |
lemma integral_add:
|
|
1150 |
assumes "integrable f" and "integrable g"
|
|
1151 |
shows "integrable (\<lambda>t. f t + g t)"
|
|
1152 |
and "integral (\<lambda>t. f t + g t) = integral f + integral g"
|
|
1153 |
proof -
|
|
1154 |
{ fix t
|
|
1155 |
have "pos_part f t + pos_part g t - (neg_part f t + neg_part g t) =
|
|
1156 |
f t + g t"
|
|
1157 |
unfolding pos_part_def neg_part_def by auto }
|
|
1158 |
note part_sum = this
|
|
1159 |
|
|
1160 |
from assms obtain a b c d where
|
|
1161 |
a: "a \<in> nnfis (pos_part f)" and b: "b \<in> nnfis (neg_part f)" and
|
|
1162 |
c: "c \<in> nnfis (pos_part g)" and d: "d \<in> nnfis (neg_part g)"
|
|
1163 |
unfolding integrable_def by auto
|
|
1164 |
note sums = nnfis_add[OF a c] nnfis_add[OF b d]
|
|
1165 |
note int = nnfis_minus_nnfis_integral[OF sums, unfolded part_sum]
|
|
1166 |
|
|
1167 |
show "integrable (\<lambda>t. f t + g t)" using int(1) .
|
|
1168 |
|
|
1169 |
show "integral (\<lambda>t. f t + g t) = integral f + integral g"
|
|
1170 |
using int(2) sums a b c d by (simp add: the_nnfis integral_def)
|
|
1171 |
qed
|
|
1172 |
|
|
1173 |
lemma integral_mono:
|
|
1174 |
assumes "integrable f" and "integrable g"
|
|
1175 |
and mono: "\<And>t. t \<in> space M \<Longrightarrow> f t \<le> g t"
|
|
1176 |
shows "integral f \<le> integral g"
|
|
1177 |
proof -
|
|
1178 |
from assms obtain a b c d where
|
|
1179 |
a: "a \<in> nnfis (pos_part f)" and b: "b \<in> nnfis (neg_part f)" and
|
|
1180 |
c: "c \<in> nnfis (pos_part g)" and d: "d \<in> nnfis (neg_part g)"
|
|
1181 |
unfolding integrable_def by auto
|
|
1182 |
|
|
1183 |
have "a \<le> c"
|
|
1184 |
proof (rule nnfis_mono[OF a c])
|
|
1185 |
fix t assume "t \<in> space M"
|
|
1186 |
from mono[OF this] show "pos_part f t \<le> pos_part g t"
|
|
1187 |
unfolding pos_part_def by auto
|
|
1188 |
qed
|
|
1189 |
moreover have "d \<le> b"
|
|
1190 |
proof (rule nnfis_mono[OF d b])
|
|
1191 |
fix t assume "t \<in> space M"
|
|
1192 |
from mono[OF this] show "neg_part g t \<le> neg_part f t"
|
|
1193 |
unfolding neg_part_def by auto
|
|
1194 |
qed
|
|
1195 |
ultimately have "a - b \<le> c - d" by auto
|
|
1196 |
thus ?thesis unfolding integral_def
|
|
1197 |
using a b c d by (simp add: the_nnfis)
|
|
1198 |
qed
|
|
1199 |
|
|
1200 |
lemma integral_uminus:
|
|
1201 |
assumes "integrable f"
|
|
1202 |
shows "integrable (\<lambda>t. - f t)"
|
|
1203 |
and "integral (\<lambda>t. - f t) = - integral f"
|
|
1204 |
proof -
|
|
1205 |
have "pos_part f = neg_part (\<lambda>t.-f t)" and "neg_part f = pos_part (\<lambda>t.-f t)"
|
|
1206 |
unfolding pos_part_def neg_part_def by (auto intro!: ext)
|
|
1207 |
with assms show "integrable (\<lambda>t.-f t)" and "integral (\<lambda>t.-f t) = -integral f"
|
|
1208 |
unfolding integrable_def integral_def by simp_all
|
|
1209 |
qed
|
|
1210 |
|
|
1211 |
lemma integral_times_const:
|
|
1212 |
assumes "integrable f"
|
|
1213 |
shows "integrable (\<lambda>t. a * f t)" (is "?P a")
|
|
1214 |
and "integral (\<lambda>t. a * f t) = a * integral f" (is "?I a")
|
|
1215 |
proof -
|
|
1216 |
{ fix a :: real assume "0 \<le> a"
|
|
1217 |
hence "pos_part (\<lambda>t. a * f t) = (\<lambda>t. a * pos_part f t)"
|
|
1218 |
and "neg_part (\<lambda>t. a * f t) = (\<lambda>t. a * neg_part f t)"
|
|
1219 |
unfolding pos_part_def neg_part_def max_def min_def
|
|
1220 |
by (auto intro!: ext simp: zero_le_mult_iff)
|
|
1221 |
moreover
|
|
1222 |
obtain x y where x: "x \<in> nnfis (pos_part f)" and y: "y \<in> nnfis (neg_part f)"
|
|
1223 |
using assms unfolding integrable_def by auto
|
|
1224 |
ultimately
|
|
1225 |
have "a * x \<in> nnfis (pos_part (\<lambda>t. a * f t))" and
|
|
1226 |
"a * y \<in> nnfis (neg_part (\<lambda>t. a * f t))"
|
|
1227 |
using nnfis_times[OF _ `0 \<le> a`] by auto
|
|
1228 |
with x y have "?P a \<and> ?I a"
|
|
1229 |
unfolding integrable_def integral_def by (auto simp: algebra_simps) }
|
|
1230 |
note int = this
|
|
1231 |
|
|
1232 |
have "?P a \<and> ?I a"
|
|
1233 |
proof (cases "0 \<le> a")
|
|
1234 |
case True from int[OF this] show ?thesis .
|
|
1235 |
next
|
|
1236 |
case False with int[of "- a"] integral_uminus[of "\<lambda>t. - a * f t"]
|
|
1237 |
show ?thesis by auto
|
|
1238 |
qed
|
|
1239 |
thus "integrable (\<lambda>t. a * f t)"
|
|
1240 |
and "integral (\<lambda>t. a * f t) = a * integral f" by simp_all
|
|
1241 |
qed
|
|
1242 |
|
|
1243 |
lemma integral_cmul_indicator:
|
|
1244 |
assumes "s \<in> sets M"
|
|
1245 |
shows "integral (\<lambda>x. c * indicator_fn s x) = c * (measure M s)"
|
|
1246 |
and "integrable (\<lambda>x. c * indicator_fn s x)"
|
|
1247 |
using assms integral_times_const integral_indicator_fn by auto
|
|
1248 |
|
|
1249 |
lemma integral_zero:
|
|
1250 |
shows "integral (\<lambda>x. 0) = 0"
|
|
1251 |
and "integrable (\<lambda>x. 0)"
|
|
1252 |
using integral_cmul_indicator[OF empty_sets, of 0]
|
|
1253 |
unfolding indicator_fn_def by auto
|
|
1254 |
|
|
1255 |
lemma integral_setsum:
|
|
1256 |
assumes "finite S"
|
|
1257 |
assumes "\<And>n. n \<in> S \<Longrightarrow> integrable (f n)"
|
|
1258 |
shows "integral (\<lambda>x. \<Sum> i \<in> S. f i x) = (\<Sum> i \<in> S. integral (f i))" (is "?int S")
|
|
1259 |
and "integrable (\<lambda>x. \<Sum> i \<in> S. f i x)" (is "?I s")
|
|
1260 |
proof -
|
|
1261 |
from assms have "?int S \<and> ?I S"
|
|
1262 |
proof (induct S)
|
|
1263 |
case empty thus ?case by (simp add: integral_zero)
|
|
1264 |
next
|
|
1265 |
case (insert i S)
|
|
1266 |
thus ?case
|
|
1267 |
apply simp
|
|
1268 |
apply (subst integral_add)
|
|
1269 |
using assms apply auto
|
|
1270 |
apply (subst integral_add)
|
|
1271 |
using assms by auto
|
|
1272 |
qed
|
|
1273 |
thus "?int S" and "?I S" by auto
|
|
1274 |
qed
|
|
1275 |
|
|
1276 |
lemma markov_ineq:
|
|
1277 |
assumes "integrable f" "0 < a" "integrable (\<lambda>x. \<bar>f x\<bar>^n)"
|
|
1278 |
shows "measure M (f -` {a ..} \<inter> space M) \<le> integral (\<lambda>x. \<bar>f x\<bar>^n) / a^n"
|
|
1279 |
using assms
|
|
1280 |
proof -
|
|
1281 |
from assms have "0 < a ^ n" using real_root_pow_pos by auto
|
|
1282 |
from assms have "f \<in> borel_measurable M"
|
|
1283 |
using integral_borel_measurable[OF `integrable f`] by auto
|
|
1284 |
hence w: "{w . w \<in> space M \<and> a \<le> f w} \<in> sets M"
|
|
1285 |
using borel_measurable_ge_iff by auto
|
|
1286 |
have i: "integrable (indicator_fn {w . w \<in> space M \<and> a \<le> f w})"
|
|
1287 |
using integral_indicator_fn[OF w] by simp
|
|
1288 |
have v1: "\<And> t. a ^ n * (indicator_fn {w . w \<in> space M \<and> a \<le> f w}) t
|
|
1289 |
\<le> (f t) ^ n * (indicator_fn {w . w \<in> space M \<and> a \<le> f w}) t"
|
|
1290 |
unfolding indicator_fn_def
|
|
1291 |
using `0 < a` power_mono[of a] assms by auto
|
|
1292 |
have v2: "\<And> t. (f t) ^ n * (indicator_fn {w . w \<in> space M \<and> a \<le> f w}) t \<le> \<bar>f t\<bar> ^ n"
|
|
1293 |
unfolding indicator_fn_def
|
|
1294 |
using power_mono[of a _ n] abs_ge_self `a > 0`
|
|
1295 |
by auto
|
|
1296 |
have "{w \<in> space M. a \<le> f w} \<inter> space M = {w . a \<le> f w} \<inter> space M"
|
|
1297 |
using Collect_eq by auto
|
|
1298 |
from Int_absorb2[OF sets_into_space[OF w]] `0 < a ^ n` sets_into_space[OF w] w this
|
|
1299 |
have "(a ^ n) * (measure M ((f -` {y . a \<le> y}) \<inter> space M)) =
|
|
1300 |
(a ^ n) * measure M {w . w \<in> space M \<and> a \<le> f w}"
|
|
1301 |
unfolding vimage_Collect_eq[of f] by simp
|
|
1302 |
also have "\<dots> = integral (\<lambda> t. a ^ n * (indicator_fn {w . w \<in> space M \<and> a \<le> f w}) t)"
|
|
1303 |
using integral_cmul_indicator[OF w] i by auto
|
|
1304 |
also have "\<dots> \<le> integral (\<lambda> t. \<bar> f t \<bar> ^ n)"
|
|
1305 |
apply (rule integral_mono)
|
|
1306 |
using integral_cmul_indicator[OF w]
|
|
1307 |
`integrable (\<lambda> x. \<bar>f x\<bar> ^ n)` real_le_trans[OF v1 v2] by auto
|
|
1308 |
finally show "measure M (f -` {a ..} \<inter> space M) \<le> integral (\<lambda>x. \<bar>f x\<bar>^n) / a^n"
|
|
1309 |
unfolding atLeast_def
|
|
1310 |
by (auto intro!: mult_imp_le_div_pos[OF `0 < a ^ n`], simp add: real_mult_commute)
|
|
1311 |
qed
|
|
1312 |
|
35748
|
1313 |
section "Lebesgue integration on countable spaces"
|
|
1314 |
|
|
1315 |
lemma nnfis_on_countable:
|
|
1316 |
assumes borel: "f \<in> borel_measurable M"
|
|
1317 |
and bij: "bij_betw enum S (f ` space M - {0})"
|
|
1318 |
and enum_zero: "enum ` (-S) \<subseteq> {0}"
|
|
1319 |
and nn_enum: "\<And>n. 0 \<le> enum n"
|
|
1320 |
and sums: "(\<lambda>r. enum r * measure M (f -` {enum r} \<inter> space M)) sums x" (is "?sum sums x")
|
|
1321 |
shows "x \<in> nnfis f"
|
|
1322 |
proof -
|
|
1323 |
have inj_enum: "inj_on enum S"
|
|
1324 |
and range_enum: "enum ` S = f ` space M - {0}"
|
|
1325 |
using bij by (auto simp: bij_betw_def)
|
|
1326 |
|
|
1327 |
let "?x n z" = "\<Sum>i = 0..<n. enum i * indicator_fn (f -` {enum i} \<inter> space M) z"
|
|
1328 |
|
|
1329 |
show ?thesis
|
|
1330 |
proof (rule nnfis_mon_conv)
|
|
1331 |
show "(\<lambda>n. \<Sum>i = 0..<n. ?sum i) ----> x" using sums unfolding sums_def .
|
|
1332 |
next
|
|
1333 |
fix n
|
|
1334 |
show "(\<Sum>i = 0..<n. ?sum i) \<in> nnfis (?x n)"
|
|
1335 |
proof (induct n)
|
|
1336 |
case 0 thus ?case by (simp add: nnfis_0)
|
|
1337 |
next
|
|
1338 |
case (Suc n) thus ?case using nn_enum
|
|
1339 |
by (auto intro!: nnfis_add nnfis_times psfis_nnfis[OF psfis_indicator] borel_measurable_vimage[OF borel])
|
|
1340 |
qed
|
|
1341 |
next
|
|
1342 |
show "mono_convergent ?x f (space M)"
|
|
1343 |
proof (rule mono_convergentI)
|
|
1344 |
fix x
|
|
1345 |
show "incseq (\<lambda>n. ?x n x)"
|
|
1346 |
by (rule incseq_SucI, auto simp: indicator_fn_def nn_enum)
|
|
1347 |
|
|
1348 |
have fin: "\<And>n. finite (enum ` ({0..<n} \<inter> S))" by auto
|
|
1349 |
|
|
1350 |
assume "x \<in> space M"
|
|
1351 |
hence "f x \<in> enum ` S \<or> f x = 0" using range_enum by auto
|
|
1352 |
thus "(\<lambda>n. ?x n x) ----> f x"
|
|
1353 |
proof (rule disjE)
|
|
1354 |
assume "f x \<in> enum ` S"
|
|
1355 |
then obtain i where "i \<in> S" and "f x = enum i" by auto
|
|
1356 |
|
|
1357 |
{ fix n
|
|
1358 |
have sum_ranges:
|
|
1359 |
"i < n \<Longrightarrow> enum`({0..<n} \<inter> S) \<inter> {z. enum i = z \<and> x\<in>space M} = {enum i}"
|
|
1360 |
"\<not> i < n \<Longrightarrow> enum`({0..<n} \<inter> S) \<inter> {z. enum i = z \<and> x\<in>space M} = {}"
|
|
1361 |
using `x \<in> space M` `i \<in> S` inj_enum[THEN inj_on_iff] by auto
|
|
1362 |
have "?x n x =
|
|
1363 |
(\<Sum>i \<in> {0..<n} \<inter> S. enum i * indicator_fn (f -` {enum i} \<inter> space M) x)"
|
|
1364 |
using enum_zero by (auto intro!: setsum_mono_zero_cong_right)
|
|
1365 |
also have "... =
|
|
1366 |
(\<Sum>z \<in> enum`({0..<n} \<inter> S). z * indicator_fn (f -` {z} \<inter> space M) x)"
|
|
1367 |
using inj_enum[THEN subset_inj_on] by (auto simp: setsum_reindex)
|
|
1368 |
also have "... = (if i < n then f x else 0)"
|
|
1369 |
unfolding indicator_fn_def if_distrib[where x=1 and y=0]
|
|
1370 |
setsum_cases[OF fin]
|
|
1371 |
using sum_ranges `f x = enum i`
|
|
1372 |
by auto
|
|
1373 |
finally have "?x n x = (if i < n then f x else 0)" . }
|
|
1374 |
note sum_equals_if = this
|
|
1375 |
|
|
1376 |
show ?thesis unfolding sum_equals_if
|
|
1377 |
by (rule LIMSEQ_offset[where k="i + 1"]) (auto intro!: LIMSEQ_const)
|
|
1378 |
next
|
|
1379 |
assume "f x = 0"
|
|
1380 |
{ fix n have "?x n x = 0"
|
|
1381 |
unfolding indicator_fn_def if_distrib[where x=1 and y=0]
|
|
1382 |
setsum_cases[OF finite_atLeastLessThan]
|
|
1383 |
using `f x = 0` `x \<in> space M`
|
|
1384 |
by (auto split: split_if) }
|
|
1385 |
thus ?thesis using `f x = 0` by (auto intro!: LIMSEQ_const)
|
|
1386 |
qed
|
|
1387 |
qed
|
|
1388 |
qed
|
|
1389 |
qed
|
|
1390 |
|
|
1391 |
lemma integral_on_countable:
|
35833
|
1392 |
fixes enum :: "nat \<Rightarrow> real"
|
35748
|
1393 |
assumes borel: "f \<in> borel_measurable M"
|
|
1394 |
and bij: "bij_betw enum S (f ` space M)"
|
|
1395 |
and enum_zero: "enum ` (-S) \<subseteq> {0}"
|
|
1396 |
and abs_summable: "summable (\<lambda>r. \<bar>enum r * measure M (f -` {enum r} \<inter> space M)\<bar>)"
|
|
1397 |
shows "integrable f"
|
|
1398 |
and "integral f = (\<Sum>r. enum r * measure M (f -` {enum r} \<inter> space M))" (is "_ = suminf (?sum f enum)")
|
|
1399 |
proof -
|
|
1400 |
{ fix f enum
|
|
1401 |
assume borel: "f \<in> borel_measurable M"
|
|
1402 |
and bij: "bij_betw enum S (f ` space M)"
|
|
1403 |
and enum_zero: "enum ` (-S) \<subseteq> {0}"
|
|
1404 |
and abs_summable: "summable (\<lambda>r. \<bar>enum r * measure M (f -` {enum r} \<inter> space M)\<bar>)"
|
|
1405 |
have inj_enum: "inj_on enum S" and range_enum: "f ` space M = enum ` S"
|
|
1406 |
using bij unfolding bij_betw_def by auto
|
|
1407 |
|
|
1408 |
have [simp, intro]: "\<And>X. 0 \<le> measure M (f -` {X} \<inter> space M)"
|
|
1409 |
by (rule positive, rule borel_measurable_vimage[OF borel])
|
|
1410 |
|
|
1411 |
have "(\<Sum>r. ?sum (pos_part f) (pos_part enum) r) \<in> nnfis (pos_part f) \<and>
|
|
1412 |
summable (\<lambda>r. ?sum (pos_part f) (pos_part enum) r)"
|
|
1413 |
proof (rule conjI, rule nnfis_on_countable)
|
|
1414 |
have pos_f_image: "pos_part f ` space M - {0} = f ` space M \<inter> {0<..}"
|
|
1415 |
unfolding pos_part_def max_def by auto
|
|
1416 |
|
|
1417 |
show "bij_betw (pos_part enum) {x \<in> S. 0 < enum x} (pos_part f ` space M - {0})"
|
|
1418 |
unfolding bij_betw_def pos_f_image
|
|
1419 |
unfolding pos_part_def max_def range_enum
|
|
1420 |
by (auto intro!: inj_onI simp: inj_enum[THEN inj_on_eq_iff])
|
|
1421 |
|
|
1422 |
show "\<And>n. 0 \<le> pos_part enum n" unfolding pos_part_def max_def by auto
|
|
1423 |
|
|
1424 |
show "pos_part f \<in> borel_measurable M"
|
|
1425 |
by (rule pos_part_borel_measurable[OF borel])
|
|
1426 |
|
|
1427 |
show "pos_part enum ` (- {x \<in> S. 0 < enum x}) \<subseteq> {0}"
|
|
1428 |
unfolding pos_part_def max_def using enum_zero by auto
|
|
1429 |
|
|
1430 |
show "summable (\<lambda>r. ?sum (pos_part f) (pos_part enum) r)"
|
|
1431 |
proof (rule summable_comparison_test[OF _ abs_summable], safe intro!: exI[of _ 0])
|
|
1432 |
fix n :: nat
|
|
1433 |
have "pos_part enum n \<noteq> 0 \<Longrightarrow> (pos_part f -` {enum n} \<inter> space M) =
|
|
1434 |
(if 0 < enum n then (f -` {enum n} \<inter> space M) else {})"
|
|
1435 |
unfolding pos_part_def max_def by (auto split: split_if_asm)
|
|
1436 |
thus "norm (?sum (pos_part f) (pos_part enum) n) \<le> \<bar>?sum f enum n \<bar>"
|
|
1437 |
by (cases "pos_part enum n = 0",
|
|
1438 |
auto simp: pos_part_def max_def abs_mult not_le split: split_if_asm intro!: mult_nonpos_nonneg)
|
|
1439 |
qed
|
|
1440 |
thus "(\<lambda>r. ?sum (pos_part f) (pos_part enum) r) sums (\<Sum>r. ?sum (pos_part f) (pos_part enum) r)"
|
|
1441 |
by (rule summable_sums)
|
|
1442 |
qed }
|
|
1443 |
note pos = this
|
|
1444 |
|
|
1445 |
note pos_part = pos[OF assms(1-4)]
|
|
1446 |
moreover
|
|
1447 |
have neg_part_to_pos_part:
|
|
1448 |
"\<And>f :: _ \<Rightarrow> real. neg_part f = pos_part (uminus \<circ> f)"
|
|
1449 |
by (auto simp: pos_part_def neg_part_def min_def max_def expand_fun_eq)
|
|
1450 |
|
|
1451 |
have neg_part: "(\<Sum>r. ?sum (neg_part f) (neg_part enum) r) \<in> nnfis (neg_part f) \<and>
|
|
1452 |
summable (\<lambda>r. ?sum (neg_part f) (neg_part enum) r)"
|
|
1453 |
unfolding neg_part_to_pos_part
|
|
1454 |
proof (rule pos)
|
|
1455 |
show "uminus \<circ> f \<in> borel_measurable M" unfolding comp_def
|
|
1456 |
by (rule borel_measurable_uminus_borel_measurable[OF borel])
|
|
1457 |
|
|
1458 |
show "bij_betw (uminus \<circ> enum) S ((uminus \<circ> f) ` space M)"
|
|
1459 |
using bij unfolding bij_betw_def
|
|
1460 |
by (auto intro!: comp_inj_on simp: image_compose)
|
|
1461 |
|
|
1462 |
show "(uminus \<circ> enum) ` (- S) \<subseteq> {0}"
|
|
1463 |
using enum_zero by auto
|
|
1464 |
|
|
1465 |
have minus_image: "\<And>r. (uminus \<circ> f) -` {(uminus \<circ> enum) r} \<inter> space M = f -` {enum r} \<inter> space M"
|
|
1466 |
by auto
|
|
1467 |
show "summable (\<lambda>r. \<bar>(uminus \<circ> enum) r * measure_space.measure M ((uminus \<circ> f) -` {(uminus \<circ> enum) r} \<inter> space M)\<bar>)"
|
|
1468 |
unfolding minus_image using abs_summable by simp
|
|
1469 |
qed
|
|
1470 |
ultimately show "integrable f" unfolding integrable_def by auto
|
|
1471 |
|
|
1472 |
{ fix r
|
|
1473 |
have "?sum (pos_part f) (pos_part enum) r - ?sum (neg_part f) (neg_part enum) r = ?sum f enum r"
|
|
1474 |
proof (cases rule: linorder_cases)
|
|
1475 |
assume "0 < enum r"
|
|
1476 |
hence "pos_part f -` {enum r} \<inter> space M = f -` {enum r} \<inter> space M"
|
|
1477 |
unfolding pos_part_def max_def by (auto split: split_if_asm)
|
|
1478 |
with `0 < enum r` show ?thesis unfolding pos_part_def neg_part_def min_def max_def expand_fun_eq
|
|
1479 |
by auto
|
|
1480 |
next
|
|
1481 |
assume "enum r < 0"
|
|
1482 |
hence "neg_part f -` {- enum r} \<inter> space M = f -` {enum r} \<inter> space M"
|
|
1483 |
unfolding neg_part_def min_def by (auto split: split_if_asm)
|
|
1484 |
with `enum r < 0` show ?thesis unfolding pos_part_def neg_part_def min_def max_def expand_fun_eq
|
|
1485 |
by auto
|
|
1486 |
qed (simp add: neg_part_def pos_part_def) }
|
|
1487 |
note sum_diff_eq_sum = this
|
|
1488 |
|
|
1489 |
have "(\<Sum>r. ?sum (pos_part f) (pos_part enum) r) - (\<Sum>r. ?sum (neg_part f) (neg_part enum) r)
|
|
1490 |
= (\<Sum>r. ?sum (pos_part f) (pos_part enum) r - ?sum (neg_part f) (neg_part enum) r)"
|
|
1491 |
using neg_part pos_part by (auto intro: suminf_diff)
|
|
1492 |
also have "... = (\<Sum>r. ?sum f enum r)" unfolding sum_diff_eq_sum ..
|
|
1493 |
finally show "integral f = suminf (?sum f enum)"
|
|
1494 |
unfolding integral_def using pos_part neg_part
|
|
1495 |
by (auto dest: the_nnfis)
|
|
1496 |
qed
|
|
1497 |
|
35692
|
1498 |
section "Lebesgue integration on finite space"
|
|
1499 |
|
35582
|
1500 |
lemma integral_finite_on_sets:
|
|
1501 |
assumes "f \<in> borel_measurable M" and "finite (space M)" and "a \<in> sets M"
|
|
1502 |
shows "integral (\<lambda>x. f x * indicator_fn a x) =
|
|
1503 |
(\<Sum> r \<in> f`a. r * measure M (f -` {r} \<inter> a))" (is "integral ?f = _")
|
|
1504 |
proof -
|
|
1505 |
{ fix x assume "x \<in> a"
|
|
1506 |
with assms have "f -` {f x} \<inter> space M \<in> sets M"
|
|
1507 |
by (subst Int_commute)
|
|
1508 |
(auto simp: vimage_def Int_def
|
|
1509 |
intro!: borel_measurable_const
|
|
1510 |
borel_measurable_eq_borel_measurable)
|
|
1511 |
from Int[OF this assms(3)]
|
|
1512 |
sets_into_space[OF assms(3), THEN Int_absorb1]
|
|
1513 |
have "f -` {f x} \<inter> a \<in> sets M" by (simp add: Int_assoc) }
|
|
1514 |
note vimage_f = this
|
|
1515 |
|
|
1516 |
have "finite a"
|
|
1517 |
using assms(2,3) sets_into_space
|
|
1518 |
by (auto intro: finite_subset)
|
|
1519 |
|
|
1520 |
have "integral (\<lambda>x. f x * indicator_fn a x) =
|
|
1521 |
integral (\<lambda>x. \<Sum>i\<in>f ` a. i * indicator_fn (f -` {i} \<inter> a) x)"
|
|
1522 |
(is "_ = integral (\<lambda>x. setsum (?f x) _)")
|
|
1523 |
unfolding indicator_fn_def if_distrib
|
|
1524 |
using `finite a` by (auto simp: setsum_cases intro!: integral_cong)
|
|
1525 |
also have "\<dots> = (\<Sum>i\<in>f`a. integral (\<lambda>x. ?f x i))"
|
|
1526 |
proof (rule integral_setsum, safe)
|
|
1527 |
fix n x assume "x \<in> a"
|
|
1528 |
thus "integrable (\<lambda>y. ?f y (f x))"
|
|
1529 |
using integral_indicator_fn(2)[OF vimage_f]
|
|
1530 |
by (auto intro!: integral_times_const)
|
|
1531 |
qed (simp add: `finite a`)
|
|
1532 |
also have "\<dots> = (\<Sum>i\<in>f`a. i * measure M (f -` {i} \<inter> a))"
|
|
1533 |
using integral_cmul_indicator[OF vimage_f]
|
|
1534 |
by (auto intro!: setsum_cong)
|
|
1535 |
finally show ?thesis .
|
|
1536 |
qed
|
|
1537 |
|
|
1538 |
lemma integral_finite:
|
|
1539 |
assumes "f \<in> borel_measurable M" and "finite (space M)"
|
|
1540 |
shows "integral f = (\<Sum> r \<in> f ` space M. r * measure M (f -` {r} \<inter> space M))"
|
|
1541 |
using integral_finite_on_sets[OF assms top]
|
|
1542 |
integral_cong[of "\<lambda>x. f x * indicator_fn (space M) x" f]
|
|
1543 |
by (auto simp add: indicator_fn_def)
|
|
1544 |
|
|
1545 |
lemma integral_finite_singleton:
|
|
1546 |
assumes fin: "finite (space M)" and "Pow (space M) = sets M"
|
|
1547 |
shows "integral f = (\<Sum>x \<in> space M. f x * measure M {x})"
|
|
1548 |
proof -
|
|
1549 |
have "f \<in> borel_measurable M"
|
|
1550 |
unfolding borel_measurable_le_iff
|
|
1551 |
using assms by auto
|
|
1552 |
{ fix r let ?x = "f -` {r} \<inter> space M"
|
|
1553 |
have "?x \<subseteq> space M" by auto
|
|
1554 |
with assms have "measure M ?x = (\<Sum>i \<in> ?x. measure M {i})"
|
|
1555 |
by (auto intro!: measure_real_sum_image) }
|
|
1556 |
note measure_eq_setsum = this
|
|
1557 |
show ?thesis
|
|
1558 |
unfolding integral_finite[OF `f \<in> borel_measurable M` fin]
|
|
1559 |
measure_eq_setsum setsum_right_distrib
|
|
1560 |
apply (subst setsum_Sigma)
|
|
1561 |
apply (simp add: assms)
|
|
1562 |
apply (simp add: assms)
|
|
1563 |
proof (rule setsum_reindex_cong[symmetric])
|
|
1564 |
fix a assume "a \<in> Sigma (f ` space M) (\<lambda>x. f -` {x} \<inter> space M)"
|
|
1565 |
thus "(\<lambda>(x, y). x * measure M {y}) a = f (snd a) * measure_space.measure M {snd a}"
|
|
1566 |
by auto
|
|
1567 |
qed (auto intro!: image_eqI inj_onI)
|
|
1568 |
qed
|
|
1569 |
|
35692
|
1570 |
section "Radon–Nikodym derivative"
|
35582
|
1571 |
|
35692
|
1572 |
definition
|
|
1573 |
"RN_deriv v \<equiv> SOME f. measure_space (M\<lparr>measure := v\<rparr>) \<and>
|
|
1574 |
f \<in> borel_measurable M \<and>
|
|
1575 |
(\<forall>a \<in> sets M. (integral (\<lambda>x. f x * indicator_fn a x) = v a))"
|
35582
|
1576 |
|
|
1577 |
lemma RN_deriv_finite_singleton:
|
|
1578 |
fixes v :: "'a set \<Rightarrow> real"
|
|
1579 |
assumes finite: "finite (space M)" and Pow: "Pow (space M) = sets M"
|
|
1580 |
and ms_v: "measure_space (M\<lparr>measure := v\<rparr>)"
|
|
1581 |
and eq_0: "\<And>x. measure M {x} = 0 \<Longrightarrow> v {x} = 0"
|
|
1582 |
and "x \<in> space M" and "measure M {x} \<noteq> 0"
|
|
1583 |
shows "RN_deriv v x = v {x} / (measure M {x})" (is "_ = ?v x")
|
|
1584 |
unfolding RN_deriv_def
|
|
1585 |
proof (rule someI2_ex[where Q = "\<lambda>f. f x = ?v x"], rule exI[where x = ?v], safe)
|
|
1586 |
show "(\<lambda>a. v {a} / measure_space.measure M {a}) \<in> borel_measurable M"
|
|
1587 |
unfolding borel_measurable_le_iff using Pow by auto
|
|
1588 |
next
|
|
1589 |
fix a assume "a \<in> sets M"
|
|
1590 |
hence "a \<subseteq> space M" and "finite a"
|
|
1591 |
using sets_into_space finite by (auto intro: finite_subset)
|
|
1592 |
have *: "\<And>x a. (if measure M {x} = 0 then 0 else v {x} * indicator_fn a x) =
|
|
1593 |
v {x} * indicator_fn a x" using eq_0 by auto
|
|
1594 |
|
|
1595 |
from measure_space.measure_real_sum_image[OF ms_v, of a]
|
|
1596 |
Pow `a \<in> sets M` sets_into_space `finite a`
|
|
1597 |
have "v a = (\<Sum>x\<in>a. v {x})" by auto
|
|
1598 |
thus "integral (\<lambda>x. v {x} / measure_space.measure M {x} * indicator_fn a x) = v a"
|
|
1599 |
apply (simp add: eq_0 integral_finite_singleton[OF finite Pow])
|
|
1600 |
apply (unfold divide_1)
|
|
1601 |
by (simp add: * indicator_fn_def if_distrib setsum_cases finite `a \<subseteq> space M` Int_absorb1)
|
|
1602 |
next
|
|
1603 |
fix w assume "w \<in> borel_measurable M"
|
|
1604 |
assume int_eq_v: "\<forall>a\<in>sets M. integral (\<lambda>x. w x * indicator_fn a x) = v a"
|
|
1605 |
have "{x} \<in> sets M" using Pow `x \<in> space M` by auto
|
|
1606 |
|
|
1607 |
have "w x * measure M {x} =
|
|
1608 |
(\<Sum>y\<in>space M. w y * indicator_fn {x} y * measure M {y})"
|
|
1609 |
apply (subst (3) mult_commute)
|
|
1610 |
unfolding indicator_fn_def if_distrib setsum_cases[OF finite]
|
|
1611 |
using `x \<in> space M` by simp
|
|
1612 |
also have "... = v {x}"
|
|
1613 |
using int_eq_v[rule_format, OF `{x} \<in> sets M`]
|
|
1614 |
by (simp add: integral_finite_singleton[OF finite Pow])
|
|
1615 |
finally show "w x = v {x} / measure M {x}"
|
|
1616 |
using `measure M {x} \<noteq> 0` by (simp add: eq_divide_eq)
|
|
1617 |
qed fact
|
|
1618 |
|
35748
|
1619 |
end
|
35582
|
1620 |
|
|
1621 |
end
|