author  hoelzl 
Fri, 02 Nov 2012 14:00:39 +0100  
changeset 50001  382bd3173584 
parent 49774  dfa8ddb874ce 
child 50002  ce0d316b5b44 
permissions  rwrr 
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 HOLProbability 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 HOLProbability 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 HOLProbability 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 

50001
382bd3173584
add syntax and a.e.rules for (conditional) probability on predicates
hoelzl
parents:
49774
diff
changeset

94 
lemma borel_measurable_indicator': 
382bd3173584
add syntax and a.e.rules for (conditional) probability on predicates
hoelzl
parents:
49774
diff
changeset

95 
"{x\<in>space M. x \<in> A} \<in> sets M \<Longrightarrow> indicator A \<in> borel_measurable M" 
382bd3173584
add syntax and a.e.rules for (conditional) probability on predicates
hoelzl
parents:
49774
diff
changeset

96 
unfolding indicator_def[abs_def] 
382bd3173584
add syntax and a.e.rules for (conditional) probability on predicates
hoelzl
parents:
49774
diff
changeset

97 
by (auto intro!: measurable_If) 
382bd3173584
add syntax and a.e.rules for (conditional) probability on predicates
hoelzl
parents:
49774
diff
changeset

98 

47694  99 
lemma borel_measurable_indicator_iff: 
40859  100 
"(indicator A :: 'a \<Rightarrow> 'x::{t1_space, zero_neq_one}) \<in> borel_measurable M \<longleftrightarrow> A \<inter> space M \<in> sets M" 
101 
(is "?I \<in> borel_measurable M \<longleftrightarrow> _") 

102 
proof 

103 
assume "?I \<in> borel_measurable M" 

104 
then have "?I ` {1} \<inter> space M \<in> sets M" 

105 
unfolding measurable_def by auto 

106 
also have "?I ` {1} \<inter> space M = A \<inter> space M" 

46905  107 
unfolding indicator_def [abs_def] by auto 
40859  108 
finally show "A \<inter> space M \<in> sets M" . 
109 
next 

110 
assume "A \<inter> space M \<in> sets M" 

111 
moreover have "?I \<in> borel_measurable M \<longleftrightarrow> 

112 
(indicator (A \<inter> space M) :: 'a \<Rightarrow> 'x) \<in> borel_measurable M" 

113 
by (intro measurable_cong) (auto simp: indicator_def) 

114 
ultimately show "?I \<in> borel_measurable M" by auto 

115 
qed 

116 

47694  117 
lemma borel_measurable_subalgebra: 
41545  118 
assumes "sets N \<subseteq> sets M" "space N = space M" "f \<in> borel_measurable N" 
39092  119 
shows "f \<in> borel_measurable M" 
120 
using assms unfolding measurable_def by auto 

121 

38656  122 
section "Borel spaces on euclidean spaces" 
123 

124 
lemma lessThan_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 greaterThan_borel[simp, intro]: 

130 
fixes a :: "'a\<Colon>ordered_euclidean_space" 

40859  131 
shows "{a <..} \<in> sets borel" 
132 
by (blast intro: borel_open) 

38656  133 

134 
lemma greaterThanLessThan_borel[simp, intro]: 

135 
fixes a b :: "'a\<Colon>ordered_euclidean_space" 

40859  136 
shows "{a<..<b} \<in> sets borel" 
137 
by (blast intro: borel_open) 

38656  138 

139 
lemma atMost_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 atLeast_borel[simp, intro]: 

145 
fixes a :: "'a\<Colon>ordered_euclidean_space" 

40859  146 
shows "{a..} \<in> sets borel" 
147 
by (blast intro: borel_closed) 

38656  148 

149 
lemma atLeastAtMost_borel[simp, intro]: 

150 
fixes a b :: "'a\<Colon>ordered_euclidean_space" 

40859  151 
shows "{a..b} \<in> sets borel" 
152 
by (blast intro: borel_closed) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

153 

38656  154 
lemma greaterThanAtMost_borel[simp, intro]: 
155 
fixes a b :: "'a\<Colon>ordered_euclidean_space" 

40859  156 
shows "{a<..b} \<in> sets borel" 
38656  157 
unfolding greaterThanAtMost_def by blast 
158 

159 
lemma atLeastLessThan_borel[simp, intro]: 

160 
fixes a b :: "'a\<Colon>ordered_euclidean_space" 

40859  161 
shows "{a..<b} \<in> sets borel" 
38656  162 
unfolding atLeastLessThan_def by blast 
163 

164 
lemma hafspace_less_borel[simp, intro]: 

165 
fixes a :: real 

40859  166 
shows "{x::'a::euclidean_space. a < x $$ i} \<in> sets borel" 
167 
by (auto intro!: borel_open open_halfspace_component_gt) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

168 

38656  169 
lemma hafspace_greater_borel[simp, intro]: 
170 
fixes a :: real 

40859  171 
shows "{x::'a::euclidean_space. x $$ i < a} \<in> sets borel" 
172 
by (auto intro!: borel_open open_halfspace_component_lt) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

173 

38656  174 
lemma hafspace_less_eq_borel[simp, intro]: 
175 
fixes a :: real 

40859  176 
shows "{x::'a::euclidean_space. a \<le> x $$ i} \<in> sets borel" 
177 
by (auto intro!: borel_closed closed_halfspace_component_ge) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

178 

38656  179 
lemma hafspace_greater_eq_borel[simp, intro]: 
180 
fixes a :: real 

40859  181 
shows "{x::'a::euclidean_space. x $$ i \<le> a} \<in> sets borel" 
182 
by (auto intro!: borel_closed closed_halfspace_component_le) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

183 

47694  184 
lemma borel_measurable_less[simp, intro]: 
38656  185 
fixes f :: "'a \<Rightarrow> real" 
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

186 
assumes f: "f \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

187 
assumes g: "g \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

188 
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

189 
proof  
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

190 
have "{w \<in> space M. f w < g w} = 
38656  191 
(\<Union>r. (f ` {..< of_rat r} \<inter> space M) \<inter> (g ` {of_rat r <..} \<inter> space M))" 
192 
using Rats_dense_in_real by (auto simp add: Rats_def) 

193 
then show ?thesis using f g 

194 
by simp (blast intro: measurable_sets) 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

195 
qed 
38656  196 

47694  197 
lemma borel_measurable_le[simp, intro]: 
38656  198 
fixes f :: "'a \<Rightarrow> real" 
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

199 
assumes f: "f \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

200 
assumes g: "g \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

201 
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

202 
proof  
38656  203 
have "{w \<in> space M. f w \<le> g w} = space M  {w \<in> space M. g w < f w}" 
204 
by auto 

205 
thus ?thesis using f g 

206 
by simp blast 

33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

207 
qed 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

208 

47694  209 
lemma borel_measurable_eq[simp, intro]: 
38656  210 
fixes f :: "'a \<Rightarrow> real" 
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

211 
assumes f: "f \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

212 
assumes g: "g \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

213 
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

214 
proof  
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

215 
have "{w \<in> space M. f w = g w} = 
33536  216 
{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

217 
by auto 
38656  218 
thus ?thesis using f g by auto 
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

219 
qed 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

220 

47694  221 
lemma borel_measurable_neq[simp, intro]: 
38656  222 
fixes f :: "'a \<Rightarrow> real" 
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

223 
assumes f: "f \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

224 
assumes g: "g \<in> borel_measurable M" 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

225 
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

226 
proof  
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff
changeset

227 
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

228 
by auto 
38656  229 
thus ?thesis using f g by auto 
230 
qed 

231 

232 
subsection "Borel space equals sigma algebras over intervals" 

233 

234 
lemma rational_boxes: 

235 
fixes x :: "'a\<Colon>ordered_euclidean_space" 

236 
assumes "0 < e" 

237 
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" 

238 
proof  

239 
def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))" 

240 
then have e: "0 < e'" using assms by (auto intro!: divide_pos_pos) 

241 
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x $$ i \<and> x $$ i  y < e'" (is "\<forall>i. ?th i") 

242 
proof 

243 
fix i from Rats_dense_in_real[of "x $$ i  e'" "x $$ i"] e 

