| author | wenzelm | 
| Thu, 01 Sep 2016 20:34:43 +0200 | |
| changeset 63761 | 2ca536d0163e | 
| parent 63627 | 6ddb43c6b711 | 
| child 63952 | 354808e9f44b | 
| permissions | -rw-r--r-- | 
| 63627 | 1 | (* Title: HOL/Analysis/Borel_Space.thy | 
| 42067 | 2 | Author: Johannes Hölzl, TU München | 
| 3 | Author: Armin Heller, TU München | |
| 4 | *) | |
| 38656 | 5 | |
| 61808 | 6 | section \<open>Borel spaces\<close> | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 7 | |
| 40859 | 8 | theory Borel_Space | 
| 50387 | 9 | imports | 
| 63626 
44ce6b524ff3
move measure theory from HOL-Probability to HOL-Multivariate_Analysis
 hoelzl parents: 
63566diff
changeset | 10 | Measurable Derivative Ordered_Euclidean_Space Extended_Real_Limits | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 11 | begin | 
| 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 12 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 13 | lemma sets_Collect_eventually_sequentially[measurable]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 14 |   "(\<And>i. {x\<in>space M. P x i} \<in> sets M) \<Longrightarrow> {x\<in>space M. eventually (P x) sequentially} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 15 | unfolding eventually_sequentially by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 16 | |
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 17 | lemma topological_basis_trivial: "topological_basis {A. open A}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 18 | by (auto simp: topological_basis_def) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 19 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 20 | lemma open_prod_generated: "open = generate_topology {A \<times> B | A B. open A \<and> open B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 21 | proof - | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 22 |   have "{A \<times> B :: ('a \<times> 'b) set | A B. open A \<and> open B} = ((\<lambda>(a, b). a \<times> b) ` ({A. open A} \<times> {A. open A}))"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 23 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 24 | then show ?thesis | 
| 62372 | 25 | by (auto intro: topological_basis_prod topological_basis_trivial topological_basis_imp_subbasis) | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 26 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 27 | |
| 62083 | 28 | definition "mono_on f A \<equiv> \<forall>r s. r \<in> A \<and> s \<in> A \<and> r \<le> s \<longrightarrow> f r \<le> f s" | 
| 29 | ||
| 30 | lemma mono_onI: | |
| 31 | "(\<And>r s. r \<in> A \<Longrightarrow> s \<in> A \<Longrightarrow> r \<le> s \<Longrightarrow> f r \<le> f s) \<Longrightarrow> mono_on f A" | |
| 32 | unfolding mono_on_def by simp | |
| 33 | ||
| 34 | lemma mono_onD: | |
| 35 | "\<lbrakk>mono_on f A; r \<in> A; s \<in> A; r \<le> s\<rbrakk> \<Longrightarrow> f r \<le> f s" | |
| 36 | unfolding mono_on_def by simp | |
| 37 | ||
| 38 | lemma mono_imp_mono_on: "mono f \<Longrightarrow> mono_on f A" | |
| 39 | unfolding mono_def mono_on_def by auto | |
| 40 | ||
| 41 | lemma mono_on_subset: "mono_on f A \<Longrightarrow> B \<subseteq> A \<Longrightarrow> mono_on f B" | |
| 42 | unfolding mono_on_def by auto | |
| 43 | ||
| 44 | definition "strict_mono_on f A \<equiv> \<forall>r s. r \<in> A \<and> s \<in> A \<and> r < s \<longrightarrow> f r < f s" | |
| 45 | ||
| 46 | lemma strict_mono_onI: | |
| 47 | "(\<And>r s. r \<in> A \<Longrightarrow> s \<in> A \<Longrightarrow> r < s \<Longrightarrow> f r < f s) \<Longrightarrow> strict_mono_on f A" | |
| 48 | unfolding strict_mono_on_def by simp | |
| 49 | ||
| 50 | lemma strict_mono_onD: | |
| 51 | "\<lbrakk>strict_mono_on f A; r \<in> A; s \<in> A; r < s\<rbrakk> \<Longrightarrow> f r < f s" | |
| 52 | unfolding strict_mono_on_def by simp | |
| 53 | ||
| 54 | lemma mono_on_greaterD: | |
| 55 | assumes "mono_on g A" "x \<in> A" "y \<in> A" "g x > (g (y::_::linorder) :: _ :: linorder)" | |
| 56 | shows "x > y" | |
| 57 | proof (rule ccontr) | |
| 58 | assume "\<not>x > y" | |
| 59 | hence "x \<le> y" by (simp add: not_less) | |
| 60 | from assms(1-3) and this have "g x \<le> g y" by (rule mono_onD) | |
| 61 | with assms(4) show False by simp | |
| 62 | qed | |
| 63 | ||
| 64 | lemma strict_mono_inv: | |
| 65 |   fixes f :: "('a::linorder) \<Rightarrow> ('b::linorder)"
 | |
| 66 | assumes "strict_mono f" and "surj f" and inv: "\<And>x. g (f x) = x" | |
| 67 | shows "strict_mono g" | |
| 68 | proof | |
| 69 | fix x y :: 'b assume "x < y" | |
| 70 | from \<open>surj f\<close> obtain x' y' where [simp]: "x = f x'" "y = f y'" by blast | |
| 71 | with \<open>x < y\<close> and \<open>strict_mono f\<close> have "x' < y'" by (simp add: strict_mono_less) | |
| 72 | with inv show "g x < g y" by simp | |
| 73 | qed | |
| 74 | ||
| 75 | lemma strict_mono_on_imp_inj_on: | |
| 76 | assumes "strict_mono_on (f :: (_ :: linorder) \<Rightarrow> (_ :: preorder)) A" | |
| 77 | shows "inj_on f A" | |
| 78 | proof (rule inj_onI) | |
| 79 | fix x y assume "x \<in> A" "y \<in> A" "f x = f y" | |
| 80 | thus "x = y" | |
| 81 | by (cases x y rule: linorder_cases) | |
| 62372 | 82 | (auto dest: strict_mono_onD[OF assms, of x y] strict_mono_onD[OF assms, of y x]) | 
| 62083 | 83 | qed | 
| 84 | ||
| 85 | lemma strict_mono_on_leD: | |
| 86 | assumes "strict_mono_on (f :: (_ :: linorder) \<Rightarrow> _ :: preorder) A" "x \<in> A" "y \<in> A" "x \<le> y" | |
| 87 | shows "f x \<le> f y" | |
| 88 | proof (insert le_less_linear[of y x], elim disjE) | |
| 89 | assume "x < y" | |
| 90 | with assms have "f x < f y" by (rule_tac strict_mono_onD[OF assms(1)]) simp_all | |
| 91 | thus ?thesis by (rule less_imp_le) | |
| 92 | qed (insert assms, simp) | |
| 93 | ||
| 94 | lemma strict_mono_on_eqD: | |
| 95 | fixes f :: "(_ :: linorder) \<Rightarrow> (_ :: preorder)" | |
| 96 | assumes "strict_mono_on f A" "f x = f y" "x \<in> A" "y \<in> A" | |
| 97 | shows "y = x" | |
| 98 | using assms by (rule_tac linorder_cases[of x y]) (auto dest: strict_mono_onD) | |
| 99 | ||
| 100 | lemma mono_on_imp_deriv_nonneg: | |
| 101 | assumes mono: "mono_on f A" and deriv: "(f has_real_derivative D) (at x)" | |
| 102 | assumes "x \<in> interior A" | |
| 103 | shows "D \<ge> 0" | |
| 104 | proof (rule tendsto_le_const) | |
| 105 | let ?A' = "(\<lambda>y. y - x) ` interior A" | |
| 106 | from deriv show "((\<lambda>h. (f (x + h) - f x) / h) \<longlongrightarrow> D) (at 0)" | |
| 107 | by (simp add: field_has_derivative_at has_field_derivative_def) | |
| 108 | from mono have mono': "mono_on f (interior A)" by (rule mono_on_subset) (rule interior_subset) | |
| 109 | ||
| 110 | show "eventually (\<lambda>h. (f (x + h) - f x) / h \<ge> 0) (at 0)" | |
| 111 | proof (subst eventually_at_topological, intro exI conjI ballI impI) | |
| 112 | have "open (interior A)" by simp | |
| 113 | hence "open (op + (-x) ` interior A)" by (rule open_translation) | |
| 114 | also have "(op + (-x) ` interior A) = ?A'" by auto | |
| 115 | finally show "open ?A'" . | |
| 116 | next | |
| 117 | from \<open>x \<in> interior A\<close> show "0 \<in> ?A'" by auto | |
| 118 | next | |
| 119 | fix h assume "h \<in> ?A'" | |
| 120 | hence "x + h \<in> interior A" by auto | |
| 121 | with mono' and \<open>x \<in> interior A\<close> show "(f (x + h) - f x) / h \<ge> 0" | |
| 122 | by (cases h rule: linorder_cases[of _ 0]) | |
| 123 | (simp_all add: divide_nonpos_neg divide_nonneg_pos mono_onD field_simps) | |
| 124 | qed | |
| 125 | qed simp | |
| 126 | ||
| 62372 | 127 | lemma strict_mono_on_imp_mono_on: | 
| 62083 | 128 | "strict_mono_on (f :: (_ :: linorder) \<Rightarrow> _ :: preorder) A \<Longrightarrow> mono_on f A" | 
| 129 | by (rule mono_onI, rule strict_mono_on_leD) | |
| 130 | ||
| 131 | lemma mono_on_ctble_discont: | |
| 132 | fixes f :: "real \<Rightarrow> real" | |
| 133 | fixes A :: "real set" | |
| 134 | assumes "mono_on f A" | |
| 135 |   shows "countable {a\<in>A. \<not> continuous (at a within A) f}"
 | |
| 136 | proof - | |
| 137 | have mono: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y" | |
| 63167 | 138 | using \<open>mono_on f A\<close> by (simp add: mono_on_def) | 
| 62083 | 139 |   have "\<forall>a \<in> {a\<in>A. \<not> continuous (at a within A) f}. \<exists>q :: nat \<times> rat.
 | 
| 140 | (fst q = 0 \<and> of_rat (snd q) < f a \<and> (\<forall>x \<in> A. x < a \<longrightarrow> f x < of_rat (snd q))) \<or> | |
| 141 | (fst q = 1 \<and> of_rat (snd q) > f a \<and> (\<forall>x \<in> A. x > a \<longrightarrow> f x > of_rat (snd q)))" | |
| 142 | proof (clarsimp simp del: One_nat_def) | |
| 143 | fix a assume "a \<in> A" assume "\<not> continuous (at a within A) f" | |
| 144 | thus "\<exists>q1 q2. | |
| 145 | q1 = 0 \<and> real_of_rat q2 < f a \<and> (\<forall>x\<in>A. x < a \<longrightarrow> f x < real_of_rat q2) \<or> | |
| 146 | q1 = 1 \<and> f a < real_of_rat q2 \<and> (\<forall>x\<in>A. a < x \<longrightarrow> real_of_rat q2 < f x)" | |
| 147 | proof (auto simp add: continuous_within order_tendsto_iff eventually_at) | |
| 148 | fix l assume "l < f a" | |
| 149 | then obtain q2 where q2: "l < of_rat q2" "of_rat q2 < f a" | |
| 150 | using of_rat_dense by blast | |
| 151 | assume * [rule_format]: "\<forall>d>0. \<exists>x\<in>A. x \<noteq> a \<and> dist x a < d \<and> \<not> l < f x" | |
| 152 | from q2 have "real_of_rat q2 < f a \<and> (\<forall>x\<in>A. x < a \<longrightarrow> f x < real_of_rat q2)" | |
| 153 | proof auto | |
| 154 | fix x assume "x \<in> A" "x < a" | |
| 155 | with q2 *[of "a - x"] show "f x < real_of_rat q2" | |
| 156 | apply (auto simp add: dist_real_def not_less) | |
| 157 | apply (subgoal_tac "f x \<le> f xa") | |
| 158 | by (auto intro: mono) | |
| 62372 | 159 | qed | 
| 62083 | 160 | thus ?thesis by auto | 
| 161 | next | |
| 162 | fix u assume "u > f a" | |
| 163 | then obtain q2 where q2: "f a < of_rat q2" "of_rat q2 < u" | |
| 164 | using of_rat_dense by blast | |
| 165 | assume *[rule_format]: "\<forall>d>0. \<exists>x\<in>A. x \<noteq> a \<and> dist x a < d \<and> \<not> u > f x" | |
| 166 | from q2 have "real_of_rat q2 > f a \<and> (\<forall>x\<in>A. x > a \<longrightarrow> f x > real_of_rat q2)" | |
| 167 | proof auto | |
| 168 | fix x assume "x \<in> A" "x > a" | |
| 169 | with q2 *[of "x - a"] show "f x > real_of_rat q2" | |
| 170 | apply (auto simp add: dist_real_def) | |
| 171 | apply (subgoal_tac "f x \<ge> f xa") | |
| 172 | by (auto intro: mono) | |
| 62372 | 173 | qed | 
| 62083 | 174 | thus ?thesis by auto | 
| 175 | qed | |
| 176 | qed | |
| 62372 | 177 |   hence "\<exists>g :: real \<Rightarrow> nat \<times> rat . \<forall>a \<in> {a\<in>A. \<not> continuous (at a within A) f}.
 | 
| 62083 | 178 | (fst (g a) = 0 \<and> of_rat (snd (g a)) < f a \<and> (\<forall>x \<in> A. x < a \<longrightarrow> f x < of_rat (snd (g a)))) | | 
| 179 | (fst (g a) = 1 \<and> of_rat (snd (g a)) > f a \<and> (\<forall>x \<in> A. x > a \<longrightarrow> f x > of_rat (snd (g a))))" | |
| 180 | by (rule bchoice) | |
| 181 | then guess g .. | |
| 182 | hence g: "\<And>a x. a \<in> A \<Longrightarrow> \<not> continuous (at a within A) f \<Longrightarrow> x \<in> A \<Longrightarrow> | |
| 183 | (fst (g a) = 0 \<and> of_rat (snd (g a)) < f a \<and> (x < a \<longrightarrow> f x < of_rat (snd (g a)))) | | |
| 184 | (fst (g a) = 1 \<and> of_rat (snd (g a)) > f a \<and> (x > a \<longrightarrow> f x > of_rat (snd (g a))))" | |
| 185 | by auto | |
| 186 |   have "inj_on g {a\<in>A. \<not> continuous (at a within A) f}"
 | |
| 187 | proof (auto simp add: inj_on_def) | |
| 188 | fix w z | |
| 189 | assume 1: "w \<in> A" and 2: "\<not> continuous (at w within A) f" and | |
| 190 | 3: "z \<in> A" and 4: "\<not> continuous (at z within A) f" and | |
| 191 | 5: "g w = g z" | |
| 62372 | 192 | from g [OF 1 2 3] g [OF 3 4 1] 5 | 
| 62083 | 193 | show "w = z" by auto | 
| 194 | qed | |
| 62372 | 195 | thus ?thesis | 
| 196 | by (rule countableI') | |
| 62083 | 197 | qed | 
| 198 | ||
| 199 | lemma mono_on_ctble_discont_open: | |
| 200 | fixes f :: "real \<Rightarrow> real" | |
| 201 | fixes A :: "real set" | |
| 202 | assumes "open A" "mono_on f A" | |
| 203 |   shows "countable {a\<in>A. \<not>isCont f a}"
 | |
| 204 | proof - | |
| 205 |   have "{a\<in>A. \<not>isCont f a} = {a\<in>A. \<not>(continuous (at a within A) f)}"
 | |
| 63167 | 206 | by (auto simp add: continuous_within_open [OF _ \<open>open A\<close>]) | 
| 62083 | 207 | thus ?thesis | 
| 208 | apply (elim ssubst) | |
| 209 | by (rule mono_on_ctble_discont, rule assms) | |
| 210 | qed | |
| 211 | ||
| 212 | lemma mono_ctble_discont: | |
| 213 | fixes f :: "real \<Rightarrow> real" | |
| 214 | assumes "mono f" | |
| 215 |   shows "countable {a. \<not> isCont f a}"
 | |
| 216 | using assms mono_on_ctble_discont [of f UNIV] unfolding mono_on_def mono_def by auto | |
| 217 | ||
| 218 | lemma has_real_derivative_imp_continuous_on: | |
| 219 | assumes "\<And>x. x \<in> A \<Longrightarrow> (f has_real_derivative f' x) (at x)" | |
| 220 | shows "continuous_on A f" | |
| 221 | apply (intro differentiable_imp_continuous_on, unfold differentiable_on_def) | |
| 222 | apply (intro ballI Deriv.differentiableI) | |
| 223 | apply (rule has_field_derivative_subset[OF assms]) | |
| 224 | apply simp_all | |
| 225 | done | |
| 226 | ||
| 227 | lemma closure_contains_Sup: | |
| 228 | fixes S :: "real set" | |
| 229 |   assumes "S \<noteq> {}" "bdd_above S"
 | |
| 230 | shows "Sup S \<in> closure S" | |
| 231 | proof- | |
| 62372 | 232 | have "Inf (uminus ` S) \<in> closure (uminus ` S)" | 
| 62083 | 233 | using assms by (intro closure_contains_Inf) auto | 
| 234 | also have "Inf (uminus ` S) = -Sup S" by (simp add: Inf_real_def) | |
| 235 | also have "closure (uminus ` S) = uminus ` closure S" | |
| 236 | by (rule sym, intro closure_injective_linear_image) (auto intro: linearI) | |
| 237 | finally show ?thesis by auto | |
| 238 | qed | |
| 239 | ||
| 240 | lemma closed_contains_Sup: | |
| 241 | fixes S :: "real set" | |
| 242 |   shows "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> closed S \<Longrightarrow> Sup S \<in> S"
 | |
| 243 | by (subst closure_closed[symmetric], assumption, rule closure_contains_Sup) | |
| 244 | ||
| 245 | lemma deriv_nonneg_imp_mono: | |
| 246 |   assumes deriv: "\<And>x. x \<in> {a..b} \<Longrightarrow> (g has_real_derivative g' x) (at x)"
 | |
| 247 |   assumes nonneg: "\<And>x. x \<in> {a..b} \<Longrightarrow> g' x \<ge> 0"
 | |
| 248 | assumes ab: "a \<le> b" | |
| 249 | shows "g a \<le> g b" | |
| 250 | proof (cases "a < b") | |
| 251 | assume "a < b" | |
| 252 | from deriv have "\<forall>x. x \<ge> a \<and> x \<le> b \<longrightarrow> (g has_real_derivative g' x) (at x)" by simp | |
| 62372 | 253 | from MVT2[OF \<open>a < b\<close> this] and deriv | 
| 62083 | 254 | obtain \<xi> where \<xi>_ab: "\<xi> > a" "\<xi> < b" and g_ab: "g b - g a = (b - a) * g' \<xi>" by blast | 
| 255 | from \<xi>_ab ab nonneg have "(b - a) * g' \<xi> \<ge> 0" by simp | |
| 256 | with g_ab show ?thesis by simp | |
| 257 | qed (insert ab, simp) | |
| 258 | ||
| 259 | lemma continuous_interval_vimage_Int: | |
| 260 |   assumes "continuous_on {a::real..b} g" and mono: "\<And>x y. a \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> b \<Longrightarrow> g x \<le> g y"
 | |
| 261 |   assumes "a \<le> b" "(c::real) \<le> d" "{c..d} \<subseteq> {g a..g b}"
 | |
| 262 |   obtains c' d' where "{a..b} \<inter> g -` {c..d} = {c'..d'}" "c' \<le> d'" "g c' = c" "g d' = d"
 | |
| 263 | proof- | |
| 63040 | 264 |   let ?A = "{a..b} \<inter> g -` {c..d}"
 | 
| 265 | from IVT'[of g a c b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5) | |
| 266 | obtain c'' where c'': "c'' \<in> ?A" "g c'' = c" by auto | |
| 267 | from IVT'[of g a d b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5) | |
| 268 | obtain d'' where d'': "d'' \<in> ?A" "g d'' = d" by auto | |
| 269 |   hence [simp]: "?A \<noteq> {}" by blast
 | |
| 62083 | 270 | |
| 63040 | 271 | define c' where "c' = Inf ?A" | 
| 272 | define d' where "d' = Sup ?A" | |
| 273 |   have "?A \<subseteq> {c'..d'}" unfolding c'_def d'_def
 | |
| 274 | by (intro subsetI) (auto intro: cInf_lower cSup_upper) | |
| 275 | moreover from assms have "closed ?A" | |
| 276 |     using continuous_on_closed_vimage[of "{a..b}" g] by (subst Int_commute) simp
 | |
| 277 | hence c'd'_in_set: "c' \<in> ?A" "d' \<in> ?A" unfolding c'_def d'_def | |
| 278 | by ((intro closed_contains_Inf closed_contains_Sup, simp_all)[])+ | |
| 279 |   hence "{c'..d'} \<subseteq> ?A" using assms
 | |
| 280 | by (intro subsetI) | |
| 281 | (auto intro!: order_trans[of c "g c'" "g x" for x] order_trans[of "g x" "g d'" d for x] | |
| 282 | intro!: mono) | |
| 283 | moreover have "c' \<le> d'" using c'd'_in_set(2) unfolding c'_def by (intro cInf_lower) auto | |
| 284 | moreover have "g c' \<le> c" "g d' \<ge> d" | |
| 285 | apply (insert c'' d'' c'd'_in_set) | |
| 286 | apply (subst c''(2)[symmetric]) | |
| 287 | apply (auto simp: c'_def intro!: mono cInf_lower c'') [] | |
| 288 | apply (subst d''(2)[symmetric]) | |
| 289 | apply (auto simp: d'_def intro!: mono cSup_upper d'') [] | |
| 290 | done | |
| 291 | with c'd'_in_set have "g c' = c" "g d' = d" by auto | |
| 292 | ultimately show ?thesis using that by blast | |
| 62083 | 293 | qed | 
| 294 | ||
| 61808 | 295 | subsection \<open>Generic Borel spaces\<close> | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 296 | |
| 62372 | 297 | definition (in topological_space) borel :: "'a measure" where | 
| 47694 | 298 |   "borel = sigma UNIV {S. open S}"
 | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 299 | |
| 47694 | 300 | abbreviation "borel_measurable M \<equiv> measurable M borel" | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 301 | |
| 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 302 | lemma in_borel_measurable: | 
| 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 303 | "f \<in> borel_measurable M \<longleftrightarrow> | 
| 47694 | 304 |     (\<forall>S \<in> sigma_sets UNIV {S. open S}. f -` S \<inter> space M \<in> sets M)"
 | 
| 40859 | 305 | by (auto simp add: measurable_def borel_def) | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 306 | |
| 40859 | 307 | lemma in_borel_measurable_borel: | 
| 38656 | 308 | "f \<in> borel_measurable M \<longleftrightarrow> | 
| 40859 | 309 | (\<forall>S \<in> sets borel. | 
| 38656 | 310 | f -` S \<inter> space M \<in> sets M)" | 
| 40859 | 311 | by (auto simp add: measurable_def borel_def) | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 312 | |
| 40859 | 313 | lemma space_borel[simp]: "space borel = UNIV" | 
| 314 | unfolding borel_def by auto | |
| 38656 | 315 | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 316 | lemma space_in_borel[measurable]: "UNIV \<in> sets borel" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 317 | unfolding borel_def by auto | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 318 | |
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 319 | lemma sets_borel: "sets borel = sigma_sets UNIV {S. open S}"
 | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 320 | unfolding borel_def by (rule sets_measure_of) simp | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 321 | |
| 62083 | 322 | lemma measurable_sets_borel: | 
| 323 | "\<lbrakk>f \<in> measurable borel M; A \<in> sets M\<rbrakk> \<Longrightarrow> f -` A \<in> sets borel" | |
| 324 | by (drule (1) measurable_sets) simp | |
| 325 | ||
| 50387 | 326 | lemma pred_Collect_borel[measurable (raw)]: "Measurable.pred borel P \<Longrightarrow> {x. P x} \<in> sets borel"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 327 | unfolding borel_def pred_def by auto | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 328 | |
| 50003 | 329 | lemma borel_open[measurable (raw generic)]: | 
| 40859 | 330 | assumes "open A" shows "A \<in> sets borel" | 
| 38656 | 331 | proof - | 
| 44537 
c10485a6a7af
make HOL-Probability respect set/pred distinction
 huffman parents: 
44282diff
changeset | 332 |   have "A \<in> {S. open S}" unfolding mem_Collect_eq using assms .
 | 
| 47694 | 333 | thus ?thesis unfolding borel_def by auto | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 334 | qed | 
| 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 335 | |
| 50003 | 336 | lemma borel_closed[measurable (raw generic)]: | 
| 40859 | 337 | assumes "closed A" shows "A \<in> sets borel" | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 338 | proof - | 
| 40859 | 339 | have "space borel - (- A) \<in> sets borel" | 
| 340 | using assms unfolding closed_def by (blast intro: borel_open) | |
| 38656 | 341 | thus ?thesis by simp | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 342 | qed | 
| 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 343 | |
| 50003 | 344 | lemma borel_singleton[measurable]: | 
| 345 | "A \<in> sets borel \<Longrightarrow> insert x A \<in> sets (borel :: 'a::t1_space measure)" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 346 | unfolding insert_def by (rule sets.Un) auto | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 347 | |
| 50003 | 348 | lemma borel_comp[measurable]: "A \<in> sets borel \<Longrightarrow> - A \<in> sets borel" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 349 | unfolding Compl_eq_Diff_UNIV by simp | 
| 41830 | 350 | |
| 47694 | 351 | lemma borel_measurable_vimage: | 
| 38656 | 352 | fixes f :: "'a \<Rightarrow> 'x::t2_space" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 353 | assumes borel[measurable]: "f \<in> borel_measurable M" | 
| 38656 | 354 |   shows "f -` {x} \<inter> space M \<in> sets M"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 355 | by simp | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 356 | |
| 47694 | 357 | lemma borel_measurableI: | 
| 61076 | 358 | fixes f :: "'a \<Rightarrow> 'x::topological_space" | 
| 38656 | 359 | assumes "\<And>S. open S \<Longrightarrow> f -` S \<inter> space M \<in> sets M" | 
| 360 | shows "f \<in> borel_measurable M" | |
| 40859 | 361 | unfolding borel_def | 
| 47694 | 362 | proof (rule measurable_measure_of, simp_all) | 
| 44537 
c10485a6a7af
make HOL-Probability respect set/pred distinction
 huffman parents: 
44282diff
changeset | 363 | 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: 
44282diff
changeset | 364 | using assms[of S] by simp | 
| 40859 | 365 | qed | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 366 | |
| 50021 
d96a3f468203
add support for function application to measurability prover
 hoelzl parents: 
50003diff
changeset | 367 | lemma borel_measurable_const: | 
| 38656 | 368 | "(\<lambda>x. c) \<in> borel_measurable M" | 
| 47694 | 369 | by auto | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 370 | |
| 50003 | 371 | lemma borel_measurable_indicator: | 
| 38656 | 372 | assumes A: "A \<in> sets M" | 
| 373 | shows "indicator A \<in> borel_measurable M" | |
| 46905 | 374 | unfolding indicator_def [abs_def] using A | 
| 47694 | 375 | by (auto intro!: measurable_If_set) | 
| 33533 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 paulson parents: diff
changeset | 376 | |
| 50096 | 377 | lemma borel_measurable_count_space[measurable (raw)]: | 
| 378 | "f \<in> borel_measurable (count_space S)" | |
| 379 | unfolding measurable_def by auto | |
| 380 | ||
| 381 | lemma borel_measurable_indicator'[measurable (raw)]: | |
| 382 |   assumes [measurable]: "{x\<in>space M. f x \<in> A x} \<in> sets M"
 | |
| 383 | shows "(\<lambda>x. indicator (A x) (f x)) \<in> borel_measurable M" | |
| 50001 
382bd3173584
add syntax and a.e.-rules for (conditional) probability on predicates
 hoelzl parents: 
49774diff
changeset | 384 | unfolding indicator_def[abs_def] | 
| 
382bd3173584
add syntax and a.e.-rules for (conditional) probability on predicates
 hoelzl parents: 
49774diff
changeset | 385 | by (auto intro!: measurable_If) | 
| 
382bd3173584
add syntax and a.e.-rules for (conditional) probability on predicates
 hoelzl parents: 
49774diff
changeset | 386 | |
| 47694 | 387 | lemma borel_measurable_indicator_iff: | 
| 40859 | 388 |   "(indicator A :: 'a \<Rightarrow> 'x::{t1_space, zero_neq_one}) \<in> borel_measurable M \<longleftrightarrow> A \<inter> space M \<in> sets M"
 | 
| 389 | (is "?I \<in> borel_measurable M \<longleftrightarrow> _") | |
| 390 | proof | |
| 391 | assume "?I \<in> borel_measurable M" | |
| 392 |   then have "?I -` {1} \<inter> space M \<in> sets M"
 | |
| 393 | unfolding measurable_def by auto | |
| 394 |   also have "?I -` {1} \<inter> space M = A \<inter> space M"
 | |
| 46905 | 395 | unfolding indicator_def [abs_def] by auto | 
| 40859 | 396 | finally show "A \<inter> space M \<in> sets M" . | 
| 397 | next | |
| 398 | assume "A \<inter> space M \<in> sets M" | |
| 399 | moreover have "?I \<in> borel_measurable M \<longleftrightarrow> | |
| 400 | (indicator (A \<inter> space M) :: 'a \<Rightarrow> 'x) \<in> borel_measurable M" | |
| 401 | by (intro measurable_cong) (auto simp: indicator_def) | |
| 402 | ultimately show "?I \<in> borel_measurable M" by auto | |
| 403 | qed | |
| 404 | ||
| 47694 | 405 | lemma borel_measurable_subalgebra: | 
| 41545 | 406 | assumes "sets N \<subseteq> sets M" "space N = space M" "f \<in> borel_measurable N" | 
| 39092 | 407 | shows "f \<in> borel_measurable M" | 
| 408 | using assms unfolding measurable_def by auto | |
| 409 | ||
| 57137 | 410 | lemma borel_measurable_restrict_space_iff_ereal: | 
| 411 | fixes f :: "'a \<Rightarrow> ereal" | |
| 412 | assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M" | |
| 413 | shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow> | |
| 414 | (\<lambda>x. f x * indicator \<Omega> x) \<in> borel_measurable M" | |
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 415 | by (subst measurable_restrict_space_iff) | 
| 63566 | 416 | (auto simp: indicator_def if_distrib[where f="\<lambda>x. a * x" for a] cong del: if_weak_cong) | 
| 57137 | 417 | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 418 | lemma borel_measurable_restrict_space_iff_ennreal: | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 419 | fixes f :: "'a \<Rightarrow> ennreal" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 420 | assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 421 | shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow> | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 422 | (\<lambda>x. f x * indicator \<Omega> x) \<in> borel_measurable M" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 423 | by (subst measurable_restrict_space_iff) | 
| 63566 | 424 | (auto simp: indicator_def if_distrib[where f="\<lambda>x. a * x" for a] cong del: if_weak_cong) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 425 | |
| 57137 | 426 | lemma borel_measurable_restrict_space_iff: | 
| 427 | fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" | |
| 428 | assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M" | |
| 429 | shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow> | |
| 430 | (\<lambda>x. indicator \<Omega> x *\<^sub>R f x) \<in> borel_measurable M" | |
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 431 | by (subst measurable_restrict_space_iff) | 
| 63566 | 432 | (auto simp: indicator_def if_distrib[where f="\<lambda>x. x *\<^sub>R a" for a] ac_simps | 
| 433 | cong del: if_weak_cong) | |
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 434 | |
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 435 | lemma cbox_borel[measurable]: "cbox a b \<in> sets borel" | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 436 | by (auto intro: borel_closed) | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 437 | |
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 438 | lemma box_borel[measurable]: "box a b \<in> sets borel" | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 439 | by (auto intro: borel_open) | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 440 | |
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 441 | lemma borel_compact: "compact (A::'a::t2_space set) \<Longrightarrow> A \<in> sets borel" | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 442 | by (auto intro: borel_closed dest!: compact_imp_closed) | 
| 57137 | 443 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 444 | lemma borel_sigma_sets_subset: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 445 | "A \<subseteq> sets borel \<Longrightarrow> sigma_sets UNIV A \<subseteq> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 446 | using sets.sigma_sets_subset[of A borel] by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 447 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 448 | lemma borel_eq_sigmaI1: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 449 | fixes F :: "'i \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 450 | assumes borel_eq: "borel = sigma UNIV X" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 451 | assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (F ` A))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 452 | assumes F: "\<And>i. i \<in> A \<Longrightarrow> F i \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 453 | shows "borel = sigma UNIV (F ` A)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 454 | unfolding borel_def | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 455 | proof (intro sigma_eqI antisym) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 456 |   have borel_rev_eq: "sigma_sets UNIV {S::'a set. open S} = sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 457 | unfolding borel_def by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 458 | also have "\<dots> = sigma_sets UNIV X" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 459 | unfolding borel_eq by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 460 | also have "\<dots> \<subseteq> sigma_sets UNIV (F`A)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 461 | using X by (intro sigma_algebra.sigma_sets_subset[OF sigma_algebra_sigma_sets]) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 462 |   finally show "sigma_sets UNIV {S. open S} \<subseteq> sigma_sets UNIV (F`A)" .
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 463 |   show "sigma_sets UNIV (F`A) \<subseteq> sigma_sets UNIV {S. open S}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 464 | unfolding borel_rev_eq using F by (intro borel_sigma_sets_subset) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 465 | qed auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 466 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 467 | lemma borel_eq_sigmaI2: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 468 | fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 469 | and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 470 | assumes borel_eq: "borel = sigma UNIV ((\<lambda>(i, j). G i j)`B)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 471 | assumes X: "\<And>i j. (i, j) \<in> B \<Longrightarrow> G i j \<in> sets (sigma UNIV ((\<lambda>(i, j). F i j) ` A))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 472 | assumes F: "\<And>i j. (i, j) \<in> A \<Longrightarrow> F i j \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 473 | shows "borel = sigma UNIV ((\<lambda>(i, j). F i j) ` A)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 474 | using assms | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 475 | by (intro borel_eq_sigmaI1[where X="(\<lambda>(i, j). G i j) ` B" and F="(\<lambda>(i, j). F i j)"]) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 476 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 477 | lemma borel_eq_sigmaI3: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 478 | fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 479 | assumes borel_eq: "borel = sigma UNIV X" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 480 | assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV ((\<lambda>(i, j). F i j) ` A))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 481 | assumes F: "\<And>i j. (i, j) \<in> A \<Longrightarrow> F i j \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 482 | shows "borel = sigma UNIV ((\<lambda>(i, j). F i j) ` A)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 483 | using assms by (intro borel_eq_sigmaI1[where X=X and F="(\<lambda>(i, j). F i j)"]) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 484 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 485 | lemma borel_eq_sigmaI4: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 486 | fixes F :: "'i \<Rightarrow> 'a::topological_space set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 487 | and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 488 | assumes borel_eq: "borel = sigma UNIV ((\<lambda>(i, j). G i j)`A)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 489 | assumes X: "\<And>i j. (i, j) \<in> A \<Longrightarrow> G i j \<in> sets (sigma UNIV (range F))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 490 | assumes F: "\<And>i. F i \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 491 | shows "borel = sigma UNIV (range F)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 492 | using assms by (intro borel_eq_sigmaI1[where X="(\<lambda>(i, j). G i j) ` A" and F=F]) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 493 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 494 | lemma borel_eq_sigmaI5: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 495 | fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and G :: "'l \<Rightarrow> 'a::topological_space set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 496 | assumes borel_eq: "borel = sigma UNIV (range G)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 497 | assumes X: "\<And>i. G i \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 498 | assumes F: "\<And>i j. F i j \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 499 | shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 500 | using assms by (intro borel_eq_sigmaI1[where X="range G" and F="(\<lambda>(i, j). F i j)"]) auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 501 | |
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 502 | lemma second_countable_borel_measurable: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 503 | fixes X :: "'a::second_countable_topology set set" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 504 | assumes eq: "open = generate_topology X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 505 | shows "borel = sigma UNIV X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 506 | unfolding borel_def | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 507 | proof (intro sigma_eqI sigma_sets_eqI) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 508 | interpret X: sigma_algebra UNIV "sigma_sets UNIV X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 509 | by (rule sigma_algebra_sigma_sets) simp | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 510 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 511 | fix S :: "'a set" assume "S \<in> Collect open" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 512 | then have "generate_topology X S" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 513 | by (auto simp: eq) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 514 | then show "S \<in> sigma_sets UNIV X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 515 | proof induction | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 516 | case (UN K) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 517 | then have K: "\<And>k. k \<in> K \<Longrightarrow> open k" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 518 | unfolding eq by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 519 | from ex_countable_basis obtain B :: "'a set set" where | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 520 | B: "\<And>b. b \<in> B \<Longrightarrow> open b" "\<And>X. open X \<Longrightarrow> \<exists>b\<subseteq>B. (\<Union>b) = X" and "countable B" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 521 | by (auto simp: topological_basis_def) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 522 | from B(2)[OF K] obtain m where m: "\<And>k. k \<in> K \<Longrightarrow> m k \<subseteq> B" "\<And>k. k \<in> K \<Longrightarrow> (\<Union>m k) = k" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 523 | by metis | 
| 63040 | 524 | define U where "U = (\<Union>k\<in>K. m k)" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 525 | with m have "countable U" | 
| 61808 | 526 | by (intro countable_subset[OF _ \<open>countable B\<close>]) auto | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 527 | have "\<Union>U = (\<Union>A\<in>U. A)" by simp | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 528 | also have "\<dots> = \<Union>K" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 529 | unfolding U_def UN_simps by (simp add: m) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 530 | finally have "\<Union>U = \<Union>K" . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 531 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 532 | have "\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 533 | using m by (auto simp: U_def) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 534 | then obtain u where u: "\<And>b. b \<in> U \<Longrightarrow> u b \<in> K" and "\<And>b. b \<in> U \<Longrightarrow> b \<subseteq> u b" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 535 | by metis | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 536 | then have "(\<Union>b\<in>U. u b) \<subseteq> \<Union>K" "\<Union>U \<subseteq> (\<Union>b\<in>U. u b)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 537 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 538 | then have "\<Union>K = (\<Union>b\<in>U. u b)" | 
| 61808 | 539 | unfolding \<open>\<Union>U = \<Union>K\<close> by auto | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 540 | also have "\<dots> \<in> sigma_sets UNIV X" | 
| 61808 | 541 | using u UN by (intro X.countable_UN' \<open>countable U\<close>) auto | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 542 | finally show "\<Union>K \<in> sigma_sets UNIV X" . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 543 | qed auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 544 | qed (auto simp: eq intro: generate_topology.Basis) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 545 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 546 | lemma borel_eq_closed: "borel = sigma UNIV (Collect closed)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 547 | unfolding borel_def | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 548 | proof (intro sigma_eqI sigma_sets_eqI, safe) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 549 | fix x :: "'a set" assume "open x" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 550 | hence "x = UNIV - (UNIV - x)" by auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 551 | also have "\<dots> \<in> sigma_sets UNIV (Collect closed)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 552 | by (force intro: sigma_sets.Compl simp: \<open>open x\<close>) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 553 | finally show "x \<in> sigma_sets UNIV (Collect closed)" by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 554 | next | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 555 | fix x :: "'a set" assume "closed x" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 556 | hence "x = UNIV - (UNIV - x)" by auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 557 | also have "\<dots> \<in> sigma_sets UNIV (Collect open)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 558 | by (force intro: sigma_sets.Compl simp: \<open>closed x\<close>) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 559 | finally show "x \<in> sigma_sets UNIV (Collect open)" by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 560 | qed simp_all | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 561 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 562 | lemma borel_eq_countable_basis: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 563 | fixes B::"'a::topological_space set set" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 564 | assumes "countable B" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 565 | assumes "topological_basis B" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 566 | shows "borel = sigma UNIV B" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 567 | unfolding borel_def | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 568 | proof (intro sigma_eqI sigma_sets_eqI, safe) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 569 | interpret countable_basis using assms by unfold_locales | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 570 | fix X::"'a set" assume "open X" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 571 | from open_countable_basisE[OF this] guess B' . note B' = this | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 572 | then show "X \<in> sigma_sets UNIV B" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 573 | by (blast intro: sigma_sets_UNION \<open>countable B\<close> countable_subset) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 574 | next | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 575 | fix b assume "b \<in> B" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 576 | hence "open b" by (rule topological_basis_open[OF assms(2)]) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 577 | thus "b \<in> sigma_sets UNIV (Collect open)" by auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 578 | qed simp_all | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 579 | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 580 | lemma borel_measurable_continuous_on_restrict: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 581 | fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 582 | assumes f: "continuous_on A f" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 583 | shows "f \<in> borel_measurable (restrict_space borel A)" | 
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 584 | proof (rule borel_measurableI) | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 585 | fix S :: "'b set" assume "open S" | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 586 | with f obtain T where "f -` S \<inter> A = T \<inter> A" "open T" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 587 | by (metis continuous_on_open_invariant) | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 588 | then show "f -` S \<inter> space (restrict_space borel A) \<in> sets (restrict_space borel A)" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 589 | by (force simp add: sets_restrict_space space_restrict_space) | 
| 57137 | 590 | qed | 
| 591 | ||
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 592 | lemma borel_measurable_continuous_on1: "continuous_on UNIV f \<Longrightarrow> f \<in> borel_measurable borel" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 593 | by (drule borel_measurable_continuous_on_restrict) simp | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 594 | |
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 595 | lemma borel_measurable_continuous_on_if: | 
| 59415 | 596 | "A \<in> sets borel \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on (- A) g \<Longrightarrow> | 
| 597 | (\<lambda>x. if x \<in> A then f x else g x) \<in> borel_measurable borel" | |
| 598 | by (auto simp add: measurable_If_restrict_space_iff Collect_neg_eq | |
| 599 | intro!: borel_measurable_continuous_on_restrict) | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 600 | |
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 601 | lemma borel_measurable_continuous_countable_exceptions: | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 602 | fixes f :: "'a::t1_space \<Rightarrow> 'b::topological_space" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 603 | assumes X: "countable X" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 604 | assumes "continuous_on (- X) f" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 605 | shows "f \<in> borel_measurable borel" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 606 | proof (rule measurable_discrete_difference[OF _ X]) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 607 | have "X \<in> sets borel" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 608 | by (rule sets.countable[OF _ X]) auto | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 609 | then show "(\<lambda>x. if x \<in> X then undefined else f x) \<in> borel_measurable borel" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 610 | by (intro borel_measurable_continuous_on_if assms continuous_intros) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 611 | qed auto | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 612 | |
| 57138 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 613 | lemma borel_measurable_continuous_on: | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 614 | assumes f: "continuous_on UNIV f" and g: "g \<in> borel_measurable M" | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 615 | shows "(\<lambda>x. f (g x)) \<in> borel_measurable M" | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 616 | using measurable_comp[OF g borel_measurable_continuous_on1[OF f]] by (simp add: comp_def) | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 617 | |
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 618 | lemma borel_measurable_continuous_on_indicator: | 
| 
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
 hoelzl parents: 
57137diff
changeset | 619 | fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" | 
| 59415 | 620 | shows "A \<in> sets borel \<Longrightarrow> continuous_on A f \<Longrightarrow> (\<lambda>x. indicator A x *\<^sub>R f x) \<in> borel_measurable borel" | 
| 621 | by (subst borel_measurable_restrict_space_iff[symmetric]) | |
| 622 | (auto intro: borel_measurable_continuous_on_restrict) | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 623 | |
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 624 | lemma borel_measurable_Pair[measurable (raw)]: | 
| 50881 
ae630bab13da
renamed countable_basis_space to second_countable_topology
 hoelzl parents: 
50526diff
changeset | 625 | fixes f :: "'a \<Rightarrow> 'b::second_countable_topology" and g :: "'a \<Rightarrow> 'c::second_countable_topology" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 626 | assumes f[measurable]: "f \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 627 | assumes g[measurable]: "g \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 628 | shows "(\<lambda>x. (f x, g x)) \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 629 | proof (subst borel_eq_countable_basis) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 630 | let ?B = "SOME B::'b set set. countable B \<and> topological_basis B" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 631 | let ?C = "SOME B::'c set set. countable B \<and> topological_basis B" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 632 | let ?P = "(\<lambda>(b, c). b \<times> c) ` (?B \<times> ?C)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 633 | show "countable ?P" "topological_basis ?P" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 634 | by (auto intro!: countable_basis topological_basis_prod is_basis) | 
| 38656 | 635 | |
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 636 | show "(\<lambda>x. (f x, g x)) \<in> measurable M (sigma UNIV ?P)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 637 | proof (rule measurable_measure_of) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 638 | fix S assume "S \<in> ?P" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 639 | then obtain b c where "b \<in> ?B" "c \<in> ?C" and S: "S = b \<times> c" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 640 | then have borel: "open b" "open c" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 641 | by (auto intro: is_basis topological_basis_open) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 642 | have "(\<lambda>x. (f x, g x)) -` S \<inter> space M = (f -` b \<inter> space M) \<inter> (g -` c \<inter> space M)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 643 | unfolding S by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 644 | also have "\<dots> \<in> sets M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 645 | using borel by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 646 | finally show "(\<lambda>x. (f x, g x)) -` S \<inter> space M \<in> sets M" . | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 647 | qed auto | 
| 39087 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
 hoelzl parents: 
39083diff
changeset | 648 | qed | 
| 
96984bf6fa5b
Measurable on euclidean space is equiv. to measurable components
 hoelzl parents: 
39083diff
changeset | 649 | |
| 49774 | 650 | lemma borel_measurable_continuous_Pair: | 
| 50881 
ae630bab13da
renamed countable_basis_space to second_countable_topology
 hoelzl parents: 
50526diff
changeset | 651 | fixes f :: "'a \<Rightarrow> 'b::second_countable_topology" and g :: "'a \<Rightarrow> 'c::second_countable_topology" | 
| 50003 | 652 | assumes [measurable]: "f \<in> borel_measurable M" | 
| 653 | assumes [measurable]: "g \<in> borel_measurable M" | |
| 49774 | 654 | assumes H: "continuous_on UNIV (\<lambda>x. H (fst x) (snd x))" | 
| 655 | shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M" | |
| 656 | proof - | |
| 657 | have eq: "(\<lambda>x. H (f x) (g x)) = (\<lambda>x. (\<lambda>x. H (fst x) (snd x)) (f x, g x))" by auto | |
| 658 | show ?thesis | |
| 659 | unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto | |
| 660 | qed | |
| 661 | ||
| 61808 | 662 | subsection \<open>Borel spaces on order topologies\<close> | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 663 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 664 | lemma [measurable]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 665 | fixes a b :: "'a::linorder_topology" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 666 |   shows lessThan_borel: "{..< a} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 667 |     and greaterThan_borel: "{a <..} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 668 |     and greaterThanLessThan_borel: "{a<..<b} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 669 |     and atMost_borel: "{..a} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 670 |     and atLeast_borel: "{a..} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 671 |     and atLeastAtMost_borel: "{a..b} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 672 |     and greaterThanAtMost_borel: "{a<..b} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 673 |     and atLeastLessThan_borel: "{a..<b} \<in> sets borel"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 674 | unfolding greaterThanAtMost_def atLeastLessThan_def | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 675 | by (blast intro: borel_open borel_closed open_lessThan open_greaterThan open_greaterThanLessThan | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 676 | closed_atMost closed_atLeast closed_atLeastAtMost)+ | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 677 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 678 | lemma borel_Iio: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 679 |   "borel = sigma UNIV (range lessThan :: 'a::{linorder_topology, second_countable_topology} set set)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 680 | unfolding second_countable_borel_measurable[OF open_generated_order] | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 681 | proof (intro sigma_eqI sigma_sets_eqI) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 682 | from countable_dense_setE guess D :: "'a set" . note D = this | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 683 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 684 | interpret L: sigma_algebra UNIV "sigma_sets UNIV (range lessThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 685 | by (rule sigma_algebra_sigma_sets) simp | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 686 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 687 | fix A :: "'a set" assume "A \<in> range lessThan \<union> range greaterThan" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 688 |   then obtain y where "A = {y <..} \<or> A = {..< y}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 689 | by blast | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 690 | then show "A \<in> sigma_sets UNIV (range lessThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 691 | proof | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 692 |     assume A: "A = {y <..}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 693 | show ?thesis | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 694 | proof cases | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 695 | assume "\<forall>x>y. \<exists>d. y < d \<and> d < x" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 696 |       with D(2)[of "{y <..< x}" for x] have "\<forall>x>y. \<exists>d\<in>D. y < d \<and> d < x"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 697 | by (auto simp: set_eq_iff) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 698 |       then have "A = UNIV - (\<Inter>d\<in>{d\<in>D. y < d}. {..< d})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 699 | by (auto simp: A) (metis less_asym) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 700 | also have "\<dots> \<in> sigma_sets UNIV (range lessThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 701 | using D(1) by (intro L.Diff L.top L.countable_INT'') auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 702 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 703 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 704 | assume "\<not> (\<forall>x>y. \<exists>d. y < d \<and> d < x)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 705 | then obtain x where "y < x" "\<And>d. y < d \<Longrightarrow> \<not> d < x" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 706 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 707 |       then have "A = UNIV - {..< x}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 708 | unfolding A by (auto simp: not_less[symmetric]) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 709 | also have "\<dots> \<in> sigma_sets UNIV (range lessThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 710 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 711 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 712 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 713 | qed auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 714 | qed auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 715 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 716 | lemma borel_Ioi: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 717 |   "borel = sigma UNIV (range greaterThan :: 'a::{linorder_topology, second_countable_topology} set set)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 718 | unfolding second_countable_borel_measurable[OF open_generated_order] | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 719 | proof (intro sigma_eqI sigma_sets_eqI) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 720 | from countable_dense_setE guess D :: "'a set" . note D = this | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 721 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 722 | interpret L: sigma_algebra UNIV "sigma_sets UNIV (range greaterThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 723 | by (rule sigma_algebra_sigma_sets) simp | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 724 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 725 | fix A :: "'a set" assume "A \<in> range lessThan \<union> range greaterThan" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 726 |   then obtain y where "A = {y <..} \<or> A = {..< y}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 727 | by blast | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 728 | then show "A \<in> sigma_sets UNIV (range greaterThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 729 | proof | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 730 |     assume A: "A = {..< y}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 731 | show ?thesis | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 732 | proof cases | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 733 | assume "\<forall>x<y. \<exists>d. x < d \<and> d < y" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 734 |       with D(2)[of "{x <..< y}" for x] have "\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 735 | by (auto simp: set_eq_iff) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 736 |       then have "A = UNIV - (\<Inter>d\<in>{d\<in>D. d < y}. {d <..})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 737 | by (auto simp: A) (metis less_asym) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 738 | also have "\<dots> \<in> sigma_sets UNIV (range greaterThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 739 | using D(1) by (intro L.Diff L.top L.countable_INT'') auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 740 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 741 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 742 | assume "\<not> (\<forall>x<y. \<exists>d. x < d \<and> d < y)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 743 | then obtain x where "x < y" "\<And>d. y > d \<Longrightarrow> x \<ge> d" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 744 | by (auto simp: not_less[symmetric]) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 745 |       then have "A = UNIV - {x <..}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 746 | unfolding A Compl_eq_Diff_UNIV[symmetric] by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 747 | also have "\<dots> \<in> sigma_sets UNIV (range greaterThan)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 748 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 749 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 750 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 751 | qed auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 752 | qed auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 753 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 754 | lemma borel_measurableI_less: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 755 |   fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 756 |   shows "(\<And>y. {x\<in>space M. f x < y} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 757 | unfolding borel_Iio | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 758 | by (rule measurable_measure_of) (auto simp: Int_def conj_commute) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 759 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 760 | lemma borel_measurableI_greater: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 761 |   fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 762 |   shows "(\<And>y. {x\<in>space M. y < f x} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 763 | unfolding borel_Ioi | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 764 | by (rule measurable_measure_of) (auto simp: Int_def conj_commute) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 765 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 766 | lemma borel_measurableI_le: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 767 |   fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 768 |   shows "(\<And>y. {x\<in>space M. f x \<le> y} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 769 | by (rule borel_measurableI_greater) (auto simp: not_le[symmetric]) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 770 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 771 | lemma borel_measurableI_ge: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 772 |   fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 773 |   shows "(\<And>y. {x\<in>space M. y \<le> f x} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 774 | by (rule borel_measurableI_less) (auto simp: not_le[symmetric]) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 775 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 776 | lemma borel_measurable_less[measurable]: | 
| 63332 | 777 |   fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 778 | assumes "f \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 779 | assumes "g \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 780 |   shows "{w \<in> space M. f w < g w} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 781 | proof - | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 782 |   have "{w \<in> space M. f w < g w} = (\<lambda>x. (f x, g x)) -` {x. fst x < snd x} \<inter> space M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 783 | by auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 784 | also have "\<dots> \<in> sets M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 785 | by (intro measurable_sets[OF borel_measurable_Pair borel_open, OF assms open_Collect_less] | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 786 | continuous_intros) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 787 | finally show ?thesis . | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 788 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 789 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 790 | lemma | 
| 63332 | 791 |   fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 792 | assumes f[measurable]: "f \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 793 | assumes g[measurable]: "g \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 794 |   shows borel_measurable_le[measurable]: "{w \<in> space M. f w \<le> g w} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 795 |     and borel_measurable_eq[measurable]: "{w \<in> space M. f w = g w} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 796 |     and borel_measurable_neq: "{w \<in> space M. f w \<noteq> g w} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 797 | unfolding eq_iff not_less[symmetric] | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 798 | by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 799 | |
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 800 | lemma borel_measurable_SUP[measurable (raw)]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 801 |   fixes F :: "_ \<Rightarrow> _ \<Rightarrow> _::{complete_linorder, linorder_topology, second_countable_topology}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 802 | assumes [simp]: "countable I" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 803 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 804 | shows "(\<lambda>x. SUP i:I. F i x) \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 805 | by (rule borel_measurableI_greater) (simp add: less_SUP_iff) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 806 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 807 | lemma borel_measurable_INF[measurable (raw)]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 808 |   fixes F :: "_ \<Rightarrow> _ \<Rightarrow> _::{complete_linorder, linorder_topology, second_countable_topology}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 809 | assumes [simp]: "countable I" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 810 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 811 | shows "(\<lambda>x. INF i:I. F i x) \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 812 | by (rule borel_measurableI_less) (simp add: INF_less_iff) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 813 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 814 | lemma borel_measurable_cSUP[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 815 |   fixes F :: "_ \<Rightarrow> _ \<Rightarrow> 'a::{conditionally_complete_linorder, linorder_topology, second_countable_topology}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 816 | assumes [simp]: "countable I" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 817 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 818 | assumes bdd: "\<And>x. x \<in> space M \<Longrightarrow> bdd_above ((\<lambda>i. F i x) ` I)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 819 | shows "(\<lambda>x. SUP i:I. F i x) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 820 | proof cases | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 821 |   assume "I = {}" then show ?thesis
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 822 |     unfolding \<open>I = {}\<close> image_empty by simp
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 823 | next | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 824 |   assume "I \<noteq> {}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 825 | show ?thesis | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 826 | proof (rule borel_measurableI_le) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 827 | fix y | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 828 |     have "{x \<in> space M. \<forall>i\<in>I. F i x \<le> y} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 829 | by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 830 |     also have "{x \<in> space M. \<forall>i\<in>I. F i x \<le> y} = {x \<in> space M. (SUP i:I. F i x) \<le> y}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 831 |       by (simp add: cSUP_le_iff \<open>I \<noteq> {}\<close> bdd cong: conj_cong)
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 832 |     finally show "{x \<in> space M. (SUP i:I. F i x) \<le>  y} \<in> sets M"  .
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 833 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 834 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 835 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 836 | lemma borel_measurable_cINF[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 837 |   fixes F :: "_ \<Rightarrow> _ \<Rightarrow> 'a::{conditionally_complete_linorder, linorder_topology, second_countable_topology}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 838 | assumes [simp]: "countable I" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 839 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 840 | assumes bdd: "\<And>x. x \<in> space M \<Longrightarrow> bdd_below ((\<lambda>i. F i x) ` I)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 841 | shows "(\<lambda>x. INF i:I. F i x) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 842 | proof cases | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 843 |   assume "I = {}" then show ?thesis
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 844 |     unfolding \<open>I = {}\<close> image_empty by simp
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 845 | next | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 846 |   assume "I \<noteq> {}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 847 | show ?thesis | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 848 | proof (rule borel_measurableI_ge) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 849 | fix y | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 850 |     have "{x \<in> space M. \<forall>i\<in>I. y \<le> F i x} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 851 | by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 852 |     also have "{x \<in> space M. \<forall>i\<in>I. y \<le> F i x} = {x \<in> space M. y \<le> (INF i:I. F i x)}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 853 |       by (simp add: le_cINF_iff \<open>I \<noteq> {}\<close> bdd cong: conj_cong)
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 854 |     finally show "{x \<in> space M. y \<le> (INF i:I. F i x)} \<in> sets M"  .
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 855 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 856 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 857 | |
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 858 | lemma borel_measurable_lfp[consumes 1, case_names continuity step]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 859 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_linorder, linorder_topology, second_countable_topology})"
 | 
| 60172 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 hoelzl parents: 
60150diff
changeset | 860 | assumes "sup_continuous F" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 861 | assumes *: "\<And>f. f \<in> borel_measurable M \<Longrightarrow> F f \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 862 | shows "lfp F \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 863 | proof - | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 864 |   { fix i have "((F ^^ i) bot) \<in> borel_measurable M"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 865 | by (induct i) (auto intro!: *) } | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 866 | then have "(\<lambda>x. SUP i. (F ^^ i) bot x) \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 867 | by measurable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 868 | also have "(\<lambda>x. SUP i. (F ^^ i) bot x) = (SUP i. (F ^^ i) bot)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 869 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 870 | also have "(SUP i. (F ^^ i) bot) = lfp F" | 
| 60172 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 hoelzl parents: 
60150diff
changeset | 871 | by (rule sup_continuous_lfp[symmetric]) fact | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 872 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 873 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 874 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 875 | lemma borel_measurable_gfp[consumes 1, case_names continuity step]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 876 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_linorder, linorder_topology, second_countable_topology})"
 | 
| 60172 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 hoelzl parents: 
60150diff
changeset | 877 | assumes "inf_continuous F" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 878 | assumes *: "\<And>f. f \<in> borel_measurable M \<Longrightarrow> F f \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 879 | shows "gfp F \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 880 | proof - | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 881 |   { fix i have "((F ^^ i) top) \<in> borel_measurable M"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 882 | by (induct i) (auto intro!: * simp: bot_fun_def) } | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 883 | then have "(\<lambda>x. INF i. (F ^^ i) top x) \<in> borel_measurable M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 884 | by measurable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 885 | also have "(\<lambda>x. INF i. (F ^^ i) top x) = (INF i. (F ^^ i) top)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 886 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 887 | also have "\<dots> = gfp F" | 
| 60172 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 hoelzl parents: 
60150diff
changeset | 888 | by (rule inf_continuous_gfp[symmetric]) fact | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 889 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 890 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59000diff
changeset | 891 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 892 | lemma borel_measurable_max[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 893 |   "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. max (g x) (f x) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 894 | by (rule borel_measurableI_less) simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 895 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 896 | lemma borel_measurable_min[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 897 |   "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. min (g x) (f x) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 898 | by (rule borel_measurableI_greater) simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 899 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 900 | lemma borel_measurable_Min[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 901 |   "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Min ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 902 | proof (induct I rule: finite_induct) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 903 | case (insert i I) then show ?case | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 904 |     by (cases "I = {}") auto
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 905 | qed auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 906 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 907 | lemma borel_measurable_Max[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 908 |   "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Max ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 909 | proof (induct I rule: finite_induct) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 910 | case (insert i I) then show ?case | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 911 |     by (cases "I = {}") auto
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 912 | qed auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 913 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 914 | lemma borel_measurable_sup[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 915 |   "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. sup (g x) (f x) :: 'b::{lattice, second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 916 | unfolding sup_max by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 917 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 918 | lemma borel_measurable_inf[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 919 |   "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. inf (g x) (f x) :: 'b::{lattice, second_countable_topology, linorder_topology}) \<in> borel_measurable M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 920 | unfolding inf_min by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 921 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 922 | lemma [measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 923 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 924 | assumes "\<And>i. f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 925 | shows borel_measurable_liminf: "(\<lambda>x. liminf (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 926 | and borel_measurable_limsup: "(\<lambda>x. limsup (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 927 | unfolding liminf_SUP_INF limsup_INF_SUP using assms by auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 928 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 929 | lemma measurable_convergent[measurable (raw)]: | 
| 63332 | 930 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 931 | assumes [measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 932 | shows "Measurable.pred M (\<lambda>x. convergent (\<lambda>i. f i x))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 933 | unfolding convergent_ereal by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 934 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 935 | lemma sets_Collect_convergent[measurable]: | 
| 63332 | 936 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 937 | assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 938 |   shows "{x\<in>space M. convergent (\<lambda>i. f i x)} \<in> sets M"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 939 | by measurable | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 940 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 941 | lemma borel_measurable_lim[measurable (raw)]: | 
| 63332 | 942 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 943 | assumes [measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 944 | shows "(\<lambda>x. lim (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 945 | proof - | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 946 | have "\<And>x. lim (\<lambda>i. f i x) = (if convergent (\<lambda>i. f i x) then limsup (\<lambda>i. f i x) else (THE i. False))" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 947 | by (simp add: lim_def convergent_def convergent_limsup_cl) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 948 | then show ?thesis | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 949 | by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 950 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 951 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 952 | lemma borel_measurable_LIMSEQ_order: | 
| 63332 | 953 |   fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 954 | assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) \<longlonglongrightarrow> u' x" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 955 | and u: "\<And>i. u i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 956 | shows "u' \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 957 | proof - | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 958 | have "\<And>x. x \<in> space M \<Longrightarrow> u' x = liminf (\<lambda>n. u n x)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 959 | using u' by (simp add: lim_imp_Liminf[symmetric]) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 960 | with u show ?thesis by (simp cong: measurable_cong) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 961 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 962 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 963 | subsection \<open>Borel spaces on topological monoids\<close> | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 964 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 965 | lemma borel_measurable_add[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 966 |   fixes f g :: "'a \<Rightarrow> 'b::{second_countable_topology, topological_monoid_add}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 967 | assumes f: "f \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 968 | assumes g: "g \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 969 | shows "(\<lambda>x. f x + g x) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 970 | using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 971 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 972 | lemma borel_measurable_setsum[measurable (raw)]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 973 |   fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> 'b::{second_countable_topology, topological_comm_monoid_add}"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 974 | assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 975 | shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 976 | proof cases | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 977 | assume "finite S" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 978 | thus ?thesis using assms by induct auto | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 979 | qed simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 980 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 981 | lemma borel_measurable_suminf_order[measurable (raw)]: | 
| 63332 | 982 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology, topological_comm_monoid_add}"
 | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 983 | assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 984 | shows "(\<lambda>x. suminf (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 985 | unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 986 | |
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 987 | subsection \<open>Borel spaces on Euclidean spaces\<close> | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 988 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 989 | lemma borel_measurable_inner[measurable (raw)]: | 
| 50881 
ae630bab13da
renamed countable_basis_space to second_countable_topology
 hoelzl parents: 
50526diff
changeset | 990 |   fixes f g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_inner}"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 991 | assumes "f \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 992 | assumes "g \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 993 | shows "(\<lambda>x. f x \<bullet> g x) \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 994 | using assms | 
| 56371 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 hoelzl parents: 
56212diff
changeset | 995 | by (rule borel_measurable_continuous_Pair) (intro continuous_intros) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 996 | |
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 997 | notation | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 998 | eucl_less (infix "<e" 50) | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 999 | |
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1000 | lemma box_oc: "{x. a <e x \<and> x \<le> b} = {x. a <e x} \<inter> {..b}"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1001 |   and box_co: "{x. a \<le> x \<and> x <e b} = {a..} \<inter> {x. x <e b}"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1002 | by auto | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1003 | |
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1004 | lemma eucl_ivals[measurable]: | 
| 61076 | 1005 | fixes a b :: "'a::ordered_euclidean_space" | 
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1006 |   shows "{x. x <e a} \<in> sets borel"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1007 |     and "{x. a <e x} \<in> sets borel"
 | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1008 |     and "{..a} \<in> sets borel"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1009 |     and "{a..} \<in> sets borel"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1010 |     and "{a..b} \<in> sets borel"
 | 
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1011 |     and  "{x. a <e x \<and> x \<le> b} \<in> sets borel"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1012 |     and "{x. a \<le> x \<and>  x <e b} \<in> sets borel"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1013 | unfolding box_oc box_co | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1014 | by (auto intro: borel_open borel_closed) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1015 | |
| 62372 | 1016 | lemma | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1017 |   fixes i :: "'a::{second_countable_topology, real_inner}"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1018 |   shows hafspace_less_borel: "{x. a < x \<bullet> i} \<in> sets borel"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1019 |     and hafspace_greater_borel: "{x. x \<bullet> i < a} \<in> sets borel"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1020 |     and hafspace_less_eq_borel: "{x. a \<le> x \<bullet> i} \<in> sets borel"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1021 |     and hafspace_greater_eq_borel: "{x. x \<bullet> i \<le> a} \<in> sets borel"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1022 | by simp_all | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1023 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1024 | lemma borel_eq_box: | 
| 61076 | 1025 | "borel = sigma UNIV (range (\<lambda> (a, b). box a b :: 'a :: euclidean_space set))" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1026 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1027 | proof (rule borel_eq_sigmaI1[OF borel_def]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1028 |   fix M :: "'a set" assume "M \<in> {S. open S}"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1029 | then have "open M" by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1030 | show "M \<in> ?SIGMA" | 
| 61808 | 1031 | apply (subst open_UNION_box[OF \<open>open M\<close>]) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1032 | apply (safe intro!: sets.countable_UN' countable_PiE countable_Collect) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1033 | apply (auto intro: countable_rat) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1034 | done | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1035 | qed (auto simp: box_def) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1036 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1037 | lemma halfspace_gt_in_halfspace: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1038 | assumes i: "i \<in> A" | 
| 62372 | 1039 |   shows "{x::'a. a < x \<bullet> i} \<in>
 | 
| 61076 | 1040 |     sigma_sets UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. x \<bullet> i < a}) ` (UNIV \<times> A))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1041 | (is "?set \<in> ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1042 | proof - | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1043 | interpret sigma_algebra UNIV ?SIGMA | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1044 | by (intro sigma_algebra_sigma_sets) simp_all | 
| 61076 | 1045 |   have *: "?set = (\<Union>n. UNIV - {x::'a. x \<bullet> i < a + 1 / real (Suc n)})"
 | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1046 | proof (safe, simp_all add: not_less del: of_nat_Suc) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1047 | fix x :: 'a assume "a < x \<bullet> i" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1048 | with reals_Archimedean[of "x \<bullet> i - a"] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1049 | obtain n where "a + 1 / real (Suc n) < x \<bullet> i" | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1050 | by (auto simp: field_simps) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1051 | then show "\<exists>n. a + 1 / real (Suc n) \<le> x \<bullet> i" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1052 | by (blast intro: less_imp_le) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1053 | next | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1054 | fix x n | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1055 | have "a < a + 1 / real (Suc n)" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1056 | also assume "\<dots> \<le> x" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1057 | finally show "a < x" . | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1058 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1059 | show "?set \<in> ?SIGMA" unfolding * | 
| 61424 
c3658c18b7bc
prod_case as canonical name for product type eliminator
 haftmann parents: 
61284diff
changeset | 1060 | by (auto intro!: Diff sigma_sets_Inter i) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1061 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1062 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1063 | lemma borel_eq_halfspace_less: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1064 |   "borel = sigma UNIV ((\<lambda>(a, i). {x::'a::euclidean_space. x \<bullet> i < a}) ` (UNIV \<times> Basis))"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1065 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1066 | proof (rule borel_eq_sigmaI2[OF borel_eq_box]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1067 | fix a b :: 'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1068 |   have "box a b = {x\<in>space ?SIGMA. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1069 | by (auto simp: box_def) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1070 | also have "\<dots> \<in> sets ?SIGMA" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1071 | by (intro sets.sets_Collect_conj sets.sets_Collect_finite_All sets.sets_Collect_const) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1072 | (auto intro!: halfspace_gt_in_halfspace countable_PiE countable_rat) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1073 | finally show "box a b \<in> sets ?SIGMA" . | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1074 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1075 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1076 | lemma borel_eq_halfspace_le: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1077 |   "borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. x \<bullet> i \<le> a}) ` (UNIV \<times> Basis))"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1078 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1079 | proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1080 | fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1081 | then have i: "i \<in> Basis" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1082 |   have *: "{x::'a. x\<bullet>i < a} = (\<Union>n. {x. x\<bullet>i \<le> a - 1/real (Suc n)})"
 | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1083 | proof (safe, simp_all del: of_nat_Suc) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1084 | fix x::'a assume *: "x\<bullet>i < a" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1085 | with reals_Archimedean[of "a - x\<bullet>i"] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1086 | obtain n where "x \<bullet> i < a - 1 / (real (Suc n))" | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1087 | by (auto simp: field_simps) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1088 | then show "\<exists>n. x \<bullet> i \<le> a - 1 / (real (Suc n))" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1089 | by (blast intro: less_imp_le) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1090 | next | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1091 | fix x::'a and n | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1092 | assume "x\<bullet>i \<le> a - 1 / real (Suc n)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1093 | also have "\<dots> < a" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1094 | finally show "x\<bullet>i < a" . | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1095 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1096 |   show "{x. x\<bullet>i < a} \<in> ?SIGMA" unfolding *
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1097 | by (intro sets.countable_UN) (auto intro: i) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1098 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1099 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1100 | lemma borel_eq_halfspace_ge: | 
| 61076 | 1101 |   "borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. a \<le> x \<bullet> i}) ` (UNIV \<times> Basis))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1102 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1103 | proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1104 | fix a :: real and i :: 'a assume i: "(a, i) \<in> UNIV \<times> Basis" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1105 |   have *: "{x::'a. x\<bullet>i < a} = space ?SIGMA - {x::'a. a \<le> x\<bullet>i}" by auto
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1106 |   show "{x. x\<bullet>i < a} \<in> ?SIGMA" unfolding *
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1107 | using i by (intro sets.compl_sets) auto | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1108 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1109 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1110 | lemma borel_eq_halfspace_greater: | 
| 61076 | 1111 |   "borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. a < x \<bullet> i}) ` (UNIV \<times> Basis))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1112 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1113 | proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_le]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1114 | fix a :: real and i :: 'a assume "(a, i) \<in> (UNIV \<times> Basis)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1115 | then have i: "i \<in> Basis" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1116 |   have *: "{x::'a. x\<bullet>i \<le> a} = space ?SIGMA - {x::'a. a < x\<bullet>i}" by auto
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1117 |   show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA" unfolding *
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1118 | by (intro sets.compl_sets) (auto intro: i) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1119 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1120 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1121 | lemma borel_eq_atMost: | 
| 61076 | 1122 |   "borel = sigma UNIV (range (\<lambda>a. {..a::'a::ordered_euclidean_space}))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1123 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1124 | proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1125 | fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1126 | then have "i \<in> Basis" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1127 |   then have *: "{x::'a. x\<bullet>i \<le> a} = (\<Union>k::nat. {.. (\<Sum>n\<in>Basis. (if n = i then a else real k)*\<^sub>R n)})"
 | 
| 62390 | 1128 | proof (safe, simp_all add: eucl_le[where 'a='a] split: if_split_asm) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1129 | fix x :: 'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1130 | from real_arch_simple[of "Max ((\<lambda>i. x\<bullet>i)`Basis)"] guess k::nat .. | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1131 | then have "\<And>i. i \<in> Basis \<Longrightarrow> x\<bullet>i \<le> real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1132 | by (subst (asm) Max_le_iff) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1133 | then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> x \<bullet> ia \<le> real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1134 | by (auto intro!: exI[of _ k]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1135 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1136 |   show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA" unfolding *
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1137 | by (intro sets.countable_UN) auto | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1138 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1139 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1140 | lemma borel_eq_greaterThan: | 
| 61076 | 1141 |   "borel = sigma UNIV (range (\<lambda>a::'a::ordered_euclidean_space. {x. a <e x}))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1142 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1143 | proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1144 | fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1145 | then have i: "i \<in> Basis" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1146 |   have "{x::'a. x\<bullet>i \<le> a} = UNIV - {x::'a. a < x\<bullet>i}" by auto
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1147 |   also have *: "{x::'a. a < x\<bullet>i} =
 | 
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1148 |       (\<Union>k::nat. {x. (\<Sum>n\<in>Basis. (if n = i then a else -real k) *\<^sub>R n) <e x})" using i
 | 
| 62390 | 1149 | proof (safe, simp_all add: eucl_less_def split: if_split_asm) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1150 | fix x :: 'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1151 | from reals_Archimedean2[of "Max ((\<lambda>i. -x\<bullet>i)`Basis)"] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1152 | guess k::nat .. note k = this | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1153 |     { fix i :: 'a assume "i \<in> Basis"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1154 | then have "-x\<bullet>i < real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1155 | using k by (subst (asm) Max_less_iff) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1156 | then have "- real k < x\<bullet>i" by simp } | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1157 | then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> -real k < x \<bullet> ia" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1158 | by (auto intro!: exI[of _ k]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1159 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1160 |   finally show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1161 | apply (simp only:) | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1162 | apply (intro sets.countable_UN sets.Diff) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1163 | apply (auto intro: sigma_sets_top) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1164 | done | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1165 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1166 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1167 | lemma borel_eq_lessThan: | 
| 61076 | 1168 |   "borel = sigma UNIV (range (\<lambda>a::'a::ordered_euclidean_space. {x. x <e a}))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1169 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1170 | proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_ge]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1171 | fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1172 | then have i: "i \<in> Basis" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1173 |   have "{x::'a. a \<le> x\<bullet>i} = UNIV - {x::'a. x\<bullet>i < a}" by auto
 | 
| 61808 | 1174 |   also have *: "{x::'a. x\<bullet>i < a} = (\<Union>k::nat. {x. x <e (\<Sum>n\<in>Basis. (if n = i then a else real k) *\<^sub>R n)})" using \<open>i\<in> Basis\<close>
 | 
| 62390 | 1175 | proof (safe, simp_all add: eucl_less_def split: if_split_asm) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1176 | fix x :: 'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1177 | from reals_Archimedean2[of "Max ((\<lambda>i. x\<bullet>i)`Basis)"] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1178 | guess k::nat .. note k = this | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1179 |     { fix i :: 'a assume "i \<in> Basis"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1180 | then have "x\<bullet>i < real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1181 | using k by (subst (asm) Max_less_iff) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1182 | then have "x\<bullet>i < real k" by simp } | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1183 | then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> x \<bullet> ia < real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1184 | by (auto intro!: exI[of _ k]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1185 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1186 |   finally show "{x. a \<le> x\<bullet>i} \<in> ?SIGMA"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1187 | apply (simp only:) | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1188 | apply (intro sets.countable_UN sets.Diff) | 
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1189 | apply (auto intro: sigma_sets_top ) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1190 | done | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1191 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1192 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1193 | lemma borel_eq_atLeastAtMost: | 
| 61076 | 1194 |   "borel = sigma UNIV (range (\<lambda>(a,b). {a..b} ::'a::ordered_euclidean_space set))"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1195 | (is "_ = ?SIGMA") | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1196 | proof (rule borel_eq_sigmaI5[OF borel_eq_atMost]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1197 | fix a::'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1198 |   have *: "{..a} = (\<Union>n::nat. {- real n *\<^sub>R One .. a})"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1199 | proof (safe, simp_all add: eucl_le[where 'a='a]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1200 | fix x :: 'a | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1201 | from real_arch_simple[of "Max ((\<lambda>i. - x\<bullet>i)`Basis)"] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1202 | guess k::nat .. note k = this | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1203 |     { fix i :: 'a assume "i \<in> Basis"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1204 | with k have "- x\<bullet>i \<le> real k" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1205 | by (subst (asm) Max_le_iff) (auto simp: field_simps) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1206 | then have "- real k \<le> x\<bullet>i" by simp } | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1207 | then show "\<exists>n::nat. \<forall>i\<in>Basis. - real n \<le> x \<bullet> i" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1208 | by (auto intro!: exI[of _ k]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1209 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1210 |   show "{..a} \<in> ?SIGMA" unfolding *
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1211 | by (intro sets.countable_UN) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1212 | (auto intro!: sigma_sets_top) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1213 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1214 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1215 | lemma borel_set_induct[consumes 1, case_names empty interval compl union]: | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1216 | assumes "A \<in> sets borel" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1217 |   assumes empty: "P {}" and int: "\<And>a b. a \<le> b \<Longrightarrow> P {a..b}" and compl: "\<And>A. A \<in> sets borel \<Longrightarrow> P A \<Longrightarrow> P (-A)" and
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1218 | un: "\<And>f. disjoint_family f \<Longrightarrow> (\<And>i. f i \<in> sets borel) \<Longrightarrow> (\<And>i. P (f i)) \<Longrightarrow> P (\<Union>i::nat. f i)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1219 | shows "P (A::real set)" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1220 | proof- | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1221 |   let ?G = "range (\<lambda>(a,b). {a..b::real})"
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1222 | have "Int_stable ?G" "?G \<subseteq> Pow UNIV" "A \<in> sigma_sets UNIV ?G" | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1223 | using assms(1) by (auto simp add: borel_eq_atLeastAtMost Int_stable_def) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1224 | thus ?thesis | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1225 | proof (induction rule: sigma_sets_induct_disjoint) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1226 | case (union f) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1227 | from union.hyps(2) have "\<And>i. f i \<in> sets borel" by (auto simp: borel_eq_atLeastAtMost) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1228 | with union show ?case by (auto intro: un) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1229 | next | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1230 | case (basic A) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1231 |     then obtain a b where "A = {a .. b}" by auto
 | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1232 | then show ?case | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1233 | by (cases "a \<le> b") (auto intro: int empty) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1234 | qed (auto intro: empty compl simp: Compl_eq_Diff_UNIV[symmetric] borel_eq_atLeastAtMost) | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1235 | qed | 
| 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1236 | |
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1237 | lemma borel_sigma_sets_Ioc: "borel = sigma UNIV (range (\<lambda>(a, b). {a <.. b::real}))"
 | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1238 | proof (rule borel_eq_sigmaI5[OF borel_eq_atMost]) | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1239 | fix i :: real | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1240 |   have "{..i} = (\<Union>j::nat. {-j <.. i})"
 | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1241 | by (auto simp: minus_less_iff reals_Archimedean2) | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1242 |   also have "\<dots> \<in> sets (sigma UNIV (range (\<lambda>(i, j). {i<..j})))"
 | 
| 62372 | 1243 | by (intro sets.countable_nat_UN) auto | 
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1244 |   finally show "{..i} \<in> sets (sigma UNIV (range (\<lambda>(i, j). {i<..j})))" .
 | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1245 | qed simp | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1246 | |
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1247 | lemma eucl_lessThan: "{x::real. x <e a} = lessThan a"
 | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1248 | by (simp add: eucl_less_def lessThan_def) | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1249 | |
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1250 | lemma borel_eq_atLeastLessThan: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1251 |   "borel = sigma UNIV (range (\<lambda>(a, b). {a ..< b :: real}))" (is "_ = ?SIGMA")
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1252 | proof (rule borel_eq_sigmaI5[OF borel_eq_lessThan]) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1253 | have move_uminus: "\<And>x y::real. -x \<le> y \<longleftrightarrow> -y \<le> x" by auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1254 | fix x :: real | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1255 |   have "{..<x} = (\<Union>i::nat. {-real i ..< x})"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1256 | by (auto simp: move_uminus real_arch_simple) | 
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1257 |   then show "{y. y <e x} \<in> ?SIGMA"
 | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1258 | by (auto intro: sigma_sets.intros(2-) simp: eucl_lessThan) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1259 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1260 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1261 | lemma borel_measurable_halfspacesI: | 
| 61076 | 1262 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1263 | assumes F: "borel = sigma UNIV (F ` (UNIV \<times> Basis))" | 
| 62372 | 1264 | and S_eq: "\<And>a i. S a i = f -` F (a,i) \<inter> space M" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1265 | shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a::real. S a i \<in> sets M)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1266 | proof safe | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1267 | fix a :: real and i :: 'b assume i: "i \<in> Basis" and f: "f \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1268 | then show "S a i \<in> sets M" unfolding assms | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1269 | by (auto intro!: measurable_sets simp: assms(1)) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1270 | next | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1271 | assume a: "\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1272 | then show "f \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1273 | by (auto intro!: measurable_measure_of simp: S_eq F) | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1274 | qed | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1275 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1276 | lemma borel_measurable_iff_halfspace_le: | 
| 61076 | 1277 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1278 |   shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. f w \<bullet> i \<le> a} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1279 | by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_le]) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1280 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1281 | lemma borel_measurable_iff_halfspace_less: | 
| 61076 | 1282 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1283 |   shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. f w \<bullet> i < a} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1284 | by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_less]) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1285 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1286 | lemma borel_measurable_iff_halfspace_ge: | 
| 61076 | 1287 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1288 |   shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. a \<le> f w \<bullet> i} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1289 | by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_ge]) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1290 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1291 | lemma borel_measurable_iff_halfspace_greater: | 
| 61076 | 1292 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1293 |   shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. a < f w \<bullet> i} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1294 | by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_greater]) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1295 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1296 | lemma borel_measurable_iff_le: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1297 |   "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w \<le> a} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1298 | using borel_measurable_iff_halfspace_le[where 'c=real] by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1299 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1300 | lemma borel_measurable_iff_less: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1301 |   "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w < a} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1302 | using borel_measurable_iff_halfspace_less[where 'c=real] by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1303 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1304 | lemma borel_measurable_iff_ge: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1305 |   "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a \<le> f w} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1306 | using borel_measurable_iff_halfspace_ge[where 'c=real] | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1307 | by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1308 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1309 | lemma borel_measurable_iff_greater: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1310 |   "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)"
 | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1311 | using borel_measurable_iff_halfspace_greater[where 'c=real] by simp | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1312 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1313 | lemma borel_measurable_euclidean_space: | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1314 | fixes f :: "'a \<Rightarrow> 'c::euclidean_space" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1315 | shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. (\<lambda>x. f x \<bullet> i) \<in> borel_measurable M)" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1316 | proof safe | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1317 | assume f: "\<forall>i\<in>Basis. (\<lambda>x. f x \<bullet> i) \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1318 | then show "f \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1319 | by (subst borel_measurable_iff_halfspace_le) auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1320 | qed auto | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1321 | |
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1322 | subsection "Borel measurable operators" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1323 | |
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1324 | lemma borel_measurable_norm[measurable]: "norm \<in> borel_measurable borel" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1325 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1326 | |
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1327 | lemma borel_measurable_sgn [measurable]: "(sgn::'a::real_normed_vector \<Rightarrow> 'a) \<in> borel_measurable borel" | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1328 |   by (rule borel_measurable_continuous_countable_exceptions[where X="{0}"])
 | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1329 | (auto intro!: continuous_on_sgn continuous_on_id) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1330 | |
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1331 | lemma borel_measurable_uminus[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1332 |   fixes g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
 | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1333 | assumes g: "g \<in> borel_measurable M" | 
| 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1334 | shows "(\<lambda>x. - g x) \<in> borel_measurable M" | 
| 56371 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 hoelzl parents: 
56212diff
changeset | 1335 | by (rule borel_measurable_continuous_on[OF _ g]) (intro continuous_intros) | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1336 | |
| 50003 | 1337 | lemma borel_measurable_diff[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1338 |   fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
 | 
| 49774 | 1339 | assumes f: "f \<in> borel_measurable M" | 
| 1340 | assumes g: "g \<in> borel_measurable M" | |
| 1341 | shows "(\<lambda>x. f x - g x) \<in> borel_measurable M" | |
| 54230 
b1d955791529
more simplification rules on unary and binary minus
 haftmann parents: 
53216diff
changeset | 1342 | using borel_measurable_add [of f M "- g"] assms by (simp add: fun_Compl_def) | 
| 49774 | 1343 | |
| 50003 | 1344 | lemma borel_measurable_times[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1345 |   fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_algebra}"
 | 
| 49774 | 1346 | assumes f: "f \<in> borel_measurable M" | 
| 1347 | assumes g: "g \<in> borel_measurable M" | |
| 1348 | shows "(\<lambda>x. f x * g x) \<in> borel_measurable M" | |
| 56371 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 hoelzl parents: 
56212diff
changeset | 1349 | using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros) | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1350 | |
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1351 | lemma borel_measurable_setprod[measurable (raw)]: | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1352 |   fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> 'b::{second_countable_topology, real_normed_field}"
 | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1353 | assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1354 | shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1355 | proof cases | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1356 | assume "finite S" | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1357 | thus ?thesis using assms by induct auto | 
| 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1358 | qed simp | 
| 49774 | 1359 | |
| 50003 | 1360 | lemma borel_measurable_dist[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1361 |   fixes g f :: "'a \<Rightarrow> 'b::{second_countable_topology, metric_space}"
 | 
| 49774 | 1362 | assumes f: "f \<in> borel_measurable M" | 
| 1363 | assumes g: "g \<in> borel_measurable M" | |
| 1364 | shows "(\<lambda>x. dist (f x) (g x)) \<in> borel_measurable M" | |
| 56371 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 hoelzl parents: 
56212diff
changeset | 1365 | using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros) | 
| 62372 | 1366 | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1367 | lemma borel_measurable_scaleR[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1368 |   fixes g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1369 | assumes f: "f \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1370 | assumes g: "g \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1371 | shows "(\<lambda>x. f x *\<^sub>R g x) \<in> borel_measurable M" | 
| 56371 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 hoelzl parents: 
56212diff
changeset | 1372 | using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros) | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1373 | |
| 47694 | 1374 | lemma affine_borel_measurable_vector: | 
| 38656 | 1375 | fixes f :: "'a \<Rightarrow> 'x::real_normed_vector" | 
| 1376 | assumes "f \<in> borel_measurable M" | |
| 1377 | shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M" | |
| 1378 | proof (rule borel_measurableI) | |
| 1379 | fix S :: "'x set" assume "open S" | |
| 1380 | show "(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M" | |
| 1381 | proof cases | |
| 1382 | assume "b \<noteq> 0" | |
| 61808 | 1383 | with \<open>open S\<close> have "open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)" (is "open ?S") | 
| 54230 
b1d955791529
more simplification rules on unary and binary minus
 haftmann parents: 
53216diff
changeset | 1384 | using open_affinity [of S "inverse b" "- a /\<^sub>R b"] | 
| 
b1d955791529
more simplification rules on unary and binary minus
 haftmann parents: 
53216diff
changeset | 1385 | by (auto simp: algebra_simps) | 
| 47694 | 1386 | hence "?S \<in> sets borel" by auto | 
| 38656 | 1387 | moreover | 
| 61808 | 1388 | from \<open>b \<noteq> 0\<close> have "(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` ?S" | 
| 38656 | 1389 | apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all) | 
| 40859 | 1390 | ultimately show ?thesis using assms unfolding in_borel_measurable_borel | 
| 38656 | 1391 | by auto | 
| 1392 | qed simp | |
| 1393 | qed | |
| 1394 | ||
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1395 | lemma borel_measurable_const_scaleR[measurable (raw)]: | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1396 | "f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. b *\<^sub>R f x ::'a::real_normed_vector) \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1397 | using affine_borel_measurable_vector[of f M 0 b] by simp | 
| 38656 | 1398 | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1399 | lemma borel_measurable_const_add[measurable (raw)]: | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1400 | "f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. a + f x ::'a::real_normed_vector) \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1401 | using affine_borel_measurable_vector[of f M a 1] by simp | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1402 | |
| 50003 | 1403 | lemma borel_measurable_inverse[measurable (raw)]: | 
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1404 | fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra" | 
| 49774 | 1405 | assumes f: "f \<in> borel_measurable M" | 
| 35692 | 1406 | shows "(\<lambda>x. inverse (f x)) \<in> borel_measurable M" | 
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1407 | apply (rule measurable_compose[OF f]) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1408 |   apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"])
 | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1409 | apply (auto intro!: continuous_on_inverse continuous_on_id) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1410 | done | 
| 35692 | 1411 | |
| 50003 | 1412 | lemma borel_measurable_divide[measurable (raw)]: | 
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1413 | "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> | 
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1414 |     (\<lambda>x. f x / g x::'b::{second_countable_topology, real_normed_div_algebra}) \<in> borel_measurable M"
 | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1415 | by (simp add: divide_inverse) | 
| 38656 | 1416 | |
| 50003 | 1417 | lemma borel_measurable_abs[measurable (raw)]: | 
| 1418 | "f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. \<bar>f x :: real\<bar>) \<in> borel_measurable M" | |
| 1419 | unfolding abs_real_def by simp | |
| 38656 | 1420 | |
| 50003 | 1421 | lemma borel_measurable_nth[measurable (raw)]: | 
| 41026 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
 hoelzl parents: 
41025diff
changeset | 1422 | "(\<lambda>x::real^'n. x $ i) \<in> borel_measurable borel" | 
| 50526 
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
 hoelzl parents: 
50419diff
changeset | 1423 | by (simp add: cart_eq_inner_axis) | 
| 41026 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
 hoelzl parents: 
41025diff
changeset | 1424 | |
| 47694 | 1425 | lemma convex_measurable: | 
| 59415 | 1426 | fixes A :: "'a :: euclidean_space set" | 
| 62372 | 1427 | shows "X \<in> borel_measurable M \<Longrightarrow> X ` space M \<subseteq> A \<Longrightarrow> open A \<Longrightarrow> convex_on A q \<Longrightarrow> | 
| 59415 | 1428 | (\<lambda>x. q (X x)) \<in> borel_measurable M" | 
| 1429 | by (rule measurable_compose[where f=X and N="restrict_space borel A"]) | |
| 1430 | (auto intro!: borel_measurable_continuous_on_restrict convex_on_continuous measurable_restrict_space2) | |
| 41830 | 1431 | |
| 50003 | 1432 | lemma borel_measurable_ln[measurable (raw)]: | 
| 49774 | 1433 | assumes f: "f \<in> borel_measurable M" | 
| 60017 
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
 paulson <lp15@cam.ac.uk> parents: 
59658diff
changeset | 1434 | shows "(\<lambda>x. ln (f x :: real)) \<in> borel_measurable M" | 
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1435 | apply (rule measurable_compose[OF f]) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1436 |   apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"])
 | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1437 | apply (auto intro!: continuous_on_ln continuous_on_id) | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57259diff
changeset | 1438 | done | 
| 41830 | 1439 | |
| 50003 | 1440 | lemma borel_measurable_log[measurable (raw)]: | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1441 | "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. log (g x) (f x)) \<in> borel_measurable M" | 
| 49774 | 1442 | unfolding log_def by auto | 
| 41830 | 1443 | |
| 58656 | 1444 | lemma borel_measurable_exp[measurable]: | 
| 1445 |   "(exp::'a::{real_normed_field,banach}\<Rightarrow>'a) \<in> borel_measurable borel"
 | |
| 51478 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 hoelzl parents: 
51351diff
changeset | 1446 | by (intro borel_measurable_continuous_on1 continuous_at_imp_continuous_on ballI isCont_exp) | 
| 50419 | 1447 | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1448 | lemma measurable_real_floor[measurable]: | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1449 | "(floor :: real \<Rightarrow> int) \<in> measurable borel (count_space UNIV)" | 
| 47761 | 1450 | proof - | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1451 | have "\<And>a x. \<lfloor>x\<rfloor> = a \<longleftrightarrow> (real_of_int a \<le> x \<and> x < real_of_int (a + 1))" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1452 | by (auto intro: floor_eq2) | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1453 | then show ?thesis | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1454 | by (auto simp: vimage_def measurable_count_space_eq2_countable) | 
| 47761 | 1455 | qed | 
| 1456 | ||
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1457 | lemma measurable_real_ceiling[measurable]: | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1458 | "(ceiling :: real \<Rightarrow> int) \<in> measurable borel (count_space UNIV)" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1459 | unfolding ceiling_def[abs_def] by simp | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1460 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1461 | lemma borel_measurable_real_floor: "(\<lambda>x::real. real_of_int \<lfloor>x\<rfloor>) \<in> borel_measurable borel" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1462 | by simp | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1463 | |
| 59415 | 1464 | lemma borel_measurable_root [measurable]: "root n \<in> borel_measurable borel" | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1465 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1466 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1467 | lemma borel_measurable_sqrt [measurable]: "sqrt \<in> borel_measurable borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1468 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1469 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1470 | lemma borel_measurable_power [measurable (raw)]: | 
| 59415 | 1471 |   fixes f :: "_ \<Rightarrow> 'b::{power,real_normed_algebra}"
 | 
| 1472 | assumes f: "f \<in> borel_measurable M" | |
| 1473 | shows "(\<lambda>x. (f x) ^ n) \<in> borel_measurable M" | |
| 1474 | by (intro borel_measurable_continuous_on [OF _ f] continuous_intros) | |
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1475 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1476 | lemma borel_measurable_Re [measurable]: "Re \<in> borel_measurable borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1477 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1478 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1479 | lemma borel_measurable_Im [measurable]: "Im \<in> borel_measurable borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1480 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1481 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1482 | lemma borel_measurable_of_real [measurable]: "(of_real :: _ \<Rightarrow> (_::real_normed_algebra)) \<in> borel_measurable borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1483 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1484 | |
| 59658 
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
 paulson <lp15@cam.ac.uk> parents: 
59587diff
changeset | 1485 | lemma borel_measurable_sin [measurable]: "(sin :: _ \<Rightarrow> (_::{real_normed_field,banach})) \<in> borel_measurable borel"
 | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1486 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1487 | |
| 59658 
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
 paulson <lp15@cam.ac.uk> parents: 
59587diff
changeset | 1488 | lemma borel_measurable_cos [measurable]: "(cos :: _ \<Rightarrow> (_::{real_normed_field,banach})) \<in> borel_measurable borel"
 | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1489 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1490 | |
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1491 | lemma borel_measurable_arctan [measurable]: "arctan \<in> borel_measurable borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1492 | by (intro borel_measurable_continuous_on1 continuous_intros) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57138diff
changeset | 1493 | |
| 57259 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1494 | lemma borel_measurable_complex_iff: | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1495 | "f \<in> borel_measurable M \<longleftrightarrow> | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1496 | (\<lambda>x. Re (f x)) \<in> borel_measurable M \<and> (\<lambda>x. Im (f x)) \<in> borel_measurable M" | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1497 | apply auto | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1498 | apply (subst fun_complex_eq) | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1499 | apply (intro borel_measurable_add) | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1500 | apply auto | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1501 | done | 
| 
3a448982a74a
add more derivative and continuity rules for complex-values functions
 hoelzl parents: 
57235diff
changeset | 1502 | |
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1503 | subsection "Borel space on the extended reals" | 
| 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1504 | |
| 50003 | 1505 | lemma borel_measurable_ereal[measurable (raw)]: | 
| 43920 | 1506 | assumes f: "f \<in> borel_measurable M" shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" | 
| 60771 | 1507 | using continuous_on_ereal f by (rule borel_measurable_continuous_on) (rule continuous_on_id) | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1508 | |
| 50003 | 1509 | lemma borel_measurable_real_of_ereal[measurable (raw)]: | 
| 62372 | 1510 | fixes f :: "'a \<Rightarrow> ereal" | 
| 49774 | 1511 | assumes f: "f \<in> borel_measurable M" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1512 | shows "(\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M" | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1513 | apply (rule measurable_compose[OF f]) | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1514 |   apply (rule borel_measurable_continuous_countable_exceptions[of "{\<infinity>, -\<infinity> }"])
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1515 | apply (auto intro: continuous_on_real simp: Compl_eq_Diff_UNIV) | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1516 | done | 
| 49774 | 1517 | |
| 1518 | lemma borel_measurable_ereal_cases: | |
| 62372 | 1519 | fixes f :: "'a \<Rightarrow> ereal" | 
| 49774 | 1520 | assumes f: "f \<in> borel_measurable M" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1521 | assumes H: "(\<lambda>x. H (ereal (real_of_ereal (f x)))) \<in> borel_measurable M" | 
| 49774 | 1522 | shows "(\<lambda>x. H (f x)) \<in> borel_measurable M" | 
| 1523 | proof - | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1524 | let ?F = "\<lambda>x. if f x = \<infinity> then H \<infinity> else if f x = - \<infinity> then H (-\<infinity>) else H (ereal (real_of_ereal (f x)))" | 
| 49774 | 1525 |   { fix x have "H (f x) = ?F x" by (cases "f x") auto }
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1526 | with f H show ?thesis by simp | 
| 47694 | 1527 | qed | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1528 | |
| 49774 | 1529 | lemma | 
| 50003 | 1530 | fixes f :: "'a \<Rightarrow> ereal" assumes f[measurable]: "f \<in> borel_measurable M" | 
| 1531 | shows borel_measurable_ereal_abs[measurable(raw)]: "(\<lambda>x. \<bar>f x\<bar>) \<in> borel_measurable M" | |
| 1532 | and borel_measurable_ereal_inverse[measurable(raw)]: "(\<lambda>x. inverse (f x) :: ereal) \<in> borel_measurable M" | |
| 1533 | and borel_measurable_uminus_ereal[measurable(raw)]: "(\<lambda>x. - f x :: ereal) \<in> borel_measurable M" | |
| 49774 | 1534 | by (auto simp del: abs_real_of_ereal simp: borel_measurable_ereal_cases[OF f] measurable_If) | 
| 1535 | ||
| 1536 | lemma borel_measurable_uminus_eq_ereal[simp]: | |
| 1537 | "(\<lambda>x. - f x :: ereal) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" (is "?l = ?r") | |
| 1538 | proof | |
| 1539 | assume ?l from borel_measurable_uminus_ereal[OF this] show ?r by simp | |
| 1540 | qed auto | |
| 1541 | ||
| 1542 | lemma set_Collect_ereal2: | |
| 62372 | 1543 | fixes f g :: "'a \<Rightarrow> ereal" | 
| 49774 | 1544 | assumes f: "f \<in> borel_measurable M" | 
| 1545 | assumes g: "g \<in> borel_measurable M" | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1546 |   assumes H: "{x \<in> space M. H (ereal (real_of_ereal (f x))) (ereal (real_of_ereal (g x)))} \<in> sets M"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1547 |     "{x \<in> space borel. H (-\<infinity>) (ereal x)} \<in> sets borel"
 | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1548 |     "{x \<in> space borel. H (\<infinity>) (ereal x)} \<in> sets borel"
 | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1549 |     "{x \<in> space borel. H (ereal x) (-\<infinity>)} \<in> sets borel"
 | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1550 |     "{x \<in> space borel. H (ereal x) (\<infinity>)} \<in> sets borel"
 | 
| 49774 | 1551 |   shows "{x \<in> space M. H (f x) (g x)} \<in> sets M"
 | 
| 1552 | proof - | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1553 | let ?G = "\<lambda>y x. if g x = \<infinity> then H y \<infinity> else if g x = -\<infinity> then H y (-\<infinity>) else H y (ereal (real_of_ereal (g x)))" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1554 | let ?F = "\<lambda>x. if f x = \<infinity> then ?G \<infinity> x else if f x = -\<infinity> then ?G (-\<infinity>) x else ?G (ereal (real_of_ereal (f x))) x" | 
| 49774 | 1555 |   { fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto }
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1556 | note * = this | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1557 | from assms show ?thesis | 
| 62390 | 1558 | by (subst *) (simp del: space_borel split del: if_split) | 
| 49774 | 1559 | qed | 
| 1560 | ||
| 47694 | 1561 | lemma borel_measurable_ereal_iff: | 
| 43920 | 1562 | 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: 
41969diff
changeset | 1563 | proof | 
| 43920 | 1564 | assume "(\<lambda>x. ereal (f x)) \<in> borel_measurable M" | 
| 1565 | from borel_measurable_real_of_ereal[OF this] | |
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1566 | show "f \<in> borel_measurable M" by auto | 
| 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1567 | qed auto | 
| 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1568 | |
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 1569 | lemma borel_measurable_erealD[measurable_dest]: | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 1570 | "(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<Longrightarrow> g \<in> measurable N M \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 1571 | unfolding borel_measurable_ereal_iff by simp | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 1572 | |
| 47694 | 1573 | lemma borel_measurable_ereal_iff_real: | 
| 43923 | 1574 | fixes f :: "'a \<Rightarrow> ereal" | 
| 1575 | shows "f \<in> borel_measurable M \<longleftrightarrow> | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1576 |     ((\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M \<and> f -` {\<infinity>} \<inter> space M \<in> sets M \<and> f -` {-\<infinity>} \<inter> space M \<in> sets M)"
 | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1577 | proof safe | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1578 |   assume *: "(\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M" "f -` {\<infinity>} \<inter> space M \<in> sets M" "f -` {-\<infinity>} \<inter> space M \<in> sets M"
 | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1579 |   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: 
41969diff
changeset | 1580 |   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
 | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1581 | let ?f = "\<lambda>x. if f x = \<infinity> then \<infinity> else if f x = -\<infinity> then -\<infinity> else ereal (real_of_ereal (f x))" | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1582 | have "?f \<in> borel_measurable M" using * ** by (intro measurable_If) auto | 
| 43920 | 1583 | 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: 
41969diff
changeset | 1584 | finally show "f \<in> borel_measurable M" . | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1585 | qed simp_all | 
| 41830 | 1586 | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1587 | lemma borel_measurable_ereal_iff_Iio: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1588 |   "(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..< a} \<inter> space M \<in> sets M)"
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1589 | by (auto simp: borel_Iio measurable_iff_measure_of) | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1590 | |
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1591 | lemma borel_measurable_ereal_iff_Ioi: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1592 |   "(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a <..} \<inter> space M \<in> sets M)"
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1593 | by (auto simp: borel_Ioi measurable_iff_measure_of) | 
| 35582 | 1594 | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1595 | lemma vimage_sets_compl_iff: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1596 | "f -` A \<inter> space M \<in> sets M \<longleftrightarrow> f -` (- A) \<inter> space M \<in> sets M" | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1597 | proof - | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1598 |   { fix A assume "f -` A \<inter> space M \<in> sets M"
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1599 | moreover have "f -` (- A) \<inter> space M = space M - f -` A \<inter> space M" by auto | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1600 | ultimately have "f -` (- A) \<inter> space M \<in> sets M" by auto } | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1601 | from this[of A] this[of "-A"] show ?thesis | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1602 | by (metis double_complement) | 
| 49774 | 1603 | qed | 
| 1604 | ||
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1605 | lemma borel_measurable_iff_Iic_ereal: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1606 |   "(f::'a\<Rightarrow>ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..a} \<inter> space M \<in> sets M)"
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1607 |   unfolding borel_measurable_ereal_iff_Ioi vimage_sets_compl_iff[where A="{a <..}" for a] by simp
 | 
| 38656 | 1608 | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1609 | lemma borel_measurable_iff_Ici_ereal: | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1610 |   "(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a..} \<inter> space M \<in> sets M)"
 | 
| 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1611 |   unfolding borel_measurable_ereal_iff_Iio vimage_sets_compl_iff[where A="{..< a}" for a] by simp
 | 
| 38656 | 1612 | |
| 49774 | 1613 | lemma borel_measurable_ereal2: | 
| 62372 | 1614 | fixes f g :: "'a \<Rightarrow> ereal" | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1615 | assumes f: "f \<in> borel_measurable M" | 
| 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1616 | assumes g: "g \<in> borel_measurable M" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1617 | assumes H: "(\<lambda>x. H (ereal (real_of_ereal (f x))) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1618 | "(\<lambda>x. H (-\<infinity>) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1619 | "(\<lambda>x. H (\<infinity>) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1620 | "(\<lambda>x. H (ereal (real_of_ereal (f x))) (-\<infinity>)) \<in> borel_measurable M" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1621 | "(\<lambda>x. H (ereal (real_of_ereal (f x))) (\<infinity>)) \<in> borel_measurable M" | 
| 49774 | 1622 | 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: 
41969diff
changeset | 1623 | proof - | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1624 | let ?G = "\<lambda>y x. if g x = \<infinity> then H y \<infinity> else if g x = - \<infinity> then H y (-\<infinity>) else H y (ereal (real_of_ereal (g x)))" | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61424diff
changeset | 1625 | let ?F = "\<lambda>x. if f x = \<infinity> then ?G \<infinity> x else if f x = - \<infinity> then ?G (-\<infinity>) x else ?G (ereal (real_of_ereal (f x))) x" | 
| 49774 | 1626 |   { fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto }
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1627 | note * = this | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1628 | from assms show ?thesis unfolding * by simp | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1629 | qed | 
| 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1630 | |
| 50003 | 1631 | lemma [measurable(raw)]: | 
| 43920 | 1632 | fixes f :: "'a \<Rightarrow> ereal" | 
| 50003 | 1633 | assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1634 | shows borel_measurable_ereal_add: "(\<lambda>x. f x + g x) \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1635 | and borel_measurable_ereal_times: "(\<lambda>x. f x * g x) \<in> borel_measurable M" | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1636 | by (simp_all add: borel_measurable_ereal2) | 
| 49774 | 1637 | |
| 50003 | 1638 | lemma [measurable(raw)]: | 
| 49774 | 1639 | fixes f g :: "'a \<Rightarrow> ereal" | 
| 1640 | assumes "f \<in> borel_measurable M" | |
| 1641 | assumes "g \<in> borel_measurable M" | |
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1642 | shows borel_measurable_ereal_diff: "(\<lambda>x. f x - g x) \<in> borel_measurable M" | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1643 | and borel_measurable_ereal_divide: "(\<lambda>x. f x / g x) \<in> borel_measurable M" | 
| 50003 | 1644 | using assms by (simp_all add: minus_ereal_def divide_ereal_def) | 
| 38656 | 1645 | |
| 50003 | 1646 | lemma borel_measurable_ereal_setsum[measurable (raw)]: | 
| 43920 | 1647 | fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" | 
| 41096 | 1648 | assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" | 
| 1649 | shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M" | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1650 | using assms by (induction S rule: infinite_finite_induct) auto | 
| 38656 | 1651 | |
| 50003 | 1652 | lemma borel_measurable_ereal_setprod[measurable (raw)]: | 
| 43920 | 1653 | fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal" | 
| 38656 | 1654 | assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" | 
| 41096 | 1655 | shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" | 
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 1656 | using assms by (induction S rule: infinite_finite_induct) auto | 
| 38656 | 1657 | |
| 50003 | 1658 | lemma borel_measurable_extreal_suminf[measurable (raw)]: | 
| 43920 | 1659 | fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> ereal" | 
| 50003 | 1660 | assumes [measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41969diff
changeset | 1661 | shows "(\<lambda>x. (\<Sum>i. f i x)) \<in> borel_measurable M" | 
| 50003 | 1662 | unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp | 
| 39092 | 1663 | |
| 62625 | 1664 | subsection "Borel space on the extended non-negative reals" | 
| 1665 | ||
| 1666 | text \<open> @{type ennreal} is a topological monoid, so no rules for plus are required, also all order
 | |
| 1667 | statements are usually done on type classes. \<close> | |
| 1668 | ||
| 1669 | lemma measurable_enn2ereal[measurable]: "enn2ereal \<in> borel \<rightarrow>\<^sub>M borel" | |
| 1670 | by (intro borel_measurable_continuous_on1 continuous_on_enn2ereal) | |
| 1671 | ||
| 1672 | lemma measurable_e2ennreal[measurable]: "e2ennreal \<in> borel \<rightarrow>\<^sub>M borel" | |
| 1673 | by (intro borel_measurable_continuous_on1 continuous_on_e2ennreal) | |
| 1674 | ||
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1675 | lemma borel_measurable_enn2real[measurable (raw)]: | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1676 | "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. enn2real (f x)) \<in> M \<rightarrow>\<^sub>M borel" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1677 | unfolding enn2real_def[abs_def] by measurable | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1678 | |
| 62625 | 1679 | definition [simp]: "is_borel f M \<longleftrightarrow> f \<in> borel_measurable M" | 
| 1680 | ||
| 1681 | lemma is_borel_transfer[transfer_rule]: "rel_fun (rel_fun op = pcr_ennreal) op = is_borel is_borel" | |
| 1682 | unfolding is_borel_def[abs_def] | |
| 1683 | proof (safe intro!: rel_funI ext dest!: rel_fun_eq_pcr_ennreal[THEN iffD1]) | |
| 1684 | fix f and M :: "'a measure" | |
| 1685 | show "f \<in> borel_measurable M" if f: "enn2ereal \<circ> f \<in> borel_measurable M" | |
| 1686 | using measurable_compose[OF f measurable_e2ennreal] by simp | |
| 1687 | qed simp | |
| 1688 | ||
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1689 | context | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1690 | includes ennreal.lifting | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1691 | begin | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1692 | |
| 62625 | 1693 | lemma measurable_ennreal[measurable]: "ennreal \<in> borel \<rightarrow>\<^sub>M borel" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1694 | unfolding is_borel_def[symmetric] | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1695 | by transfer simp | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1696 | |
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1697 | lemma borel_measurable_ennreal_iff[simp]: | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1698 | assumes [simp]: "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1699 | shows "(\<lambda>x. ennreal (f x)) \<in> M \<rightarrow>\<^sub>M borel \<longleftrightarrow> f \<in> M \<rightarrow>\<^sub>M borel" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1700 | proof safe | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1701 | assume "(\<lambda>x. ennreal (f x)) \<in> M \<rightarrow>\<^sub>M borel" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1702 | then have "(\<lambda>x. enn2real (ennreal (f x))) \<in> M \<rightarrow>\<^sub>M borel" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1703 | by measurable | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1704 | then show "f \<in> M \<rightarrow>\<^sub>M borel" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1705 | by (rule measurable_cong[THEN iffD1, rotated]) auto | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1706 | qed measurable | 
| 62625 | 1707 | |
| 1708 | lemma borel_measurable_times_ennreal[measurable (raw)]: | |
| 1709 | fixes f g :: "'a \<Rightarrow> ennreal" | |
| 1710 | shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x * g x) \<in> M \<rightarrow>\<^sub>M borel" | |
| 1711 | unfolding is_borel_def[symmetric] by transfer simp | |
| 1712 | ||
| 1713 | lemma borel_measurable_inverse_ennreal[measurable (raw)]: | |
| 1714 | fixes f :: "'a \<Rightarrow> ennreal" | |
| 1715 | shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. inverse (f x)) \<in> M \<rightarrow>\<^sub>M borel" | |
| 1716 | unfolding is_borel_def[symmetric] by transfer simp | |
| 1717 | ||
| 1718 | lemma borel_measurable_divide_ennreal[measurable (raw)]: | |
| 1719 | fixes f :: "'a \<Rightarrow> ennreal" | |
| 1720 | shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x / g x) \<in> M \<rightarrow>\<^sub>M borel" | |
| 1721 | unfolding divide_ennreal_def by simp | |
| 1722 | ||
| 1723 | lemma borel_measurable_minus_ennreal[measurable (raw)]: | |
| 1724 | fixes f :: "'a \<Rightarrow> ennreal" | |
| 1725 | shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x - g x) \<in> M \<rightarrow>\<^sub>M borel" | |
| 1726 | unfolding is_borel_def[symmetric] by transfer simp | |
| 1727 | ||
| 1728 | lemma borel_measurable_setprod_ennreal[measurable (raw)]: | |
| 1729 | fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ennreal" | |
| 1730 | assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M" | |
| 1731 | shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M" | |
| 1732 | using assms by (induction S rule: infinite_finite_induct) auto | |
| 1733 | ||
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1734 | end | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62625diff
changeset | 1735 | |
| 62625 | 1736 | hide_const (open) is_borel | 
| 1737 | ||
| 61808 | 1738 | subsection \<open>LIMSEQ is borel measurable\<close> | 
| 39092 | 1739 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1740 | lemma borel_measurable_LIMSEQ_real: | 
| 39092 | 1741 | fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real" | 
| 61969 | 1742 | assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) \<longlonglongrightarrow> u' x" | 
| 39092 | 1743 | and u: "\<And>i. u i \<in> borel_measurable M" | 
| 1744 | shows "u' \<in> borel_measurable M" | |
| 1745 | proof - | |
| 43920 | 1746 | have "\<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)" | 
| 46731 | 1747 | using u' by (simp add: lim_imp_Liminf) | 
| 43920 | 1748 | moreover from u have "(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M" | 
| 39092 | 1749 | by auto | 
| 43920 | 1750 | ultimately show ?thesis by (simp cong: measurable_cong add: borel_measurable_ereal_iff) | 
| 39092 | 1751 | qed | 
| 1752 | ||
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1753 | lemma borel_measurable_LIMSEQ_metric: | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1754 | fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: metric_space" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1755 | assumes [measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 61969 | 1756 | assumes lim: "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. f i x) \<longlonglongrightarrow> g x" | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1757 | shows "g \<in> borel_measurable M" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1758 | unfolding borel_eq_closed | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1759 | proof (safe intro!: measurable_measure_of) | 
| 62372 | 1760 | fix A :: "'b set" assume "closed A" | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1761 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1762 | have [measurable]: "(\<lambda>x. infdist (g x) A) \<in> borel_measurable M" | 
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1763 | proof (rule borel_measurable_LIMSEQ_real) | 
| 61969 | 1764 | show "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. infdist (f i x) A) \<longlonglongrightarrow> infdist (g x) A" | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1765 | by (intro tendsto_infdist lim) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1766 | show "\<And>i. (\<lambda>x. infdist (f i x) A) \<in> borel_measurable M" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1767 | by (intro borel_measurable_continuous_on[where f="\<lambda>x. infdist x A"] | 
| 60150 
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
 paulson <lp15@cam.ac.uk> parents: 
60017diff
changeset | 1768 | continuous_at_imp_continuous_on ballI continuous_infdist continuous_ident) auto | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1769 | qed | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1770 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1771 | show "g -` A \<inter> space M \<in> sets M" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1772 | proof cases | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1773 |     assume "A \<noteq> {}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1774 | then have "\<And>x. infdist x A = 0 \<longleftrightarrow> x \<in> A" | 
| 61808 | 1775 | using \<open>closed A\<close> by (simp add: in_closed_iff_infdist_zero) | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1776 |     then have "g -` A \<inter> space M = {x\<in>space M. infdist (g x) A = 0}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1777 | by auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1778 | also have "\<dots> \<in> sets M" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1779 | by measurable | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1780 | finally show ?thesis . | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1781 | qed simp | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1782 | qed auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56371diff
changeset | 1783 | |
| 62372 | 1784 | lemma sets_Collect_Cauchy[measurable]: | 
| 57036 | 1785 |   fixes f :: "nat \<Rightarrow> 'a => 'b::{metric_space, second_countable_topology}"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1786 | assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 49774 | 1787 |   shows "{x\<in>space M. Cauchy (\<lambda>i. f i x)} \<in> sets M"
 | 
