author | hoelzl |
Wed, 10 Oct 2012 12:12:34 +0200 | |
changeset 49799 | 15ea98537c76 |
parent 49774 | dfa8ddb874ce |
child 50001 | 382bd3173584 |
permissions | -rw-r--r-- |
42150 | 1 |
(* Title: HOL/Probability/Borel_Space.thy |
42067 | 2 |
Author: Johannes Hölzl, TU München |
3 |
Author: Armin Heller, TU München |
|
4 |
*) |
|
38656 | 5 |
|
6 |
header {*Borel spaces*} |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
7 |
|
40859 | 8 |
theory Borel_Space |
45288 | 9 |
imports Sigma_Algebra "~~/src/HOL/Multivariate_Analysis/Multivariate_Analysis" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
10 |
begin |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
11 |
|
38656 | 12 |
section "Generic Borel spaces" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
13 |
|
47694 | 14 |
definition borel :: "'a::topological_space measure" where |
15 |
"borel = sigma UNIV {S. open S}" |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
16 |
|
47694 | 17 |
abbreviation "borel_measurable M \<equiv> measurable M borel" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
18 |
|
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
19 |
lemma in_borel_measurable: |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
20 |
"f \<in> borel_measurable M \<longleftrightarrow> |
47694 | 21 |
(\<forall>S \<in> sigma_sets UNIV {S. open S}. f -` S \<inter> space M \<in> sets M)" |
40859 | 22 |
by (auto simp add: measurable_def borel_def) |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
23 |
|
40859 | 24 |
lemma in_borel_measurable_borel: |
38656 | 25 |
"f \<in> borel_measurable M \<longleftrightarrow> |
40859 | 26 |
(\<forall>S \<in> sets borel. |
38656 | 27 |
f -` S \<inter> space M \<in> sets M)" |
40859 | 28 |
by (auto simp add: measurable_def borel_def) |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
29 |
|
40859 | 30 |
lemma space_borel[simp]: "space borel = UNIV" |
31 |
unfolding borel_def by auto |
|
38656 | 32 |
|
40859 | 33 |
lemma borel_open[simp]: |
34 |
assumes "open A" shows "A \<in> sets borel" |
|
38656 | 35 |
proof - |
44537
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
36 |
have "A \<in> {S. open S}" unfolding mem_Collect_eq using assms . |
47694 | 37 |
thus ?thesis unfolding borel_def by auto |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
38 |
qed |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
39 |
|
40859 | 40 |
lemma borel_closed[simp]: |
41 |
assumes "closed A" shows "A \<in> sets borel" |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
42 |
proof - |
40859 | 43 |
have "space borel - (- A) \<in> sets borel" |
44 |
using assms unfolding closed_def by (blast intro: borel_open) |
|
38656 | 45 |
thus ?thesis by simp |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
46 |
qed |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
47 |
|
41830 | 48 |
lemma borel_comp[intro,simp]: "A \<in> sets borel \<Longrightarrow> - A \<in> sets borel" |
47694 | 49 |
unfolding Compl_eq_Diff_UNIV by (intro Diff) auto |
41830 | 50 |
|
47694 | 51 |
lemma borel_measurable_vimage: |
38656 | 52 |
fixes f :: "'a \<Rightarrow> 'x::t2_space" |
53 |
assumes borel: "f \<in> borel_measurable M" |
|
54 |
shows "f -` {x} \<inter> space M \<in> sets M" |
|
55 |
proof (cases "x \<in> f ` space M") |
|
56 |
case True then obtain y where "x = f y" by auto |
|
41969 | 57 |
from closed_singleton[of "f y"] |
40859 | 58 |
have "{f y} \<in> sets borel" by (rule borel_closed) |
38656 | 59 |
with assms show ?thesis |
40859 | 60 |
unfolding in_borel_measurable_borel `x = f y` by auto |
38656 | 61 |
next |
62 |
case False hence "f -` {x} \<inter> space M = {}" by auto |
|
63 |
thus ?thesis by auto |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
64 |
qed |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
65 |
|
47694 | 66 |
lemma borel_measurableI: |
38656 | 67 |
fixes f :: "'a \<Rightarrow> 'x\<Colon>topological_space" |
68 |
assumes "\<And>S. open S \<Longrightarrow> f -` S \<inter> space M \<in> sets M" |
|
69 |
shows "f \<in> borel_measurable M" |
|
40859 | 70 |
unfolding borel_def |
47694 | 71 |
proof (rule measurable_measure_of, simp_all) |
44537
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
72 |
fix S :: "'x set" assume "open S" thus "f -` S \<inter> space M \<in> sets M" |
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
73 |
using assms[of S] by simp |
40859 | 74 |
qed |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
75 |
|
40859 | 76 |
lemma borel_singleton[simp, intro]: |
38656 | 77 |
fixes x :: "'a::t1_space" |
40859 | 78 |
shows "A \<in> sets borel \<Longrightarrow> insert x A \<in> sets borel" |
47694 | 79 |
proof (rule insert_in_sets) |
40859 | 80 |
show "{x} \<in> sets borel" |
41969 | 81 |
using closed_singleton[of x] by (rule borel_closed) |
38656 | 82 |
qed simp |
83 |
||
47694 | 84 |
lemma borel_measurable_const[simp, intro]: |
38656 | 85 |
"(\<lambda>x. c) \<in> borel_measurable M" |
47694 | 86 |
by auto |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
87 |
|
47694 | 88 |
lemma borel_measurable_indicator[simp, intro!]: |
38656 | 89 |
assumes A: "A \<in> sets M" |
90 |
shows "indicator A \<in> borel_measurable M" |
|
46905 | 91 |
unfolding indicator_def [abs_def] using A |
47694 | 92 |
by (auto intro!: measurable_If_set) |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
93 |
|
47694 | 94 |
lemma borel_measurable_indicator_iff: |
40859 | 95 |
"(indicator A :: 'a \<Rightarrow> 'x::{t1_space, zero_neq_one}) \<in> borel_measurable M \<longleftrightarrow> A \<inter> space M \<in> sets M" |
96 |
(is "?I \<in> borel_measurable M \<longleftrightarrow> _") |
|
97 |
proof |
|
98 |
assume "?I \<in> borel_measurable M" |
|
99 |
then have "?I -` {1} \<inter> space M \<in> sets M" |
|
100 |
unfolding measurable_def by auto |
|
101 |
also have "?I -` {1} \<inter> space M = A \<inter> space M" |
|
46905 | 102 |
unfolding indicator_def [abs_def] by auto |
40859 | 103 |
finally show "A \<inter> space M \<in> sets M" . |
104 |
next |
|
105 |
assume "A \<inter> space M \<in> sets M" |
|
106 |
moreover have "?I \<in> borel_measurable M \<longleftrightarrow> |
|
107 |
(indicator (A \<inter> space M) :: 'a \<Rightarrow> 'x) \<in> borel_measurable M" |
|
108 |
by (intro measurable_cong) (auto simp: indicator_def) |
|
109 |
ultimately show "?I \<in> borel_measurable M" by auto |
|
110 |
qed |
|
111 |
||
47694 | 112 |
lemma borel_measurable_subalgebra: |
41545 | 113 |
assumes "sets N \<subseteq> sets M" "space N = space M" "f \<in> borel_measurable N" |
39092 | 114 |
shows "f \<in> borel_measurable M" |
115 |
using assms unfolding measurable_def by auto |
|
116 |
||
38656 | 117 |
section "Borel spaces on euclidean spaces" |
118 |
||
119 |
lemma lessThan_borel[simp, intro]: |
|
120 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 121 |
shows "{..< a} \<in> sets borel" |
122 |
by (blast intro: borel_open) |
|
38656 | 123 |
|
124 |
lemma greaterThan_borel[simp, intro]: |
|
125 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 126 |
shows "{a <..} \<in> sets borel" |
127 |
by (blast intro: borel_open) |
|
38656 | 128 |
|
129 |
lemma greaterThanLessThan_borel[simp, intro]: |
|
130 |
fixes a b :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 131 |
shows "{a<..<b} \<in> sets borel" |
132 |
by (blast intro: borel_open) |
|
38656 | 133 |
|
134 |
lemma atMost_borel[simp, intro]: |
|
135 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 136 |
shows "{..a} \<in> sets borel" |
137 |
by (blast intro: borel_closed) |
|
38656 | 138 |
|
139 |
lemma atLeast_borel[simp, intro]: |
|
140 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 141 |
shows "{a..} \<in> sets borel" |
142 |
by (blast intro: borel_closed) |
|
38656 | 143 |
|
144 |
lemma atLeastAtMost_borel[simp, intro]: |
|
145 |
fixes a b :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 146 |
shows "{a..b} \<in> sets borel" |
147 |
by (blast intro: borel_closed) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
148 |
|
38656 | 149 |
lemma greaterThanAtMost_borel[simp, intro]: |
150 |
fixes a b :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 151 |
shows "{a<..b} \<in> sets borel" |
38656 | 152 |
unfolding greaterThanAtMost_def by blast |
153 |
||
154 |
lemma atLeastLessThan_borel[simp, intro]: |
|
155 |
fixes a b :: "'a\<Colon>ordered_euclidean_space" |
|
40859 | 156 |
shows "{a..<b} \<in> sets borel" |
38656 | 157 |
unfolding atLeastLessThan_def by blast |
158 |
||
159 |
lemma hafspace_less_borel[simp, intro]: |
|
160 |
fixes a :: real |
|
40859 | 161 |
shows "{x::'a::euclidean_space. a < x $$ i} \<in> sets borel" |
162 |
by (auto intro!: borel_open open_halfspace_component_gt) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
163 |
|
38656 | 164 |
lemma hafspace_greater_borel[simp, intro]: |
165 |
fixes a :: real |
|
40859 | 166 |
shows "{x::'a::euclidean_space. x $$ i < a} \<in> sets borel" |
167 |
by (auto intro!: borel_open open_halfspace_component_lt) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
168 |
|
38656 | 169 |
lemma hafspace_less_eq_borel[simp, intro]: |
170 |
fixes a :: real |
|
40859 | 171 |
shows "{x::'a::euclidean_space. a \<le> x $$ i} \<in> sets borel" |
172 |
by (auto intro!: borel_closed closed_halfspace_component_ge) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
173 |
|
38656 | 174 |
lemma hafspace_greater_eq_borel[simp, intro]: |
175 |
fixes a :: real |
|
40859 | 176 |
shows "{x::'a::euclidean_space. x $$ i \<le> a} \<in> sets borel" |
177 |
by (auto intro!: borel_closed closed_halfspace_component_le) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
178 |
|
47694 | 179 |
lemma borel_measurable_less[simp, intro]: |
38656 | 180 |
fixes f :: "'a \<Rightarrow> real" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
181 |
assumes f: "f \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
182 |
assumes g: "g \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
183 |
shows "{w \<in> space M. f w < g w} \<in> sets M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
184 |
proof - |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
185 |
have "{w \<in> space M. f w < g w} = |
38656 | 186 |
(\<Union>r. (f -` {..< of_rat r} \<inter> space M) \<inter> (g -` {of_rat r <..} \<inter> space M))" |
187 |
using Rats_dense_in_real by (auto simp add: Rats_def) |
|
188 |
then show ?thesis using f g |
|
189 |
by simp (blast intro: measurable_sets) |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
190 |
qed |
38656 | 191 |
|
47694 | 192 |
lemma borel_measurable_le[simp, intro]: |
38656 | 193 |
fixes f :: "'a \<Rightarrow> real" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
194 |
assumes f: "f \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
195 |
assumes g: "g \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
196 |
shows "{w \<in> space M. f w \<le> g w} \<in> sets M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
197 |
proof - |
38656 | 198 |
have "{w \<in> space M. f w \<le> g w} = space M - {w \<in> space M. g w < f w}" |
199 |
by auto |
|
200 |
thus ?thesis using f g |
|
201 |
by simp blast |
|
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
202 |
qed |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
203 |
|
47694 | 204 |
lemma borel_measurable_eq[simp, intro]: |
38656 | 205 |
fixes f :: "'a \<Rightarrow> real" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
206 |
assumes f: "f \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
207 |
assumes g: "g \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
208 |
shows "{w \<in> space M. f w = g w} \<in> sets M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
209 |
proof - |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
210 |
have "{w \<in> space M. f w = g w} = |
33536 | 211 |
{w \<in> space M. f w \<le> g w} \<inter> {w \<in> space M. g w \<le> f w}" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
212 |
by auto |
38656 | 213 |
thus ?thesis using f g by auto |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
214 |
qed |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
215 |
|
47694 | 216 |
lemma borel_measurable_neq[simp, intro]: |
38656 | 217 |
fixes f :: "'a \<Rightarrow> real" |
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
218 |
assumes f: "f \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
219 |
assumes g: "g \<in> borel_measurable M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
220 |
shows "{w \<in> space M. f w \<noteq> g w} \<in> sets M" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
221 |
proof - |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
222 |
have "{w \<in> space M. f w \<noteq> g w} = space M - {w \<in> space M. f w = g w}" |
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset
|
223 |
by auto |
38656 | 224 |
thus ?thesis using f g by auto |
225 |
qed |
|
226 |
||
227 |
subsection "Borel space equals sigma algebras over intervals" |
|
228 |
||
229 |
lemma rational_boxes: |
|
230 |
fixes x :: "'a\<Colon>ordered_euclidean_space" |
|
231 |
assumes "0 < e" |
|
232 |
shows "\<exists>a b. (\<forall>i. a $$ i \<in> \<rat>) \<and> (\<forall>i. b $$ i \<in> \<rat>) \<and> x \<in> {a <..< b} \<and> {a <..< b} \<subseteq> ball x e" |
|
233 |
proof - |
|
234 |
def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))" |
|
235 |
then have e: "0 < e'" using assms by (auto intro!: divide_pos_pos) |
|
236 |
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x $$ i \<and> x $$ i - y < e'" (is "\<forall>i. ?th i") |
|
237 |
proof |
|
238 |
fix i from Rats_dense_in_real[of "x $$ i - e'" "x $$ i"] e |
|
239 |
show "?th i" by auto |
|
240 |
qed |
|
241 |
from choice[OF this] guess a .. note a = this |
|
242 |
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x $$ i < y \<and> y - x $$ i < e'" (is "\<forall>i. ?th i") |
|
243 |
proof |
|
244 |
fix i from Rats_dense_in_real[of "x $$ i" "x $$ i + e'"] e |
|
245 |
show "?th i" by auto |
|
246 |
qed |
|
247 |
from choice[OF this] guess b .. note b = this |
|
248 |
{ fix y :: 'a assume *: "Chi a < y" "y < Chi b" |
|
249 |
have "dist x y = sqrt (\<Sum>i<DIM('a). (dist (x $$ i) (y $$ i))\<twosuperior>)" |
|
250 |
unfolding setL2_def[symmetric] by (rule euclidean_dist_l2) |
|
251 |
also have "\<dots> < sqrt (\<Sum>i<DIM('a). e^2 / real (DIM('a)))" |
|
252 |
proof (rule real_sqrt_less_mono, rule setsum_strict_mono) |
|
253 |
fix i assume i: "i \<in> {..<DIM('a)}" |
|
254 |
have "a i < y$$i \<and> y$$i < b i" using * i eucl_less[where 'a='a] by auto |
|
255 |
moreover have "a i < x$$i" "x$$i - a i < e'" using a by auto |
|
256 |
moreover have "x$$i < b i" "b i - x$$i < e'" using b by auto |
|
257 |
ultimately have "\<bar>x$$i - y$$i\<bar> < 2 * e'" by auto |
|
258 |
then have "dist (x $$ i) (y $$ i) < e/sqrt (real (DIM('a)))" |
|
259 |
unfolding e'_def by (auto simp: dist_real_def) |
|
260 |
then have "(dist (x $$ i) (y $$ i))\<twosuperior> < (e/sqrt (real (DIM('a))))\<twosuperior>" |
|
261 |
by (rule power_strict_mono) auto |
|
262 |
then show "(dist (x $$ i) (y $$ i))\<twosuperior> < e\<twosuperior> / real DIM('a)" |
|
263 |
by (simp add: power_divide) |
|
264 |
qed auto |
|
265 |
also have "\<dots> = e" using `0 < e` by (simp add: real_eq_of_nat DIM_positive) |
|
266 |
finally have "dist x y < e" . } |
|
267 |
with a b show ?thesis |
|
268 |
apply (rule_tac exI[of _ "Chi a"]) |
|
269 |
apply (rule_tac exI[of _ "Chi b"]) |
|
270 |
using eucl_less[where 'a='a] by auto |
|
271 |
qed |
|
272 |
||
273 |
lemma ex_rat_list: |
|
274 |
fixes x :: "'a\<Colon>ordered_euclidean_space" |
|
275 |
assumes "\<And> i. x $$ i \<in> \<rat>" |
|
276 |
shows "\<exists> r. length r = DIM('a) \<and> (\<forall> i < DIM('a). of_rat (r ! i) = x $$ i)" |
|
277 |
proof - |
|
278 |
have "\<forall>i. \<exists>r. x $$ i = of_rat r" using assms unfolding Rats_def by blast |
|
279 |
from choice[OF this] guess r .. |
|
280 |
then show ?thesis by (auto intro!: exI[of _ "map r [0 ..< DIM('a)]"]) |
|
281 |
qed |
|
282 |
||
283 |
lemma open_UNION: |
|
284 |
fixes M :: "'a\<Colon>ordered_euclidean_space set" |
|
285 |
assumes "open M" |
|
286 |
shows "M = UNION {(a, b) | a b. {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)} \<subseteq> M} |
|
287 |
(\<lambda> (a, b). {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)})" |
|
288 |
(is "M = UNION ?idx ?box") |
|
289 |
proof safe |
|
290 |
fix x assume "x \<in> M" |
|
291 |
obtain e where e: "e > 0" "ball x e \<subseteq> M" |
|
292 |
using openE[OF assms `x \<in> M`] by auto |
|
293 |
then obtain a b where ab: "x \<in> {a <..< b}" "\<And>i. a $$ i \<in> \<rat>" "\<And>i. b $$ i \<in> \<rat>" "{a <..< b} \<subseteq> ball x e" |
|
294 |
using rational_boxes[OF e(1)] by blast |
|
295 |
then obtain p q where pq: "length p = DIM ('a)" |
|
296 |
"length q = DIM ('a)" |
|
297 |
"\<forall> i < DIM ('a). of_rat (p ! i) = a $$ i \<and> of_rat (q ! i) = b $$ i" |
|
298 |
using ex_rat_list[OF ab(2)] ex_rat_list[OF ab(3)] by blast |
|
299 |
hence p: "Chi (of_rat \<circ> op ! p) = a" |
|
300 |
using euclidean_eq[of "Chi (of_rat \<circ> op ! p)" a] |
|
301 |
unfolding o_def by auto |
|
302 |
from pq have q: "Chi (of_rat \<circ> op ! q) = b" |
|
303 |
using euclidean_eq[of "Chi (of_rat \<circ> op ! q)" b] |
|
304 |
unfolding o_def by auto |
|
305 |
have "x \<in> ?box (p, q)" |
|
306 |
using p q ab by auto |
|
307 |
thus "x \<in> UNION ?idx ?box" using ab e p q exI[of _ p] exI[of _ q] by auto |
|
308 |
qed auto |
|
309 |
||
47694 | 310 |
lemma borel_sigma_sets_subset: |
311 |
"A \<subseteq> sets borel \<Longrightarrow> sigma_sets UNIV A \<subseteq> sets borel" |
|
312 |
using sigma_sets_subset[of A borel] by simp |
|
313 |
||
314 |
lemma borel_eq_sigmaI1: |
|
315 |
fixes F :: "'i \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" |
|
316 |
assumes borel_eq: "borel = sigma UNIV X" |
|
317 |
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (range F))" |
|
318 |
assumes F: "\<And>i. F i \<in> sets borel" |
|
319 |
shows "borel = sigma UNIV (range F)" |
|
320 |
unfolding borel_def |
|
321 |
proof (intro sigma_eqI antisym) |
|
322 |
have borel_rev_eq: "sigma_sets UNIV {S::'a set. open S} = sets borel" |
|
323 |
unfolding borel_def by simp |
|
324 |
also have "\<dots> = sigma_sets UNIV X" |
|
325 |
unfolding borel_eq by simp |
|
326 |
also have "\<dots> \<subseteq> sigma_sets UNIV (range F)" |
|
327 |
using X by (intro sigma_algebra.sigma_sets_subset[OF sigma_algebra_sigma_sets]) auto |
|
328 |
finally show "sigma_sets UNIV {S. open S} \<subseteq> sigma_sets UNIV (range F)" . |
|
329 |
show "sigma_sets UNIV (range F) \<subseteq> sigma_sets UNIV {S. open S}" |
|
330 |
unfolding borel_rev_eq using F by (intro borel_sigma_sets_subset) auto |
|
331 |
qed auto |
|
38656 | 332 |
|
47694 | 333 |
lemma borel_eq_sigmaI2: |
334 |
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" |
|
335 |
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" |
|
336 |
assumes borel_eq: "borel = sigma UNIV (range (\<lambda>(i, j). G i j))" |
|
337 |
assumes X: "\<And>i j. G i j \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" |
|
338 |
assumes F: "\<And>i j. F i j \<in> sets borel" |
|
339 |
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" |
|
340 |
using assms by (intro borel_eq_sigmaI1[where X="range (\<lambda>(i, j). G i j)" and F="(\<lambda>(i, j). F i j)"]) auto |
|
341 |
||
342 |
lemma borel_eq_sigmaI3: |
|
343 |
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" |
|
344 |
assumes borel_eq: "borel = sigma UNIV X" |
|
345 |
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" |
|
346 |
assumes F: "\<And>i j. F i j \<in> sets borel" |
|
347 |
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" |
|
348 |
using assms by (intro borel_eq_sigmaI1[where X=X and F="(\<lambda>(i, j). F i j)"]) auto |
|
349 |
||
350 |
lemma borel_eq_sigmaI4: |
|
351 |
fixes F :: "'i \<Rightarrow> 'a::topological_space set" |
|
352 |
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" |
|
353 |
assumes borel_eq: "borel = sigma UNIV (range (\<lambda>(i, j). G i j))" |
|
354 |
assumes X: "\<And>i j. G i j \<in> sets (sigma UNIV (range F))" |
|
355 |
assumes F: "\<And>i. F i \<in> sets borel" |
|
356 |
shows "borel = sigma UNIV (range F)" |
|
357 |
using assms by (intro borel_eq_sigmaI1[where X="range (\<lambda>(i, j). G i j)" and F=F]) auto |
|
358 |
||
359 |
lemma borel_eq_sigmaI5: |
|
360 |
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and G :: "'l \<Rightarrow> 'a::topological_space set" |
|
361 |
assumes borel_eq: "borel = sigma UNIV (range G)" |
|
362 |
assumes X: "\<And>i. G i \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" |
|
363 |
assumes F: "\<And>i j. F i j \<in> sets borel" |
|
364 |
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" |
|
365 |
using assms by (intro borel_eq_sigmaI1[where X="range G" and F="(\<lambda>(i, j). F i j)"]) auto |
|
38656 | 366 |
|
367 |
lemma halfspace_gt_in_halfspace: |
|
47694 | 368 |
"{x\<Colon>'a. a < x $$ i} \<in> sigma_sets UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a}))" |
369 |
(is "?set \<in> ?SIGMA") |
|
38656 | 370 |
proof - |
47694 | 371 |
interpret sigma_algebra UNIV ?SIGMA |
372 |
by (intro sigma_algebra_sigma_sets) simp_all |
|
373 |
have *: "?set = (\<Union>n. UNIV - {x\<Colon>'a. x $$ i < a + 1 / real (Suc n)})" |
|
38656 | 374 |
proof (safe, simp_all add: not_less) |
375 |
fix x assume "a < x $$ i" |
|
376 |
with reals_Archimedean[of "x $$ i - a"] |
|
377 |
obtain n where "a + 1 / real (Suc n) < x $$ i" |
|
378 |
by (auto simp: inverse_eq_divide field_simps) |
|
379 |
then show "\<exists>n. a + 1 / real (Suc n) \<le> x $$ i" |
|
380 |
by (blast intro: less_imp_le) |
|
381 |
next |
|
382 |
fix x n |
|
383 |
have "a < a + 1 / real (Suc n)" by auto |
|
384 |
also assume "\<dots> \<le> x" |
|
385 |
finally show "a < x" . |
|
386 |
qed |
|
47694 | 387 |
show "?set \<in> ?SIGMA" unfolding * |
388 |
by (auto intro!: Diff) |
|
40859 | 389 |
qed |
38656 | 390 |
|
47694 | 391 |
lemma borel_eq_halfspace_less: |
392 |
"borel = sigma UNIV (range (\<lambda>(a, i). {x::'a::ordered_euclidean_space. x $$ i < a}))" |
|
393 |
(is "_ = ?SIGMA") |
|
394 |
proof (rule borel_eq_sigmaI3[OF borel_def]) |
|
395 |
fix S :: "'a set" assume "S \<in> {S. open S}" |
|
396 |
then have "open S" by simp |
|
397 |
from open_UNION[OF this] |
|
398 |
obtain I where *: "S = |
|
399 |
(\<Union>(a, b)\<in>I. |
|
400 |
(\<Inter> i<DIM('a). {x. (Chi (real_of_rat \<circ> op ! a)::'a) $$ i < x $$ i}) \<inter> |
|
401 |
(\<Inter> i<DIM('a). {x. x $$ i < (Chi (real_of_rat \<circ> op ! b)::'a) $$ i}))" |
|
402 |
unfolding greaterThanLessThan_def |
|
403 |
unfolding eucl_greaterThan_eq_halfspaces[where 'a='a] |
|
404 |
unfolding eucl_lessThan_eq_halfspaces[where 'a='a] |
|
405 |
by blast |
|
406 |
show "S \<in> ?SIGMA" |
|
407 |
unfolding * |
|
408 |
by (safe intro!: countable_UN Int countable_INT) (auto intro!: halfspace_gt_in_halfspace) |
|
409 |
qed auto |
|
38656 | 410 |
|
47694 | 411 |
lemma borel_eq_halfspace_le: |
412 |
"borel = sigma UNIV (range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. x $$ i \<le> a}))" |
|
413 |
(is "_ = ?SIGMA") |
|
414 |
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) |
|
415 |
fix a i |
|
416 |
have *: "{x::'a. x$$i < a} = (\<Union>n. {x. x$$i \<le> a - 1/real (Suc n)})" |
|
417 |
proof (safe, simp_all) |
|
418 |
fix x::'a assume *: "x$$i < a" |
|
419 |
with reals_Archimedean[of "a - x$$i"] |
|
420 |
obtain n where "x $$ i < a - 1 / (real (Suc n))" |
|
421 |
by (auto simp: field_simps inverse_eq_divide) |
|
422 |
then show "\<exists>n. x $$ i \<le> a - 1 / (real (Suc n))" |
|
423 |
by (blast intro: less_imp_le) |
|
424 |
next |
|
425 |
fix x::'a and n |
|
426 |
assume "x$$i \<le> a - 1 / real (Suc n)" |
|
427 |
also have "\<dots> < a" by auto |
|
428 |
finally show "x$$i < a" . |
|
429 |
qed |
|
430 |
show "{x. x$$i < a} \<in> ?SIGMA" unfolding * |
|
431 |
by (safe intro!: countable_UN) auto |
|
432 |
qed auto |
|
38656 | 433 |
|
47694 | 434 |
lemma borel_eq_halfspace_ge: |
435 |
"borel = sigma UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. a \<le> x $$ i}))" |
|
436 |
(is "_ = ?SIGMA") |
|
437 |
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) |
|
438 |
fix a i have *: "{x::'a. x$$i < a} = space ?SIGMA - {x::'a. a \<le> x$$i}" by auto |
|
439 |
show "{x. x$$i < a} \<in> ?SIGMA" unfolding * |
|
440 |
by (safe intro!: compl_sets) auto |
|
441 |
qed auto |
|
38656 | 442 |
|
47694 | 443 |
lemma borel_eq_halfspace_greater: |
444 |
"borel = sigma UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. a < x $$ i}))" |
|
445 |
(is "_ = ?SIGMA") |
|
446 |
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_le]) |
|
447 |
fix a i have *: "{x::'a. x$$i \<le> a} = space ?SIGMA - {x::'a. a < x$$i}" by auto |
|
448 |
show "{x. x$$i \<le> a} \<in> ?SIGMA" unfolding * |
|
449 |
by (safe intro!: compl_sets) auto |
|
450 |
qed auto |
|
451 |
||
452 |
lemma borel_eq_atMost: |
|
453 |
"borel = sigma UNIV (range (\<lambda>a. {..a\<Colon>'a\<Colon>ordered_euclidean_space}))" |
|
454 |
(is "_ = ?SIGMA") |
|
455 |
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) |
|
456 |
fix a i show "{x. x$$i \<le> a} \<in> ?SIGMA" |
|
38656 | 457 |
proof cases |
47694 | 458 |
assume "i < DIM('a)" |
38656 | 459 |
then have *: "{x::'a. x$$i \<le> a} = (\<Union>k::nat. {.. (\<chi>\<chi> n. if n = i then a else real k)})" |
460 |
proof (safe, simp_all add: eucl_le[where 'a='a] split: split_if_asm) |
|
461 |
fix x |
|
462 |
from real_arch_simple[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] guess k::nat .. |
|
463 |
then have "\<And>i. i < DIM('a) \<Longrightarrow> x$$i \<le> real k" |
|
464 |
by (subst (asm) Max_le_iff) auto |
|
465 |
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia \<le> real k" |
|
466 |
by (auto intro!: exI[of _ k]) |
|
467 |
qed |
|
47694 | 468 |
show "{x. x$$i \<le> a} \<in> ?SIGMA" unfolding * |
469 |
by (safe intro!: countable_UN) auto |
|
470 |
qed (auto intro: sigma_sets_top sigma_sets.Empty) |
|
471 |
qed auto |
|
38656 | 472 |
|
47694 | 473 |
lemma borel_eq_greaterThan: |
474 |
"borel = sigma UNIV (range (\<lambda>a\<Colon>'a\<Colon>ordered_euclidean_space. {a<..}))" |
|
475 |
(is "_ = ?SIGMA") |
|
476 |
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) |
|
477 |
fix a i show "{x. x$$i \<le> a} \<in> ?SIGMA" |
|
38656 | 478 |
proof cases |
47694 | 479 |
assume "i < DIM('a)" |
480 |
have "{x::'a. x$$i \<le> a} = UNIV - {x::'a. a < x$$i}" by auto |
|
38656 | 481 |
also have *: "{x::'a. a < x$$i} = (\<Union>k::nat. {(\<chi>\<chi> n. if n = i then a else -real k) <..})" using `i <DIM('a)` |
482 |
proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm) |
|
483 |
fix x |
|
44666 | 484 |
from reals_Archimedean2[of "Max ((\<lambda>i. -x$$i)`{..<DIM('a)})"] |
38656 | 485 |
guess k::nat .. note k = this |
486 |
{ fix i assume "i < DIM('a)" |
|
487 |
then have "-x$$i < real k" |
|
488 |
using k by (subst (asm) Max_less_iff) auto |
|
489 |
then have "- real k < x$$i" by simp } |
|
490 |
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> -real k < x $$ ia" |
|
491 |
by (auto intro!: exI[of _ k]) |
|
492 |
qed |
|
47694 | 493 |
finally show "{x. x$$i \<le> a} \<in> ?SIGMA" |
38656 | 494 |
apply (simp only:) |
495 |
apply (safe intro!: countable_UN Diff) |
|
47694 | 496 |
apply (auto intro: sigma_sets_top) |
46731 | 497 |
done |
47694 | 498 |
qed (auto intro: sigma_sets_top sigma_sets.Empty) |
499 |
qed auto |
|
40859 | 500 |
|
47694 | 501 |
lemma borel_eq_lessThan: |
502 |
"borel = sigma UNIV (range (\<lambda>a\<Colon>'a\<Colon>ordered_euclidean_space. {..<a}))" |
|
503 |
(is "_ = ?SIGMA") |
|
504 |
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_ge]) |
|
505 |
fix a i show "{x. a \<le> x$$i} \<in> ?SIGMA" |
|
40859 | 506 |
proof cases |
507 |
fix a i assume "i < DIM('a)" |
|
47694 | 508 |
have "{x::'a. a \<le> x$$i} = UNIV - {x::'a. x$$i < a}" by auto |
40859 | 509 |
also have *: "{x::'a. x$$i < a} = (\<Union>k::nat. {..< (\<chi>\<chi> n. if n = i then a else real k)})" using `i <DIM('a)` |
510 |
proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm) |
|
511 |
fix x |
|
44666 | 512 |
from reals_Archimedean2[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] |
40859 | 513 |
guess k::nat .. note k = this |
514 |
{ fix i assume "i < DIM('a)" |
|
515 |
then have "x$$i < real k" |
|
516 |
using k by (subst (asm) Max_less_iff) auto |
|
517 |
then have "x$$i < real k" by simp } |
|
518 |
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia < real k" |
|
519 |
by (auto intro!: exI[of _ k]) |
|
520 |
qed |
|
47694 | 521 |
finally show "{x. a \<le> x$$i} \<in> ?SIGMA" |
40859 | 522 |
apply (simp only:) |
523 |
apply (safe intro!: countable_UN Diff) |
|
47694 | 524 |
apply (auto intro: sigma_sets_top) |
46731 | 525 |
done |
47694 | 526 |
qed (auto intro: sigma_sets_top sigma_sets.Empty) |
40859 | 527 |
qed auto |
528 |
||
529 |
lemma borel_eq_atLeastAtMost: |
|
47694 | 530 |
"borel = sigma UNIV (range (\<lambda>(a,b). {a..b} \<Colon>'a\<Colon>ordered_euclidean_space set))" |
531 |
(is "_ = ?SIGMA") |
|
532 |
proof (rule borel_eq_sigmaI5[OF borel_eq_atMost]) |
|
533 |
fix a::'a |
|
534 |
have *: "{..a} = (\<Union>n::nat. {- real n *\<^sub>R One .. a})" |
|
535 |
proof (safe, simp_all add: eucl_le[where 'a='a]) |
|
536 |
fix x |
|
537 |
from real_arch_simple[of "Max ((\<lambda>i. - x$$i)`{..<DIM('a)})"] |
|
538 |
guess k::nat .. note k = this |
|
539 |
{ fix i assume "i < DIM('a)" |
|
540 |
with k have "- x$$i \<le> real k" |
|
541 |
by (subst (asm) Max_le_iff) (auto simp: field_simps) |
|
542 |
then have "- real k \<le> x$$i" by simp } |
|
543 |
then show "\<exists>n::nat. \<forall>i<DIM('a). - real n \<le> x $$ i" |
|
544 |
by (auto intro!: exI[of _ k]) |
|
545 |
qed |
|
546 |
show "{..a} \<in> ?SIGMA" unfolding * |
|
547 |
by (safe intro!: countable_UN) |
|
548 |
(auto intro!: sigma_sets_top) |
|
40859 | 549 |
qed auto |
550 |
||
551 |
lemma borel_eq_greaterThanLessThan: |
|
47694 | 552 |
"borel = sigma UNIV (range (\<lambda> (a, b). {a <..< b} :: 'a \<Colon> ordered_euclidean_space set))" |
40859 | 553 |
(is "_ = ?SIGMA") |
47694 | 554 |
proof (rule borel_eq_sigmaI1[OF borel_def]) |
555 |
fix M :: "'a set" assume "M \<in> {S. open S}" |
|
556 |
then have "open M" by simp |
|
557 |
show "M \<in> ?SIGMA" |
|
558 |
apply (subst open_UNION[OF `open M`]) |
|
559 |
apply (safe intro!: countable_UN) |
|
560 |
apply auto |
|
561 |
done |
|
38656 | 562 |
qed auto |
563 |
||
42862 | 564 |
lemma borel_eq_atLeastLessThan: |
47694 | 565 |
"borel = sigma UNIV (range (\<lambda>(a, b). {a ..< b :: real}))" (is "_ = ?SIGMA") |
566 |
proof (rule borel_eq_sigmaI5[OF borel_eq_lessThan]) |
|
567 |
have move_uminus: "\<And>x y::real. -x \<le> y \<longleftrightarrow> -y \<le> x" by auto |
|
568 |
fix x :: real |
|
569 |
have "{..<x} = (\<Union>i::nat. {-real i ..< x})" |
|
570 |
by (auto simp: move_uminus real_arch_simple) |
|
571 |
then show "{..< x} \<in> ?SIGMA" |
|
572 |
by (auto intro: sigma_sets.intros) |
|
40859 | 573 |
qed auto |
574 |
||
47694 | 575 |
lemma borel_measurable_halfspacesI: |
38656 | 576 |
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" |
47694 | 577 |
assumes F: "borel = sigma UNIV (range F)" |
578 |
and S_eq: "\<And>a i. S a i = f -` F (a,i) \<inter> space M" |
|
579 |
and S: "\<And>a i. \<not> i < DIM('c) \<Longrightarrow> S a i \<in> sets M" |
|
38656 | 580 |
shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a::real. S a i \<in> sets M)" |
581 |
proof safe |
|
582 |
fix a :: real and i assume i: "i < DIM('c)" and f: "f \<in> borel_measurable M" |
|
583 |
then show "S a i \<in> sets M" unfolding assms |
|
47694 | 584 |
by (auto intro!: measurable_sets sigma_sets.Basic simp: assms(1)) |
38656 | 585 |
next |
586 |
assume a: "\<forall>i<DIM('c). \<forall>a. S a i \<in> sets M" |
|
587 |
{ fix a i have "S a i \<in> sets M" |
|
588 |
proof cases |
|
589 |
assume "i < DIM('c)" |
|
590 |
with a show ?thesis unfolding assms(2) by simp |
|
591 |
next |
|
592 |
assume "\<not> i < DIM('c)" |
|
47694 | 593 |
from S[OF this] show ?thesis . |
38656 | 594 |
qed } |
47694 | 595 |
then show "f \<in> borel_measurable M" |
596 |
by (auto intro!: measurable_measure_of simp: S_eq F) |
|
38656 | 597 |
qed |
598 |
||
47694 | 599 |
lemma borel_measurable_iff_halfspace_le: |
38656 | 600 |
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" |
601 |
shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. f w $$ i \<le> a} \<in> sets M)" |
|
40859 | 602 |
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_le]) auto |
38656 | 603 |
|
47694 | 604 |
lemma borel_measurable_iff_halfspace_less: |
38656 | 605 |
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" |
606 |
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. f w $$ i < a} \<in> sets M)" |
|
40859 | 607 |
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_less]) auto |
38656 | 608 |
|
47694 | 609 |
lemma borel_measurable_iff_halfspace_ge: |
38656 | 610 |
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" |
611 |
shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. a \<le> f w $$ i} \<in> sets M)" |
|
40859 | 612 |
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_ge]) auto |
38656 | 613 |
|
47694 | 614 |
lemma borel_measurable_iff_halfspace_greater: |
38656 | 615 |
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" |
616 |
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. a < f w $$ i} \<in> sets M)" |
|
47694 | 617 |
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_greater]) auto |
38656 | 618 |
|
47694 | 619 |
lemma borel_measurable_iff_le: |
38656 | 620 |
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w \<le> a} \<in> sets M)" |
621 |
using borel_measurable_iff_halfspace_le[where 'c=real] by simp |
|
622 |
||
47694 | 623 |
lemma borel_measurable_iff_less: |
38656 | 624 |
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w < a} \<in> sets M)" |
625 |
using borel_measurable_iff_halfspace_less[where 'c=real] by simp |
|
626 |
||
47694 | 627 |
lemma borel_measurable_iff_ge: |
38656 | 628 |
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a \<le> f w} \<in> sets M)" |
629 |
using borel_measurable_iff_halfspace_ge[where 'c=real] by simp |
|
630 |
||
47694 | 631 |
lemma borel_measurable_iff_greater: |
38656 | 632 |
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)" |
633 |
using borel_measurable_iff_halfspace_greater[where 'c=real] by simp |
|
634 |
||
49774 | 635 |
lemma borel_measurable_euclidean_component': |
40859 | 636 |
"(\<lambda>x::'a::euclidean_space. x $$ i) \<in> borel_measurable borel" |
47694 | 637 |
proof (rule borel_measurableI) |
44537
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
638 |
fix S::"real set" assume "open S" |
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
639 |
from open_vimage_euclidean_component[OF this] |
47694 | 640 |
show "(\<lambda>x. x $$ i) -` S \<inter> space borel \<in> sets borel" |
40859 | 641 |
by (auto intro: borel_open) |
642 |
qed |
|
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
643 |
|
49774 | 644 |
lemma borel_measurable_euclidean_component: |
645 |
fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
|
646 |
assumes f: "f \<in> borel_measurable M" |
|
647 |
shows "(\<lambda>x. f x $$ i) \<in> borel_measurable M" |
|
648 |
using measurable_comp[OF f borel_measurable_euclidean_component'] by (simp add: comp_def) |
|
649 |
||
47694 | 650 |
lemma borel_measurable_euclidean_space: |
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
651 |
fixes f :: "'a \<Rightarrow> 'c::ordered_euclidean_space" |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
652 |
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). (\<lambda>x. f x $$ i) \<in> borel_measurable M)" |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
653 |
proof safe |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
654 |
fix i assume "f \<in> borel_measurable M" |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
655 |
then show "(\<lambda>x. f x $$ i) \<in> borel_measurable M" |
41025 | 656 |
by (auto intro: borel_measurable_euclidean_component) |
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
657 |
next |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
658 |
assume f: "\<forall>i<DIM('c). (\<lambda>x. f x $$ i) \<in> borel_measurable M" |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
659 |
then show "f \<in> borel_measurable M" |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
660 |
unfolding borel_measurable_iff_halfspace_le by auto |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
661 |
qed |
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset
|
662 |
|
38656 | 663 |
subsection "Borel measurable operators" |
664 |
||
49774 | 665 |
lemma borel_measurable_continuous_on1: |
666 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" |
|
667 |
assumes "continuous_on UNIV f" |
|
668 |
shows "f \<in> borel_measurable borel" |
|
669 |
apply(rule borel_measurableI) |
|
670 |
using continuous_open_preimage[OF assms] unfolding vimage_def by auto |
|
671 |
||
672 |
lemma borel_measurable_continuous_on: |
|
673 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" |
|
674 |
assumes f: "continuous_on UNIV f" and g: "g \<in> borel_measurable M" |
|
675 |
shows "(\<lambda>x. f (g x)) \<in> borel_measurable M" |
|
676 |
using measurable_comp[OF g borel_measurable_continuous_on1[OF f]] by (simp add: comp_def) |
|
677 |
||
678 |
lemma borel_measurable_continuous_on_open': |
|
679 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t1_space" |
|
680 |
assumes cont: "continuous_on A f" "open A" |
|
681 |
shows "(\<lambda>x. if x \<in> A then f x else c) \<in> borel_measurable borel" (is "?f \<in> _") |
|
682 |
proof (rule borel_measurableI) |
|
683 |
fix S :: "'b set" assume "open S" |
|
684 |
then have "open {x\<in>A. f x \<in> S}" |
|
685 |
by (intro continuous_open_preimage[OF cont]) auto |
|
686 |
then have *: "{x\<in>A. f x \<in> S} \<in> sets borel" by auto |
|
687 |
have "?f -` S \<inter> space borel = |
|
688 |
{x\<in>A. f x \<in> S} \<union> (if c \<in> S then space borel - A else {})" |
|
689 |
by (auto split: split_if_asm) |
|
690 |
also have "\<dots> \<in> sets borel" |
|
691 |
using * `open A` by (auto simp del: space_borel intro!: Un) |
|
692 |
finally show "?f -` S \<inter> space borel \<in> sets borel" . |
|
693 |
qed |
|
694 |
||
695 |
lemma borel_measurable_continuous_on_open: |
|
696 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t1_space" |
|
697 |
assumes cont: "continuous_on A f" "open A" |
|
698 |
assumes g: "g \<in> borel_measurable M" |
|
699 |
shows "(\<lambda>x. if g x \<in> A then f (g x) else c) \<in> borel_measurable M" |
|
700 |
using measurable_comp[OF g borel_measurable_continuous_on_open'[OF cont], of c] |
|
701 |
by (simp add: comp_def) |
|
702 |
||
703 |
lemma borel_measurable_uminus[simp, intro]: |
|
704 |
fixes g :: "'a \<Rightarrow> real" |
|
705 |
assumes g: "g \<in> borel_measurable M" |
|
706 |
shows "(\<lambda>x. - g x) \<in> borel_measurable M" |
|
707 |
by (rule borel_measurable_continuous_on[OF _ g]) (auto intro: continuous_on_minus continuous_on_id) |
|
708 |
||
709 |
lemma euclidean_component_prod: |
|
710 |
fixes x :: "'a :: euclidean_space \<times> 'b :: euclidean_space" |
|
711 |
shows "x $$ i = (if i < DIM('a) then fst x $$ i else snd x $$ (i - DIM('a)))" |
|
712 |
unfolding euclidean_component_def basis_prod_def inner_prod_def by auto |
|
713 |
||
714 |
lemma borel_measurable_Pair[simp, intro]: |
|
715 |
fixes f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" and g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" |
|
716 |
assumes f: "f \<in> borel_measurable M" |
|
717 |
assumes g: "g \<in> borel_measurable M" |
|
718 |
shows "(\<lambda>x. (f x, g x)) \<in> borel_measurable M" |
|
719 |
proof (intro borel_measurable_iff_halfspace_le[THEN iffD2] allI impI) |
|
720 |
fix i and a :: real assume i: "i < DIM('b \<times> 'c)" |
|
721 |
have [simp]: "\<And>P A B C. {w. (P \<longrightarrow> A w \<and> B w) \<and> (\<not> P \<longrightarrow> A w \<and> C w)} = |
|
722 |
{w. A w \<and> (P \<longrightarrow> B w) \<and> (\<not> P \<longrightarrow> C w)}" by auto |
|
723 |
from i f g show "{w \<in> space M. (f w, g w) $$ i \<le> a} \<in> sets M" |
|
724 |
by (auto simp: euclidean_component_prod intro!: sets_Collect borel_measurable_euclidean_component) |
|
725 |
qed |
|
726 |
||
727 |
lemma continuous_on_fst: "continuous_on UNIV fst" |
|
728 |
proof - |
|
729 |
have [simp]: "range fst = UNIV" by (auto simp: image_iff) |
|
730 |
show ?thesis |
|
731 |
using closed_vimage_fst |
|
732 |
by (auto simp: continuous_on_closed closed_closedin vimage_def) |
|
733 |
qed |
|
734 |
||
735 |
lemma continuous_on_snd: "continuous_on UNIV snd" |
|
736 |
proof - |
|
737 |
have [simp]: "range snd = UNIV" by (auto simp: image_iff) |
|
738 |
show ?thesis |
|
739 |
using closed_vimage_snd |
|
740 |
by (auto simp: continuous_on_closed closed_closedin vimage_def) |
|
741 |
qed |
|
742 |
||
743 |
lemma borel_measurable_continuous_Pair: |
|
744 |
fixes f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" and g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" |
|
745 |
assumes [simp]: "f \<in> borel_measurable M" |
|
746 |
assumes [simp]: "g \<in> borel_measurable M" |
|
747 |
assumes H: "continuous_on UNIV (\<lambda>x. H (fst x) (snd x))" |
|
748 |
shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M" |
|
749 |
proof - |
|
750 |
have eq: "(\<lambda>x. H (f x) (g x)) = (\<lambda>x. (\<lambda>x. H (fst x) (snd x)) (f x, g x))" by auto |
|
751 |
show ?thesis |
|
752 |
unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto |
|
753 |
qed |
|
754 |
||
755 |
lemma borel_measurable_add[simp, intro]: |
|
756 |
fixes f g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" |
|
757 |
assumes f: "f \<in> borel_measurable M" |
|
758 |
assumes g: "g \<in> borel_measurable M" |
|
759 |
shows "(\<lambda>x. f x + g x) \<in> borel_measurable M" |
|
760 |
using f g |
|
761 |
by (rule borel_measurable_continuous_Pair) |
|
762 |
(auto intro: continuous_on_fst continuous_on_snd continuous_on_add) |
|
763 |
||
764 |
lemma borel_measurable_setsum[simp, intro]: |
|
765 |
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real" |
|
766 |
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" |
|
767 |
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" |
|
768 |
proof cases |
|
769 |
assume "finite S" |
|
770 |
thus ?thesis using assms by induct auto |
|
771 |
qed simp |
|
772 |
||
773 |
lemma borel_measurable_diff[simp, intro]: |
|
774 |
fixes f :: "'a \<Rightarrow> real" |
|
775 |
assumes f: "f \<in> borel_measurable M" |
|
776 |
assumes g: "g \<in> borel_measurable M" |
|
777 |
shows "(\<lambda>x. f x - g x) \<in> borel_measurable M" |
|
778 |
unfolding diff_minus using assms by fast |
|
779 |
||
780 |
lemma borel_measurable_times[simp, intro]: |
|
781 |
fixes f :: "'a \<Rightarrow> real" |
|
782 |
assumes f: "f \<in> borel_measurable M" |
|
783 |
assumes g: "g \<in> borel_measurable M" |
|
784 |
shows "(\<lambda>x. f x * g x) \<in> borel_measurable M" |
|
785 |
using f g |
|
786 |
by (rule borel_measurable_continuous_Pair) |
|
787 |
(auto intro: continuous_on_fst continuous_on_snd continuous_on_mult) |
|
788 |
||
789 |
lemma continuous_on_dist: |
|
790 |
fixes f :: "'a :: t2_space \<Rightarrow> 'b :: metric_space" |
|
791 |
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. dist (f x) (g x))" |
|
792 |
unfolding continuous_on_eq_continuous_within by (auto simp: continuous_dist) |
|
793 |
||
794 |
lemma borel_measurable_dist[simp, intro]: |
|
795 |
fixes g f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" |
|
796 |
assumes f: "f \<in> borel_measurable M" |
|
797 |
assumes g: "g \<in> borel_measurable M" |
|
798 |
shows "(\<lambda>x. dist (f x) (g x)) \<in> borel_measurable M" |
|
799 |
using f g |
|
800 |
by (rule borel_measurable_continuous_Pair) |
|
801 |
(intro continuous_on_dist continuous_on_fst continuous_on_snd) |
|
802 |
||
47694 | 803 |
lemma affine_borel_measurable_vector: |
38656 | 804 |
fixes f :: "'a \<Rightarrow> 'x::real_normed_vector" |
805 |
assumes "f \<in> borel_measurable M" |
|
806 |
shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M" |
|
807 |
proof (rule borel_measurableI) |
|
808 |
fix S :: "'x set" assume "open S" |
|
809 |
show "(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M" |
|
810 |
proof cases |
|
811 |
assume "b \<noteq> 0" |
|
44537
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
812 |
with `open S` have "open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)" (is "open ?S") |
c10485a6a7af
make HOL-Probability respect set/pred distinction
huffman
parents:
44282
diff
changeset
|
813 |
by (auto intro!: open_affinity simp: scaleR_add_right) |
47694 | 814 |
hence "?S \<in> sets borel" by auto |
38656 | 815 |
moreover |
816 |
from `b \<noteq> 0` have "(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` ?S" |
|
817 |
apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all) |
|
40859 | 818 |
ultimately show ?thesis using assms unfolding in_borel_measurable_borel |
38656 | 819 |
by auto |
820 |
qed simp |
|
821 |
qed |
|
822 |
||
47694 | 823 |
lemma affine_borel_measurable: |
38656 | 824 |
fixes g :: "'a \<Rightarrow> real" |
825 |
assumes g: "g \<in> borel_measurable M" |
|
826 |
shows "(\<lambda>x. a + (g x) * b) \<in> borel_measurable M" |
|
827 |
using affine_borel_measurable_vector[OF assms] by (simp add: mult_commute) |
|
828 |
||
47694 | 829 |
lemma borel_measurable_setprod[simp, intro]: |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
830 |
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real" |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
831 |
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
832 |
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
833 |
proof cases |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
834 |
assume "finite S" |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
835 |
thus ?thesis using assms by induct auto |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
836 |
qed simp |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
837 |
|
47694 | 838 |
lemma borel_measurable_inverse[simp, intro]: |
38656 | 839 |
fixes f :: "'a \<Rightarrow> real" |
49774 | 840 |
assumes f: "f \<in> borel_measurable M" |
35692 | 841 |
shows "(\<lambda>x. inverse (f x)) \<in> borel_measurable M" |
49774 | 842 |
proof - |
843 |
have *: "\<And>x::real. inverse x = (if x \<in> UNIV - {0} then inverse x else 0)" by auto |
|
844 |
show ?thesis |
|
845 |
apply (subst *) |
|
846 |
apply (rule borel_measurable_continuous_on_open) |
|
847 |
apply (auto intro!: f continuous_on_inverse continuous_on_id) |
|
848 |
done |
|
35692 | 849 |
qed |
850 |
||
47694 | 851 |
lemma borel_measurable_divide[simp, intro]: |
38656 | 852 |
fixes f :: "'a \<Rightarrow> real" |
35692 | 853 |
assumes "f \<in> borel_measurable M" |
854 |
and "g \<in> borel_measurable M" |
|
855 |
shows "(\<lambda>x. f x / g x) \<in> borel_measurable M" |
|
856 |
unfolding field_divide_inverse |
|
38656 | 857 |
by (rule borel_measurable_inverse borel_measurable_times assms)+ |
858 |
||
47694 | 859 |
lemma borel_measurable_max[intro, simp]: |
38656 | 860 |
fixes f g :: "'a \<Rightarrow> real" |
861 |
assumes "f \<in> borel_measurable M" |
|
862 |
assumes "g \<in> borel_measurable M" |
|
863 |
shows "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M" |
|
49774 | 864 |
unfolding max_def by (auto intro!: assms measurable_If) |
38656 | 865 |
|
47694 | 866 |
lemma borel_measurable_min[intro, simp]: |
38656 | 867 |
fixes f g :: "'a \<Rightarrow> real" |
868 |
assumes "f \<in> borel_measurable M" |
|
869 |
assumes "g \<in> borel_measurable M" |
|
870 |
shows "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M" |
|
49774 | 871 |
unfolding min_def by (auto intro!: assms measurable_If) |
38656 | 872 |
|
47694 | 873 |
lemma borel_measurable_abs[simp, intro]: |
38656 | 874 |
assumes "f \<in> borel_measurable M" |
875 |
shows "(\<lambda>x. \<bar>f x :: real\<bar>) \<in> borel_measurable M" |
|
876 |
proof - |
|
877 |
have *: "\<And>x. \<bar>f x\<bar> = max 0 (f x) + max 0 (- f x)" by (simp add: max_def) |
|
878 |
show ?thesis unfolding * using assms by auto |
|
879 |
qed |
|
880 |
||
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
881 |
lemma borel_measurable_nth[simp, intro]: |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
882 |
"(\<lambda>x::real^'n. x $ i) \<in> borel_measurable borel" |
49774 | 883 |
using borel_measurable_euclidean_component' |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
884 |
unfolding nth_conv_component by auto |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset
|
885 |
|
47694 | 886 |
lemma convex_measurable: |
42990
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
887 |
fixes a b :: real |
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
888 |
assumes X: "X \<in> borel_measurable M" "X ` space M \<subseteq> { a <..< b}" |
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
889 |
assumes q: "convex_on { a <..< b} q" |
49774 | 890 |
shows "(\<lambda>x. q (X x)) \<in> borel_measurable M" |
42990
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
891 |
proof - |
49774 | 892 |
have "(\<lambda>x. if X x \<in> {a <..< b} then q (X x) else 0) \<in> borel_measurable M" (is "?qX") |
893 |
proof (rule borel_measurable_continuous_on_open[OF _ _ X(1)]) |
|
42990
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
894 |
show "open {a<..<b}" by auto |
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
895 |
from this q show "continuous_on {a<..<b} q" |
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
896 |
by (rule convex_on_continuous) |
41830 | 897 |
qed |
49774 | 898 |
moreover have "?qX \<longleftrightarrow> (\<lambda>x. q (X x)) \<in> borel_measurable M" |
42990
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
899 |
using X by (intro measurable_cong) auto |
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset
|
900 |
ultimately show ?thesis by simp |
41830 | 901 |
qed |
902 |
||
49774 | 903 |
lemma borel_measurable_ln[simp,intro]: |
904 |
assumes f: "f \<in> borel_measurable M" |
|
905 |
shows "(\<lambda>x. ln (f x)) \<in> borel_measurable M" |
|
41830 | 906 |
proof - |
907 |
{ fix x :: real assume x: "x \<le> 0" |
|
908 |
{ fix x::real assume "x \<le> 0" then have "\<And>u. exp u = x \<longleftrightarrow> False" by auto } |
|
49774 | 909 |
from this[of x] x this[of 0] have "ln 0 = ln x" |
910 |
by (auto simp: ln_def) } |
|
911 |
note ln_imp = this |
|
912 |
have "(\<lambda>x. if f x \<in> {0<..} then ln (f x) else ln 0) \<in> borel_measurable M" |
|
913 |
proof (rule borel_measurable_continuous_on_open[OF _ _ f]) |
|
914 |
show "continuous_on {0<..} ln" |
|
915 |
by (auto intro!: continuous_at_imp_continuous_on DERIV_ln DERIV_isCont |
|
41830 | 916 |
simp: continuous_isCont[symmetric]) |
917 |
show "open ({0<..}::real set)" by auto |
|
918 |
qed |
|
49774 | 919 |
also have "(\<lambda>x. if x \<in> {0<..} then ln x else ln 0) = ln" |
920 |
by (simp add: fun_eq_iff not_less ln_imp) |
|
41830 | 921 |
finally show ?thesis . |
922 |
qed |
|
923 |
||
47694 | 924 |
lemma borel_measurable_log[simp,intro]: |
49774 | 925 |
"f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. log b (f x)) \<in> borel_measurable M" |
926 |
unfolding log_def by auto |
|
41830 | 927 |
|
47761 | 928 |
lemma borel_measurable_real_floor: |
929 |
"(\<lambda>x::real. real \<lfloor>x\<rfloor>) \<in> borel_measurable borel" |
|
930 |
unfolding borel_measurable_iff_ge |
|
931 |
proof (intro allI) |
|
932 |
fix a :: real |
|
933 |
{ fix x have "a \<le> real \<lfloor>x\<rfloor> \<longleftrightarrow> real \<lceil>a\<rceil> \<le> x" |
|
934 |
using le_floor_eq[of "\<lceil>a\<rceil>" x] ceiling_le_iff[of a "\<lfloor>x\<rfloor>"] |
|
935 |
unfolding real_eq_of_int by simp } |
|
936 |
then have "{w::real \<in> space borel. a \<le> real \<lfloor>w\<rfloor>} = {real \<lceil>a\<rceil>..}" by auto |
|
937 |
then show "{w::real \<in> space borel. a \<le> real \<lfloor>w\<rfloor>} \<in> sets borel" by auto |
|
938 |
qed |
|
939 |
||
940 |
lemma borel_measurable_real_natfloor[intro, simp]: |
|
941 |
assumes "f \<in> borel_measurable M" |
|
942 |
shows "(\<lambda>x. real (natfloor (f x))) \<in> borel_measurable M" |
|
943 |
proof - |
|
944 |
have "\<And>x. real (natfloor (f x)) = max 0 (real \<lfloor>f x\<rfloor>)" |
|
945 |
by (auto simp: max_def natfloor_def) |
|
946 |
with borel_measurable_max[OF measurable_comp[OF assms borel_measurable_real_floor] borel_measurable_const] |
|
947 |
show ?thesis by (simp add: comp_def) |
|
948 |
qed |
|
949 |
||
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
950 |
subsection "Borel space on the extended reals" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
951 |
|
47694 | 952 |
lemma borel_measurable_ereal[simp, intro]: |
43920 | 953 |
assumes f: "f \<in> borel_measurable M" shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" |
49774 | 954 |
using continuous_on_ereal f by (rule borel_measurable_continuous_on) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
955 |
|
49774 | 956 |
lemma borel_measurable_real_of_ereal[simp, intro]: |
957 |
fixes f :: "'a \<Rightarrow> ereal" |
|
958 |
assumes f: "f \<in> borel_measurable M" |
|
959 |
shows "(\<lambda>x. real (f x)) \<in> borel_measurable M" |
|
960 |
proof - |
|
961 |
have "(\<lambda>x. if f x \<in> UNIV - { \<infinity>, - \<infinity> } then real (f x) else 0) \<in> borel_measurable M" |
|
962 |
using continuous_on_real |
|
963 |
by (rule borel_measurable_continuous_on_open[OF _ _ f]) auto |
|
964 |
also have "(\<lambda>x. if f x \<in> UNIV - { \<infinity>, - \<infinity> } then real (f x) else 0) = (\<lambda>x. real (f x))" |
|
965 |
by auto |
|
966 |
finally show ?thesis . |
|
967 |
qed |
|
968 |
||
969 |
lemma borel_measurable_ereal_cases: |
|
970 |
fixes f :: "'a \<Rightarrow> ereal" |
|
971 |
assumes f: "f \<in> borel_measurable M" |
|
972 |
assumes H: "(\<lambda>x. H (ereal (real (f x)))) \<in> borel_measurable M" |
|
973 |
shows "(\<lambda>x. H (f x)) \<in> borel_measurable M" |
|
974 |
proof - |
|
975 |
let ?F = "\<lambda>x. if x \<in> f -` {\<infinity>} then H \<infinity> else if x \<in> f -` {-\<infinity>} then H (-\<infinity>) else H (ereal (real (f x)))" |
|
976 |
{ fix x have "H (f x) = ?F x" by (cases "f x") auto } |
|
977 |
moreover |
|
978 |
have "?F \<in> borel_measurable M" |
|
979 |
by (intro measurable_If_set f measurable_sets[OF f] H) auto |
|
980 |
ultimately |
|
981 |
show ?thesis by simp |
|
47694 | 982 |
qed |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
983 |
|
49774 | 984 |
lemma |
985 |
fixes f :: "'a \<Rightarrow> ereal" assumes f[simp]: "f \<in> borel_measurable M" |
|
986 |
shows borel_measurable_ereal_abs[intro, simp]: "(\<lambda>x. \<bar>f x\<bar>) \<in> borel_measurable M" |
|
987 |
and borel_measurable_ereal_inverse[simp, intro]: "(\<lambda>x. inverse (f x) :: ereal) \<in> borel_measurable M" |
|
988 |
and borel_measurable_uminus_ereal[intro]: "(\<lambda>x. - f x :: ereal) \<in> borel_measurable M" |
|
989 |
by (auto simp del: abs_real_of_ereal simp: borel_measurable_ereal_cases[OF f] measurable_If) |
|
990 |
||
991 |
lemma borel_measurable_uminus_eq_ereal[simp]: |
|
992 |
"(\<lambda>x. - f x :: ereal) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" (is "?l = ?r") |
|
993 |
proof |
|
994 |
assume ?l from borel_measurable_uminus_ereal[OF this] show ?r by simp |
|
995 |
qed auto |
|
996 |
||
997 |
lemma sets_Collect_If_set: |
|
998 |
assumes "A \<inter> space M \<in> sets M" "{x \<in> space M. P x} \<in> sets M" "{x \<in> space M. Q x} \<in> sets M" |
|
999 |
shows "{x \<in> space M. if x \<in> A then P x else Q x} \<in> sets M" |
|
1000 |
proof - |
|
1001 |
have *: "{x \<in> space M. if x \<in> A then P x else Q x} = |
|
1002 |
{x \<in> space M. if x \<in> A \<inter> space M then P x else Q x}" by auto |
|
1003 |
show ?thesis unfolding * unfolding if_bool_eq_conj using assms |
|
1004 |
by (auto intro!: sets_Collect simp: Int_def conj_commute) |
|
1005 |
qed |
|
1006 |
||
1007 |
lemma set_Collect_ereal2: |
|
1008 |
fixes f g :: "'a \<Rightarrow> ereal" |
|
1009 |
assumes f: "f \<in> borel_measurable M" |
|
1010 |
assumes g: "g \<in> borel_measurable M" |
|
1011 |
assumes H: "{x \<in> space M. H (ereal (real (f x))) (ereal (real (g x)))} \<in> sets M" |
|
1012 |
"{x \<in> space M. H (-\<infinity>) (ereal (real (g x)))} \<in> sets M" |
|
1013 |
"{x \<in> space M. H (\<infinity>) (ereal (real (g x)))} \<in> sets M" |
|
1014 |
"{x \<in> space M. H (ereal (real (f x))) (-\<infinity>)} \<in> sets M" |
|
1015 |
"{x \<in> space M. H (ereal (real (f x))) (\<infinity>)} \<in> sets M" |
|
1016 |
shows "{x \<in> space M. H (f x) (g x)} \<in> sets M" |
|
1017 |
proof - |
|
1018 |
let ?G = "\<lambda>y x. if x \<in> g -` {\<infinity>} then H y \<infinity> else if x \<in> g -` {-\<infinity>} then H y (-\<infinity>) else H y (ereal (real (g x)))" |
|
1019 |
let ?F = "\<lambda>x. if x \<in> f -` {\<infinity>} then ?G \<infinity> x else if x \<in> f -` {-\<infinity>} then ?G (-\<infinity>) x else ?G (ereal (real (f x))) x" |
|
1020 |
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto } |
|
1021 |
moreover |
|
1022 |
have "{x \<in> space M. ?F x} \<in> sets M" |
|
1023 |
by (intro sets_Collect H measurable_sets[OF f] measurable_sets[OF g] sets_Collect_If_set) auto |
|
1024 |
ultimately |
|
1025 |
show ?thesis by simp |
|
1026 |
qed |
|
1027 |
||
1028 |
lemma |
|
1029 |
fixes f g :: "'a \<Rightarrow> ereal" |
|
1030 |
assumes f: "f \<in> borel_measurable M" |
|
1031 |
assumes g: "g \<in> borel_measurable M" |
|
1032 |
shows borel_measurable_ereal_le[intro,simp]: "{x \<in> space M. f x \<le> g x} \<in> sets M" |
|
1033 |
and borel_measurable_ereal_less[intro,simp]: "{x \<in> space M. f x < g x} \<in> sets M" |
|
1034 |
and borel_measurable_ereal_eq[intro,simp]: "{w \<in> space M. f w = g w} \<in> sets M" |
|
1035 |
and borel_measurable_ereal_neq[intro,simp]: "{w \<in> space M. f w \<noteq> g w} \<in> sets M" |
|
1036 |
using f g by (auto simp: f g set_Collect_ereal2[OF f g] intro!: sets_Collect_neg) |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1037 |
|
47694 | 1038 |
lemma borel_measurable_ereal_iff: |
43920 | 1039 |
shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1040 |
proof |
43920 | 1041 |
assume "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" |
1042 |
from borel_measurable_real_of_ereal[OF this] |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1043 |
show "f \<in> borel_measurable M" by auto |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1044 |
qed auto |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1045 |
|
47694 | 1046 |
lemma borel_measurable_ereal_iff_real: |
43923 | 1047 |
fixes f :: "'a \<Rightarrow> ereal" |
1048 |
shows "f \<in> borel_measurable M \<longleftrightarrow> |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1049 |
((\<lambda>x. real (f x)) \<in> borel_measurable M \<and> f -` {\<infinity>} \<inter> space M \<in> sets M \<and> f -` {-\<infinity>} \<inter> space M \<in> sets M)" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1050 |
proof safe |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1051 |
assume *: "(\<lambda>x. real (f x)) \<in> borel_measurable M" "f -` {\<infinity>} \<inter> space M \<in> sets M" "f -` {-\<infinity>} \<inter> space M \<in> sets M" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1052 |
have "f -` {\<infinity>} \<inter> space M = {x\<in>space M. f x = \<infinity>}" "f -` {-\<infinity>} \<inter> space M = {x\<in>space M. f x = -\<infinity>}" by auto |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1053 |
with * have **: "{x\<in>space M. f x = \<infinity>} \<in> sets M" "{x\<in>space M. f x = -\<infinity>} \<in> sets M" by simp_all |
46731 | 1054 |
let ?f = "\<lambda>x. if f x = \<infinity> then \<infinity> else if f x = -\<infinity> then -\<infinity> else ereal (real (f x))" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1055 |
have "?f \<in> borel_measurable M" using * ** by (intro measurable_If) auto |
43920 | 1056 |
also have "?f = f" by (auto simp: fun_eq_iff ereal_real) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1057 |
finally show "f \<in> borel_measurable M" . |
43920 | 1058 |
qed (auto intro: measurable_sets borel_measurable_real_of_ereal) |
41830 | 1059 |
|
47694 | 1060 |
lemma borel_measurable_eq_atMost_ereal: |
43923 | 1061 |
fixes f :: "'a \<Rightarrow> ereal" |
1062 |
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..a} \<inter> space M \<in> sets M)" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1063 |
proof (intro iffI allI) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1064 |
assume pos[rule_format]: "\<forall>a. f -` {..a} \<inter> space M \<in> sets M" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1065 |
show "f \<in> borel_measurable M" |
43920 | 1066 |
unfolding borel_measurable_ereal_iff_real borel_measurable_iff_le |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1067 |
proof (intro conjI allI) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1068 |
fix a :: real |
43920 | 1069 |
{ fix x :: ereal assume *: "\<forall>i::nat. real i < x" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1070 |
have "x = \<infinity>" |
43920 | 1071 |
proof (rule ereal_top) |
44666 | 1072 |
fix B from reals_Archimedean2[of B] guess n .. |
43920 | 1073 |
then have "ereal B < real n" by auto |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1074 |
with * show "B \<le> x" by (metis less_trans less_imp_le) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1075 |
qed } |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1076 |
then have "f -` {\<infinity>} \<inter> space M = space M - (\<Union>i::nat. f -` {.. real i} \<inter> space M)" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1077 |
by (auto simp: not_le) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1078 |
then show "f -` {\<infinity>} \<inter> space M \<in> sets M" using pos by (auto simp del: UN_simps intro!: Diff) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1079 |
moreover |
43923 | 1080 |
have "{-\<infinity>::ereal} = {..-\<infinity>}" by auto |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1081 |
then show "f -` {-\<infinity>} \<inter> space M \<in> sets M" using pos by auto |
43920 | 1082 |
moreover have "{x\<in>space M. f x \<le> ereal a} \<in> sets M" |
1083 |
using pos[of "ereal a"] by (simp add: vimage_def Int_def conj_commute) |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1084 |
moreover have "{w \<in> space M. real (f w) \<le> a} = |
43920 | 1085 |
(if a < 0 then {w \<in> space M. f w \<le> ereal a} - f -` {-\<infinity>} \<inter> space M |
1086 |
else {w \<in> space M. f w \<le> ereal a} \<union> (f -` {\<infinity>} \<inter> space M) \<union> (f -` {-\<infinity>} \<inter> space M))" (is "?l = ?r") |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1087 |
proof (intro set_eqI) fix x show "x \<in> ?l \<longleftrightarrow> x \<in> ?r" by (cases "f x") auto qed |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1088 |
ultimately show "{w \<in> space M. real (f w) \<le> a} \<in> sets M" by auto |
35582 | 1089 |
qed |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1090 |
qed (simp add: measurable_sets) |
35582 | 1091 |
|
47694 | 1092 |
lemma borel_measurable_eq_atLeast_ereal: |
43920 | 1093 |
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a..} \<inter> space M \<in> sets M)" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1094 |
proof |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1095 |
assume pos: "\<forall>a. f -` {a..} \<inter> space M \<in> sets M" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1096 |
moreover have "\<And>a. (\<lambda>x. - f x) -` {..a} = f -` {-a ..}" |
43920 | 1097 |
by (auto simp: ereal_uminus_le_reorder) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1098 |
ultimately have "(\<lambda>x. - f x) \<in> borel_measurable M" |
43920 | 1099 |
unfolding borel_measurable_eq_atMost_ereal by auto |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1100 |
then show "f \<in> borel_measurable M" by simp |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1101 |
qed (simp add: measurable_sets) |
35582 | 1102 |
|
49774 | 1103 |
lemma greater_eq_le_measurable: |
1104 |
fixes f :: "'a \<Rightarrow> 'c::linorder" |
|
1105 |
shows "f -` {..< a} \<inter> space M \<in> sets M \<longleftrightarrow> f -` {a ..} \<inter> space M \<in> sets M" |
|
1106 |
proof |
|
1107 |
assume "f -` {a ..} \<inter> space M \<in> sets M" |
|
1108 |
moreover have "f -` {..< a} \<inter> space M = space M - f -` {a ..} \<inter> space M" by auto |
|
1109 |
ultimately show "f -` {..< a} \<inter> space M \<in> sets M" by auto |
|
1110 |
next |
|
1111 |
assume "f -` {..< a} \<inter> space M \<in> sets M" |
|
1112 |
moreover have "f -` {a ..} \<inter> space M = space M - f -` {..< a} \<inter> space M" by auto |
|
1113 |
ultimately show "f -` {a ..} \<inter> space M \<in> sets M" by auto |
|
1114 |
qed |
|
1115 |
||
47694 | 1116 |
lemma borel_measurable_ereal_iff_less: |
43920 | 1117 |
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..< a} \<inter> space M \<in> sets M)" |
1118 |
unfolding borel_measurable_eq_atLeast_ereal greater_eq_le_measurable .. |
|
38656 | 1119 |
|
49774 | 1120 |
lemma less_eq_ge_measurable: |
1121 |
fixes f :: "'a \<Rightarrow> 'c::linorder" |
|
1122 |
shows "f -` {a <..} \<inter> space M \<in> sets M \<longleftrightarrow> f -` {..a} \<inter> space M \<in> sets M" |
|
1123 |
proof |
|
1124 |
assume "f -` {a <..} \<inter> space M \<in> sets M" |
|
1125 |
moreover have "f -` {..a} \<inter> space M = space M - f -` {a <..} \<inter> space M" by auto |
|
1126 |
ultimately show "f -` {..a} \<inter> space M \<in> sets M" by auto |
|
1127 |
next |
|
1128 |
assume "f -` {..a} \<inter> space M \<in> sets M" |
|
1129 |
moreover have "f -` {a <..} \<inter> space M = space M - f -` {..a} \<inter> space M" by auto |
|
1130 |
ultimately show "f -` {a <..} \<inter> space M \<in> sets M" by auto |
|
1131 |
qed |
|
1132 |
||
47694 | 1133 |
lemma borel_measurable_ereal_iff_ge: |
43920 | 1134 |
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a <..} \<inter> space M \<in> sets M)" |
1135 |
unfolding borel_measurable_eq_atMost_ereal less_eq_ge_measurable .. |
|
38656 | 1136 |
|
49774 | 1137 |
lemma borel_measurable_ereal2: |
1138 |
fixes f g :: "'a \<Rightarrow> ereal" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1139 |
assumes f: "f \<in> borel_measurable M" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1140 |
assumes g: "g \<in> borel_measurable M" |
49774 | 1141 |
assumes H: "(\<lambda>x. H (ereal (real (f x))) (ereal (real (g x)))) \<in> borel_measurable M" |
1142 |
"(\<lambda>x. H (-\<infinity>) (ereal (real (g x)))) \<in> borel_measurable M" |
|
1143 |
"(\<lambda>x. H (\<infinity>) (ereal (real (g x)))) \<in> borel_measurable M" |
|
1144 |
"(\<lambda>x. H (ereal (real (f x))) (-\<infinity>)) \<in> borel_measurable M" |
|
1145 |
"(\<lambda>x. H (ereal (real (f x))) (\<infinity>)) \<in> borel_measurable M" |
|
1146 |
shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1147 |
proof - |
49774 | 1148 |
let ?G = "\<lambda>y x. if x \<in> g -` {\<infinity>} then H y \<infinity> else if x \<in> g -` {-\<infinity>} then H y (-\<infinity>) else H y (ereal (real (g x)))" |
1149 |
let ?F = "\<lambda>x. if x \<in> f -` {\<infinity>} then ?G \<infinity> x else if x \<in> f -` {-\<infinity>} then ?G (-\<infinity>) x else ?G (ereal (real (f x))) x" |
|
1150 |
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto } |
|
1151 |
moreover |
|
1152 |
have "?F \<in> borel_measurable M" |
|
1153 |
by (intro measurable_If_set measurable_sets[OF f] measurable_sets[OF g] H) auto |
|
1154 |
ultimately |
|
1155 |
show ?thesis by simp |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1156 |
qed |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1157 |
|
49774 | 1158 |
lemma |
1159 |
fixes f :: "'a \<Rightarrow> ereal" assumes f: "f \<in> borel_measurable M" |
|
1160 |
shows borel_measurable_ereal_eq_const: "{x\<in>space M. f x = c} \<in> sets M" |
|
1161 |
and borel_measurable_ereal_neq_const: "{x\<in>space M. f x \<noteq> c} \<in> sets M" |
|
1162 |
using f by auto |
|
38656 | 1163 |
|
47694 | 1164 |
lemma split_sets: |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1165 |
"{x\<in>space M. P x \<or> Q x} = {x\<in>space M. P x} \<union> {x\<in>space M. Q x}" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1166 |
"{x\<in>space M. P x \<and> Q x} = {x\<in>space M. P x} \<inter> {x\<in>space M. Q x}" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1167 |
by auto |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1168 |
|
49774 | 1169 |
lemma |
43920 | 1170 |
fixes f :: "'a \<Rightarrow> ereal" |
49774 | 1171 |
assumes [simp]: "f \<in> borel_measurable M" "g \<in> borel_measurable M" |
1172 |
shows borel_measurable_ereal_add[intro, simp]: "(\<lambda>x. f x + g x) \<in> borel_measurable M" |
|
1173 |
and borel_measurable_ereal_times[intro, simp]: "(\<lambda>x. f x * g x) \<in> borel_measurable M" |
|
1174 |
and borel_measurable_ereal_min[simp, intro]: "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M" |
|
1175 |
and borel_measurable_ereal_max[simp, intro]: "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M" |
|
1176 |
by (auto simp add: borel_measurable_ereal2 measurable_If min_def max_def) |
|
1177 |
||
1178 |
lemma |
|
1179 |
fixes f g :: "'a \<Rightarrow> ereal" |
|
1180 |
assumes "f \<in> borel_measurable M" |
|
1181 |
assumes "g \<in> borel_measurable M" |
|
1182 |
shows borel_measurable_ereal_diff[simp, intro]: "(\<lambda>x. f x - g x) \<in> borel_measurable M" |
|
1183 |
and borel_measurable_ereal_divide[simp, intro]: "(\<lambda>x. f x / g x) \<in> borel_measurable M" |
|
1184 |
unfolding minus_ereal_def divide_ereal_def using assms by auto |
|
38656 | 1185 |
|
47694 | 1186 |
lemma borel_measurable_ereal_setsum[simp, intro]: |
43920 | 1187 |
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" |
41096 | 1188 |
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" |
1189 |
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" |
|
1190 |
proof cases |
|
1191 |
assume "finite S" |
|
1192 |
thus ?thesis using assms |
|
1193 |
by induct auto |
|
49774 | 1194 |
qed simp |
38656 | 1195 |
|
47694 | 1196 |
lemma borel_measurable_ereal_setprod[simp, intro]: |
43920 | 1197 |
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" |
38656 | 1198 |
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" |
41096 | 1199 |
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" |
38656 | 1200 |
proof cases |
1201 |
assume "finite S" |
|
41096 | 1202 |
thus ?thesis using assms by induct auto |
1203 |
qed simp |
|
38656 | 1204 |
|
47694 | 1205 |
lemma borel_measurable_SUP[simp, intro]: |
43920 | 1206 |
fixes f :: "'d\<Colon>countable \<Rightarrow> 'a \<Rightarrow> ereal" |
38656 | 1207 |
assumes "\<And>i. i \<in> A \<Longrightarrow> f i \<in> borel_measurable M" |
41097
a1abfa4e2b44
use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents:
41096
diff
changeset
|
1208 |
shows "(\<lambda>x. SUP i : A. f i x) \<in> borel_measurable M" (is "?sup \<in> borel_measurable M") |
43920 | 1209 |
unfolding borel_measurable_ereal_iff_ge |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1210 |
proof |
38656 | 1211 |
fix a |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1212 |
have "?sup -` {a<..} \<inter> space M = (\<Union>i\<in>A. {x\<in>space M. a < f i x})" |
46884 | 1213 |
by (auto simp: less_SUP_iff) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1214 |
then show "?sup -` {a<..} \<inter> space M \<in> sets M" |
38656 | 1215 |
using assms by auto |
1216 |
qed |
|
1217 |
||
47694 | 1218 |
lemma borel_measurable_INF[simp, intro]: |
43920 | 1219 |
fixes f :: "'d :: countable \<Rightarrow> 'a \<Rightarrow> ereal" |
38656 | 1220 |
assumes "\<And>i. i \<in> A \<Longrightarrow> f i \<in> borel_measurable M" |
41097
a1abfa4e2b44
use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents:
41096
diff
changeset
|
1221 |
shows "(\<lambda>x. INF i : A. f i x) \<in> borel_measurable M" (is "?inf \<in> borel_measurable M") |
43920 | 1222 |
unfolding borel_measurable_ereal_iff_less |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1223 |
proof |
38656 | 1224 |
fix a |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1225 |
have "?inf -` {..<a} \<inter> space M = (\<Union>i\<in>A. {x\<in>space M. f i x < a})" |
46884 | 1226 |
by (auto simp: INF_less_iff) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1227 |
then show "?inf -` {..<a} \<inter> space M \<in> sets M" |
38656 | 1228 |
using assms by auto |
1229 |
qed |
|
1230 |
||
49774 | 1231 |
lemma |
43920 | 1232 |
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> ereal" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1233 |
assumes "\<And>i. f i \<in> borel_measurable M" |
49774 | 1234 |
shows borel_measurable_liminf[simp, intro]: "(\<lambda>x. liminf (\<lambda>i. f i x)) \<in> borel_measurable M" |
1235 |
and borel_measurable_limsup[simp, intro]: "(\<lambda>x. limsup (\<lambda>i. f i x)) \<in> borel_measurable M" |
|
1236 |
unfolding liminf_SUPR_INFI limsup_INFI_SUPR using assms by auto |
|
35692 | 1237 |
|
49774 | 1238 |
lemma borel_measurable_ereal_LIMSEQ: |
1239 |
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> ereal" |
|
1240 |
assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x" |
|
1241 |
and u: "\<And>i. u i \<in> borel_measurable M" |
|
1242 |
shows "u' \<in> borel_measurable M" |
|
47694 | 1243 |
proof - |
49774 | 1244 |
have "\<And>x. x \<in> space M \<Longrightarrow> u' x = liminf (\<lambda>n. u n x)" |
1245 |
using u' by (simp add: lim_imp_Liminf[symmetric]) |
|
1246 |
then show ?thesis by (simp add: u cong: measurable_cong) |
|
47694 | 1247 |
qed |
1248 |
||
1249 |
lemma borel_measurable_psuminf[simp, intro]: |
|
43920 | 1250 |
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> ereal" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1251 |
assumes "\<And>i. f i \<in> borel_measurable M" and pos: "\<And>i x. x \<in> space M \<Longrightarrow> 0 \<le> f i x" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1252 |
shows "(\<lambda>x. (\<Sum>i. f i x)) \<in> borel_measurable M" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1253 |
apply (subst measurable_cong) |
43920 | 1254 |
apply (subst suminf_ereal_eq_SUPR) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1255 |
apply (rule pos) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset
|
1256 |
using assms by auto |
39092 | 1257 |
|
1258 |
section "LIMSEQ is borel measurable" |
|
1259 |
||
47694 | 1260 |
lemma borel_measurable_LIMSEQ: |
39092 | 1261 |
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real" |
1262 |
assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x" |
|
1263 |
and u: "\<And>i. u i \<in> borel_measurable M" |
|
1264 |
shows "u' \<in> borel_measurable M" |
|
1265 |
proof - |
|
43920 | 1266 |
have "\<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)" |
46731 | 1267 |
using u' by (simp add: lim_imp_Liminf) |
43920 | 1268 |
moreover from u have "(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M" |
39092 | 1269 |
by auto |
43920 | 1270 |
ultimately show ?thesis by (simp cong: measurable_cong add: borel_measurable_ereal_iff) |
39092 | 1271 |
qed |
1272 |
||
49774 | 1273 |
lemma sets_Collect_Cauchy: |
1274 |
fixes f :: "nat \<Rightarrow> 'a => real" |
|
1275 |
assumes f: "\<And>i. f i \<in> borel_measurable M" |
|
1276 |
shows "{x\<in>space M. Cauchy (\<lambda>i. f i x)} \<in> sets M" |
|
1277 |
unfolding Cauchy_iff2 using f by (auto intro!: sets_Collect) |
|
1278 |
||
1279 |
lemma borel_measurable_lim: |
|
1280 |
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> real" |
|
1281 |
assumes f: "\<And>i. f i \<in> borel_measurable M" |
|
1282 |
shows "(\<lambda>x. lim (\<lambda>i. f i x)) \<in> borel_measurable M" |
|
1283 |
proof - |
|
1284 |
have *: "\<And>x. lim (\<lambda>i. f i x) = |
|
1285 |
(if Cauchy (\<lambda>i. f i x) then lim (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0) else (THE x. False))" |
|
1286 |
by (auto simp: lim_def convergent_eq_cauchy[symmetric]) |
|
1287 |
{ fix x have "convergent (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0)" |
|
1288 |
by (cases "Cauchy (\<lambda>i. f i x)") |
|
1289 |
(auto simp add: convergent_eq_cauchy[symmetric] convergent_def) } |
|
1290 |
note convergent = this |
|
1291 |
show ?thesis |
|
1292 |
unfolding * |
|
1293 |
apply (intro measurable_If sets_Collect_Cauchy f borel_measurable_const) |
|
1294 |
apply (rule borel_measurable_LIMSEQ) |
|
1295 |
apply (rule convergent_LIMSEQ_iff[THEN iffD1, OF convergent]) |
|
1296 |
apply (intro measurable_If sets_Collect_Cauchy f borel_measurable_const) |
|
1297 |
done |
|
1298 |
qed |
|
1299 |
||
1300 |
lemma borel_measurable_suminf: |
|
1301 |
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> real" |
|
1302 |
assumes f: "\<And>i. f i \<in> borel_measurable M" |
|
1303 |
shows "(\<lambda>x. suminf (\<lambda>i. f i x)) \<in> borel_measurable M" |
|
1304 |
unfolding suminf_def sums_def[abs_def] lim_def[symmetric] |
|
1305 |
by (simp add: f borel_measurable_lim) |
|
1306 |
||
1307 |
end |