244 
show "?th i" by auto 

245 
qed 

246 
from choice[OF this] guess a .. note a = this 

247 
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x $$ i < y \<and> y  x $$ i < e'" (is "\<forall>i. ?th i") 

248 
proof 

249 
fix i from Rats_dense_in_real[of "x $$ i" "x $$ i + e'"] e 

250 
show "?th i" by auto 

251 
qed 

252 
from choice[OF this] guess b .. note b = this 

253 
{ fix y :: 'a assume *: "Chi a < y" "y < Chi b" 

254 
have "dist x y = sqrt (\<Sum>i<DIM('a). (dist (x $$ i) (y $$ i))\<twosuperior>)" 

255 
unfolding setL2_def[symmetric] by (rule euclidean_dist_l2) 

256 
also have "\<dots> < sqrt (\<Sum>i<DIM('a). e^2 / real (DIM('a)))" 

257 
proof (rule real_sqrt_less_mono, rule setsum_strict_mono) 

258 
fix i assume i: "i \<in> {..<DIM('a)}" 

259 
have "a i < y$$i \<and> y$$i < b i" using * i eucl_less[where 'a='a] by auto 

260 
moreover have "a i < x$$i" "x$$i  a i < e'" using a by auto 

261 
moreover have "x$$i < b i" "b i  x$$i < e'" using b by auto 

262 
ultimately have "\<bar>x$$i  y$$i\<bar> < 2 * e'" by auto 

263 
then have "dist (x $$ i) (y $$ i) < e/sqrt (real (DIM('a)))" 

264 
unfolding e'_def by (auto simp: dist_real_def) 

265 
then have "(dist (x $$ i) (y $$ i))\<twosuperior> < (e/sqrt (real (DIM('a))))\<twosuperior>" 

266 
by (rule power_strict_mono) auto 

267 
then show "(dist (x $$ i) (y $$ i))\<twosuperior> < e\<twosuperior> / real DIM('a)" 

268 
by (simp add: power_divide) 

269 
qed auto 

270 
also have "\<dots> = e" using `0 < e` by (simp add: real_eq_of_nat DIM_positive) 

271 
finally have "dist x y < e" . } 

272 
with a b show ?thesis 

273 
apply (rule_tac exI[of _ "Chi a"]) 

274 
apply (rule_tac exI[of _ "Chi b"]) 

275 
using eucl_less[where 'a='a] by auto 

276 
qed 

277 

278 
lemma ex_rat_list: 

279 
fixes x :: "'a\<Colon>ordered_euclidean_space" 

280 
assumes "\<And> i. x $$ i \<in> \<rat>" 

281 
shows "\<exists> r. length r = DIM('a) \<and> (\<forall> i < DIM('a). of_rat (r ! i) = x $$ i)" 

282 
proof  

283 
have "\<forall>i. \<exists>r. x $$ i = of_rat r" using assms unfolding Rats_def by blast 

284 
from choice[OF this] guess r .. 

285 
then show ?thesis by (auto intro!: exI[of _ "map r [0 ..< DIM('a)]"]) 

286 
qed 

287 

288 
lemma open_UNION: 

289 
fixes M :: "'a\<Colon>ordered_euclidean_space set" 

290 
assumes "open M" 

291 
shows "M = UNION {(a, b)  a b. {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)} \<subseteq> M} 

292 
(\<lambda> (a, b). {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)})" 

293 
(is "M = UNION ?idx ?box") 

294 
proof safe 

295 
fix x assume "x \<in> M" 

296 
obtain e where e: "e > 0" "ball x e \<subseteq> M" 

297 
using openE[OF assms `x \<in> M`] by auto 

298 
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" 

299 
using rational_boxes[OF e(1)] by blast 

300 
then obtain p q where pq: "length p = DIM ('a)" 

301 
"length q = DIM ('a)" 

302 
"\<forall> i < DIM ('a). of_rat (p ! i) = a $$ i \<and> of_rat (q ! i) = b $$ i" 

303 
using ex_rat_list[OF ab(2)] ex_rat_list[OF ab(3)] by blast 

304 
hence p: "Chi (of_rat \<circ> op ! p) = a" 

305 
using euclidean_eq[of "Chi (of_rat \<circ> op ! p)" a] 

306 
unfolding o_def by auto 

307 
from pq have q: "Chi (of_rat \<circ> op ! q) = b" 

308 
using euclidean_eq[of "Chi (of_rat \<circ> op ! q)" b] 

309 
unfolding o_def by auto 

310 
have "x \<in> ?box (p, q)" 

311 
using p q ab by auto 

312 
thus "x \<in> UNION ?idx ?box" using ab e p q exI[of _ p] exI[of _ q] by auto 

313 
qed auto 

314 

47694  315 
lemma borel_sigma_sets_subset: 
316 
"A \<subseteq> sets borel \<Longrightarrow> sigma_sets UNIV A \<subseteq> sets borel" 

317 
using sigma_sets_subset[of A borel] by simp 

318 

319 
lemma borel_eq_sigmaI1: 

320 
fixes F :: "'i \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" 

321 
assumes borel_eq: "borel = sigma UNIV X" 

322 
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (range F))" 

323 
assumes F: "\<And>i. F i \<in> sets borel" 

324 
shows "borel = sigma UNIV (range F)" 

325 
unfolding borel_def 

326 
proof (intro sigma_eqI antisym) 

327 
have borel_rev_eq: "sigma_sets UNIV {S::'a set. open S} = sets borel" 

328 
unfolding borel_def by simp 

329 
also have "\<dots> = sigma_sets UNIV X" 

330 
unfolding borel_eq by simp 

331 
also have "\<dots> \<subseteq> sigma_sets UNIV (range F)" 

332 
using X by (intro sigma_algebra.sigma_sets_subset[OF sigma_algebra_sigma_sets]) auto 

333 
finally show "sigma_sets UNIV {S. open S} \<subseteq> sigma_sets UNIV (range F)" . 

334 
show "sigma_sets UNIV (range F) \<subseteq> sigma_sets UNIV {S. open S}" 

335 
unfolding borel_rev_eq using F by (intro borel_sigma_sets_subset) auto 

336 
qed auto 

38656  337 

47694  338 
lemma borel_eq_sigmaI2: 
339 
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" 

340 
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" 

341 
assumes borel_eq: "borel = sigma UNIV (range (\<lambda>(i, j). G i j))" 

342 
assumes X: "\<And>i j. G i j \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" 

343 
assumes F: "\<And>i j. F i j \<in> sets borel" 

344 
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" 

345 
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 

346 

347 
lemma borel_eq_sigmaI3: 

348 
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" 

349 
assumes borel_eq: "borel = sigma UNIV X" 

350 
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" 

351 
assumes F: "\<And>i j. F i j \<in> sets borel" 

352 
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" 

353 
using assms by (intro borel_eq_sigmaI1[where X=X and F="(\<lambda>(i, j). F i j)"]) auto 

354 

355 
lemma borel_eq_sigmaI4: 

356 
fixes F :: "'i \<Rightarrow> 'a::topological_space set" 

357 
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" 

358 
assumes borel_eq: "borel = sigma UNIV (range (\<lambda>(i, j). G i j))" 

359 
assumes X: "\<And>i j. G i j \<in> sets (sigma UNIV (range F))" 

360 
assumes F: "\<And>i. F i \<in> sets borel" 

361 
shows "borel = sigma UNIV (range F)" 

362 
using assms by (intro borel_eq_sigmaI1[where X="range (\<lambda>(i, j). G i j)" and F=F]) auto 

363 

364 
lemma borel_eq_sigmaI5: 

365 
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and G :: "'l \<Rightarrow> 'a::topological_space set" 

366 
assumes borel_eq: "borel = sigma UNIV (range G)" 

367 
assumes X: "\<And>i. G i \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" 

368 
assumes F: "\<And>i j. F i j \<in> sets borel" 

369 
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" 

370 
using assms by (intro borel_eq_sigmaI1[where X="range G" and F="(\<lambda>(i, j). F i j)"]) auto 

38656  371 

372 
lemma halfspace_gt_in_halfspace: 

