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