11 |
11 |
12 text \<open> |
12 text \<open> |
13 Originally from the Hurd/Coble measure theory development, translated by Lawrence Paulson. |
13 Originally from the Hurd/Coble measure theory development, translated by Lawrence Paulson. |
14 \<close> |
14 \<close> |
15 |
15 |
16 lemma suminf_ereal_2dimen: |
16 lemma suminf_ennreal_2dimen: |
17 fixes f:: "nat \<times> nat \<Rightarrow> ereal" |
17 fixes f:: "nat \<times> nat \<Rightarrow> ennreal" |
18 assumes pos: "\<And>p. 0 \<le> f p" |
|
19 assumes "\<And>m. g m = (\<Sum>n. f (m,n))" |
18 assumes "\<And>m. g m = (\<Sum>n. f (m,n))" |
20 shows "(\<Sum>i. f (prod_decode i)) = suminf g" |
19 shows "(\<Sum>i. f (prod_decode i)) = suminf g" |
21 proof - |
20 proof - |
22 have g_def: "g = (\<lambda>m. (\<Sum>n. f (m,n)))" |
21 have g_def: "g = (\<lambda>m. (\<Sum>n. f (m,n)))" |
23 using assms by (simp add: fun_eq_iff) |
22 using assms by (simp add: fun_eq_iff) |
24 have reindex: "\<And>B. (\<Sum>x\<in>B. f (prod_decode x)) = setsum f (prod_decode ` B)" |
23 have reindex: "\<And>B. (\<Sum>x\<in>B. f (prod_decode x)) = setsum f (prod_decode ` B)" |
25 by (simp add: setsum.reindex[OF inj_prod_decode] comp_def) |
24 by (simp add: setsum.reindex[OF inj_prod_decode] comp_def) |
26 { fix n |
25 have "(SUP n. \<Sum>i<n. f (prod_decode i)) = (SUP p : UNIV \<times> UNIV. \<Sum>i<fst p. \<Sum>n<snd p. f (i, n))" |
|
26 proof (intro SUP_eq; clarsimp simp: setsum.cartesian_product reindex) |
|
27 fix n |
27 let ?M = "\<lambda>f. Suc (Max (f ` prod_decode ` {..<n}))" |
28 let ?M = "\<lambda>f. Suc (Max (f ` prod_decode ` {..<n}))" |
28 { fix a b x assume "x < n" and [symmetric]: "(a, b) = prod_decode x" |
29 { fix a b x assume "x < n" and [symmetric]: "(a, b) = prod_decode x" |
29 then have "a < ?M fst" "b < ?M snd" |
30 then have "a < ?M fst" "b < ?M snd" |
30 by (auto intro!: Max_ge le_imp_less_Suc image_eqI) } |
31 by (auto intro!: Max_ge le_imp_less_Suc image_eqI) } |
31 then have "setsum f (prod_decode ` {..<n}) \<le> setsum f ({..<?M fst} \<times> {..<?M snd})" |
32 then have "setsum f (prod_decode ` {..<n}) \<le> setsum f ({..<?M fst} \<times> {..<?M snd})" |
32 by (auto intro!: setsum_mono3 simp: pos) |
33 by (auto intro!: setsum_mono3) |
33 then have "\<exists>a b. setsum f (prod_decode ` {..<n}) \<le> setsum f ({..<a} \<times> {..<b})" by auto } |
34 then show "\<exists>a b. setsum f (prod_decode ` {..<n}) \<le> setsum f ({..<a} \<times> {..<b})" by auto |
34 moreover |
35 next |
35 { fix a b |
36 fix a b |
36 let ?M = "prod_decode ` {..<Suc (Max (prod_encode ` ({..<a} \<times> {..<b})))}" |
37 let ?M = "prod_decode ` {..<Suc (Max (prod_encode ` ({..<a} \<times> {..<b})))}" |
37 { fix a' b' assume "a' < a" "b' < b" then have "(a', b') \<in> ?M" |
38 { fix a' b' assume "a' < a" "b' < b" then have "(a', b') \<in> ?M" |
38 by (auto intro!: Max_ge le_imp_less_Suc image_eqI[where x="prod_encode (a', b')"]) } |
39 by (auto intro!: Max_ge le_imp_less_Suc image_eqI[where x="prod_encode (a', b')"]) } |
39 then have "setsum f ({..<a} \<times> {..<b}) \<le> setsum f ?M" |
40 then have "setsum f ({..<a} \<times> {..<b}) \<le> setsum f ?M" |
40 by (auto intro!: setsum_mono3 simp: pos) } |
41 by (auto intro!: setsum_mono3) |
41 ultimately |
42 then show "\<exists>n. setsum f ({..<a} \<times> {..<b}) \<le> setsum f (prod_decode ` {..<n})" |
42 show ?thesis unfolding g_def using pos |
43 by auto |
43 by (auto intro!: SUP_eq simp: setsum.cartesian_product reindex SUP_upper2 |
44 qed |
44 suminf_ereal_eq_SUP SUP_pair |
45 also have "\<dots> = (SUP p. \<Sum>i<p. \<Sum>n. f (i, n))" |
45 SUP_ereal_setsum[symmetric] incseq_setsumI setsum_nonneg) |
46 unfolding suminf_setsum[OF summableI, symmetric] |
|
47 by (simp add: suminf_eq_SUP SUP_pair setsum.commute[of _ "{..< fst _}"]) |
|
48 finally show ?thesis unfolding g_def |
|
49 by (simp add: suminf_eq_SUP) |
46 qed |
50 qed |
47 |
51 |
48 subsection \<open>Characterizations of Measures\<close> |
52 subsection \<open>Characterizations of Measures\<close> |
49 |
|
50 definition subadditive where |
|
51 "subadditive M f \<longleftrightarrow> (\<forall>x\<in>M. \<forall>y\<in>M. x \<inter> y = {} \<longrightarrow> f (x \<union> y) \<le> f x + f y)" |
|
52 |
|
53 definition countably_subadditive where |
|
54 "countably_subadditive M f \<longleftrightarrow> |
|
55 (\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i. A i) \<in> M \<longrightarrow> (f (\<Union>i. A i) \<le> (\<Sum>i. f (A i))))" |
|
56 |
53 |
57 definition outer_measure_space where |
54 definition outer_measure_space where |
58 "outer_measure_space M f \<longleftrightarrow> positive M f \<and> increasing M f \<and> countably_subadditive M f" |
55 "outer_measure_space M f \<longleftrightarrow> positive M f \<and> increasing M f \<and> countably_subadditive M f" |
59 |
56 |
60 lemma subadditiveD: "subadditive M f \<Longrightarrow> x \<inter> y = {} \<Longrightarrow> x \<in> M \<Longrightarrow> y \<in> M \<Longrightarrow> f (x \<union> y) \<le> f x + f y" |
|
61 by (auto simp add: subadditive_def) |
|
62 |
|
63 subsubsection \<open>Lambda Systems\<close> |
57 subsubsection \<open>Lambda Systems\<close> |
64 |
58 |
65 definition lambda_system where |
59 definition lambda_system :: "'a set \<Rightarrow> 'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> 'a set set" |
|
60 where |
66 "lambda_system \<Omega> M f = {l \<in> M. \<forall>x \<in> M. f (l \<inter> x) + f ((\<Omega> - l) \<inter> x) = f x}" |
61 "lambda_system \<Omega> M f = {l \<in> M. \<forall>x \<in> M. f (l \<inter> x) + f ((\<Omega> - l) \<inter> x) = f x}" |
67 |
62 |
68 lemma (in algebra) lambda_system_eq: |
63 lemma (in algebra) lambda_system_eq: |
69 "lambda_system \<Omega> M f = {l \<in> M. \<forall>x \<in> M. f (x \<inter> l) + f (x - l) = f x}" |
64 "lambda_system \<Omega> M f = {l \<in> M. \<forall>x \<in> M. f (x \<inter> l) + f (x - l) = f x}" |
70 proof - |
65 proof - |
174 thus "f (x \<union> y) = f x + f y" |
169 thus "f (x \<union> y) = f x + f y" |
175 using lambda_system_strong_additive [OF top disj xl yl] |
170 using lambda_system_strong_additive [OF top disj xl yl] |
176 by (simp add: Un) |
171 by (simp add: Un) |
177 qed |
172 qed |
178 |
173 |
179 lemma (in ring_of_sets) countably_subadditive_subadditive: |
|
180 assumes f: "positive M f" and cs: "countably_subadditive M f" |
|
181 shows "subadditive M f" |
|
182 proof (auto simp add: subadditive_def) |
|
183 fix x y |
|
184 assume x: "x \<in> M" and y: "y \<in> M" and "x \<inter> y = {}" |
|
185 hence "disjoint_family (binaryset x y)" |
|
186 by (auto simp add: disjoint_family_on_def binaryset_def) |
|
187 hence "range (binaryset x y) \<subseteq> M \<longrightarrow> |
|
188 (\<Union>i. binaryset x y i) \<in> M \<longrightarrow> |
|
189 f (\<Union>i. binaryset x y i) \<le> (\<Sum> n. f (binaryset x y n))" |
|
190 using cs by (auto simp add: countably_subadditive_def) |
|
191 hence "{x,y,{}} \<subseteq> M \<longrightarrow> x \<union> y \<in> M \<longrightarrow> |
|
192 f (x \<union> y) \<le> (\<Sum> n. f (binaryset x y n))" |
|
193 by (simp add: range_binaryset_eq UN_binaryset_eq) |
|
194 thus "f (x \<union> y) \<le> f x + f y" using f x y |
|
195 by (auto simp add: Un o_def suminf_binaryset_eq positive_def) |
|
196 qed |
|
197 |
|
198 lemma lambda_system_increasing: "increasing M f \<Longrightarrow> increasing (lambda_system \<Omega> M f) f" |
174 lemma lambda_system_increasing: "increasing M f \<Longrightarrow> increasing (lambda_system \<Omega> M f) f" |
199 by (simp add: increasing_def lambda_system_def) |
175 by (simp add: increasing_def lambda_system_def) |
200 |
176 |
201 lemma lambda_system_positive: "positive M f \<Longrightarrow> positive (lambda_system \<Omega> M f) f" |
177 lemma lambda_system_positive: "positive M f \<Longrightarrow> positive (lambda_system \<Omega> M f) f" |
202 by (simp add: positive_def lambda_system_def) |
178 by (simp add: positive_def lambda_system_def) |
203 |
179 |
204 lemma (in algebra) lambda_system_strong_sum: |
180 lemma (in algebra) lambda_system_strong_sum: |
205 fixes A:: "nat \<Rightarrow> 'a set" and f :: "'a set \<Rightarrow> ereal" |
181 fixes A:: "nat \<Rightarrow> 'a set" and f :: "'a set \<Rightarrow> ennreal" |
206 assumes f: "positive M f" and a: "a \<in> M" |
182 assumes f: "positive M f" and a: "a \<in> M" |
207 and A: "range A \<subseteq> lambda_system \<Omega> M f" |
183 and A: "range A \<subseteq> lambda_system \<Omega> M f" |
208 and disj: "disjoint_family A" |
184 and disj: "disjoint_family A" |
209 shows "(\<Sum>i = 0..<n. f (a \<inter>A i)) = f (a \<inter> (\<Union>i\<in>{0..<n}. A i))" |
185 shows "(\<Sum>i = 0..<n. f (a \<inter>A i)) = f (a \<inter> (\<Union>i\<in>{0..<n}. A i))" |
210 proof (induct n) |
186 proof (induct n) |
245 by (metis A'' countable_UN) |
221 by (metis A'' countable_UN) |
246 have U_eq: "f (\<Union>i. A i) = (\<Sum>i. f (A i))" |
222 have U_eq: "f (\<Union>i. A i) = (\<Sum>i. f (A i))" |
247 proof (rule antisym) |
223 proof (rule antisym) |
248 show "f (\<Union>i. A i) \<le> (\<Sum>i. f (A i))" |
224 show "f (\<Union>i. A i) \<le> (\<Sum>i. f (A i))" |
249 using csa[unfolded countably_subadditive_def] A'' disj U_in by auto |
225 using csa[unfolded countably_subadditive_def] A'' disj U_in by auto |
250 have *: "\<And>i. 0 \<le> f (A i)" using pos A'' unfolding positive_def by auto |
|
251 have dis: "\<And>N. disjoint_family_on A {..<N}" by (intro disjoint_family_on_mono[OF _ disj]) auto |
226 have dis: "\<And>N. disjoint_family_on A {..<N}" by (intro disjoint_family_on_mono[OF _ disj]) auto |
252 show "(\<Sum>i. f (A i)) \<le> f (\<Union>i. A i)" |
227 show "(\<Sum>i. f (A i)) \<le> f (\<Union>i. A i)" |
253 using ls.additive_sum [OF lambda_system_positive[OF pos] lambda_system_additive _ A' dis] A'' |
228 using ls.additive_sum [OF lambda_system_positive[OF pos] lambda_system_additive _ A' dis] A'' |
254 by (intro suminf_bound[OF _ *]) (auto intro!: increasingD[OF inc] countable_UN) |
229 by (intro suminf_le_const[OF summableI]) (auto intro!: increasingD[OF inc] countable_UN) |
255 qed |
230 qed |
256 have "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) = f a" |
231 have "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) = f a" |
257 if a [iff]: "a \<in> M" for a |
232 if a [iff]: "a \<in> M" for a |
258 proof (rule antisym) |
233 proof (rule antisym) |
259 have "range (\<lambda>i. a \<inter> A i) \<subseteq> M" using A'' |
234 have "range (\<lambda>i. a \<inter> A i) \<subseteq> M" using A'' |
283 by (simp add: lambda_system_eq UNION_in) |
258 by (simp add: lambda_system_eq UNION_in) |
284 have "f (a - (\<Union>i. A i)) \<le> f (a - (\<Union>i\<in>{0..<n}. A i))" |
259 have "f (a - (\<Union>i. A i)) \<le> f (a - (\<Union>i\<in>{0..<n}. A i))" |
285 by (blast intro: increasingD [OF inc] UNION_in U_in) |
260 by (blast intro: increasingD [OF inc] UNION_in U_in) |
286 thus "(\<Sum>i<n. f (a \<inter> A i)) + f (a - (\<Union>i. A i)) \<le> f a" |
261 thus "(\<Sum>i<n. f (a \<inter> A i)) + f (a - (\<Union>i. A i)) \<le> f a" |
287 by (simp add: lambda_system_strong_sum pos A disj eq_fa add_left_mono atLeast0LessThan[symmetric]) |
262 by (simp add: lambda_system_strong_sum pos A disj eq_fa add_left_mono atLeast0LessThan[symmetric]) |
288 next |
|
289 have "\<And>i. a \<inter> A i \<in> M" using A'' by auto |
|
290 then show "\<And>i. 0 \<le> f (a \<inter> A i)" using pos[unfolded positive_def] by auto |
|
291 have "\<And>i. a - (\<Union>i. A i) \<in> M" using A'' by auto |
|
292 then have "\<And>i. 0 \<le> f (a - (\<Union>i. A i))" using pos[unfolded positive_def] by auto |
|
293 then show "f (a - (\<Union>i. A i)) \<noteq> -\<infinity>" by auto |
|
294 qed |
263 qed |
295 finally show "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) \<le> f a" . |
264 finally show "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) \<le> f a" |
|
265 by simp |
296 next |
266 next |
297 have "f a \<le> f (a \<inter> (\<Union>i. A i) \<union> (a - (\<Union>i. A i)))" |
267 have "f a \<le> f (a \<inter> (\<Union>i. A i) \<union> (a - (\<Union>i. A i)))" |
298 by (blast intro: increasingD [OF inc] U_in) |
268 by (blast intro: increasingD [OF inc] U_in) |
299 also have "... \<le> f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i))" |
269 also have "... \<le> f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i))" |
300 by (blast intro: subadditiveD [OF sa] U_in) |
270 by (blast intro: subadditiveD [OF sa] U_in) |
344 also have "\<dots> = (\<Sum>i. f (A i \<inter> s))" |
314 also have "\<dots> = (\<Sum>i. f (A i \<inter> s))" |
345 using sA dA A s |
315 using sA dA A s |
346 by (intro ca[unfolded countably_additive_def, rule_format, symmetric]) |
316 by (intro ca[unfolded countably_additive_def, rule_format, symmetric]) |
347 (auto simp: Int_absorb1 disjoint_family_on_def) |
317 (auto simp: Int_absorb1 disjoint_family_on_def) |
348 also have "... \<le> (\<Sum>i. f (A i))" |
318 also have "... \<le> (\<Sum>i. f (A i))" |
349 using A s by (intro suminf_le_pos increasingD[OF inc] positiveD2[OF posf]) auto |
319 using A s by (auto intro!: suminf_le increasingD[OF inc]) |
350 finally show "f s \<le> (\<Sum>i. f (A i))" . |
320 finally show "f s \<le> (\<Sum>i. f (A i))" . |
351 next |
321 next |
352 have "(\<Sum>i. f (if i = 0 then s else {})) \<le> f s" |
322 have "(\<Sum>i. f (if i = 0 then s else {})) \<le> f s" |
353 using positiveD1[OF posf] by (subst suminf_finite[of "{0}"]) auto |
323 using positiveD1[OF posf] by (subst suminf_finite[of "{0}"]) auto |
354 with s show "(INF A:{A. range A \<subseteq> M \<and> disjoint_family A \<and> s \<subseteq> UNION UNIV A}. \<Sum>i. f (A i)) \<le> f s" |
324 with s show "(INF A:{A. range A \<subseteq> M \<and> disjoint_family A \<and> s \<subseteq> UNION UNIV A}. \<Sum>i. f (A i)) \<le> f s" |
355 by (intro INF_lower2[of "\<lambda>i. if i = 0 then s else {}"]) |
325 by (intro INF_lower2[of "\<lambda>i. if i = 0 then s else {}"]) |
356 (auto simp: disjoint_family_on_def) |
326 (auto simp: disjoint_family_on_def) |
357 qed |
327 qed |
358 |
328 |
359 lemma outer_measure_nonneg: "positive M f \<Longrightarrow> 0 \<le> outer_measure M f X" |
|
360 by (auto intro!: INF_greatest suminf_0_le intro: positiveD2 simp: outer_measure_def) |
|
361 |
|
362 lemma outer_measure_empty: |
329 lemma outer_measure_empty: |
363 assumes posf: "positive M f" and "{} \<in> M" |
330 "positive M f \<Longrightarrow> {} \<in> M \<Longrightarrow> outer_measure M f {} = 0" |
364 shows "outer_measure M f {} = 0" |
331 unfolding outer_measure_def |
365 proof (rule antisym) |
332 by (intro antisym INF_lower2[of "\<lambda>_. {}"]) (auto simp: disjoint_family_on_def positive_def) |
366 show "outer_measure M f {} \<le> 0" |
|
367 using assms by (auto intro!: INF_lower2[of "\<lambda>_. {}"] simp: outer_measure_def disjoint_family_on_def positive_def) |
|
368 qed (intro outer_measure_nonneg posf) |
|
369 |
333 |
370 lemma (in ring_of_sets) positive_outer_measure: |
334 lemma (in ring_of_sets) positive_outer_measure: |
371 assumes "positive M f" shows "positive (Pow \<Omega>) (outer_measure M f)" |
335 assumes "positive M f" shows "positive (Pow \<Omega>) (outer_measure M f)" |
372 unfolding positive_def by (auto simp: assms outer_measure_empty outer_measure_nonneg) |
336 unfolding positive_def by (auto simp: assms outer_measure_empty) |
373 |
337 |
374 lemma (in ring_of_sets) increasing_outer_measure: "increasing (Pow \<Omega>) (outer_measure M f)" |
338 lemma (in ring_of_sets) increasing_outer_measure: "increasing (Pow \<Omega>) (outer_measure M f)" |
375 by (force simp: increasing_def outer_measure_def intro!: INF_greatest intro: INF_lower) |
339 by (force simp: increasing_def outer_measure_def intro!: INF_greatest intro: INF_lower) |
376 |
340 |
377 lemma (in ring_of_sets) outer_measure_le: |
341 lemma (in ring_of_sets) outer_measure_le: |
381 proof (safe intro!: INF_lower2[of "disjointed A"] del: subsetI) |
345 proof (safe intro!: INF_lower2[of "disjointed A"] del: subsetI) |
382 show dA: "range (disjointed A) \<subseteq> M" |
346 show dA: "range (disjointed A) \<subseteq> M" |
383 by (auto intro!: A range_disjointed_sets) |
347 by (auto intro!: A range_disjointed_sets) |
384 have "\<forall>n. f (disjointed A n) \<le> f (A n)" |
348 have "\<forall>n. f (disjointed A n) \<le> f (A n)" |
385 by (metis increasingD [OF inc] UNIV_I dA image_subset_iff disjointed_subset A) |
349 by (metis increasingD [OF inc] UNIV_I dA image_subset_iff disjointed_subset A) |
386 moreover have "\<forall>i. 0 \<le> f (disjointed A i)" |
350 then show "(\<Sum>i. f (disjointed A i)) \<le> (\<Sum>i. f (A i))" |
387 using pos dA unfolding positive_def by auto |
351 by (blast intro!: suminf_le) |
388 ultimately show "(\<Sum>i. f (disjointed A i)) \<le> (\<Sum>i. f (A i))" |
|
389 by (blast intro!: suminf_le_pos) |
|
390 qed (auto simp: X UN_disjointed_eq disjoint_family_disjointed) |
352 qed (auto simp: X UN_disjointed_eq disjoint_family_disjointed) |
391 |
353 |
392 lemma (in ring_of_sets) outer_measure_close: |
354 lemma (in ring_of_sets) outer_measure_close: |
393 assumes posf: "positive M f" and "0 < e" and "outer_measure M f X \<noteq> \<infinity>" |
355 "outer_measure M f X < e \<Longrightarrow> \<exists>A. range A \<subseteq> M \<and> disjoint_family A \<and> X \<subseteq> (\<Union>i. A i) \<and> (\<Sum>i. f (A i)) < e" |
394 shows "\<exists>A. range A \<subseteq> M \<and> disjoint_family A \<and> X \<subseteq> (\<Union>i. A i) \<and> (\<Sum>i. f (A i)) \<le> outer_measure M f X + e" |
356 unfolding outer_measure_def INF_less_iff by auto |
395 proof - |
|
396 from \<open>outer_measure M f X \<noteq> \<infinity>\<close> have fin: "\<bar>outer_measure M f X\<bar> \<noteq> \<infinity>" |
|
397 using outer_measure_nonneg[OF posf, of X] by auto |
|
398 show ?thesis |
|
399 using Inf_ereal_close [OF fin [unfolded outer_measure_def], OF \<open>0 < e\<close>] |
|
400 by (auto intro: less_imp_le simp add: outer_measure_def) |
|
401 qed |
|
402 |
357 |
403 lemma (in ring_of_sets) countably_subadditive_outer_measure: |
358 lemma (in ring_of_sets) countably_subadditive_outer_measure: |
404 assumes posf: "positive M f" and inc: "increasing M f" |
359 assumes posf: "positive M f" and inc: "increasing M f" |
405 shows "countably_subadditive (Pow \<Omega>) (outer_measure M f)" |
360 shows "countably_subadditive (Pow \<Omega>) (outer_measure M f)" |
406 proof (simp add: countably_subadditive_def, safe) |
361 proof (simp add: countably_subadditive_def, safe) |
407 fix A :: "nat \<Rightarrow> _" assume A: "range A \<subseteq> Pow (\<Omega>)" and sb: "(\<Union>i. A i) \<subseteq> \<Omega>" |
362 fix A :: "nat \<Rightarrow> _" assume A: "range A \<subseteq> Pow (\<Omega>)" and sb: "(\<Union>i. A i) \<subseteq> \<Omega>" |
408 let ?O = "outer_measure M f" |
363 let ?O = "outer_measure M f" |
409 |
364 show "?O (\<Union>i. A i) \<le> (\<Sum>n. ?O (A n))" |
410 { fix e :: ereal assume e: "0 < e" and "\<forall>i. ?O (A i) \<noteq> \<infinity>" |
365 proof (rule ennreal_le_epsilon) |
411 hence "\<exists>B. \<forall>n. range (B n) \<subseteq> M \<and> disjoint_family (B n) \<and> A n \<subseteq> (\<Union>i. B n i) \<and> |
366 fix b and e :: real assume "0 < e" "(\<Sum>n. outer_measure M f (A n)) < top" |
412 (\<Sum>i. f (B n i)) \<le> ?O (A n) + e * (1/2)^(Suc n)" |
367 then have *: "\<And>n. outer_measure M f (A n) < outer_measure M f (A n) + e * (1/2)^Suc n" |
413 using e sb by (auto intro!: choice outer_measure_close [of f, OF posf] simp: ereal_zero_less_0_iff one_ereal_def) |
368 by (auto simp add: less_top dest!: ennreal_suminf_lessD) |
414 then obtain B |
369 obtain B |
415 where B: "\<And>n. range (B n) \<subseteq> M" |
370 where B: "\<And>n. range (B n) \<subseteq> M" |
416 and sbB: "\<And>n. A n \<subseteq> (\<Union>i. B n i)" |
371 and sbB: "\<And>n. A n \<subseteq> (\<Union>i. B n i)" |
417 and Ble: "\<And>n. (\<Sum>i. f (B n i)) \<le> ?O (A n) + e * (1/2)^(Suc n)" |
372 and Ble: "\<And>n. (\<Sum>i. f (B n i)) \<le> ?O (A n) + e * (1/2)^(Suc n)" |
418 by auto blast |
373 by (metis less_imp_le outer_measure_close[OF *]) |
419 |
374 |
420 def C \<equiv> "case_prod B o prod_decode" |
375 def C \<equiv> "case_prod B o prod_decode" |
421 from B have B_in_M: "\<And>i j. B i j \<in> M" |
376 from B have B_in_M: "\<And>i j. B i j \<in> M" |
422 by (rule range_subsetD) |
377 by (rule range_subsetD) |
423 then have C: "range C \<subseteq> M" |
378 then have C: "range C \<subseteq> M" |
424 by (auto simp add: C_def split_def) |
379 by (auto simp add: C_def split_def) |
425 have A_C: "(\<Union>i. A i) \<subseteq> (\<Union>i. C i)" |
380 have A_C: "(\<Union>i. A i) \<subseteq> (\<Union>i. C i)" |
426 using sbB by (auto simp add: C_def subset_eq) (metis prod.case prod_encode_inverse) |
381 using sbB by (auto simp add: C_def subset_eq) (metis prod.case prod_encode_inverse) |
427 |
382 |
428 have "?O (\<Union>i. A i) \<le> ?O (\<Union>i. C i)" |
383 have "?O (\<Union>i. A i) \<le> ?O (\<Union>i. C i)" |
429 using A_C A C by (intro increasing_outer_measure[THEN increasingD]) (auto dest!: sets_into_space) |
384 using A_C A C by (intro increasing_outer_measure[THEN increasingD]) (auto dest!: sets_into_space) |
430 also have "\<dots> \<le> (\<Sum>i. f (C i))" |
385 also have "\<dots> \<le> (\<Sum>i. f (C i))" |
431 using C by (intro outer_measure_le[OF posf inc]) auto |
386 using C by (intro outer_measure_le[OF posf inc]) auto |
432 also have "\<dots> = (\<Sum>n. \<Sum>i. f (B n i))" |
387 also have "\<dots> = (\<Sum>n. \<Sum>i. f (B n i))" |
433 using B_in_M unfolding C_def comp_def by (intro suminf_ereal_2dimen positiveD2[OF posf]) auto |
388 using B_in_M unfolding C_def comp_def by (intro suminf_ennreal_2dimen) auto |
434 also have "\<dots> \<le> (\<Sum>n. ?O (A n) + e*(1/2) ^ Suc n)" |
389 also have "\<dots> \<le> (\<Sum>n. ?O (A n) + e * (1/2) ^ Suc n)" |
435 using B_in_M by (intro suminf_le_pos[OF Ble] suminf_0_le posf[THEN positiveD2]) auto |
390 using B_in_M by (intro suminf_le suminf_nonneg allI Ble) auto |
436 also have "... = (\<Sum>n. ?O (A n)) + (\<Sum>n. e*(1/2) ^ Suc n)" |
391 also have "... = (\<Sum>n. ?O (A n)) + (\<Sum>n. ennreal e * ennreal ((1/2) ^ Suc n))" |
437 using e by (subst suminf_add_ereal) (auto simp add: ereal_zero_le_0_iff outer_measure_nonneg posf) |
392 using \<open>0 < e\<close> by (subst suminf_add[symmetric]) |
438 also have "(\<Sum>n. e*(1/2) ^ Suc n) = e" |
393 (auto simp del: ennreal_suminf_cmult simp add: ennreal_mult[symmetric]) |
439 using suminf_half_series_ereal e by (simp add: ereal_zero_le_0_iff suminf_cmult_ereal) |
394 also have "\<dots> = (\<Sum>n. ?O (A n)) + e" |
440 finally have "?O (\<Union>i. A i) \<le> (\<Sum>n. ?O (A n)) + e" . } |
395 unfolding ennreal_suminf_cmult |
441 note * = this |
396 by (subst suminf_ennreal_eq[OF zero_le_power power_half_series]) auto |
442 |
397 finally show "?O (\<Union>i. A i) \<le> (\<Sum>n. ?O (A n)) + e" . |
443 show "?O (\<Union>i. A i) \<le> (\<Sum>n. ?O (A n))" |
398 qed |
444 proof cases |
|
445 assume "\<forall>i. ?O (A i) \<noteq> \<infinity>" with * show ?thesis |
|
446 by (intro ereal_le_epsilon) auto |
|
447 qed (metis suminf_PInfty[OF outer_measure_nonneg, OF posf] ereal_less_eq(1)) |
|
448 qed |
399 qed |
449 |
400 |
450 lemma (in ring_of_sets) outer_measure_space_outer_measure: |
401 lemma (in ring_of_sets) outer_measure_space_outer_measure: |
451 "positive M f \<Longrightarrow> increasing M f \<Longrightarrow> outer_measure_space (Pow \<Omega>) (outer_measure M f)" |
402 "positive M f \<Longrightarrow> increasing M f \<Longrightarrow> outer_measure_space (Pow \<Omega>) (outer_measure M f)" |
452 by (simp add: outer_measure_space_def |
403 by (simp add: outer_measure_space_def |
539 qed |
490 qed |
540 |
491 |
541 lemma (in ring_of_sets) caratheodory_empty_continuous: |
492 lemma (in ring_of_sets) caratheodory_empty_continuous: |
542 assumes f: "positive M f" "additive M f" and fin: "\<And>A. A \<in> M \<Longrightarrow> f A \<noteq> \<infinity>" |
493 assumes f: "positive M f" "additive M f" and fin: "\<And>A. A \<in> M \<Longrightarrow> f A \<noteq> \<infinity>" |
543 assumes cont: "\<And>A. range A \<subseteq> M \<Longrightarrow> decseq A \<Longrightarrow> (\<Inter>i. A i) = {} \<Longrightarrow> (\<lambda>i. f (A i)) \<longlonglongrightarrow> 0" |
494 assumes cont: "\<And>A. range A \<subseteq> M \<Longrightarrow> decseq A \<Longrightarrow> (\<Inter>i. A i) = {} \<Longrightarrow> (\<lambda>i. f (A i)) \<longlonglongrightarrow> 0" |
544 shows "\<exists>\<mu> :: 'a set \<Rightarrow> ereal. (\<forall>s \<in> M. \<mu> s = f s) \<and> measure_space \<Omega> (sigma_sets \<Omega> M) \<mu>" |
495 shows "\<exists>\<mu> :: 'a set \<Rightarrow> ennreal. (\<forall>s \<in> M. \<mu> s = f s) \<and> measure_space \<Omega> (sigma_sets \<Omega> M) \<mu>" |
545 proof (intro caratheodory' empty_continuous_imp_countably_additive f) |
496 proof (intro caratheodory' empty_continuous_imp_countably_additive f) |
546 show "\<forall>A\<in>M. f A \<noteq> \<infinity>" using fin by auto |
497 show "\<forall>A\<in>M. f A \<noteq> \<infinity>" using fin by auto |
547 qed (rule cont) |
498 qed (rule cont) |
548 |
499 |
549 subsection \<open>Volumes\<close> |
500 subsection \<open>Volumes\<close> |
550 |
501 |
551 definition volume :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ereal) \<Rightarrow> bool" where |
502 definition volume :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where |
552 "volume M f \<longleftrightarrow> |
503 "volume M f \<longleftrightarrow> |
553 (f {} = 0) \<and> (\<forall>a\<in>M. 0 \<le> f a) \<and> |
504 (f {} = 0) \<and> (\<forall>a\<in>M. 0 \<le> f a) \<and> |
554 (\<forall>C\<subseteq>M. disjoint C \<longrightarrow> finite C \<longrightarrow> \<Union>C \<in> M \<longrightarrow> f (\<Union>C) = (\<Sum>c\<in>C. f c))" |
505 (\<forall>C\<subseteq>M. disjoint C \<longrightarrow> finite C \<longrightarrow> \<Union>C \<in> M \<longrightarrow> f (\<Union>C) = (\<Sum>c\<in>C. f c))" |
555 |
506 |
556 lemma volumeI: |
507 lemma volumeI: |