47694  373 
"{x\<Colon>'a. a < x $$ i} \<in> sigma_sets UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a}))" 
374 
(is "?set \<in> ?SIGMA") 

38656  375 
proof  
47694  376 
interpret sigma_algebra UNIV ?SIGMA 
377 
by (intro sigma_algebra_sigma_sets) simp_all 

378 
have *: "?set = (\<Union>n. UNIV  {x\<Colon>'a. x $$ i < a + 1 / real (Suc n)})" 

38656  379 
proof (safe, simp_all add: not_less) 
380 
fix x assume "a < x $$ i" 

381 
with reals_Archimedean[of "x $$ i  a"] 

382 
obtain n where "a + 1 / real (Suc n) < x $$ i" 

383 
by (auto simp: inverse_eq_divide field_simps) 

384 
then show "\<exists>n. a + 1 / real (Suc n) \<le> x $$ i" 

385 
by (blast intro: less_imp_le) 

386 
next 

387 
fix x n 

388 
have "a < a + 1 / real (Suc n)" by auto 

389 
also assume "\<dots> \<le> x" 

390 
finally show "a < x" . 

391 
qed 

47694  392 
show "?set \<in> ?SIGMA" unfolding * 
393 
by (auto intro!: Diff) 

40859  394 
qed 
38656  395 

47694  396 
lemma borel_eq_halfspace_less: 
397 
"borel = sigma UNIV (range (\<lambda>(a, i). {x::'a::ordered_euclidean_space. x $$ i < a}))" 

398 
(is "_ = ?SIGMA") 

399 
proof (rule borel_eq_sigmaI3[OF borel_def]) 

400 
fix S :: "'a set" assume "S \<in> {S. open S}" 

401 
then have "open S" by simp 

402 
from open_UNION[OF this] 

403 
obtain I where *: "S = 

404 
(\<Union>(a, b)\<in>I. 

405 
(\<Inter> i<DIM('a). {x. (Chi (real_of_rat \<circ> op ! a)::'a) $$ i < x $$ i}) \<inter> 

406 
(\<Inter> i<DIM('a). {x. x $$ i < (Chi (real_of_rat \<circ> op ! b)::'a) $$ i}))" 

407 
unfolding greaterThanLessThan_def 

408 
unfolding eucl_greaterThan_eq_halfspaces[where 'a='a] 

409 
unfolding eucl_lessThan_eq_halfspaces[where 'a='a] 

410 
by blast 

411 
show "S \<in> ?SIGMA" 

412 
unfolding * 

413 
by (safe intro!: countable_UN Int countable_INT) (auto intro!: halfspace_gt_in_halfspace) 

414 
qed auto 

38656  415 

47694  416 
lemma borel_eq_halfspace_le: 
417 
"borel = sigma UNIV (range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. x $$ i \<le> a}))" 

418 
(is "_ = ?SIGMA") 

419 
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) 

420 
fix a i 

421 
have *: "{x::'a. x$$i < a} = (\<Union>n. {x. x$$i \<le> a  1/real (Suc n)})" 

422 
proof (safe, simp_all) 

423 
fix x::'a assume *: "x$$i < a" 

424 
with reals_Archimedean[of "a  x$$i"] 

425 
obtain n where "x $$ i < a  1 / (real (Suc n))" 

426 
by (auto simp: field_simps inverse_eq_divide) 

427 
then show "\<exists>n. x $$ i \<le> a  1 / (real (Suc n))" 

428 
by (blast intro: less_imp_le) 

429 
next 

430 
fix x::'a and n 

431 
assume "x$$i \<le> a  1 / real (Suc n)" 

432 
also have "\<dots> < a" by auto 

433 
finally show "x$$i < a" . 

434 
qed 

435 
show "{x. x$$i < a} \<in> ?SIGMA" unfolding * 

436 
by (safe intro!: countable_UN) auto 

437 
qed auto 

38656  438 

47694  439 
lemma borel_eq_halfspace_ge: 
440 
"borel = sigma UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. a \<le> x $$ i}))" 

441 
(is "_ = ?SIGMA") 

442 
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) 

443 
fix a i have *: "{x::'a. x$$i < a} = space ?SIGMA  {x::'a. a \<le> x$$i}" by auto 

444 
show "{x. x$$i < a} \<in> ?SIGMA" unfolding * 

445 
by (safe intro!: compl_sets) auto 

446 
qed auto 

38656  447 

47694  448 
lemma borel_eq_halfspace_greater: 
449 
"borel = sigma UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. a < x $$ i}))" 

450 
(is "_ = ?SIGMA") 

451 
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_le]) 

452 
fix a i have *: "{x::'a. x$$i \<le> a} = space ?SIGMA  {x::'a. a < x$$i}" by auto 

453 
show "{x. x$$i \<le> a} \<in> ?SIGMA" unfolding * 

454 
by (safe intro!: compl_sets) auto 

455 
qed auto 

456 

457 
lemma borel_eq_atMost: 

458 
"borel = sigma UNIV (range (\<lambda>a. {..a\<Colon>'a\<Colon>ordered_euclidean_space}))" 

459 
(is "_ = ?SIGMA") 

460 
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) 

461 
fix a i show "{x. x$$i \<le> a} \<in> ?SIGMA" 

38656  462 
proof cases 
47694  463 
assume "i < DIM('a)" 
38656  464 
then have *: "{x::'a. x$$i \<le> a} = (\<Union>k::nat. {.. (\<chi>\<chi> n. if n = i then a else real k)})" 
465 
proof (safe, simp_all add: eucl_le[where 'a='a] split: split_if_asm) 

466 
fix x 

467 
from real_arch_simple[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] guess k::nat .. 

468 
then have "\<And>i. i < DIM('a) \<Longrightarrow> x$$i \<le> real k" 

469 
by (subst (asm) Max_le_iff) auto 

470 
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia \<le> real k" 

471 
by (auto intro!: exI[of _ k]) 

472 
qed 

47694  473 
show "{x. x$$i \<le> a} \<in> ?SIGMA" unfolding * 
474 
by (safe intro!: countable_UN) auto 

475 
qed (auto intro: sigma_sets_top sigma_sets.Empty) 

476 
qed auto 

38656  477 

47694  478 
lemma borel_eq_greaterThan: 
479 
"borel = sigma UNIV (range (\<lambda>a\<Colon>'a\<Colon>ordered_euclidean_space. {a<..}))" 

480 
(is "_ = ?SIGMA") 

481 
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) 

482 
fix a i show "{x. x$$i \<le> a} \<in> ?SIGMA" 

38656  483 
proof cases 
47694  484 
assume "i < DIM('a)" 
485 
have "{x::'a. x$$i \<le> a} = UNIV  {x::'a. a < x$$i}" by auto 

38656  486 
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)` 
487 
proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm) 

488 
fix x 

44666  489 
from reals_Archimedean2[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] 
38656  490 
guess k::nat .. note k = this 
491 
{ fix i assume "i < DIM('a)" 

492 
then have "x$$i < real k" 

493 
using k by (subst (asm) Max_less_iff) auto 

494 
then have " real k < x$$i" by simp } 

495 
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> real k < x $$ ia" 

496 
by (auto intro!: exI[of _ k]) 

497 
qed 

47694  498 
finally show "{x. x$$i \<le> a} \<in> ?SIGMA" 
38656  499 
apply (simp only:) 
500 
apply (safe intro!: countable_UN Diff) 

47694  501 
apply (auto intro: sigma_sets_top) 
46731  502 
done 
47694  503 
qed (auto intro: sigma_sets_top sigma_sets.Empty) 
504 
qed auto 

40859  505 

47694  506 
lemma borel_eq_lessThan: 
507 
"borel = sigma UNIV (range (\<lambda>a\<Colon>'a\<Colon>ordered_euclidean_space. {..<a}))" 

508 
(is "_ = ?SIGMA") 

509 
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_ge]) 

510 
fix a i show "{x. a \<le> x$$i} \<in> ?SIGMA" 

40859  511 
proof cases 
512 
fix a i assume "i < DIM('a)" 

47694  513 
have "{x::'a. a \<le> x$$i} = UNIV  {x::'a. x$$i < a}" by auto 
40859  514 
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)` 
515 
proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm) 