| 57036 | 1788 | unfolding metric_Cauchy_iff2 using f by auto | 
| 49774 | 1789 | |
| 62624 
59ceeb6f3079
generalized some Borel measurable statements to support ennreal
 hoelzl parents: 
62390diff
changeset | 1790 | lemma borel_measurable_lim_metric[measurable (raw)]: | 
| 57036 | 1791 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{banach, second_countable_topology}"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1792 | assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 49774 | 1793 | shows "(\<lambda>x. lim (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 1794 | proof - | |
| 63040 | 1795 | define u' where "u' x = lim (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0)" for x | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1796 | then have *: "\<And>x. lim (\<lambda>i. f i x) = (if Cauchy (\<lambda>i. f i x) then u' x else (THE x. False))" | 
| 49774 | 1797 | by (auto simp: lim_def convergent_eq_cauchy[symmetric]) | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1798 | have "u' \<in> borel_measurable M" | 
| 57036 | 1799 | proof (rule borel_measurable_LIMSEQ_metric) | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1800 | fix x | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1801 | have "convergent (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0)" | 
| 49774 | 1802 | by (cases "Cauchy (\<lambda>i. f i x)") | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1803 | (auto simp add: convergent_eq_cauchy[symmetric] convergent_def) | 
| 61969 | 1804 | then show "(\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0) \<longlonglongrightarrow> u' x" | 
| 62372 | 1805 | unfolding u'_def | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1806 | by (rule convergent_LIMSEQ_iff[THEN iffD1]) | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1807 | qed measurable | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1808 | then show ?thesis | 
| 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1809 | unfolding * by measurable | 
| 49774 | 1810 | qed | 
| 1811 | ||
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1812 | lemma borel_measurable_suminf[measurable (raw)]: | 
| 57036 | 1813 |   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{banach, second_countable_topology}"
 | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1814 | assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M" | 
| 49774 | 1815 | shows "(\<lambda>x. suminf (\<lambda>i. f i x)) \<in> borel_measurable M" | 
| 50002 
ce0d316b5b44
add measurability prover; add support for Borel sets
 hoelzl parents: 
50001diff
changeset | 1816 | unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp | 
| 49774 | 1817 | |
| 63389 | 1818 | lemma Collect_closed_imp_pred_borel: "closed {x. P x} \<Longrightarrow> Measurable.pred borel P"
 | 
| 1819 | by (simp add: pred_def) | |
| 1820 | ||
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1821 | (* Proof by Jeremy Avigad and Luke Serafin *) | 
| 63389 | 1822 | lemma isCont_borel_pred[measurable]: | 
| 1823 | fixes f :: "'b::metric_space \<Rightarrow> 'a::metric_space" | |
| 1824 | shows "Measurable.pred borel (isCont f)" | |
| 1825 | proof (subst measurable_cong) | |
| 1826 | let ?I = "\<lambda>j. inverse(real (Suc j))" | |
| 1827 | show "isCont f x = (\<forall>i. \<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i)" for x | |
| 1828 | unfolding continuous_at_eps_delta | |
| 1829 | proof safe | |
| 1830 | fix i assume "\<forall>e>0. \<exists>d>0. \<forall>y. dist y x < d \<longrightarrow> dist (f y) (f x) < e" | |
| 1831 | moreover have "0 < ?I i / 2" | |
| 1832 | by simp | |
| 1833 | ultimately obtain d where d: "0 < d" "\<And>y. dist x y < d \<Longrightarrow> dist (f y) (f x) < ?I i / 2" | |
| 1834 | by (metis dist_commute) | |
| 1835 | then obtain j where j: "?I j < d" | |
| 1836 | by (metis reals_Archimedean) | |
| 1837 | ||
| 1838 | show "\<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i" | |
| 1839 | proof (safe intro!: exI[where x=j]) | |
| 1840 | fix y z assume *: "dist x y < ?I j" "dist x z < ?I j" | |
| 1841 | have "dist (f y) (f z) \<le> dist (f y) (f x) + dist (f z) (f x)" | |
| 1842 | by (rule dist_triangle2) | |
| 1843 | also have "\<dots> < ?I i / 2 + ?I i / 2" | |
| 1844 | by (intro add_strict_mono d less_trans[OF _ j] *) | |
| 1845 | also have "\<dots> \<le> ?I i" | |
| 1846 | by (simp add: field_simps of_nat_Suc) | |
| 1847 | finally show "dist (f y) (f z) \<le> ?I i" | |
| 1848 | by simp | |
| 1849 | qed | |
| 1850 | next | |
| 1851 | fix e::real assume "0 < e" | |
| 1852 | then obtain n where n: "?I n < e" | |
| 1853 | by (metis reals_Archimedean) | |
| 1854 | assume "\<forall>i. \<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i" | |
| 1855 | from this[THEN spec, of "Suc n"] | |
| 1856 | obtain j where j: "\<And>y z. dist x y < ?I j \<Longrightarrow> dist x z < ?I j \<Longrightarrow> dist (f y) (f z) \<le> ?I (Suc n)" | |
| 1857 | by auto | |
| 1858 | ||
| 1859 | show "\<exists>d>0. \<forall>y. dist y x < d \<longrightarrow> dist (f y) (f x) < e" | |
| 1860 | proof (safe intro!: exI[of _ "?I j"]) | |
| 1861 | fix y assume "dist y x < ?I j" | |
| 1862 | then have "dist (f y) (f x) \<le> ?I (Suc n)" | |
| 1863 | by (intro j) (auto simp: dist_commute) | |
| 1864 | also have "?I (Suc n) < ?I n" | |
| 1865 | by simp | |
| 1866 | also note n | |
| 1867 | finally show "dist (f y) (f x) < e" . | |
| 1868 | qed simp | |
| 1869 | qed | |
| 1870 | qed (intro pred_intros_countable closed_Collect_all closed_Collect_le open_Collect_less | |
| 1871 | Collect_closed_imp_pred_borel closed_Collect_imp open_Collect_conj continuous_intros) | |
| 1872 | ||
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1873 | lemma isCont_borel: | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1874 | fixes f :: "'b::metric_space \<Rightarrow> 'a::metric_space" | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57275diff
changeset | 1875 |   shows "{x. isCont f x} \<in> sets borel"
 | 
| 63389 | 1876 | by simp | 
| 62083 | 1877 | |
| 61880 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1878 | lemma is_real_interval: | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1879 | assumes S: "is_interval S" | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1880 |   shows "\<exists>a b::real. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or>
 | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1881 |     S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}"
 | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1882 | using S unfolding is_interval_1 by (blast intro: interval_cases) | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1883 | |
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1884 | lemma real_interval_borel_measurable: | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1885 | assumes "is_interval (S::real set)" | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1886 | shows "S \<in> sets borel" | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1887 | proof - | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1888 |   from assms is_real_interval have "\<exists>a b::real. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or>
 | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1889 |     S = {a<..} \<or> S = {a..} \<or> S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}" by auto
 | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1890 | then guess a .. | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1891 | then guess b .. | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1892 | thus ?thesis | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1893 | by auto | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1894 | qed | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1895 | |
| 62083 | 1896 | lemma borel_measurable_mono_on_fnc: | 
| 1897 | fixes f :: "real \<Rightarrow> real" and A :: "real set" | |
| 1898 | assumes "mono_on f A" | |
| 1899 | shows "f \<in> borel_measurable (restrict_space borel A)" | |
| 1900 | apply (rule measurable_restrict_countable[OF mono_on_ctble_discont[OF assms]]) | |
| 1901 |   apply (auto intro!: image_eqI[where x="{x}" for x] simp: sets_restrict_space)
 | |
| 1902 | apply (auto simp add: sets_restrict_restrict_space continuous_on_eq_continuous_within | |
| 62372 | 1903 | cong: measurable_cong_sets | 
| 62083 | 1904 | intro!: borel_measurable_continuous_on_restrict intro: continuous_within_subset) | 
| 1905 | done | |
| 1906 | ||
| 61880 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1907 | lemma borel_measurable_mono: | 
| 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1908 | fixes f :: "real \<Rightarrow> real" | 
| 62083 | 1909 | shows "mono f \<Longrightarrow> f \<in> borel_measurable borel" | 
| 1910 | using borel_measurable_mono_on_fnc[of f UNIV] by (simp add: mono_def mono_on_def) | |
| 61880 
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
 hoelzl parents: 
61808diff
changeset | 1911 | |
| 54775 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1912 | no_notation | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1913 | eucl_less (infix "<e" 50) | 
| 
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
 immler parents: 
54230diff
changeset | 1914 | |
| 51683 
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
 hoelzl parents: 
51478diff
changeset | 1915 | end |