author | hoelzl |
Fri, 03 Dec 2010 15:25:14 +0100 | |
changeset 41023 | 9118eb4eb8dc |
parent 40874 | f5a74b17a69e |
child 41095 | c335d880ff82 |
permissions | -rw-r--r-- |
40859 | 1 |
(* Author: Robert Himmelmann, TU Muenchen *) |
38656 | 2 |
header {* Lebsegue measure *} |
3 |
theory Lebesgue_Measure |
|
40859 | 4 |
imports Product_Measure Gauge_Measure Complete_Measure |
38656 | 5 |
begin |
6 |
||
7 |
subsection {* Standard Cubes *} |
|
8 |
||
40859 | 9 |
definition cube :: "nat \<Rightarrow> 'a::ordered_euclidean_space set" where |
10 |
"cube n \<equiv> {\<chi>\<chi> i. - real n .. \<chi>\<chi> i. real n}" |
|
11 |
||
12 |
lemma cube_closed[intro]: "closed (cube n)" |
|
13 |
unfolding cube_def by auto |
|
14 |
||
15 |
lemma cube_subset[intro]: "n \<le> N \<Longrightarrow> cube n \<subseteq> cube N" |
|
16 |
by (fastsimp simp: eucl_le[where 'a='a] cube_def) |
|
38656 | 17 |
|
40859 | 18 |
lemma cube_subset_iff: |
19 |
"cube n \<subseteq> cube N \<longleftrightarrow> n \<le> N" |
|
20 |
proof |
|
21 |
assume subset: "cube n \<subseteq> (cube N::'a set)" |
|
22 |
then have "((\<chi>\<chi> i. real n)::'a) \<in> cube N" |
|
23 |
using DIM_positive[where 'a='a] |
|
24 |
by (fastsimp simp: cube_def eucl_le[where 'a='a]) |
|
25 |
then show "n \<le> N" |
|
26 |
by (fastsimp simp: cube_def eucl_le[where 'a='a]) |
|
27 |
next |
|
28 |
assume "n \<le> N" then show "cube n \<subseteq> (cube N::'a set)" by (rule cube_subset) |
|
29 |
qed |
|
38656 | 30 |
|
31 |
lemma ball_subset_cube:"ball (0::'a::ordered_euclidean_space) (real n) \<subseteq> cube n" |
|
32 |
unfolding cube_def subset_eq mem_interval apply safe unfolding euclidean_lambda_beta' |
|
33 |
proof- fix x::'a and i assume as:"x\<in>ball 0 (real n)" "i<DIM('a)" |
|
34 |
thus "- real n \<le> x $$ i" "real n \<ge> x $$ i" |
|
35 |
using component_le_norm[of x i] by(auto simp: dist_norm) |
|
36 |
qed |
|
37 |
||
38 |
lemma mem_big_cube: obtains n where "x \<in> cube n" |
|
39 |
proof- from real_arch_lt[of "norm x"] guess n .. |
|
40 |
thus ?thesis apply-apply(rule that[where n=n]) |
|
41 |
apply(rule ball_subset_cube[unfolded subset_eq,rule_format]) |
|
42 |
by (auto simp add:dist_norm) |
|
43 |
qed |
|
44 |
||
45 |
lemma Union_inter_cube:"\<Union>{s \<inter> cube n |n. n \<in> UNIV} = s" |
|
46 |
proof safe case goal1 |
|
47 |
from mem_big_cube[of x] guess n . note n=this |
|
48 |
show ?case unfolding Union_iff apply(rule_tac x="s \<inter> cube n" in bexI) |
|
49 |
using n goal1 by auto |
|
50 |
qed |
|
51 |
||
52 |
lemma gmeasurable_cube[intro]:"gmeasurable (cube n)" |
|
53 |
unfolding cube_def by auto |
|
54 |
||
55 |
lemma gmeasure_le_inter_cube[intro]: fixes s::"'a::ordered_euclidean_space set" |
|
56 |
assumes "gmeasurable (s \<inter> cube n)" shows "gmeasure (s \<inter> cube n) \<le> gmeasure (cube n::'a set)" |
|
57 |
apply(rule has_gmeasure_subset[of "s\<inter>cube n" _ "cube n"]) |
|
58 |
unfolding has_gmeasure_measure[THEN sym] using assms by auto |
|
59 |
||
40859 | 60 |
lemma has_gmeasure_cube[intro]: "(cube n::('a::ordered_euclidean_space) set) |
61 |
has_gmeasure ((2 * real n) ^ (DIM('a)))" |
|
62 |
proof- |
|
63 |
have "content {\<chi>\<chi> i. - real n..(\<chi>\<chi> i. real n)::'a} = (2 * real n) ^ (DIM('a))" |
|
64 |
apply(subst content_closed_interval) defer |
|
65 |
by (auto simp add:setprod_constant) |
|
66 |
thus ?thesis unfolding cube_def |
|
67 |
using has_gmeasure_interval(1)[of "(\<chi>\<chi> i. - real n)::'a" "(\<chi>\<chi> i. real n)::'a"] |
|
68 |
by auto |
|
69 |
qed |
|
70 |
||
71 |
lemma gmeasure_cube_eq[simp]: |
|
72 |
"gmeasure (cube n::('a::ordered_euclidean_space) set) = (2 * real n) ^ DIM('a)" |
|
73 |
by (intro measure_unique) auto |
|
74 |
||
75 |
lemma gmeasure_cube_ge_n: "gmeasure (cube n::('a::ordered_euclidean_space) set) \<ge> real n" |
|
76 |
proof cases |
|
77 |
assume "n = 0" then show ?thesis by simp |
|
78 |
next |
|
79 |
assume "n \<noteq> 0" |
|
80 |
have "real n \<le> (2 * real n)^1" by simp |
|
81 |
also have "\<dots> \<le> (2 * real n)^DIM('a)" |
|
82 |
using DIM_positive[where 'a='a] `n \<noteq> 0` |
|
83 |
by (intro power_increasing) auto |
|
84 |
also have "\<dots> = gmeasure (cube n::'a set)" by simp |
|
85 |
finally show ?thesis . |
|
86 |
qed |
|
87 |
||
88 |
lemma gmeasure_setsum: |
|
89 |
assumes "finite A" and "\<And>s t. s \<in> A \<Longrightarrow> t \<in> A \<Longrightarrow> s \<noteq> t \<Longrightarrow> f s \<inter> f t = {}" |
|
90 |
and "\<And>i. i \<in> A \<Longrightarrow> gmeasurable (f i)" |
|
91 |
shows "gmeasure (\<Union>i\<in>A. f i) = (\<Sum>i\<in>A. gmeasure (f i))" |
|
92 |
proof - |
|
93 |
have "gmeasure (\<Union>i\<in>A. f i) = gmeasure (\<Union>f ` A)" by auto |
|
94 |
also have "\<dots> = setsum gmeasure (f ` A)" using assms |
|
95 |
proof (intro measure_negligible_unions) |
|
96 |
fix X Y assume "X \<in> f`A" "Y \<in> f`A" "X \<noteq> Y" |
|
97 |
then have "X \<inter> Y = {}" using assms by auto |
|
98 |
then show "negligible (X \<inter> Y)" by auto |
|
99 |
qed auto |
|
100 |
also have "\<dots> = setsum gmeasure (f ` A - {{}})" |
|
101 |
using assms by (intro setsum_mono_zero_cong_right) auto |
|
102 |
also have "\<dots> = (\<Sum>i\<in>A - {i. f i = {}}. gmeasure (f i))" |
|
103 |
proof (intro setsum_reindex_cong inj_onI) |
|
104 |
fix s t assume *: "s \<in> A - {i. f i = {}}" "t \<in> A - {i. f i = {}}" "f s = f t" |
|
105 |
show "s = t" |
|
106 |
proof (rule ccontr) |
|
107 |
assume "s \<noteq> t" with assms(2)[of s t] * show False by auto |
|
108 |
qed |
|
109 |
qed auto |
|
110 |
also have "\<dots> = (\<Sum>i\<in>A. gmeasure (f i))" |
|
111 |
using assms by (intro setsum_mono_zero_cong_left) auto |
|
112 |
finally show ?thesis . |
|
113 |
qed |
|
114 |
||
115 |
lemma gmeasurable_finite_UNION[intro]: |
|
116 |
assumes "\<And>i. i \<in> S \<Longrightarrow> gmeasurable (A i)" "finite S" |
|
117 |
shows "gmeasurable (\<Union>i\<in>S. A i)" |
|
118 |
unfolding UNION_eq_Union_image using assms |
|
119 |
by (intro gmeasurable_finite_unions) auto |
|
120 |
||
121 |
lemma gmeasurable_countable_UNION[intro]: |
|
122 |
fixes A :: "nat \<Rightarrow> ('a::ordered_euclidean_space) set" |
|
123 |
assumes measurable: "\<And>i. gmeasurable (A i)" |
|
124 |
and finite: "\<And>n. gmeasure (UNION {.. n} A) \<le> B" |
|
125 |
shows "gmeasurable (\<Union>i. A i)" |
|
126 |
proof - |
|
127 |
have *: "\<And>n. \<Union>{A k |k. k \<le> n} = (\<Union>i\<le>n. A i)" |
|
128 |
"(\<Union>{A n |n. n \<in> UNIV}) = (\<Union>i. A i)" by auto |
|
129 |
show ?thesis |
|
130 |
by (rule gmeasurable_countable_unions_strong[of A B, unfolded *, OF assms]) |
|
131 |
qed |
|
38656 | 132 |
|
133 |
subsection {* Measurability *} |
|
134 |
||
40859 | 135 |
definition lebesgue :: "'a::ordered_euclidean_space algebra" where |
136 |
"lebesgue = \<lparr> space = UNIV, sets = {A. \<forall>n. gmeasurable (A \<inter> cube n)} \<rparr>" |
|
137 |
||
138 |
lemma space_lebesgue[simp]:"space lebesgue = UNIV" |
|
139 |
unfolding lebesgue_def by auto |
|
38656 | 140 |
|
40859 | 141 |
lemma lebesgueD[dest]: assumes "S \<in> sets lebesgue" |
142 |
shows "\<And>n. gmeasurable (S \<inter> cube n)" |
|
143 |
using assms unfolding lebesgue_def by auto |
|
38656 | 144 |
|
40859 | 145 |
lemma lebesgueI[intro]: assumes "gmeasurable S" |
146 |
shows "S \<in> sets lebesgue" unfolding lebesgue_def cube_def |
|
38656 | 147 |
using assms gmeasurable_interval by auto |
148 |
||
40859 | 149 |
lemma lebesgueI2: "(\<And>n. gmeasurable (S \<inter> cube n)) \<Longrightarrow> S \<in> sets lebesgue" |
150 |
using assms unfolding lebesgue_def by auto |
|
38656 | 151 |
|
40859 | 152 |
interpretation lebesgue: sigma_algebra lebesgue |
153 |
proof |
|
154 |
show "sets lebesgue \<subseteq> Pow (space lebesgue)" |
|
155 |
unfolding lebesgue_def by auto |
|
156 |
show "{} \<in> sets lebesgue" |
|
157 |
using gmeasurable_empty by auto |
|
158 |
{ fix A B :: "'a set" assume "A \<in> sets lebesgue" "B \<in> sets lebesgue" |
|
159 |
then show "A \<union> B \<in> sets lebesgue" |
|
160 |
by (auto intro: gmeasurable_union simp: lebesgue_def Int_Un_distrib2) } |
|
161 |
{ fix A :: "nat \<Rightarrow> 'a set" assume A: "range A \<subseteq> sets lebesgue" |
|
162 |
show "(\<Union>i. A i) \<in> sets lebesgue" |
|
163 |
proof (rule lebesgueI2) |
|
164 |
fix n show "gmeasurable ((\<Union>i. A i) \<inter> cube n)" unfolding UN_extend_simps |
|
165 |
using A |
|
166 |
by (intro gmeasurable_countable_UNION[where B="gmeasure (cube n::'a set)"]) |
|
167 |
(auto intro!: measure_subset gmeasure_setsum simp: UN_extend_simps simp del: gmeasure_cube_eq UN_simps) |
|
168 |
qed } |
|
169 |
{ fix A assume A: "A \<in> sets lebesgue" show "space lebesgue - A \<in> sets lebesgue" |
|
170 |
proof (rule lebesgueI2) |
|
171 |
fix n |
|
172 |
have *: "(space lebesgue - A) \<inter> cube n = cube n - (A \<inter> cube n)" |
|
173 |
unfolding lebesgue_def by auto |
|
174 |
show "gmeasurable ((space lebesgue - A) \<inter> cube n)" unfolding * |
|
175 |
using A by (auto intro!: gmeasurable_diff) |
|
176 |
qed } |
|
38656 | 177 |
qed |
178 |
||
40859 | 179 |
lemma lebesgueI_borel[intro, simp]: fixes s::"'a::ordered_euclidean_space set" |
180 |
assumes "s \<in> sets borel" shows "s \<in> sets lebesgue" |
|
181 |
proof- let ?S = "range (\<lambda>(a, b). {a .. (b :: 'a\<Colon>ordered_euclidean_space)})" |
|
182 |
have *:"?S \<subseteq> sets lebesgue" by auto |
|
183 |
have "s \<in> sigma_sets UNIV ?S" using assms |
|
184 |
unfolding borel_eq_atLeastAtMost by (simp add: sigma_def) |
|
185 |
thus ?thesis |
|
186 |
using lebesgue.sigma_subset[of "\<lparr> space = UNIV, sets = ?S\<rparr>", simplified, OF *] |
|
187 |
by (auto simp: sigma_def) |
|
38656 | 188 |
qed |
189 |
||
40859 | 190 |
lemma lebesgueI_negligible[dest]: fixes s::"'a::ordered_euclidean_space set" |
191 |
assumes "negligible s" shows "s \<in> sets lebesgue" |
|
192 |
proof (rule lebesgueI2) |
|
193 |
fix n |
|
38656 | 194 |
have *:"\<And>x. (if x \<in> cube n then indicator s x else 0) = (if x \<in> s \<inter> cube n then 1 else 0)" |
195 |
unfolding indicator_def_raw by auto |
|
196 |
note assms[unfolded negligible_def,rule_format,of "(\<chi>\<chi> i. - real n)::'a" "\<chi>\<chi> i. real n"] |
|
40859 | 197 |
thus "gmeasurable (s \<inter> cube n)" apply-apply(rule gmeasurableI[of _ 0]) unfolding has_gmeasure_def |
38656 | 198 |
apply(subst(asm) has_integral_restrict_univ[THEN sym]) unfolding cube_def[symmetric] |
199 |
apply(subst has_integral_restrict_univ[THEN sym]) unfolding * . |
|
200 |
qed |
|
201 |
||
202 |
section {* The Lebesgue Measure *} |
|
203 |
||
40859 | 204 |
definition "lmeasure A = (SUP n. Real (gmeasure (A \<inter> cube n)))" |
38656 | 205 |
|
40859 | 206 |
lemma lmeasure_eq_0: assumes "negligible S" shows "lmeasure S = 0" |
207 |
proof - |
|
208 |
from lebesgueI_negligible[OF assms] |
|
209 |
have "\<And>n. gmeasurable (S \<inter> cube n)" by auto |
|
210 |
from gmeasurable_measure_eq_0[OF this] |
|
211 |
have "\<And>n. gmeasure (S \<inter> cube n) = 0" using assms by auto |
|
212 |
then show ?thesis unfolding lmeasure_def by simp |
|
213 |
qed |
|
214 |
||
215 |
lemma lmeasure_iff_LIMSEQ: |
|
216 |
assumes "A \<in> sets lebesgue" "0 \<le> m" |
|
217 |
shows "lmeasure A = Real m \<longleftrightarrow> (\<lambda>n. (gmeasure (A \<inter> cube n))) ----> m" |
|
218 |
unfolding lmeasure_def using assms cube_subset[where 'a='a] |
|
219 |
by (intro SUP_eq_LIMSEQ monoI measure_subset) force+ |
|
38656 | 220 |
|
40859 | 221 |
interpretation lebesgue: measure_space lebesgue lmeasure |
222 |
proof |
|
223 |
show "lmeasure {} = 0" |
|
224 |
by (auto intro!: lmeasure_eq_0) |
|
225 |
show "countably_additive lebesgue lmeasure" |
|
226 |
proof (unfold countably_additive_def, intro allI impI conjI) |
|
227 |
fix A :: "nat \<Rightarrow> 'b set" assume "range A \<subseteq> sets lebesgue" "disjoint_family A" |
|
228 |
then have A: "\<And>i. A i \<in> sets lebesgue" by auto |
|
229 |
show "(\<Sum>\<^isub>\<infinity>n. lmeasure (A n)) = lmeasure (\<Union>i. A i)" unfolding lmeasure_def |
|
230 |
proof (subst psuminf_SUP_eq) |
|
231 |
{ fix i n |
|
232 |
have "gmeasure (A i \<inter> cube n) \<le> gmeasure (A i \<inter> cube (Suc n))" |
|
233 |
using A cube_subset[of n "Suc n"] by (auto intro!: measure_subset) |
|
234 |
then show "Real (gmeasure (A i \<inter> cube n)) \<le> Real (gmeasure (A i \<inter> cube (Suc n)))" |
|
235 |
by auto } |
|
236 |
show "(SUP n. \<Sum>\<^isub>\<infinity>i. Real (gmeasure (A i \<inter> cube n))) = (SUP n. Real (gmeasure ((\<Union>i. A i) \<inter> cube n)))" |
|
237 |
proof (intro arg_cong[where f="SUPR UNIV"] ext) |
|
238 |
fix n |
|
239 |
have sums: "(\<lambda>i. gmeasure (A i \<inter> cube n)) sums gmeasure (\<Union>{A i \<inter> cube n |i. i \<in> UNIV})" |
|
240 |
proof (rule has_gmeasure_countable_negligible_unions(2)) |
|
241 |
fix i show "gmeasurable (A i \<inter> cube n)" using A by auto |
|
242 |
next |
|
243 |
fix i m :: nat assume "m \<noteq> i" |
|
244 |
then have "A m \<inter> cube n \<inter> (A i \<inter> cube n) = {}" |
|
245 |
using `disjoint_family A` unfolding disjoint_family_on_def by auto |
|
246 |
then show "negligible (A m \<inter> cube n \<inter> (A i \<inter> cube n))" by auto |
|
247 |
next |
|
248 |
fix i |
|
249 |
have "(\<Sum>k = 0..i. gmeasure (A k \<inter> cube n)) = gmeasure (\<Union>k\<le>i . A k \<inter> cube n)" |
|
250 |
unfolding atLeast0AtMost using A |
|
251 |
proof (intro gmeasure_setsum[symmetric]) |
|
252 |
fix s t :: nat assume "s \<noteq> t" then have "A t \<inter> A s = {}" |
|
253 |
using `disjoint_family A` unfolding disjoint_family_on_def by auto |
|
254 |
then show "A s \<inter> cube n \<inter> (A t \<inter> cube n) = {}" by auto |
|
255 |
qed auto |
|
256 |
also have "\<dots> \<le> gmeasure (cube n :: 'b set)" using A |
|
257 |
by (intro measure_subset gmeasurable_finite_UNION) auto |
|
258 |
finally show "(\<Sum>k = 0..i. gmeasure (A k \<inter> cube n)) \<le> gmeasure (cube n :: 'b set)" . |
|
259 |
qed |
|
260 |
show "(\<Sum>\<^isub>\<infinity>i. Real (gmeasure (A i \<inter> cube n))) = Real (gmeasure ((\<Union>i. A i) \<inter> cube n))" |
|
261 |
unfolding psuminf_def |
|
262 |
apply (subst setsum_Real) |
|
263 |
apply (simp add: measure_pos_le) |
|
264 |
proof (rule SUP_eq_LIMSEQ[THEN iffD2]) |
|
265 |
have "(\<Union>{A i \<inter> cube n |i. i \<in> UNIV}) = (\<Union>i. A i) \<inter> cube n" by auto |
|
266 |
with sums show "(\<lambda>i. \<Sum>k<i. gmeasure (A k \<inter> cube n)) ----> gmeasure ((\<Union>i. A i) \<inter> cube n)" |
|
267 |
unfolding sums_def atLeast0LessThan by simp |
|
268 |
qed (auto intro!: monoI setsum_nonneg setsum_mono2) |
|
269 |
qed |
|
270 |
qed |
|
271 |
qed |
|
272 |
qed |
|
38656 | 273 |
|
40859 | 274 |
lemma lmeasure_finite_has_gmeasure: assumes "s \<in> sets lebesgue" "lmeasure s = Real m" "0 \<le> m" |
38656 | 275 |
shows "s has_gmeasure m" |
40859 | 276 |
proof- |
38656 | 277 |
have *:"(\<lambda>n. (gmeasure (s \<inter> cube n))) ----> m" |
40859 | 278 |
using `lmeasure s = Real m` unfolding lmeasure_iff_LIMSEQ[OF `s \<in> sets lebesgue` `0 \<le> m`] . |
279 |
have s: "\<And>n. gmeasurable (s \<inter> cube n)" using assms by auto |
|
38656 | 280 |
have "(\<lambda>x. if x \<in> s then 1 else (0::real)) integrable_on UNIV \<and> |
281 |
(\<lambda>k. integral UNIV (\<lambda>x. if x \<in> s \<inter> cube k then 1 else (0::real))) |
|
282 |
----> integral UNIV (\<lambda>x. if x \<in> s then 1 else 0)" |
|
283 |
proof(rule monotone_convergence_increasing) |
|
40859 | 284 |
have "lmeasure s \<le> Real m" using `lmeasure s = Real m` by simp |
285 |
then have "\<forall>n. gmeasure (s \<inter> cube n) \<le> m" |
|
286 |
unfolding lmeasure_def complete_lattice_class.SUP_le_iff |
|
287 |
using `0 \<le> m` by (auto simp: measure_pos_le) |
|
288 |
thus *:"bounded {integral UNIV (\<lambda>x. if x \<in> s \<inter> cube k then 1 else (0::real)) |k. True}" |
|
289 |
unfolding integral_measure_univ[OF s] bounded_def apply- |
|
38656 | 290 |
apply(rule_tac x=0 in exI,rule_tac x=m in exI) unfolding dist_real_def |
291 |
by (auto simp: measure_pos_le) |
|
292 |
show "\<forall>k. (\<lambda>x. if x \<in> s \<inter> cube k then (1::real) else 0) integrable_on UNIV" |
|
293 |
unfolding integrable_restrict_univ |
|
40859 | 294 |
using s unfolding gmeasurable_def has_gmeasure_def by auto |
38656 | 295 |
have *:"\<And>n. n \<le> Suc n" by auto |
296 |
show "\<forall>k. \<forall>x\<in>UNIV. (if x \<in> s \<inter> cube k then 1 else 0) \<le> (if x \<in> s \<inter> cube (Suc k) then 1 else (0::real))" |
|
297 |
using cube_subset[OF *] by fastsimp |
|
298 |
show "\<forall>x\<in>UNIV. (\<lambda>k. if x \<in> s \<inter> cube k then 1 else 0) ----> (if x \<in> s then 1 else (0::real))" |
|
40859 | 299 |
unfolding Lim_sequentially |
38656 | 300 |
proof safe case goal1 from real_arch_lt[of "norm x"] guess N .. note N = this |
301 |
show ?case apply(rule_tac x=N in exI) |
|
302 |
proof safe case goal1 |
|
303 |
have "x \<in> cube n" using cube_subset[OF goal1] N |
|
40859 | 304 |
using ball_subset_cube[of N] by(auto simp: dist_norm) |
38656 | 305 |
thus ?case using `e>0` by auto |
306 |
qed |
|
307 |
qed |
|
308 |
qed note ** = conjunctD2[OF this] |
|
309 |
hence *:"m = integral UNIV (\<lambda>x. if x \<in> s then 1 else 0)" apply- |
|
40859 | 310 |
apply(rule LIMSEQ_unique[OF _ **(2)]) unfolding measure_integral_univ[THEN sym,OF s] using * . |
38656 | 311 |
show ?thesis unfolding has_gmeasure * apply(rule integrable_integral) using ** by auto |
312 |
qed |
|
313 |
||
40859 | 314 |
lemma lmeasure_finite_gmeasurable: assumes "s \<in> sets lebesgue" "lmeasure s \<noteq> \<omega>" |
38656 | 315 |
shows "gmeasurable s" |
40859 | 316 |
proof (cases "lmeasure s") |
317 |
case (preal m) from lmeasure_finite_has_gmeasure[OF `s \<in> sets lebesgue` this] |
|
318 |
show ?thesis unfolding gmeasurable_def by auto |
|
319 |
qed (insert assms, auto) |
|
38656 | 320 |
|
40859 | 321 |
lemma has_gmeasure_lmeasure: assumes "s has_gmeasure m" |
322 |
shows "lmeasure s = Real m" |
|
323 |
proof- |
|
324 |
have gmea:"gmeasurable s" using assms by auto |
|
325 |
then have s: "s \<in> sets lebesgue" by auto |
|
38656 | 326 |
have m:"m \<ge> 0" using assms by auto |
327 |
have *:"m = gmeasure (\<Union>{s \<inter> cube n |n. n \<in> UNIV})" unfolding Union_inter_cube |
|
328 |
using assms by(rule measure_unique[THEN sym]) |
|
40859 | 329 |
show ?thesis |
330 |
unfolding lmeasure_iff_LIMSEQ[OF s `0 \<le> m`] unfolding * |
|
38656 | 331 |
apply(rule gmeasurable_nested_unions[THEN conjunct2, where B1="gmeasure s"]) |
332 |
proof- fix n::nat show *:"gmeasurable (s \<inter> cube n)" |
|
333 |
using gmeasurable_inter[OF gmea gmeasurable_cube] . |
|
334 |
show "gmeasure (s \<inter> cube n) \<le> gmeasure s" apply(rule measure_subset) |
|
335 |
apply(rule * gmea)+ by auto |
|
336 |
show "s \<inter> cube n \<subseteq> s \<inter> cube (Suc n)" using cube_subset[of n "Suc n"] by auto |
|
337 |
qed |
|
338 |
qed |
|
339 |
||
40859 | 340 |
lemma has_gmeasure_iff_lmeasure: |
341 |
"A has_gmeasure m \<longleftrightarrow> (A \<in> sets lebesgue \<and> 0 \<le> m \<and> lmeasure A = Real m)" |
|
342 |
proof |
|
343 |
assume "A has_gmeasure m" |
|
344 |
with has_gmeasure_lmeasure[OF this] |
|
345 |
have "gmeasurable A" "0 \<le> m" "lmeasure A = Real m" by auto |
|
346 |
then show "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lmeasure A = Real m" by auto |
|
347 |
next |
|
348 |
assume "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lmeasure A = Real m" |
|
349 |
then show "A has_gmeasure m" by (intro lmeasure_finite_has_gmeasure) auto |
|
38656 | 350 |
qed |
351 |
||
40859 | 352 |
lemma gmeasure_lmeasure: assumes "gmeasurable s" shows "lmeasure s = Real (gmeasure s)" |
353 |
proof - |
|
354 |
note has_gmeasure_measureI[OF assms] |
|
355 |
note has_gmeasure_lmeasure[OF this] |
|
356 |
thus ?thesis . |
|
357 |
qed |
|
38656 | 358 |
|
359 |
lemma lebesgue_simple_function_indicator: |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
360 |
fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal" |
38656 | 361 |
assumes f:"lebesgue.simple_function f" |
362 |
shows "f = (\<lambda>x. (\<Sum>y \<in> f ` UNIV. y * indicator (f -` {y}) x))" |
|
363 |
apply(rule,subst lebesgue.simple_function_indicator_representation[OF f]) by auto |
|
364 |
||
365 |
lemma lmeasure_gmeasure: |
|
366 |
"gmeasurable s \<Longrightarrow> gmeasure s = real (lmeasure s)" |
|
40859 | 367 |
by (subst gmeasure_lmeasure) auto |
38656 | 368 |
|
369 |
lemma lmeasure_finite: assumes "gmeasurable s" shows "lmeasure s \<noteq> \<omega>" |
|
370 |
using gmeasure_lmeasure[OF assms] by auto |
|
371 |
||
40859 | 372 |
lemma negligible_iff_lebesgue_null_sets: |
373 |
"negligible A \<longleftrightarrow> A \<in> lebesgue.null_sets" |
|
374 |
proof |
|
375 |
assume "negligible A" |
|
376 |
from this[THEN lebesgueI_negligible] this[THEN lmeasure_eq_0] |
|
377 |
show "A \<in> lebesgue.null_sets" by auto |
|
378 |
next |
|
379 |
assume A: "A \<in> lebesgue.null_sets" |
|
380 |
then have *:"gmeasurable A" using lmeasure_finite_gmeasurable[of A] by auto |
|
381 |
show "negligible A" |
|
382 |
unfolding gmeasurable_measure_eq_0[OF *, symmetric] |
|
383 |
unfolding lmeasure_gmeasure[OF *] using A by auto |
|
384 |
qed |
|
385 |
||
386 |
lemma |
|
387 |
fixes a b ::"'a::ordered_euclidean_space" |
|
388 |
shows lmeasure_atLeastAtMost[simp]: "lmeasure {a..b} = Real (content {a..b})" |
|
389 |
and lmeasure_greaterThanLessThan[simp]: "lmeasure {a <..< b} = Real (content {a..b})" |
|
390 |
using has_gmeasure_interval[of a b] by (auto intro!: has_gmeasure_lmeasure) |
|
391 |
||
392 |
lemma lmeasure_cube: |
|
393 |
"lmeasure (cube n::('a::ordered_euclidean_space) set) = (Real ((2 * real n) ^ (DIM('a))))" |
|
394 |
by (intro has_gmeasure_lmeasure) auto |
|
395 |
||
396 |
lemma lmeasure_UNIV[intro]: "lmeasure UNIV = \<omega>" |
|
397 |
unfolding lmeasure_def SUP_\<omega> |
|
398 |
proof (intro allI impI) |
|
399 |
fix x assume "x < \<omega>" |
|
400 |
then obtain r where r: "x = Real r" "0 \<le> r" by (cases x) auto |
|
401 |
then obtain n where n: "r < of_nat n" using ex_less_of_nat by auto |
|
402 |
show "\<exists>i\<in>UNIV. x < Real (gmeasure (UNIV \<inter> cube i))" |
|
403 |
proof (intro bexI[of _ n]) |
|
404 |
have "x < Real (of_nat n)" using n r by auto |
|
405 |
also have "Real (of_nat n) \<le> Real (gmeasure (UNIV \<inter> cube n))" |
|
406 |
using gmeasure_cube_ge_n[of n] by (auto simp: real_eq_of_nat[symmetric]) |
|
407 |
finally show "x < Real (gmeasure (UNIV \<inter> cube n))" . |
|
408 |
qed auto |
|
409 |
qed |
|
410 |
||
411 |
lemma atLeastAtMost_singleton_euclidean[simp]: |
|
412 |
fixes a :: "'a::ordered_euclidean_space" shows "{a .. a} = {a}" |
|
413 |
by (force simp: eucl_le[where 'a='a] euclidean_eq[where 'a='a]) |
|
414 |
||
415 |
lemma content_singleton[simp]: "content {a} = 0" |
|
416 |
proof - |
|
417 |
have "content {a .. a} = 0" |
|
418 |
by (subst content_closed_interval) auto |
|
419 |
then show ?thesis by simp |
|
420 |
qed |
|
421 |
||
422 |
lemma lmeasure_singleton[simp]: |
|
423 |
fixes a :: "'a::ordered_euclidean_space" shows "lmeasure {a} = 0" |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
424 |
using has_gmeasure_interval[of a a] unfolding zero_pextreal_def |
40859 | 425 |
by (intro has_gmeasure_lmeasure) |
426 |
(simp add: content_closed_interval DIM_positive) |
|
427 |
||
428 |
declare content_real[simp] |
|
429 |
||
430 |
lemma |
|
431 |
fixes a b :: real |
|
432 |
shows lmeasure_real_greaterThanAtMost[simp]: |
|
433 |
"lmeasure {a <.. b} = Real (if a \<le> b then b - a else 0)" |
|
434 |
proof cases |
|
435 |
assume "a < b" |
|
436 |
then have "lmeasure {a <.. b} = lmeasure {a <..< b} + lmeasure {b}" |
|
437 |
by (subst lebesgue.measure_additive) |
|
438 |
(auto intro!: lebesgueI_borel arg_cong[where f=lmeasure]) |
|
439 |
then show ?thesis by auto |
|
440 |
qed auto |
|
441 |
||
442 |
lemma |
|
443 |
fixes a b :: real |
|
444 |
shows lmeasure_real_atLeastLessThan[simp]: |
|
445 |
"lmeasure {a ..< b} = Real (if a \<le> b then b - a else 0)" (is ?eqlt) |
|
446 |
proof cases |
|
447 |
assume "a < b" |
|
448 |
then have "lmeasure {a ..< b} = lmeasure {a} + lmeasure {a <..< b}" |
|
449 |
by (subst lebesgue.measure_additive) |
|
450 |
(auto intro!: lebesgueI_borel arg_cong[where f=lmeasure]) |
|
451 |
then show ?thesis by auto |
|
452 |
qed auto |
|
453 |
||
454 |
interpretation borel: measure_space borel lmeasure |
|
455 |
proof |
|
456 |
show "countably_additive borel lmeasure" |
|
457 |
using lebesgue.ca unfolding countably_additive_def |
|
458 |
apply safe apply (erule_tac x=A in allE) by auto |
|
459 |
qed auto |
|
460 |
||
461 |
interpretation borel: sigma_finite_measure borel lmeasure |
|
462 |
proof (default, intro conjI exI[of _ "\<lambda>n. cube n"]) |
|
463 |
show "range cube \<subseteq> sets borel" by (auto intro: borel_closed) |
|
464 |
{ fix x have "\<exists>n. x\<in>cube n" using mem_big_cube by auto } |
|
465 |
thus "(\<Union>i. cube i) = space borel" by auto |
|
466 |
show "\<forall>i. lmeasure (cube i) \<noteq> \<omega>" unfolding lmeasure_cube by auto |
|
467 |
qed |
|
468 |
||
469 |
interpretation lebesgue: sigma_finite_measure lebesgue lmeasure |
|
470 |
proof |
|
471 |
from borel.sigma_finite guess A .. |
|
472 |
moreover then have "range A \<subseteq> sets lebesgue" using lebesgueI_borel by blast |
|
473 |
ultimately show "\<exists>A::nat \<Rightarrow> 'b set. range A \<subseteq> sets lebesgue \<and> (\<Union>i. A i) = space lebesgue \<and> (\<forall>i. lmeasure (A i) \<noteq> \<omega>)" |
|
474 |
by auto |
|
475 |
qed |
|
476 |
||
477 |
lemma simple_function_has_integral: |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
478 |
fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal" |
40859 | 479 |
assumes f:"lebesgue.simple_function f" |
480 |
and f':"\<forall>x. f x \<noteq> \<omega>" |
|
481 |
and om:"\<forall>x\<in>range f. lmeasure (f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0" |
|
482 |
shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.simple_integral f))) UNIV" |
|
483 |
unfolding lebesgue.simple_integral_def |
|
484 |
apply(subst lebesgue_simple_function_indicator[OF f]) |
|
485 |
proof- case goal1 |
|
486 |
have *:"\<And>x. \<forall>y\<in>range f. y * indicator (f -` {y}) x \<noteq> \<omega>" |
|
487 |
"\<forall>x\<in>range f. x * lmeasure (f -` {x} \<inter> UNIV) \<noteq> \<omega>" |
|
488 |
using f' om unfolding indicator_def by auto |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
489 |
show ?case unfolding space_lebesgue real_of_pextreal_setsum'[OF *(1),THEN sym] |
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
490 |
unfolding real_of_pextreal_setsum'[OF *(2),THEN sym] |
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
491 |
unfolding real_of_pextreal_setsum space_lebesgue |
40859 | 492 |
apply(rule has_integral_setsum) |
493 |
proof safe show "finite (range f)" using f by (auto dest: lebesgue.simple_functionD) |
|
494 |
fix y::'a show "((\<lambda>x. real (f y * indicator (f -` {f y}) x)) has_integral |
|
495 |
real (f y * lmeasure (f -` {f y} \<inter> UNIV))) UNIV" |
|
496 |
proof(cases "f y = 0") case False |
|
497 |
have mea:"gmeasurable (f -` {f y})" apply(rule lmeasure_finite_gmeasurable) |
|
498 |
using assms unfolding lebesgue.simple_function_def using False by auto |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
499 |
have *:"\<And>x. real (indicator (f -` {f y}) x::pextreal) = (if x \<in> f -` {f y} then 1 else 0)" by auto |
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
500 |
show ?thesis unfolding real_of_pextreal_mult[THEN sym] |
40859 | 501 |
apply(rule has_integral_cmul[where 'b=real, unfolded real_scaleR_def]) |
502 |
unfolding Int_UNIV_right lmeasure_gmeasure[OF mea,THEN sym] |
|
503 |
unfolding measure_integral_univ[OF mea] * apply(rule integrable_integral) |
|
504 |
unfolding gmeasurable_integrable[THEN sym] using mea . |
|
505 |
qed auto |
|
506 |
qed qed |
|
507 |
||
508 |
lemma bounded_realI: assumes "\<forall>x\<in>s. abs (x::real) \<le> B" shows "bounded s" |
|
509 |
unfolding bounded_def dist_real_def apply(rule_tac x=0 in exI) |
|
510 |
using assms by auto |
|
511 |
||
512 |
lemma simple_function_has_integral': |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
513 |
fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal" |
40859 | 514 |
assumes f:"lebesgue.simple_function f" |
515 |
and i: "lebesgue.simple_integral f \<noteq> \<omega>" |
|
516 |
shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.simple_integral f))) UNIV" |
|
517 |
proof- let ?f = "\<lambda>x. if f x = \<omega> then 0 else f x" |
|
518 |
{ fix x have "real (f x) = real (?f x)" by (cases "f x") auto } note * = this |
|
519 |
have **:"{x. f x \<noteq> ?f x} = f -` {\<omega>}" by auto |
|
520 |
have **:"lmeasure {x\<in>space lebesgue. f x \<noteq> ?f x} = 0" |
|
521 |
using lebesgue.simple_integral_omega[OF assms] by(auto simp add:**) |
|
522 |
show ?thesis apply(subst lebesgue.simple_integral_cong'[OF f _ **]) |
|
523 |
apply(rule lebesgue.simple_function_compose1[OF f]) |
|
524 |
unfolding * defer apply(rule simple_function_has_integral) |
|
525 |
proof- |
|
526 |
show "lebesgue.simple_function ?f" |
|
527 |
using lebesgue.simple_function_compose1[OF f] . |
|
528 |
show "\<forall>x. ?f x \<noteq> \<omega>" by auto |
|
529 |
show "\<forall>x\<in>range ?f. lmeasure (?f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0" |
|
530 |
proof (safe, simp, safe, rule ccontr) |
|
531 |
fix y assume "f y \<noteq> \<omega>" "f y \<noteq> 0" |
|
532 |
hence "(\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y} = f -` {f y}" |
|
533 |
by (auto split: split_if_asm) |
|
534 |
moreover assume "lmeasure ((\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y}) = \<omega>" |
|
535 |
ultimately have "lmeasure (f -` {f y}) = \<omega>" by simp |
|
536 |
moreover |
|
537 |
have "f y * lmeasure (f -` {f y}) \<noteq> \<omega>" using i f |
|
538 |
unfolding lebesgue.simple_integral_def setsum_\<omega> lebesgue.simple_function_def |
|
539 |
by auto |
|
540 |
ultimately have "f y = 0" by (auto split: split_if_asm) |
|
541 |
then show False using `f y \<noteq> 0` by simp |
|
542 |
qed |
|
543 |
qed |
|
544 |
qed |
|
545 |
||
546 |
lemma (in measure_space) positive_integral_monotone_convergence: |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
547 |
fixes f::"nat \<Rightarrow> 'a \<Rightarrow> pextreal" |
40859 | 548 |
assumes i: "\<And>i. f i \<in> borel_measurable M" and mono: "\<And>x. mono (\<lambda>n. f n x)" |
549 |
and lim: "\<And>x. (\<lambda>i. f i x) ----> u x" |
|
550 |
shows "u \<in> borel_measurable M" |
|
551 |
and "(\<lambda>i. positive_integral (f i)) ----> positive_integral u" (is ?ilim) |
|
552 |
proof - |
|
553 |
from positive_integral_isoton[unfolded isoton_fun_expand isoton_iff_Lim_mono, of f u] |
|
554 |
show ?ilim using mono lim i by auto |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
555 |
have "(SUP i. f i) = u" using mono lim SUP_Lim_pextreal |
40859 | 556 |
unfolding fun_eq_iff SUPR_fun_expand mono_def by auto |
557 |
moreover have "(SUP i. f i) \<in> borel_measurable M" |
|
558 |
using i by (rule borel_measurable_SUP) |
|
559 |
ultimately show "u \<in> borel_measurable M" by simp |
|
560 |
qed |
|
561 |
||
562 |
lemma positive_integral_has_integral: |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
563 |
fixes f::"'a::ordered_euclidean_space => pextreal" |
40859 | 564 |
assumes f:"f \<in> borel_measurable lebesgue" |
565 |
and int_om:"lebesgue.positive_integral f \<noteq> \<omega>" |
|
566 |
and f_om:"\<forall>x. f x \<noteq> \<omega>" (* TODO: remove this *) |
|
567 |
shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.positive_integral f))) UNIV" |
|
568 |
proof- let ?i = "lebesgue.positive_integral f" |
|
569 |
from lebesgue.borel_measurable_implies_simple_function_sequence[OF f] |
|
570 |
guess u .. note conjunctD2[OF this,rule_format] note u = conjunctD2[OF this(1)] this(2) |
|
571 |
let ?u = "\<lambda>i x. real (u i x)" and ?f = "\<lambda>x. real (f x)" |
|
572 |
have u_simple:"\<And>k. lebesgue.simple_integral (u k) = lebesgue.positive_integral (u k)" |
|
573 |
apply(subst lebesgue.positive_integral_eq_simple_integral[THEN sym,OF u(1)]) .. |
|
574 |
have int_u_le:"\<And>k. lebesgue.simple_integral (u k) \<le> lebesgue.positive_integral f" |
|
575 |
unfolding u_simple apply(rule lebesgue.positive_integral_mono) |
|
576 |
using isoton_Sup[OF u(3)] unfolding le_fun_def by auto |
|
577 |
have u_int_om:"\<And>i. lebesgue.simple_integral (u i) \<noteq> \<omega>" |
|
578 |
proof- case goal1 thus ?case using int_u_le[of i] int_om by auto qed |
|
579 |
||
580 |
note u_int = simple_function_has_integral'[OF u(1) this] |
|
581 |
have "(\<lambda>x. real (f x)) integrable_on UNIV \<and> |
|
582 |
(\<lambda>k. Integration.integral UNIV (\<lambda>x. real (u k x))) ----> Integration.integral UNIV (\<lambda>x. real (f x))" |
|
583 |
apply(rule monotone_convergence_increasing) apply(rule,rule,rule u_int) |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
584 |
proof safe case goal1 show ?case apply(rule real_of_pextreal_mono) using u(2,3) by auto |
40859 | 585 |
next case goal2 show ?case using u(3) apply(subst lim_Real[THEN sym]) |
586 |
prefer 3 apply(subst Real_real') defer apply(subst Real_real') |
|
587 |
using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] using f_om u by auto |
|
588 |
next case goal3 |
|
589 |
show ?case apply(rule bounded_realI[where B="real (lebesgue.positive_integral f)"]) |
|
590 |
apply safe apply(subst abs_of_nonneg) apply(rule integral_nonneg,rule) apply(rule u_int) |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
591 |
unfolding integral_unique[OF u_int] defer apply(rule real_of_pextreal_mono[OF _ int_u_le]) |
40859 | 592 |
using u int_om by auto |
593 |
qed note int = conjunctD2[OF this] |
|
594 |
||
595 |
have "(\<lambda>i. lebesgue.simple_integral (u i)) ----> ?i" unfolding u_simple |
|
596 |
apply(rule lebesgue.positive_integral_monotone_convergence(2)) |
|
597 |
apply(rule lebesgue.borel_measurable_simple_function[OF u(1)]) |
|
598 |
using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] by auto |
|
599 |
hence "(\<lambda>i. real (lebesgue.simple_integral (u i))) ----> real ?i" apply- |
|
600 |
apply(subst lim_Real[THEN sym]) prefer 3 |
|
601 |
apply(subst Real_real') defer apply(subst Real_real') |
|
602 |
using u f_om int_om u_int_om by auto |
|
603 |
note * = LIMSEQ_unique[OF this int(2)[unfolded integral_unique[OF u_int]]] |
|
604 |
show ?thesis unfolding * by(rule integrable_integral[OF int(1)]) |
|
605 |
qed |
|
606 |
||
607 |
lemma lebesgue_integral_has_integral: |
|
608 |
fixes f::"'a::ordered_euclidean_space => real" |
|
609 |
assumes f:"lebesgue.integrable f" |
|
610 |
shows "(f has_integral (lebesgue.integral f)) UNIV" |
|
611 |
proof- let ?n = "\<lambda>x. - min (f x) 0" and ?p = "\<lambda>x. max (f x) 0" |
|
612 |
have *:"f = (\<lambda>x. ?p x - ?n x)" apply rule by auto |
|
613 |
note f = lebesgue.integrableD[OF f] |
|
614 |
show ?thesis unfolding lebesgue.integral_def apply(subst *) |
|
615 |
proof(rule has_integral_sub) case goal1 |
|
616 |
have *:"\<forall>x. Real (f x) \<noteq> \<omega>" by auto |
|
617 |
note lebesgue.borel_measurable_Real[OF f(1)] |
|
618 |
from positive_integral_has_integral[OF this f(2) *] |
|
619 |
show ?case unfolding real_Real_max . |
|
620 |
next case goal2 |
|
621 |
have *:"\<forall>x. Real (- f x) \<noteq> \<omega>" by auto |
|
622 |
note lebesgue.borel_measurable_uminus[OF f(1)] |
|
623 |
note lebesgue.borel_measurable_Real[OF this] |
|
624 |
from positive_integral_has_integral[OF this f(3) *] |
|
625 |
show ?case unfolding real_Real_max minus_min_eq_max by auto |
|
626 |
qed |
|
627 |
qed |
|
628 |
||
629 |
lemma continuous_on_imp_borel_measurable: |
|
630 |
fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::ordered_euclidean_space" |
|
631 |
assumes "continuous_on UNIV f" |
|
632 |
shows "f \<in> borel_measurable lebesgue" |
|
633 |
apply(rule lebesgue.borel_measurableI) |
|
634 |
using continuous_open_preimage[OF assms] unfolding vimage_def by auto |
|
635 |
||
636 |
lemma (in measure_space) integral_monotone_convergence_pos': |
|
637 |
assumes i: "\<And>i. integrable (f i)" and mono: "\<And>x. mono (\<lambda>n. f n x)" |
|
638 |
and pos: "\<And>x i. 0 \<le> f i x" |
|
639 |
and lim: "\<And>x. (\<lambda>i. f i x) ----> u x" |
|
640 |
and ilim: "(\<lambda>i. integral (f i)) ----> x" |
|
641 |
shows "integrable u \<and> integral u = x" |
|
642 |
using integral_monotone_convergence_pos[OF assms] by auto |
|
643 |
||
644 |
definition e2p :: "'a::ordered_euclidean_space \<Rightarrow> (nat \<Rightarrow> real)" where |
|
645 |
"e2p x = (\<lambda>i\<in>{..<DIM('a)}. x$$i)" |
|
646 |
||
647 |
definition p2e :: "(nat \<Rightarrow> real) \<Rightarrow> 'a::ordered_euclidean_space" where |
|
648 |
"p2e x = (\<chi>\<chi> i. x i)" |
|
649 |
||
650 |
lemma bij_euclidean_component: |
|
651 |
"bij_betw (e2p::'a::ordered_euclidean_space \<Rightarrow> _) (UNIV :: 'a set) |
|
652 |
({..<DIM('a)} \<rightarrow>\<^isub>E (UNIV :: real set))" |
|
653 |
unfolding bij_betw_def e2p_def_raw |
|
654 |
proof let ?e = "\<lambda>x.\<lambda>i\<in>{..<DIM('a::ordered_euclidean_space)}. (x::'a)$$i" |
|
655 |
show "inj ?e" unfolding inj_on_def restrict_def apply(subst euclidean_eq) apply safe |
|
656 |
apply(drule_tac x=i in fun_cong) by auto |
|
657 |
{ fix x::"nat \<Rightarrow> real" assume x:"\<forall>i. i \<notin> {..<DIM('a)} \<longrightarrow> x i = undefined" |
|
658 |
hence "x = ?e (\<chi>\<chi> i. x i)" apply-apply(rule,case_tac "xa<DIM('a)") by auto |
|
659 |
hence "x \<in> range ?e" by fastsimp |
|
660 |
} thus "range ?e = ({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)}" |
|
661 |
unfolding extensional_def using DIM_positive by auto |
|
662 |
qed |
|
663 |
||
664 |
lemma bij_p2e: |
|
665 |
"bij_betw (p2e::_ \<Rightarrow> 'a::ordered_euclidean_space) ({..<DIM('a)} \<rightarrow>\<^isub>E (UNIV :: real set)) |
|
666 |
(UNIV :: 'a set)" (is "bij_betw ?p ?U _") |
|
667 |
unfolding bij_betw_def |
|
668 |
proof show "inj_on ?p ?U" unfolding inj_on_def p2e_def |
|
669 |
apply(subst euclidean_eq) apply(safe,rule) unfolding extensional_def |
|
670 |
apply(case_tac "xa<DIM('a)") by auto |
|
671 |
{ fix x::'a have "x \<in> ?p ` extensional {..<DIM('a)}" |
|
672 |
unfolding image_iff apply(rule_tac x="\<lambda>i. if i<DIM('a) then x$$i else undefined" in bexI) |
|
673 |
apply(subst euclidean_eq,safe) unfolding p2e_def extensional_def by auto |
|
674 |
} thus "?p ` ?U = UNIV" by auto |
|
675 |
qed |
|
676 |
||
677 |
lemma e2p_p2e[simp]: fixes z::"'a::ordered_euclidean_space" |
|
678 |
assumes "x \<in> extensional {..<DIM('a)}" |
|
679 |
shows "e2p (p2e x::'a) = x" |
|
680 |
proof fix i::nat |
|
681 |
show "e2p (p2e x::'a) i = x i" unfolding e2p_def p2e_def restrict_def |
|
682 |
using assms unfolding extensional_def by auto |
|
683 |
qed |
|
684 |
||
685 |
lemma p2e_e2p[simp]: fixes x::"'a::ordered_euclidean_space" |
|
686 |
shows "p2e (e2p x) = x" |
|
687 |
apply(subst euclidean_eq) unfolding e2p_def p2e_def restrict_def by auto |
|
688 |
||
689 |
interpretation borel_product: product_sigma_finite "\<lambda>x. borel::real algebra" "\<lambda>x. lmeasure" |
|
690 |
by default |
|
691 |
||
692 |
lemma cube_subset_Suc[intro]: "cube n \<subseteq> cube (Suc n)" |
|
693 |
unfolding cube_def_raw subset_eq apply safe unfolding mem_interval by auto |
|
694 |
||
695 |
lemma borel_vimage_algebra_eq: |
|
696 |
"sigma_algebra.vimage_algebra |
|
697 |
(borel :: ('a::ordered_euclidean_space) algebra) ({..<DIM('a)} \<rightarrow>\<^isub>E UNIV) p2e = |
|
698 |
sigma (product_algebra (\<lambda>x. \<lparr> space = UNIV::real set, sets = range (\<lambda>a. {..<a}) \<rparr>) {..<DIM('a)} )" |
|
699 |
proof- note bor = borel_eq_lessThan |
|
700 |
def F \<equiv> "product_algebra (\<lambda>x. \<lparr> space = UNIV::real set, sets = range (\<lambda>a. {..<a}) \<rparr>) {..<DIM('a)}" |
|
701 |
def E \<equiv> "\<lparr>space = (UNIV::'a set), sets = range lessThan\<rparr>" |
|
702 |
have *:"(({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)}) = space F" unfolding F_def by auto |
|
703 |
show ?thesis unfolding F_def[symmetric] * bor |
|
704 |
proof(rule vimage_algebra_sigma,unfold E_def[symmetric]) |
|
705 |
show "sets E \<subseteq> Pow (space E)" "p2e \<in> space F \<rightarrow> space E" unfolding E_def by auto |
|
706 |
next fix A assume "A \<in> sets F" |
|
707 |
hence A:"A \<in> (Pi\<^isub>E {..<DIM('a)}) ` ({..<DIM('a)} \<rightarrow> range lessThan)" |
|
708 |
unfolding F_def product_algebra_def algebra.simps . |
|
709 |
then guess B unfolding image_iff .. note B=this |
|
710 |
hence "\<forall>x<DIM('a). B x \<in> range lessThan" by auto |
|
711 |
hence "\<forall>x. \<exists>xa. x<DIM('a) \<longrightarrow> B x = {..<xa}" unfolding image_iff by auto |
|
712 |
from choice[OF this] guess b .. note b=this |
|
713 |
hence b':"\<forall>i<DIM('a). Sup (B i) = b i" using Sup_lessThan by auto |
|
714 |
||
715 |
show "A \<in> (\<lambda>X. p2e -` X \<inter> space F) ` sets E" unfolding image_iff B |
|
716 |
proof(rule_tac x="{..< \<chi>\<chi> i. Sup (B i)}" in bexI) |
|
717 |
show "Pi\<^isub>E {..<DIM('a)} B = p2e -` {..<(\<chi>\<chi> i. Sup (B i))::'a} \<inter> space F" |
|
718 |
unfolding F_def E_def product_algebra_def algebra.simps |
|
719 |
proof(rule,unfold subset_eq,rule_tac[!] ballI) |
|
720 |
fix x assume "x \<in> Pi\<^isub>E {..<DIM('a)} B" |
|
721 |
hence *:"\<forall>i<DIM('a). x i < b i" "\<forall>i\<ge>DIM('a). x i = undefined" |
|
722 |
unfolding Pi_def extensional_def using b by auto |
|
723 |
have "(p2e x::'a) < (\<chi>\<chi> i. Sup (B i))" unfolding less_prod_def eucl_less[of "p2e x"] |
|
724 |
apply safe unfolding euclidean_lambda_beta b'[rule_format] p2e_def using * by auto |
|
725 |
moreover have "x \<in> extensional {..<DIM('a)}" |
|
726 |
using *(2) unfolding extensional_def by auto |
|
727 |
ultimately show "x \<in> p2e -` {..<(\<chi>\<chi> i. Sup (B i)) ::'a} \<inter> |
|
728 |
(({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" by auto |
|
729 |
next fix x assume as:"x \<in> p2e -` {..<(\<chi>\<chi> i. Sup (B i))::'a} \<inter> |
|
730 |
(({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" |
|
731 |
hence "p2e x < ((\<chi>\<chi> i. Sup (B i))::'a)" by auto |
|
732 |
hence "\<forall>i<DIM('a). x i \<in> B i" apply-apply(subst(asm) eucl_less) |
|
733 |
unfolding p2e_def using b b' by auto |
|
734 |
thus "x \<in> Pi\<^isub>E {..<DIM('a)} B" using as unfolding Pi_def extensional_def by auto |
|
735 |
qed |
|
736 |
show "{..<(\<chi>\<chi> i. Sup (B i))::'a} \<in> sets E" unfolding E_def algebra.simps by auto |
|
737 |
qed |
|
738 |
next fix A assume "A \<in> sets E" |
|
739 |
then guess a unfolding E_def algebra.simps image_iff .. note a = this(2) |
|
740 |
def B \<equiv> "\<lambda>i. {..<a $$ i}" |
|
741 |
show "p2e -` A \<inter> space F \<in> sets F" unfolding F_def |
|
742 |
unfolding product_algebra_def algebra.simps image_iff |
|
743 |
apply(rule_tac x=B in bexI) apply rule unfolding subset_eq apply(rule_tac[1-2] ballI) |
|
744 |
proof- show "B \<in> {..<DIM('a)} \<rightarrow> range lessThan" unfolding B_def by auto |
|
745 |
fix x assume as:"x \<in> p2e -` A \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" |
|
746 |
hence "p2e x \<in> A" by auto |
|
747 |
hence "\<forall>i<DIM('a). x i \<in> B i" unfolding B_def a lessThan_iff |
|
748 |
apply-apply(subst (asm) eucl_less) unfolding p2e_def by auto |
|
749 |
thus "x \<in> Pi\<^isub>E {..<DIM('a)} B" using as unfolding Pi_def extensional_def by auto |
|
750 |
next fix x assume x:"x \<in> Pi\<^isub>E {..<DIM('a)} B" |
|
751 |
moreover have "p2e x \<in> A" unfolding a lessThan_iff p2e_def apply(subst eucl_less) |
|
752 |
using x unfolding Pi_def extensional_def B_def by auto |
|
753 |
ultimately show "x \<in> p2e -` A \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" by auto |
|
754 |
qed |
|
755 |
qed |
|
756 |
qed |
|
757 |
||
758 |
lemma e2p_Int:"e2p ` A \<inter> e2p ` B = e2p ` (A \<inter> B)" (is "?L = ?R") |
|
759 |
apply(rule image_Int[THEN sym]) using bij_euclidean_component |
|
760 |
unfolding bij_betw_def by auto |
|
761 |
||
762 |
lemma Int_stable_cuboids: fixes x::"'a::ordered_euclidean_space" |
|
763 |
shows "Int_stable \<lparr>space = UNIV, sets = range (\<lambda>(a, b::'a). e2p ` {a..b})\<rparr>" |
|
764 |
unfolding Int_stable_def algebra.select_convs |
|
765 |
proof safe fix a b x y::'a |
|
766 |
have *:"e2p ` {a..b} \<inter> e2p ` {x..y} = |
|
767 |
(\<lambda>(a, b). e2p ` {a..b}) (\<chi>\<chi> i. max (a $$ i) (x $$ i), \<chi>\<chi> i. min (b $$ i) (y $$ i)::'a)" |
|
768 |
unfolding e2p_Int inter_interval by auto |
|
769 |
show "e2p ` {a..b} \<inter> e2p ` {x..y} \<in> range (\<lambda>(a, b). e2p ` {a..b::'a})" unfolding * |
|
770 |
apply(rule range_eqI) .. |
|
771 |
qed |
|
772 |
||
773 |
lemma Int_stable_cuboids': fixes x::"'a::ordered_euclidean_space" |
|
774 |
shows "Int_stable \<lparr>space = UNIV, sets = range (\<lambda>(a, b::'a). {a..b})\<rparr>" |
|
775 |
unfolding Int_stable_def algebra.select_convs |
|
776 |
apply safe unfolding inter_interval by auto |
|
777 |
||
778 |
lemma product_borel_eq_vimage: |
|
779 |
"sigma (product_algebra (\<lambda>x. borel) {..<DIM('a::ordered_euclidean_space)}) = |
|
780 |
sigma_algebra.vimage_algebra borel (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)}) |
|
781 |
(p2e:: _ \<Rightarrow> 'a::ordered_euclidean_space)" |
|
782 |
unfolding borel_vimage_algebra_eq unfolding borel_eq_lessThan |
|
783 |
apply(subst sigma_product_algebra_sigma_eq[where S="\<lambda>i. \<lambda>n. lessThan (real n)"]) |
|
784 |
unfolding lessThan_iff |
|
785 |
proof- fix i assume i:"i<DIM('a)" |
|
786 |
show "(\<lambda>n. {..<real n}) \<up> space \<lparr>space = UNIV, sets = range lessThan\<rparr>" |
|
787 |
by(auto intro!:real_arch_lt isotoneI) |
|
788 |
qed auto |
|
789 |
||
790 |
lemma inj_on_disjoint_family_on: assumes "disjoint_family_on A S" "inj f" |
|
791 |
shows "disjoint_family_on (\<lambda>x. f ` A x) S" |
|
792 |
unfolding disjoint_family_on_def |
|
793 |
proof(rule,rule,rule) |
|
794 |
fix x1 x2 assume x:"x1 \<in> S" "x2 \<in> S" "x1 \<noteq> x2" |
|
795 |
show "f ` A x1 \<inter> f ` A x2 = {}" |
|
796 |
proof(rule ccontr) case goal1 |
|
797 |
then obtain z where z:"z \<in> f ` A x1 \<inter> f ` A x2" by auto |
|
798 |
then obtain z1 z2 where z12:"z1 \<in> A x1" "z2 \<in> A x2" "f z1 = z" "f z2 = z" by auto |
|
799 |
hence "z1 = z2" using assms(2) unfolding inj_on_def by blast |
|
800 |
hence "x1 = x2" using z12(1-2) using assms[unfolded disjoint_family_on_def] using x by auto |
|
801 |
thus False using x(3) by auto |
|
802 |
qed |
|
803 |
qed |
|
804 |
||
805 |
declare restrict_extensional[intro] |
|
806 |
||
807 |
lemma e2p_extensional[intro]:"e2p (y::'a::ordered_euclidean_space) \<in> extensional {..<DIM('a)}" |
|
808 |
unfolding e2p_def by auto |
|
809 |
||
810 |
lemma e2p_image_vimage: fixes A::"'a::ordered_euclidean_space set" |
|
811 |
shows "e2p ` A = p2e -` A \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" |
|
812 |
proof(rule set_eqI,rule) |
|
813 |
fix x assume "x \<in> e2p ` A" then guess y unfolding image_iff .. note y=this |
|
814 |
show "x \<in> p2e -` A \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" |
|
815 |
apply safe apply(rule vimageI[OF _ y(1)]) unfolding y p2e_e2p by auto |
|
816 |
next fix x assume "x \<in> p2e -` A \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)})" |
|
817 |
thus "x \<in> e2p ` A" unfolding image_iff apply(rule_tac x="p2e x" in bexI) apply(subst e2p_p2e) by auto |
|
818 |
qed |
|
819 |
||
820 |
lemma lmeasure_measure_eq_borel_prod: |
|
821 |
fixes A :: "('a::ordered_euclidean_space) set" |
|
822 |
assumes "A \<in> sets borel" |
|
823 |
shows "lmeasure A = borel_product.product_measure {..<DIM('a)} (e2p ` A :: (nat \<Rightarrow> real) set)" |
|
824 |
proof (rule measure_unique_Int_stable[where X=A and A=cube]) |
|
825 |
interpret fprod: finite_product_sigma_finite "\<lambda>x. borel" "\<lambda>x. lmeasure" "{..<DIM('a)}" by default auto |
|
826 |
show "Int_stable \<lparr> space = UNIV :: 'a set, sets = range (\<lambda>(a,b). {a..b}) \<rparr>" |
|
827 |
(is "Int_stable ?E" ) using Int_stable_cuboids' . |
|
828 |
show "borel = sigma ?E" using borel_eq_atLeastAtMost . |
|
829 |
show "\<And>i. lmeasure (cube i) \<noteq> \<omega>" unfolding lmeasure_cube by auto |
|
830 |
show "\<And>X. X \<in> sets ?E \<Longrightarrow> |
|
831 |
lmeasure X = borel_product.product_measure {..<DIM('a)} (e2p ` X :: (nat \<Rightarrow> real) set)" |
|
832 |
proof- case goal1 then obtain a b where X:"X = {a..b}" by auto |
|
833 |
{ presume *:"X \<noteq> {} \<Longrightarrow> ?case" |
|
834 |
show ?case apply(cases,rule *,assumption) by auto } |
|
835 |
def XX \<equiv> "\<lambda>i. {a $$ i .. b $$ i}" assume "X \<noteq> {}" note X' = this[unfolded X interval_ne_empty] |
|
836 |
have *:"Pi\<^isub>E {..<DIM('a)} XX = e2p ` X" apply(rule set_eqI) |
|
837 |
proof fix x assume "x \<in> Pi\<^isub>E {..<DIM('a)} XX" |
|
838 |
thus "x \<in> e2p ` X" unfolding image_iff apply(rule_tac x="\<chi>\<chi> i. x i" in bexI) |
|
839 |
unfolding Pi_def extensional_def e2p_def restrict_def X mem_interval XX_def by rule auto |
|
840 |
next fix x assume "x \<in> e2p ` X" then guess y unfolding image_iff .. note y = this |
|
841 |
show "x \<in> Pi\<^isub>E {..<DIM('a)} XX" unfolding y using y(1) |
|
842 |
unfolding Pi_def extensional_def e2p_def restrict_def X mem_interval XX_def by auto |
|
843 |
qed |
|
844 |
have "lmeasure X = (\<Prod>x<DIM('a). Real (b $$ x - a $$ x))" using X' apply- unfolding X |
|
845 |
unfolding lmeasure_atLeastAtMost content_closed_interval apply(subst Real_setprod) by auto |
|
846 |
also have "... = (\<Prod>i<DIM('a). lmeasure (XX i))" apply(rule setprod_cong2) |
|
847 |
unfolding XX_def lmeasure_atLeastAtMost apply(subst content_real) using X' by auto |
|
848 |
also have "... = borel_product.product_measure {..<DIM('a)} (e2p ` X)" unfolding *[THEN sym] |
|
849 |
apply(rule fprod.measure_times[THEN sym]) unfolding XX_def by auto |
|
850 |
finally show ?case . |
|
851 |
qed |
|
852 |
||
853 |
show "range cube \<subseteq> sets \<lparr>space = UNIV, sets = range (\<lambda>(a, b). {a..b})\<rparr>" |
|
854 |
unfolding cube_def_raw by auto |
|
855 |
have "\<And>x. \<exists>xa. x \<in> cube xa" apply(rule_tac x=x in mem_big_cube) by fastsimp |
|
856 |
thus "cube \<up> space \<lparr>space = UNIV, sets = range (\<lambda>(a, b). {a..b})\<rparr>" |
|
857 |
apply-apply(rule isotoneI) apply(rule cube_subset_Suc) by auto |
|
858 |
show "A \<in> sets borel " by fact |
|
859 |
show "measure_space borel lmeasure" by default |
|
860 |
show "measure_space borel |
|
861 |
(\<lambda>a::'a set. finite_product_sigma_finite.measure (\<lambda>x. borel) (\<lambda>x. lmeasure) {..<DIM('a)} (e2p ` a))" |
|
862 |
apply default unfolding countably_additive_def |
|
863 |
proof safe fix A::"nat \<Rightarrow> 'a set" assume A:"range A \<subseteq> sets borel" "disjoint_family A" |
|
864 |
"(\<Union>i. A i) \<in> sets borel" |
|
865 |
note fprod.ca[unfolded countably_additive_def,rule_format] |
|
866 |
note ca = this[of "\<lambda> n. e2p ` (A n)"] |
|
867 |
show "(\<Sum>\<^isub>\<infinity>n. finite_product_sigma_finite.measure |
|
868 |
(\<lambda>x. borel) (\<lambda>x. lmeasure) {..<DIM('a)} (e2p ` A n)) = |
|
869 |
finite_product_sigma_finite.measure (\<lambda>x. borel) |
|
870 |
(\<lambda>x. lmeasure) {..<DIM('a)} (e2p ` (\<Union>i. A i))" unfolding image_UN |
|
871 |
proof(rule ca) show "range (\<lambda>n. e2p ` A n) \<subseteq> sets |
|
872 |
(sigma (product_algebra (\<lambda>x. borel) {..<DIM('a)}))" |
|
873 |
unfolding product_borel_eq_vimage |
|
874 |
proof case goal1 |
|
875 |
then guess y unfolding image_iff .. note y=this(2) |
|
876 |
show ?case unfolding borel.in_vimage_algebra y apply- |
|
877 |
apply(rule_tac x="A y" in bexI,rule e2p_image_vimage) |
|
878 |
using A(1) by auto |
|
879 |
qed |
|
880 |
||
881 |
show "disjoint_family (\<lambda>n. e2p ` A n)" apply(rule inj_on_disjoint_family_on) |
|
882 |
using bij_euclidean_component using A(2) unfolding bij_betw_def by auto |
|
883 |
show "(\<Union>n. e2p ` A n) \<in> sets (sigma (product_algebra (\<lambda>x. borel) {..<DIM('a)}))" |
|
884 |
unfolding product_borel_eq_vimage borel.in_vimage_algebra |
|
885 |
proof(rule bexI[OF _ A(3)],rule set_eqI,rule) |
|
886 |
fix x assume x:"x \<in> (\<Union>n. e2p ` A n)" hence "p2e x \<in> (\<Union>i. A i)" by auto |
|
887 |
moreover have "x \<in> extensional {..<DIM('a)}" |
|
888 |
using x unfolding extensional_def e2p_def_raw by auto |
|
889 |
ultimately show "x \<in> p2e -` (\<Union>i. A i) \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> |
|
890 |
extensional {..<DIM('a)})" by auto |
|
891 |
next fix x assume x:"x \<in> p2e -` (\<Union>i. A i) \<inter> (({..<DIM('a)} \<rightarrow> UNIV) \<inter> |
|
892 |
extensional {..<DIM('a)})" |
|
893 |
hence "p2e x \<in> (\<Union>i. A i)" by auto |
|
894 |
hence "\<exists>n. x \<in> e2p ` A n" apply safe apply(rule_tac x=i in exI) |
|
895 |
unfolding image_iff apply(rule_tac x="p2e x" in bexI) |
|
896 |
apply(subst e2p_p2e) using x by auto |
|
897 |
thus "x \<in> (\<Union>n. e2p ` A n)" by auto |
|
898 |
qed |
|
899 |
qed |
|
900 |
qed auto |
|
901 |
qed |
|
902 |
||
903 |
lemma e2p_p2e'[simp]: fixes x::"'a::ordered_euclidean_space" |
|
904 |
assumes "A \<subseteq> extensional {..<DIM('a)}" |
|
905 |
shows "e2p ` (p2e ` A ::'a set) = A" |
|
906 |
apply(rule set_eqI) unfolding image_iff Bex_def apply safe defer |
|
907 |
apply(rule_tac x="p2e x" in exI,safe) using assms by auto |
|
908 |
||
909 |
lemma range_p2e:"range (p2e::_\<Rightarrow>'a::ordered_euclidean_space) = UNIV" |
|
910 |
apply safe defer unfolding image_iff apply(rule_tac x="\<lambda>i. x $$ i" in bexI) |
|
911 |
unfolding p2e_def by auto |
|
912 |
||
913 |
lemma p2e_inv_extensional:"(A::'a::ordered_euclidean_space set) |
|
914 |
= p2e ` (p2e -` A \<inter> extensional {..<DIM('a)})" |
|
915 |
unfolding p2e_def_raw apply safe unfolding image_iff |
|
916 |
proof- fix x assume "x\<in>A" |
|
917 |
let ?y = "\<lambda>i. if i<DIM('a) then x$$i else undefined" |
|
918 |
have *:"Chi ?y = x" apply(subst euclidean_eq) by auto |
|
919 |
show "\<exists>xa\<in>Chi -` A \<inter> extensional {..<DIM('a)}. x = Chi xa" apply(rule_tac x="?y" in bexI) |
|
920 |
apply(subst euclidean_eq) unfolding extensional_def using `x\<in>A` by(auto simp: *) |
|
921 |
qed |
|
922 |
||
923 |
lemma borel_fubini_positiv_integral: |
|
41023
9118eb4eb8dc
it is known as the extended reals, not the infinite reals
hoelzl
parents:
40874
diff
changeset
|
924 |
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> pextreal" |
40859 | 925 |
assumes f: "f \<in> borel_measurable borel" |
926 |
shows "borel.positive_integral f = |
|
927 |
borel_product.product_positive_integral {..<DIM('a)} (f \<circ> p2e)" |
|
928 |
proof- def U \<equiv> "(({..<DIM('a)} \<rightarrow> UNIV) \<inter> extensional {..<DIM('a)}):: (nat \<Rightarrow> real) set" |
|
929 |
interpret fprod: finite_product_sigma_finite "\<lambda>x. borel" "\<lambda>x. lmeasure" "{..<DIM('a)}" by default auto |
|
930 |
have "\<And>x. \<exists>i::nat. x < real i" by (metis real_arch_lt) |
|
931 |
hence "(\<lambda>n::nat. {..<real n}) \<up> UNIV" apply-apply(rule isotoneI) by auto |
|
932 |
hence *:"sigma_algebra.vimage_algebra borel U (p2e:: _ \<Rightarrow> 'a) |
|
933 |
= sigma (product_algebra (\<lambda>x. borel) {..<DIM('a)})" |
|
934 |
unfolding U_def apply-apply(subst borel_vimage_algebra_eq) |
|
935 |
apply(subst sigma_product_algebra_sigma_eq[where S="\<lambda>x. \<lambda>n. {..<(\<chi>\<chi> i. real n)}", THEN sym]) |
|
936 |
unfolding borel_eq_lessThan[THEN sym] by auto |
|
937 |
show ?thesis unfolding borel.positive_integral_vimage[unfolded space_borel,OF bij_p2e] |
|
938 |
apply(subst fprod.positive_integral_cong_measure[THEN sym, of "\<lambda>A. lmeasure (p2e ` A)"]) |
|
939 |
unfolding U_def[symmetric] *[THEN sym] o_def |
|
940 |
proof- fix A assume A:"A \<in> sets (sigma_algebra.vimage_algebra borel U (p2e ::_ \<Rightarrow> 'a))" |
|
941 |
hence *:"A \<subseteq> extensional {..<DIM('a)}" unfolding U_def by auto |
|
942 |
from A guess B unfolding borel.in_vimage_algebra U_def .. note B=this |
|
943 |
have "(p2e ` A::'a set) \<in> sets borel" unfolding B apply(subst Int_left_commute) |
|
944 |
apply(subst Int_absorb1) unfolding p2e_inv_extensional[of B,THEN sym] using B(1) by auto |
|
945 |
from lmeasure_measure_eq_borel_prod[OF this] show "lmeasure (p2e ` A::'a set) = |
|
946 |
finite_product_sigma_finite.measure (\<lambda>x. borel) (\<lambda>x. lmeasure) {..<DIM('a)} A" |
|
947 |
unfolding e2p_p2e'[OF *] . |
|
948 |
qed auto |
|
949 |
qed |
|
950 |
||
951 |
lemma borel_fubini: |
|
952 |
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> real" |
|
953 |
assumes f: "f \<in> borel_measurable borel" |
|
954 |
shows "borel.integral f = borel_product.product_integral {..<DIM('a)} (f \<circ> p2e)" |
|
955 |
proof- interpret fprod: finite_product_sigma_finite "\<lambda>x. borel" "\<lambda>x. lmeasure" "{..<DIM('a)}" by default auto |
|
956 |
have 1:"(\<lambda>x. Real (f x)) \<in> borel_measurable borel" using f by auto |
|
957 |
have 2:"(\<lambda>x. Real (- f x)) \<in> borel_measurable borel" using f by auto |
|
958 |
show ?thesis unfolding fprod.integral_def borel.integral_def |
|
959 |
unfolding borel_fubini_positiv_integral[OF 1] borel_fubini_positiv_integral[OF 2] |
|
960 |
unfolding o_def .. |
|
38656 | 961 |
qed |
962 |
||
963 |
end |