516 
fix x 

44666  517 
from reals_Archimedean2[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] 
40859  518 
guess k::nat .. note k = this 
519 
{ fix i assume "i < DIM('a)" 

520 
then have "x$$i < real k" 

521 
using k by (subst (asm) Max_less_iff) auto 

522 
then have "x$$i < real k" by simp } 

523 
then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia < real k" 

524 
by (auto intro!: exI[of _ k]) 

525 
qed 

47694  526 
finally show "{x. a \<le> x$$i} \<in> ?SIGMA" 
40859  527 
apply (simp only:) 
528 
apply (safe intro!: countable_UN Diff) 

47694  529 
apply (auto intro: sigma_sets_top) 
46731  530 
done 
47694  531 
qed (auto intro: sigma_sets_top sigma_sets.Empty) 
40859  532 
qed auto 
533 

534 
lemma borel_eq_atLeastAtMost: 

47694  535 
"borel = sigma UNIV (range (\<lambda>(a,b). {a..b} \<Colon>'a\<Colon>ordered_euclidean_space set))" 
536 
(is "_ = ?SIGMA") 

537 
proof (rule borel_eq_sigmaI5[OF borel_eq_atMost]) 

538 
fix a::'a 

539 
have *: "{..a} = (\<Union>n::nat. { real n *\<^sub>R One .. a})" 

540 
proof (safe, simp_all add: eucl_le[where 'a='a]) 

541 
fix x 

542 
from real_arch_simple[of "Max ((\<lambda>i.  x$$i)`{..<DIM('a)})"] 

543 
guess k::nat .. note k = this 

544 
{ fix i assume "i < DIM('a)" 

545 
with k have " x$$i \<le> real k" 

546 
by (subst (asm) Max_le_iff) (auto simp: field_simps) 

547 
then have " real k \<le> x$$i" by simp } 

548 
then show "\<exists>n::nat. \<forall>i<DIM('a).  real n \<le> x $$ i" 

549 
by (auto intro!: exI[of _ k]) 

550 
qed 

551 
show "{..a} \<in> ?SIGMA" unfolding * 

552 
by (safe intro!: countable_UN) 

553 
(auto intro!: sigma_sets_top) 

40859  554 
qed auto 
555 

556 
lemma borel_eq_greaterThanLessThan: 

47694  557 
"borel = sigma UNIV (range (\<lambda> (a, b). {a <..< b} :: 'a \<Colon> ordered_euclidean_space set))" 
40859  558 
(is "_ = ?SIGMA") 
47694  559 
proof (rule borel_eq_sigmaI1[OF borel_def]) 
560 
fix M :: "'a set" assume "M \<in> {S. open S}" 

561 
then have "open M" by simp 

562 
show "M \<in> ?SIGMA" 

563 
apply (subst open_UNION[OF `open M`]) 

564 
apply (safe intro!: countable_UN) 

565 
apply auto 

566 
done 

38656  567 
qed auto 
568 

42862  569 
lemma borel_eq_atLeastLessThan: 
47694  570 
"borel = sigma UNIV (range (\<lambda>(a, b). {a ..< b :: real}))" (is "_ = ?SIGMA") 
571 
proof (rule borel_eq_sigmaI5[OF borel_eq_lessThan]) 

572 
have move_uminus: "\<And>x y::real. x \<le> y \<longleftrightarrow> y \<le> x" by auto 

573 
fix x :: real 

574 
have "{..<x} = (\<Union>i::nat. {real i ..< x})" 

575 
by (auto simp: move_uminus real_arch_simple) 

576 
then show "{..< x} \<in> ?SIGMA" 

577 
by (auto intro: sigma_sets.intros) 

40859  578 
qed auto 
579 

47694  580 
lemma borel_measurable_halfspacesI: 
38656  581 
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" 
47694  582 
assumes F: "borel = sigma UNIV (range F)" 
583 
and S_eq: "\<And>a i. S a i = f ` F (a,i) \<inter> space M" 

584 
and S: "\<And>a i. \<not> i < DIM('c) \<Longrightarrow> S a i \<in> sets M" 

38656  585 
shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a::real. S a i \<in> sets M)" 
586 
proof safe 

587 
fix a :: real and i assume i: "i < DIM('c)" and f: "f \<in> borel_measurable M" 

588 
then show "S a i \<in> sets M" unfolding assms 

47694  589 
by (auto intro!: measurable_sets sigma_sets.Basic simp: assms(1)) 
38656  590 
next 
591 
assume a: "\<forall>i<DIM('c). \<forall>a. S a i \<in> sets M" 

592 
{ fix a i have "S a i \<in> sets M" 

593 
proof cases 

594 
assume "i < DIM('c)" 

595 
with a show ?thesis unfolding assms(2) by simp 

596 
next 

597 
assume "\<not> i < DIM('c)" 

47694  598 
from S[OF this] show ?thesis . 
38656  599 
qed } 
47694  600 
then show "f \<in> borel_measurable M" 
601 
by (auto intro!: measurable_measure_of simp: S_eq F) 

38656  602 
qed 
603 

47694  604 
lemma borel_measurable_iff_halfspace_le: 
38656  605 
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" 
606 
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  607 
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_le]) auto 
38656  608 

47694  609 
lemma borel_measurable_iff_halfspace_less: 
38656  610 
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" 
611 
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  612 
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_less]) auto 
38656  613 

47694  614 
lemma borel_measurable_iff_halfspace_ge: 
38656  615 
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" 
616 
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  617 
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_ge]) auto 
38656  618 

47694  619 
lemma borel_measurable_iff_halfspace_greater: 
38656  620 
fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space" 
621 
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  622 
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_greater]) auto 
38656  623 

47694  624 
lemma borel_measurable_iff_le: 
38656  625 
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w \<le> a} \<in> sets M)" 
626 
using borel_measurable_iff_halfspace_le[where 'c=real] by simp 

627 

47694  628 
lemma borel_measurable_iff_less: 
38656  629 
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w < a} \<in> sets M)" 
630 
using borel_measurable_iff_halfspace_less[where 'c=real] by simp 

631 

47694  632 
lemma borel_measurable_iff_ge: 
38656  633 
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a \<le> f w} \<in> sets M)" 
634 
using borel_measurable_iff_halfspace_ge[where 'c=real] by simp 

635 

47694  636 
lemma borel_measurable_iff_greater: 
38656  637 
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)" 
638 
using borel_measurable_iff_halfspace_greater[where 'c=real] by simp 

639 

49774  640 
lemma borel_measurable_euclidean_component': 
40859  641 
"(\<lambda>x::'a::euclidean_space. x $$ i) \<in> borel_measurable borel" 
47694  642 
proof (rule borel_measurableI) 
44537
c10485a6a7af
make HOLProbability respect set/pred distinction
huffman
parents:
44282
diff
changeset

643 
fix S::"real set" assume "open S" 
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

644 
from open_vimage_euclidean_component[OF this] 
47694  645 
show "(\<lambda>x. x $$ i) ` S \<inter> space borel \<in> sets borel" 
40859  646 
by (auto intro: borel_open) 
647 
qed 

39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

648 

49774  649 
lemma borel_measurable_euclidean_component: 
650 
fixes f :: "'a \<Rightarrow> 'b::euclidean_space" 

651 
assumes f: "f \<in> borel_measurable M" 

652 
shows "(\<lambda>x. f x $$ i) \<in> borel_measurable M" 

653 
using measurable_comp[OF f borel_measurable_euclidean_component'] by (simp add: comp_def) 

654 

47694  655 
lemma borel_measurable_euclidean_space: 
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

656 
fixes f :: "'a \<Rightarrow> 'c::ordered_euclidean_space" 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

657 
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

658 
proof safe 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

659 
fix i assume "f \<in> borel_measurable M" 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

660 
then show "(\<lambda>x. f x $$ i) \<in> borel_measurable M" 
41025  661 
by (auto intro: borel_measurable_euclidean_component) 
39087
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

662 
next 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

663 
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

664 
then show "f \<in> borel_measurable M" 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

665 
unfolding borel_measurable_iff_halfspace_le by auto 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

666 
qed 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
hoelzl
parents:
39083
diff
changeset

667 

38656  668 
subsection "Borel measurable operators" 
669 

49774  670 
lemma borel_measurable_continuous_on1: 
671 
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" 

672 
assumes "continuous_on UNIV f" 

673 
shows "f \<in> borel_measurable borel" 

674 
apply(rule borel_measurableI) 

675 
using continuous_open_preimage[OF assms] unfolding vimage_def by auto 

676 

677 
lemma borel_measurable_continuous_on: 

678 
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" 

679 
assumes f: "continuous_on UNIV f" and g: "g \<in> borel_measurable M" 

680 
shows "(\<lambda>x. f (g x)) \<in> borel_measurable M" 

681 
using measurable_comp[OF g borel_measurable_continuous_on1[OF f]] by (simp add: comp_def) 

682 

683 
lemma borel_measurable_continuous_on_open': 

684 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t1_space" 

685 
assumes cont: "continuous_on A f" "open A" 

686 
shows "(\<lambda>x. if x \<in> A then f x else c) \<in> borel_measurable borel" (is "?f \<in> _") 

687 
proof (rule borel_measurableI) 

688 
fix S :: "'b set" assume "open S" 

689 
then have "open {x\<in>A. f x \<in> S}" 

690 
by (intro continuous_open_preimage[OF cont]) auto 

691 
then have *: "{x\<in>A. f x \<in> S} \<in> sets borel" by auto 

692 
have "?f ` S \<inter> space borel = 

693 
{x\<in>A. f x \<in> S} \<union> (if c \<in> S then space borel  A else {})" 

694 
by (auto split: split_if_asm) 

695 
also have "\<dots> \<in> sets borel" 

696 
using * `open A` by (auto simp del: space_borel intro!: Un) 

697 
finally show "?f ` S \<inter> space borel \<in> sets borel" . 

698 
qed 

699 

700 
lemma borel_measurable_continuous_on_open: 

701 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t1_space" 

702 
assumes cont: "continuous_on A f" "open A" 

703 
assumes g: "g \<in> borel_measurable M" 

704 
shows "(\<lambda>x. if g x \<in> A then f (g x) else c) \<in> borel_measurable M" 

705 
using measurable_comp[OF g borel_measurable_continuous_on_open'[OF cont], of c] 

706 
by (simp add: comp_def) 

707 

708 
lemma borel_measurable_uminus[simp, intro]: 

709 
fixes g :: "'a \<Rightarrow> real" 

710 
assumes g: "g \<in> borel_measurable M" 

711 
shows "(\<lambda>x.  g x) \<in> borel_measurable M" 

712 
by (rule borel_measurable_continuous_on[OF _ g]) (auto intro: continuous_on_minus continuous_on_id) 

713 

714 
lemma euclidean_component_prod: 

715 
fixes x :: "'a :: euclidean_space \<times> 'b :: euclidean_space" 

716 
shows "x $$ i = (if i < DIM('a) then fst x $$ i else snd x $$ (i  DIM('a)))" 

717 
unfolding euclidean_component_def basis_prod_def inner_prod_def by auto 

718 

719 
lemma borel_measurable_Pair[simp, intro]: 

720 
fixes f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" and g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" 

721 
assumes f: "f \<in> borel_measurable M" 

722 
assumes g: "g \<in> borel_measurable M" 

723 
shows "(\<lambda>x. (f x, g x)) \<in> borel_measurable M" 

724 
proof (intro borel_measurable_iff_halfspace_le[THEN iffD2] allI impI) 

725 
fix i and a :: real assume i: "i < DIM('b \<times> 'c)" 

726 
have [simp]: "\<And>P A B C. {w. (P \<longrightarrow> A w \<and> B w) \<and> (\<not> P \<longrightarrow> A w \<and> C w)} = 

727 
{w. A w \<and> (P \<longrightarrow> B w) \<and> (\<not> P \<longrightarrow> C w)}" by auto 

728 
from i f g show "{w \<in> space M. (f w, g w) $$ i \<le> a} \<in> sets M" 

729 
by (auto simp: euclidean_component_prod intro!: sets_Collect borel_measurable_euclidean_component) 

730 
qed 

731 

732 
lemma continuous_on_fst: "continuous_on UNIV fst" 

733 
proof  

734 
have [simp]: "range fst = UNIV" by (auto simp: image_iff) 

735 
show ?thesis 

736 
using closed_vimage_fst 

737 
by (auto simp: continuous_on_closed closed_closedin vimage_def) 

738 
qed 

739 

740 
lemma continuous_on_snd: "continuous_on UNIV snd" 

741 
proof  

742 
have [simp]: "range snd = UNIV" by (auto simp: image_iff) 

743 
show ?thesis 

744 
using closed_vimage_snd 

745 
by (auto simp: continuous_on_closed closed_closedin vimage_def) 

746 
qed 

747 

748 
lemma borel_measurable_continuous_Pair: 

749 
fixes f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" and g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" 

750 
assumes [simp]: "f \<in> borel_measurable M" 

751 
assumes [simp]: "g \<in> borel_measurable M" 

752 
assumes H: "continuous_on UNIV (\<lambda>x. H (fst x) (snd x))" 

753 
shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M" 

754 
proof  

755 
have eq: "(\<lambda>x. H (f x) (g x)) = (\<lambda>x. (\<lambda>x. H (fst x) (snd x)) (f x, g x))" by auto 

756 
show ?thesis 

757 
unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto 

758 
qed 

759 

760 
lemma borel_measurable_add[simp, intro]: 

761 
fixes f g :: "'a \<Rightarrow> 'c::ordered_euclidean_space" 

762 
assumes f: "f \<in> borel_measurable M" 

763 
assumes g: "g \<in> borel_measurable M" 

764 
shows "(\<lambda>x. f x + g x) \<in> borel_measurable M" 

765 
using f g 

766 
by (rule borel_measurable_continuous_Pair) 

767 
(auto intro: continuous_on_fst continuous_on_snd continuous_on_add) 

768 

769 
lemma borel_measurable_setsum[simp, intro]: 

770 
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real" 

771 
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" 

772 
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" 

773 
proof cases 

774 
assume "finite S" 

775 
thus ?thesis using assms by induct auto 

776 
qed simp 

777 

778 
lemma borel_measurable_diff[simp, intro]: 

779 
fixes f :: "'a \<Rightarrow> real" 

780 
assumes f: "f \<in> borel_measurable M" 

781 
assumes g: "g \<in> borel_measurable M" 

782 
shows "(\<lambda>x. f x  g x) \<in> borel_measurable M" 

783 
unfolding diff_minus using assms by fast 

784 

785 
lemma borel_measurable_times[simp, intro]: 

786 
fixes f :: "'a \<Rightarrow> real" 

787 
assumes f: "f \<in> borel_measurable M" 

788 
assumes g: "g \<in> borel_measurable M" 

789 
shows "(\<lambda>x. f x * g x) \<in> borel_measurable M" 

790 
using f g 

791 
by (rule borel_measurable_continuous_Pair) 

792 
(auto intro: continuous_on_fst continuous_on_snd continuous_on_mult) 

793 

794 
lemma continuous_on_dist: 

795 
fixes f :: "'a :: t2_space \<Rightarrow> 'b :: metric_space" 

796 
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. dist (f x) (g x))" 

797 
unfolding continuous_on_eq_continuous_within by (auto simp: continuous_dist) 

798 

799 
lemma borel_measurable_dist[simp, intro]: 

800 
fixes g f :: "'a \<Rightarrow> 'b::ordered_euclidean_space" 

801 
assumes f: "f \<in> borel_measurable M" 

802 
assumes g: "g \<in> borel_measurable M" 

803 
shows "(\<lambda>x. dist (f x) (g x)) \<in> borel_measurable M" 

804 
using f g 

805 
by (rule borel_measurable_continuous_Pair) 

806 
(intro continuous_on_dist continuous_on_fst continuous_on_snd) 

807 

47694  808 
lemma affine_borel_measurable_vector: 
38656  809 
fixes f :: "'a \<Rightarrow> 'x::real_normed_vector" 
810 
assumes "f \<in> borel_measurable M" 

811 
shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M" 

812 
proof (rule borel_measurableI) 

813 
fix S :: "'x set" assume "open S" 

814 
show "(\<lambda>x. a + b *\<^sub>R f x) ` S \<inter> space M \<in> sets M" 

815 
proof cases 

816 
assume "b \<noteq> 0" 

44537
c10485a6a7af
make HOLProbability respect set/pred distinction
huffman
parents:
44282
diff
changeset

817 
with `open S` have "open ((\<lambda>x. ( a + x) /\<^sub>R b) ` S)" (is "open ?S") 
c10485a6a7af
make HOLProbability respect set/pred distinction
huffman
parents:
44282
diff
changeset

818 
by (auto intro!: open_affinity simp: scaleR_add_right) 
47694  819 
hence "?S \<in> sets borel" by auto 
38656  820 
moreover 
821 
from `b \<noteq> 0` have "(\<lambda>x. a + b *\<^sub>R f x) ` S = f ` ?S" 

822 
apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all) 

40859  823 
ultimately show ?thesis using assms unfolding in_borel_measurable_borel 
38656  824 
by auto 
825 
qed simp 

826 
qed 

827 

47694  828 
lemma affine_borel_measurable: 
38656  829 
fixes g :: "'a \<Rightarrow> real" 
830 
assumes g: "g \<in> borel_measurable M" 

831 
shows "(\<lambda>x. a + (g x) * b) \<in> borel_measurable M" 

832 
using affine_borel_measurable_vector[OF assms] by (simp add: mult_commute) 

833 

47694  834 
lemma borel_measurable_setprod[simp, intro]: 
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

835 
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real" 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

836 
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

837 
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

838 
proof cases 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

839 
assume "finite S" 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

840 
thus ?thesis using assms by induct auto 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

841 
qed simp 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

842 

47694  843 
lemma borel_measurable_inverse[simp, intro]: 
38656  844 
fixes f :: "'a \<Rightarrow> real" 
49774  845 
assumes f: "f \<in> borel_measurable M" 
35692  846 
shows "(\<lambda>x. inverse (f x)) \<in> borel_measurable M" 
49774  847 
proof  
848 
have *: "\<And>x::real. inverse x = (if x \<in> UNIV  {0} then inverse x else 0)" by auto 

849 
show ?thesis 

850 
apply (subst *) 

851 
apply (rule borel_measurable_continuous_on_open) 

852 
apply (auto intro!: f continuous_on_inverse continuous_on_id) 

853 
done 

35692  854 
qed 
855 

47694  856 
lemma borel_measurable_divide[simp, intro]: 
38656  857 
fixes f :: "'a \<Rightarrow> real" 
35692  858 
assumes "f \<in> borel_measurable M" 
859 
and "g \<in> borel_measurable M" 

860 
shows "(\<lambda>x. f x / g x) \<in> borel_measurable M" 

861 
unfolding field_divide_inverse 

38656  862 
by (rule borel_measurable_inverse borel_measurable_times assms)+ 
863 

47694  864 
lemma borel_measurable_max[intro, simp]: 
38656  865 
fixes f g :: "'a \<Rightarrow> real" 
866 
assumes "f \<in> borel_measurable M" 

867 
assumes "g \<in> borel_measurable M" 

868 
shows "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M" 

49774  869 
unfolding max_def by (auto intro!: assms measurable_If) 
38656  870 

47694  871 
lemma borel_measurable_min[intro, simp]: 
38656  872 
fixes f g :: "'a \<Rightarrow> real" 
873 
assumes "f \<in> borel_measurable M" 

874 
assumes "g \<in> borel_measurable M" 

875 
shows "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M" 

49774  876 
unfolding min_def by (auto intro!: assms measurable_If) 
38656  877 

47694  878 
lemma borel_measurable_abs[simp, intro]: 
38656  879 
assumes "f \<in> borel_measurable M" 
880 
shows "(\<lambda>x. \<bar>f x :: real\<bar>) \<in> borel_measurable M" 

881 
proof  

882 
have *: "\<And>x. \<bar>f x\<bar> = max 0 (f x) + max 0 ( f x)" by (simp add: max_def) 

883 
show ?thesis unfolding * using assms by auto 

884 
qed 

885 

41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

886 
lemma borel_measurable_nth[simp, intro]: 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

887 
"(\<lambda>x::real^'n. x $ i) \<in> borel_measurable borel" 
49774  888 
using borel_measurable_euclidean_component' 
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

889 
unfolding nth_conv_component by auto 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41025
diff
changeset

890 

47694  891 
lemma convex_measurable: 
42990
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset

892 
fixes a b :: real 
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset

893 
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

894 
assumes q: "convex_on { a <..< b} q" 
49774  895 
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

896 
proof  
49774  897 
have "(\<lambda>x. if X x \<in> {a <..< b} then q (X x) else 0) \<in> borel_measurable M" (is "?qX") 
898 
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

899 
show "open {a<..<b}" by auto 
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset

900 
from this q show "continuous_on {a<..<b} q" 
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset

901 
by (rule convex_on_continuous) 
41830  902 
qed 
49774  903 
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

904 
using X by (intro measurable_cong) auto 
3706951a6421
composition of convex and measurable function is measurable
hoelzl
parents:
42950
diff
changeset

905 
ultimately show ?thesis by simp 
41830  906 
qed 
907 

49774  908 
lemma borel_measurable_ln[simp,intro]: 
909 
assumes f: "f \<in> borel_measurable M" 

910 
shows "(\<lambda>x. ln (f x)) \<in> borel_measurable M" 

41830  911 
proof  
912 
{ fix x :: real assume x: "x \<le> 0" 

913 
{ fix x::real assume "x \<le> 0" then have "\<And>u. exp u = x \<longleftrightarrow> False" by auto } 

49774  914 
from this[of x] x this[of 0] have "ln 0 = ln x" 
915 
by (auto simp: ln_def) } 

916 
note ln_imp = this 

917 
have "(\<lambda>x. if f x \<in> {0<..} then ln (f x) else ln 0) \<in> borel_measurable M" 

918 
proof (rule borel_measurable_continuous_on_open[OF _ _ f]) 

919 
show "continuous_on {0<..} ln" 

920 
by (auto intro!: continuous_at_imp_continuous_on DERIV_ln DERIV_isCont 

41830  921 
simp: continuous_isCont[symmetric]) 
922 
show "open ({0<..}::real set)" by auto 

923 
qed 

49774  924 
also have "(\<lambda>x. if x \<in> {0<..} then ln x else ln 0) = ln" 
925 
by (simp add: fun_eq_iff not_less ln_imp) 

41830  926 
finally show ?thesis . 
927 
qed 

928 

47694  929 
lemma borel_measurable_log[simp,intro]: 
49774  930 
"f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. log b (f x)) \<in> borel_measurable M" 
931 
unfolding log_def by auto 

41830  932 

47761  933 
lemma borel_measurable_real_floor: 
934 
"(\<lambda>x::real. real \<lfloor>x\<rfloor>) \<in> borel_measurable borel" 

935 
unfolding borel_measurable_iff_ge 

936 
proof (intro allI) 

937 
fix a :: real 

938 
{ fix x have "a \<le> real \<lfloor>x\<rfloor> \<longleftrightarrow> real \<lceil>a\<rceil> \<le> x" 

939 
using le_floor_eq[of "\<lceil>a\<rceil>" x] ceiling_le_iff[of a "\<lfloor>x\<rfloor>"] 

940 
unfolding real_eq_of_int by simp } 

941 
then have "{w::real \<in> space borel. a \<le> real \<lfloor>w\<rfloor>} = {real \<lceil>a\<rceil>..}" by auto 

942 
then show "{w::real \<in> space borel. a \<le> real \<lfloor>w\<rfloor>} \<in> sets borel" by auto 

943 
qed 

944 

945 
lemma borel_measurable_real_natfloor[intro, simp]: 

946 
assumes "f \<in> borel_measurable M" 

947 
shows "(\<lambda>x. real (natfloor (f x))) \<in> borel_measurable M" 

948 
proof  

949 
have "\<And>x. real (natfloor (f x)) = max 0 (real \<lfloor>f x\<rfloor>)" 

950 
by (auto simp: max_def natfloor_def) 

951 
with borel_measurable_max[OF measurable_comp[OF assms borel_measurable_real_floor] borel_measurable_const] 

952 
show ?thesis by (simp add: comp_def) 

953 
qed 

954 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

955 
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

956 

47694  957 
lemma borel_measurable_ereal[simp, intro]: 
43920  958 
assumes f: "f \<in> borel_measurable M" shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" 
49774  959 
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

960 

49774  961 
lemma borel_measurable_real_of_ereal[simp, intro]: 
962 
fixes f :: "'a \<Rightarrow> ereal" 

963 
assumes f: "f \<in> borel_measurable M" 

964 
shows "(\<lambda>x. real (f x)) \<in> borel_measurable M" 

965 
proof  

966 
have "(\<lambda>x. if f x \<in> UNIV  { \<infinity>,  \<infinity> } then real (f x) else 0) \<in> borel_measurable M" 

967 
using continuous_on_real 

968 
by (rule borel_measurable_continuous_on_open[OF _ _ f]) auto 

969 
also have "(\<lambda>x. if f x \<in> UNIV  { \<infinity>,  \<infinity> } then real (f x) else 0) = (\<lambda>x. real (f x))" 

970 
by auto 

971 
finally show ?thesis . 

972 
qed 

973 

974 
lemma borel_measurable_ereal_cases: 

975 
fixes f :: "'a \<Rightarrow> ereal" 

976 
assumes f: "f \<in> borel_measurable M" 

977 
assumes H: "(\<lambda>x. H (ereal (real (f x)))) \<in> borel_measurable M" 

978 
shows "(\<lambda>x. H (f x)) \<in> borel_measurable M" 

979 
proof  

980 
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)))" 

981 
{ fix x have "H (f x) = ?F x" by (cases "f x") auto } 

982 
moreover 

983 
have "?F \<in> borel_measurable M" 

984 
by (intro measurable_If_set f measurable_sets[OF f] H) auto 

985 
ultimately 

986 
show ?thesis by simp 

47694  987 
qed 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

988 

49774  989 
lemma 
990 
fixes f :: "'a \<Rightarrow> ereal" assumes f[simp]: "f \<in> borel_measurable M" 

991 
shows borel_measurable_ereal_abs[intro, simp]: "(\<lambda>x. \<bar>f x\<bar>) \<in> borel_measurable M" 

992 
and borel_measurable_ereal_inverse[simp, intro]: "(\<lambda>x. inverse (f x) :: ereal) \<in> borel_measurable M" 

993 
and borel_measurable_uminus_ereal[intro]: "(\<lambda>x.  f x :: ereal) \<in> borel_measurable M" 

994 
by (auto simp del: abs_real_of_ereal simp: borel_measurable_ereal_cases[OF f] measurable_If) 

995 

996 
lemma borel_measurable_uminus_eq_ereal[simp]: 

997 
"(\<lambda>x.  f x :: ereal) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" (is "?l = ?r") 

998 
proof 

999 
assume ?l from borel_measurable_uminus_ereal[OF this] show ?r by simp 

1000 
qed auto 

1001 

1002 
lemma sets_Collect_If_set: 

1003 
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" 

1004 
shows "{x \<in> space M. if x \<in> A then P x else Q x} \<in> sets M" 

1005 
proof  

1006 
have *: "{x \<in> space M. if x \<in> A then P x else Q x} = 

1007 
{x \<in> space M. if x \<in> A \<inter> space M then P x else Q x}" by auto 

1008 
show ?thesis unfolding * unfolding if_bool_eq_conj using assms 

1009 
by (auto intro!: sets_Collect simp: Int_def conj_commute) 

1010 
qed 

1011 

1012 
lemma set_Collect_ereal2: 

1013 
fixes f g :: "'a \<Rightarrow> ereal" 

1014 
assumes f: "f \<in> borel_measurable M" 

1015 
assumes g: "g \<in> borel_measurable M" 

1016 
assumes H: "{x \<in> space M. H (ereal (real (f x))) (ereal (real (g x)))} \<in> sets M" 

1017 
"{x \<in> space M. H (\<infinity>) (ereal (real (g x)))} \<in> sets M" 

1018 
"{x \<in> space M. H (\<infinity>) (ereal (real (g x)))} \<in> sets M" 

1019 
"{x \<in> space M. H (ereal (real (f x))) (\<infinity>)} \<in> sets M" 

1020 
"{x \<in> space M. H (ereal (real (f x))) (\<infinity>)} \<in> sets M" 

1021 
shows "{x \<in> space M. H (f x) (g x)} \<in> sets M" 

1022 
proof  

1023 
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)))" 

1024 
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" 

1025 
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto } 

1026 
moreover 

1027 
have "{x \<in> space M. ?F x} \<in> sets M" 

1028 
by (intro sets_Collect H measurable_sets[OF f] measurable_sets[OF g] sets_Collect_If_set) auto 

1029 
ultimately 

1030 
show ?thesis by simp 

1031 
qed 

1032 

1033 
lemma 

1034 
fixes f g :: "'a \<Rightarrow> ereal" 

1035 
assumes f: "f \<in> borel_measurable M" 

1036 
assumes g: "g \<in> borel_measurable M" 

1037 
shows borel_measurable_ereal_le[intro,simp]: "{x \<in> space M. f x \<le> g x} \<in> sets M" 

1038 
and borel_measurable_ereal_less[intro,simp]: "{x \<in> space M. f x < g x} \<in> sets M" 

1039 
and borel_measurable_ereal_eq[intro,simp]: "{w \<in> space M. f w = g w} \<in> sets M" 

1040 
and borel_measurable_ereal_neq[intro,simp]: "{w \<in> space M. f w \<noteq> g w} \<in> sets M" 

1041 
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

1042 

47694  1043 
lemma borel_measurable_ereal_iff: 
43920  1044 
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

1045 
proof 
43920  1046 
assume "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" 
1047 
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

1048 
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

1049 
qed auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1050 

47694  1051 
lemma borel_measurable_ereal_iff_real: 
43923  1052 
fixes f :: "'a \<Rightarrow> ereal" 
1053 
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

1054 
((\<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

1055 
proof safe 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1056 
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

1057 
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

1058 
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  1059 
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

1060 
have "?f \<in> borel_measurable M" using * ** by (intro measurable_If) auto 
43920  1061 
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

1062 
finally show "f \<in> borel_measurable M" . 
43920  1063 
qed (auto intro: measurable_sets borel_measurable_real_of_ereal) 
41830  1064 

47694  1065 
lemma borel_measurable_eq_atMost_ereal: 
43923  1066 
fixes f :: "'a \<Rightarrow> ereal" 
1067 
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

1068 
proof (intro iffI allI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1069 
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

1070 
show "f \<in> borel_measurable M" 
43920  1071 
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

1072 
proof (intro conjI allI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1073 
fix a :: real 
43920  1074 
{ 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

1075 
have "x = \<infinity>" 
43920  1076 
proof (rule ereal_top) 
44666  1077 
fix B from reals_Archimedean2[of B] guess n .. 
43920  1078 
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

1079 
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

1080 
qed } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1081 
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

1082 
by (auto simp: not_le) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1083 
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

1084 
moreover 
43923  1085 
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

1086 
then show "f ` {\<infinity>} \<inter> space M \<in> sets M" using pos by auto 
43920  1087 
moreover have "{x\<in>space M. f x \<le> ereal a} \<in> sets M" 
1088 
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

1089 
moreover have "{w \<in> space M. real (f w) \<le> a} = 
43920  1090 
(if a < 0 then {w \<in> space M. f w \<le> ereal a}  f ` {\<infinity>} \<inter> space M 
1091 
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

1092 
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

1093 
ultimately show "{w \<in> space M. real (f w) \<le> a} \<in> sets M" by auto 
35582  1094 
qed 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1095 
qed (simp add: measurable_sets) 
35582  1096 

47694  1097 
lemma borel_measurable_eq_atLeast_ereal: 
43920  1098 
"(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

1099 
proof 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1100 
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

1101 
moreover have "\<And>a. (\<lambda>x.  f x) ` {..a} = f ` {a ..}" 
43920  1102 
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

1103 
ultimately have "(\<lambda>x.  f x) \<in> borel_measurable M" 
43920  1104 
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

1105 
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

1106 
qed (simp add: measurable_sets) 
35582  1107 

49774  1108 
lemma greater_eq_le_measurable: 
1109 
fixes f :: "'a \<Rightarrow> 'c::linorder" 

1110 
shows "f ` {..< a} \<inter> space M \<in> sets M \<longleftrightarrow> f ` {a ..} \<inter> space M \<in> sets M" 

1111 
proof 

1112 
assume "f ` {a ..} \<inter> space M \<in> sets M" 

1113 
moreover have "f ` {..< a} \<inter> space M = space M  f ` {a ..} \<inter> space M" by auto 

1114 
ultimately show "f ` {..< a} \<inter> space M \<in> sets M" by auto 

1115 
next 

1116 
assume "f ` {..< a} \<inter> space M \<in> sets M" 

1117 
moreover have "f ` {a ..} \<inter> space M = space M  f ` {..< a} \<inter> space M" by auto 

1118 
ultimately show "f ` {a ..} \<inter> space M \<in> sets M" by auto 

1119 
qed 

1120 

47694  1121 
lemma borel_measurable_ereal_iff_less: 
43920  1122 
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f ` {..< a} \<inter> space M \<in> sets M)" 
1123 
unfolding borel_measurable_eq_atLeast_ereal greater_eq_le_measurable .. 

38656  1124 

49774  1125 
lemma less_eq_ge_measurable: 
1126 
fixes f :: "'a \<Rightarrow> 'c::linorder" 

1127 
shows "f ` {a <..} \<inter> space M \<in> sets M \<longleftrightarrow> f ` {..a} \<inter> space M \<in> sets M" 

1128 
proof 

1129 
assume "f ` {a <..} \<inter> space M \<in> sets M" 

1130 
moreover have "f ` {..a} \<inter> space M = space M  f ` {a <..} \<inter> space M" by auto 

1131 
ultimately show "f ` {..a} \<inter> space M \<in> sets M" by auto 

1132 
next 

1133 
assume "f ` {..a} \<inter> space M \<in> sets M" 

1134 
moreover have "f ` {a <..} \<inter> space M = space M  f ` {..a} \<inter> space M" by auto 

1135 
ultimately show "f ` {a <..} \<inter> space M \<in> sets M" by auto 

1136 
qed 

1137 

47694  1138 
lemma borel_measurable_ereal_iff_ge: 
43920  1139 
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f ` {a <..} \<inter> space M \<in> sets M)" 
1140 
unfolding borel_measurable_eq_atMost_ereal less_eq_ge_measurable .. 

38656  1141 

49774  1142 
lemma borel_measurable_ereal2: 
1143 
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

1144 
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

1145 
assumes g: "g \<in> borel_measurable M" 
49774  1146 
assumes H: "(\<lambda>x. H (ereal (real (f x))) (ereal (real (g x)))) \<in> borel_measurable M" 
1147 
"(\<lambda>x. H (\<infinity>) (ereal (real (g x)))) \<in> borel_measurable M" 

1148 
"(\<lambda>x. H (\<infinity>) (ereal (real (g x)))) \<in> borel_measurable M" 

1149 
"(\<lambda>x. H (ereal (real (f x))) (\<infinity>)) \<in> borel_measurable M" 

1150 
"(\<lambda>x. H (ereal (real (f x))) (\<infinity>)) \<in> borel_measurable M" 

1151 
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

1152 
proof  
49774  1153 
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)))" 
1154 
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" 

1155 
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto } 

1156 
moreover 

1157 
have "?F \<in> borel_measurable M" 

1158 
by (intro measurable_If_set measurable_sets[OF f] measurable_sets[OF g] H) auto 

1159 
ultimately 

1160 
show ?thesis by simp 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1161 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1162 

49774  1163 
lemma 
1164 
fixes f :: "'a \<Rightarrow> ereal" assumes f: "f \<in> borel_measurable M" 

1165 
shows borel_measurable_ereal_eq_const: "{x\<in>space M. f x = c} \<in> sets M" 

1166 
and borel_measurable_ereal_neq_const: "{x\<in>space M. f x \<noteq> c} \<in> sets M" 

1167 
using f by auto 

38656  1168 

47694  1169 
lemma split_sets: 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1170 
"{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

1171 
"{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

1172 
by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1173 

49774  1174 
lemma 
43920  1175 
fixes f :: "'a \<Rightarrow> ereal" 
49774  1176 
assumes [simp]: "f \<in> borel_measurable M" "g \<in> borel_measurable M" 
1177 
shows borel_measurable_ereal_add[intro, simp]: "(\<lambda>x. f x + g x) \<in> borel_measurable M" 

1178 
and borel_measurable_ereal_times[intro, simp]: "(\<lambda>x. f x * g x) \<in> borel_measurable M" 

1179 
and borel_measurable_ereal_min[simp, intro]: "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M" 

1180 
and borel_measurable_ereal_max[simp, intro]: "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M" 

1181 
by (auto simp add: borel_measurable_ereal2 measurable_If min_def max_def) 

1182 

1183 
lemma 

1184 
fixes f g :: "'a \<Rightarrow> ereal" 

1185 
assumes "f \<in> borel_measurable M" 

1186 
assumes "g \<in> borel_measurable M" 

1187 
shows borel_measurable_ereal_diff[simp, intro]: "(\<lambda>x. f x  g x) \<in> borel_measurable M" 

1188 
and borel_measurable_ereal_divide[simp, intro]: "(\<lambda>x. f x / g x) \<in> borel_measurable M" 

1189 
unfolding minus_ereal_def divide_ereal_def using assms by auto 

38656  1190 

47694  1191 
lemma borel_measurable_ereal_setsum[simp, intro]: 
43920  1192 
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" 
41096  1193 
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" 
1194 
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" 

1195 
proof cases 

1196 
assume "finite S" 

1197 
thus ?thesis using assms 

1198 
by induct auto 

49774  1199 
qed simp 
38656  1200 

47694  1201 
lemma borel_measurable_ereal_setprod[simp, intro]: 
43920  1202 
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" 
38656  1203 
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" 
41096  1204 
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" 
38656  1205 
proof cases 
1206 
assume "finite S" 

41096  1207 
thus ?thesis using assms by induct auto 
1208 
qed simp 

38656  1209 

47694  1210 
lemma borel_measurable_SUP[simp, intro]: 
43920  1211 
fixes f :: "'d\<Colon>countable \<Rightarrow> 'a \<Rightarrow> ereal" 
38656  1212 
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

1213 
shows "(\<lambda>x. SUP i : A. f i x) \<in> borel_measurable M" (is "?sup \<in> borel_measurable M") 
43920  1214 
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

1215 
proof 
38656  1216 
fix a 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1217 
have "?sup ` {a<..} \<inter> space M = (\<Union>i\<in>A. {x\<in>space M. a < f i x})" 
46884  1218 
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

1219 
then show "?sup ` {a<..} \<inter> space M \<in> sets M" 
38656  1220 
using assms by auto 
1221 
qed 

1222 

47694  1223 
lemma borel_measurable_INF[simp, intro]: 
43920  1224 
fixes f :: "'d :: countable \<Rightarrow> 'a \<Rightarrow> ereal" 
38656  1225 
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

1226 
shows "(\<lambda>x. INF i : A. f i x) \<in> borel_measurable M" (is "?inf \<in> borel_measurable M") 
43920  1227 
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

1228 
proof 
38656  1229 
fix a 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41969
diff
changeset

1230 
have "?inf ` {..<a} \<inter> space M = (\<Union>i\<in>A. {x\<in>space M. f i x < a})" 
46884  1231 
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

1232 
then show "?inf ` {..<a} \<inter> space M \<in> sets M" 
38656  1233 
using assms by auto 
1234 
qed 

1235 

49774  1236 
lemma 
43920  1237 
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

1238 
assumes "\<And>i. f i \<in> borel_measurable M" 
49774
dfa8ddb874ce
use continuit 