| author | blanchet | 
| Tue, 28 Apr 2015 22:56:28 +0200 | |
| changeset 60152 | 7b051a6c9e28 | 
| parent 59361 | fd5da2434be4 | 
| child 60172 | 423273355b55 | 
| permissions | -rw-r--r-- | 
| 50530 | 1 | (* Title: HOL/Probability/Measurable.thy | 
| 50387 | 2 | Author: Johannes Hölzl <hoelzl@in.tum.de> | 
| 3 | *) | |
| 4 | theory Measurable | |
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 5 | imports | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 6 | Sigma_Algebra | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 7 | "~~/src/HOL/Library/Order_Continuity" | 
| 50387 | 8 | begin | 
| 9 | ||
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 10 | hide_const (open) Order_Continuity.continuous | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 11 | |
| 50387 | 12 | subsection {* Measurability prover *}
 | 
| 13 | ||
| 14 | lemma (in algebra) sets_Collect_finite_All: | |
| 15 |   assumes "\<And>i. i \<in> S \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" "finite S"
 | |
| 16 |   shows "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} \<in> M"
 | |
| 17 | proof - | |
| 18 |   have "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} = (if S = {} then \<Omega> else \<Inter>i\<in>S. {x\<in>\<Omega>. P i x})"
 | |
| 19 | by auto | |
| 20 | with assms show ?thesis by (auto intro!: sets_Collect_finite_All') | |
| 21 | qed | |
| 22 | ||
| 23 | abbreviation "pred M P \<equiv> P \<in> measurable M (count_space (UNIV::bool set))" | |
| 24 | ||
| 25 | lemma pred_def: "pred M P \<longleftrightarrow> {x\<in>space M. P x} \<in> sets M"
 | |
| 26 | proof | |
| 27 | assume "pred M P" | |
| 28 |   then have "P -` {True} \<inter> space M \<in> sets M"
 | |
| 29 | by (auto simp: measurable_count_space_eq2) | |
| 30 |   also have "P -` {True} \<inter> space M = {x\<in>space M. P x}" by auto
 | |
| 31 |   finally show "{x\<in>space M. P x} \<in> sets M" .
 | |
| 32 | next | |
| 33 |   assume P: "{x\<in>space M. P x} \<in> sets M"
 | |
| 34 | moreover | |
| 35 |   { fix X
 | |
| 36 | have "X \<in> Pow (UNIV :: bool set)" by simp | |
| 37 |     then have "P -` X \<inter> space M = {x\<in>space M. ((X = {True} \<longrightarrow> P x) \<and> (X = {False} \<longrightarrow> \<not> P x) \<and> X \<noteq> {})}"
 | |
| 38 | unfolding UNIV_bool Pow_insert Pow_empty by auto | |
| 39 | then have "P -` X \<inter> space M \<in> sets M" | |
| 40 | by (auto intro!: sets.sets_Collect_neg sets.sets_Collect_imp sets.sets_Collect_conj sets.sets_Collect_const P) } | |
| 41 | then show "pred M P" | |
| 42 | by (auto simp: measurable_def) | |
| 43 | qed | |
| 44 | ||
| 45 | lemma pred_sets1: "{x\<in>space M. P x} \<in> sets M \<Longrightarrow> f \<in> measurable N M \<Longrightarrow> pred N (\<lambda>x. P (f x))"
 | |
| 46 | by (rule measurable_compose[where f=f and N=M]) (auto simp: pred_def) | |
| 47 | ||
| 48 | lemma pred_sets2: "A \<in> sets N \<Longrightarrow> f \<in> measurable M N \<Longrightarrow> pred M (\<lambda>x. f x \<in> A)" | |
| 49 | by (rule measurable_compose[where f=f and N=N]) (auto simp: pred_def Int_def[symmetric]) | |
| 50 | ||
| 51 | ML_file "measurable.ML" | |
| 52 | ||
| 53043 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 53 | attribute_setup measurable = {*
 | 
| 59047 | 54 | Scan.lift ( | 
| 55 | (Args.add >> K true || Args.del >> K false || Scan.succeed true) -- | |
| 56 | Scan.optional (Args.parens ( | |
| 57 | Scan.optional (Args.$$$ "raw" >> K true) false -- | |
| 58965 | 58 | Scan.optional (Args.$$$ "generic" >> K Measurable.Generic) Measurable.Concrete)) | 
| 59047 | 59 | (false, Measurable.Concrete) >> | 
| 60 | Measurable.measurable_thm_attr) | |
| 53043 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 61 | *} "declaration of measurability theorems" | 
| 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 62 | |
| 59047 | 63 | attribute_setup measurable_dest = Measurable.dest_thm_attr | 
| 59048 | 64 | "add dest rule to measurability prover" | 
| 53043 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 65 | |
| 59048 | 66 | attribute_setup measurable_cong = Measurable.cong_thm_attr | 
| 67 | "add congurence rules to measurability prover" | |
| 53043 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 68 | |
| 59047 | 69 | method_setup measurable = \<open> Scan.lift (Scan.succeed (METHOD o Measurable.measurable_tac)) \<close> | 
| 70 | "measurability prover" | |
| 53043 
8cbfbeb566a4
more standard attribute_setup / method_setup -- export key ML operations instead of parsers;
 wenzelm parents: 
50530diff
changeset | 71 | |
| 50387 | 72 | simproc_setup measurable ("A \<in> sets M" | "f \<in> measurable M N") = {* K Measurable.simproc *}
 | 
| 73 | ||
| 58965 | 74 | setup {*
 | 
| 59048 | 75 |   Global_Theory.add_thms_dynamic (@{binding measurable}, Measurable.get_all)
 | 
| 58965 | 76 | *} | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 77 | |
| 50387 | 78 | declare | 
| 79 | pred_sets1[measurable_dest] | |
| 80 | pred_sets2[measurable_dest] | |
| 81 | sets.sets_into_space[measurable_dest] | |
| 82 | ||
| 83 | declare | |
| 84 | sets.top[measurable] | |
| 85 | sets.empty_sets[measurable (raw)] | |
| 86 | sets.Un[measurable (raw)] | |
| 87 | sets.Diff[measurable (raw)] | |
| 88 | ||
| 89 | declare | |
| 90 | measurable_count_space[measurable (raw)] | |
| 91 | measurable_ident[measurable (raw)] | |
| 59048 | 92 | measurable_id[measurable (raw)] | 
| 50387 | 93 | measurable_const[measurable (raw)] | 
| 94 | measurable_If[measurable (raw)] | |
| 95 | measurable_comp[measurable (raw)] | |
| 96 | measurable_sets[measurable (raw)] | |
| 97 | ||
| 59048 | 98 | declare measurable_cong_sets[measurable_cong] | 
| 99 | declare sets_restrict_space_cong[measurable_cong] | |
| 59361 
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
 hoelzl parents: 
59353diff
changeset | 100 | declare sets_restrict_UNIV[measurable_cong] | 
| 59048 | 101 | |
| 50387 | 102 | lemma predE[measurable (raw)]: | 
| 103 |   "pred M P \<Longrightarrow> {x\<in>space M. P x} \<in> sets M"
 | |
| 104 | unfolding pred_def . | |
| 105 | ||
| 106 | lemma pred_intros_imp'[measurable (raw)]: | |
| 107 | "(K \<Longrightarrow> pred M (\<lambda>x. P x)) \<Longrightarrow> pred M (\<lambda>x. K \<longrightarrow> P x)" | |
| 108 | by (cases K) auto | |
| 109 | ||
| 110 | lemma pred_intros_conj1'[measurable (raw)]: | |
| 111 | "(K \<Longrightarrow> pred M (\<lambda>x. P x)) \<Longrightarrow> pred M (\<lambda>x. K \<and> P x)" | |
| 112 | by (cases K) auto | |
| 113 | ||
| 114 | lemma pred_intros_conj2'[measurable (raw)]: | |
| 115 | "(K \<Longrightarrow> pred M (\<lambda>x. P x)) \<Longrightarrow> pred M (\<lambda>x. P x \<and> K)" | |
| 116 | by (cases K) auto | |
| 117 | ||
| 118 | lemma pred_intros_disj1'[measurable (raw)]: | |
| 119 | "(\<not> K \<Longrightarrow> pred M (\<lambda>x. P x)) \<Longrightarrow> pred M (\<lambda>x. K \<or> P x)" | |
| 120 | by (cases K) auto | |
| 121 | ||
| 122 | lemma pred_intros_disj2'[measurable (raw)]: | |
| 123 | "(\<not> K \<Longrightarrow> pred M (\<lambda>x. P x)) \<Longrightarrow> pred M (\<lambda>x. P x \<or> K)" | |
| 124 | by (cases K) auto | |
| 125 | ||
| 126 | lemma pred_intros_logic[measurable (raw)]: | |
| 127 | "pred M (\<lambda>x. x \<in> space M)" | |
| 128 | "pred M (\<lambda>x. P x) \<Longrightarrow> pred M (\<lambda>x. \<not> P x)" | |
| 129 | "pred M (\<lambda>x. Q x) \<Longrightarrow> pred M (\<lambda>x. P x) \<Longrightarrow> pred M (\<lambda>x. Q x \<and> P x)" | |
| 130 | "pred M (\<lambda>x. Q x) \<Longrightarrow> pred M (\<lambda>x. P x) \<Longrightarrow> pred M (\<lambda>x. Q x \<longrightarrow> P x)" | |
| 131 | "pred M (\<lambda>x. Q x) \<Longrightarrow> pred M (\<lambda>x. P x) \<Longrightarrow> pred M (\<lambda>x. Q x \<or> P x)" | |
| 132 | "pred M (\<lambda>x. Q x) \<Longrightarrow> pred M (\<lambda>x. P x) \<Longrightarrow> pred M (\<lambda>x. Q x = P x)" | |
| 133 | "pred M (\<lambda>x. f x \<in> UNIV)" | |
| 134 |   "pred M (\<lambda>x. f x \<in> {})"
 | |
| 135 |   "pred M (\<lambda>x. P' (f x) x) \<Longrightarrow> pred M (\<lambda>x. f x \<in> {y. P' y x})"
 | |
| 136 | "pred M (\<lambda>x. f x \<in> (B x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> - (B x))" | |
| 137 | "pred M (\<lambda>x. f x \<in> (A x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (B x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (A x) - (B x))" | |
| 138 | "pred M (\<lambda>x. f x \<in> (A x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (B x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (A x) \<inter> (B x))" | |
| 139 | "pred M (\<lambda>x. f x \<in> (A x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (B x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (A x) \<union> (B x))" | |
| 140 | "pred M (\<lambda>x. g x (f x) \<in> (X x)) \<Longrightarrow> pred M (\<lambda>x. f x \<in> (g x) -` (X x))" | |
| 141 | by (auto simp: iff_conv_conj_imp pred_def) | |
| 142 | ||
| 143 | lemma pred_intros_countable[measurable (raw)]: | |
| 144 | fixes P :: "'a \<Rightarrow> 'i :: countable \<Rightarrow> bool" | |
| 145 | shows | |
| 146 | "(\<And>i. pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<forall>i. P x i)" | |
| 147 | "(\<And>i. pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<exists>i. P x i)" | |
| 148 | by (auto intro!: sets.sets_Collect_countable_All sets.sets_Collect_countable_Ex simp: pred_def) | |
| 149 | ||
| 150 | lemma pred_intros_countable_bounded[measurable (raw)]: | |
| 151 | fixes X :: "'i :: countable set" | |
| 152 | shows | |
| 153 | "(\<And>i. i \<in> X \<Longrightarrow> pred M (\<lambda>x. x \<in> N x i)) \<Longrightarrow> pred M (\<lambda>x. x \<in> (\<Inter>i\<in>X. N x i))" | |
| 154 | "(\<And>i. i \<in> X \<Longrightarrow> pred M (\<lambda>x. x \<in> N x i)) \<Longrightarrow> pred M (\<lambda>x. x \<in> (\<Union>i\<in>X. N x i))" | |
| 155 | "(\<And>i. i \<in> X \<Longrightarrow> pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<forall>i\<in>X. P x i)" | |
| 156 | "(\<And>i. i \<in> X \<Longrightarrow> pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<exists>i\<in>X. P x i)" | |
| 157 | by (auto simp: Bex_def Ball_def) | |
| 158 | ||
| 159 | lemma pred_intros_finite[measurable (raw)]: | |
| 160 | "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> pred M (\<lambda>x. x \<in> N x i)) \<Longrightarrow> pred M (\<lambda>x. x \<in> (\<Inter>i\<in>I. N x i))" | |
| 161 | "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> pred M (\<lambda>x. x \<in> N x i)) \<Longrightarrow> pred M (\<lambda>x. x \<in> (\<Union>i\<in>I. N x i))" | |
| 162 | "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<forall>i\<in>I. P x i)" | |
| 163 | "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> pred M (\<lambda>x. P x i)) \<Longrightarrow> pred M (\<lambda>x. \<exists>i\<in>I. P x i)" | |
| 164 | by (auto intro!: sets.sets_Collect_finite_Ex sets.sets_Collect_finite_All simp: iff_conv_conj_imp pred_def) | |
| 165 | ||
| 166 | lemma countable_Un_Int[measurable (raw)]: | |
| 167 | "(\<And>i :: 'i :: countable. i \<in> I \<Longrightarrow> N i \<in> sets M) \<Longrightarrow> (\<Union>i\<in>I. N i) \<in> sets M" | |
| 168 |   "I \<noteq> {} \<Longrightarrow> (\<And>i :: 'i :: countable. i \<in> I \<Longrightarrow> N i \<in> sets M) \<Longrightarrow> (\<Inter>i\<in>I. N i) \<in> sets M"
 | |
| 169 | by auto | |
| 170 | ||
| 171 | declare | |
| 172 | finite_UN[measurable (raw)] | |
| 173 | finite_INT[measurable (raw)] | |
| 174 | ||
| 175 | lemma sets_Int_pred[measurable (raw)]: | |
| 176 | assumes space: "A \<inter> B \<subseteq> space M" and [measurable]: "pred M (\<lambda>x. x \<in> A)" "pred M (\<lambda>x. x \<in> B)" | |
| 177 | shows "A \<inter> B \<in> sets M" | |
| 178 | proof - | |
| 179 |   have "{x\<in>space M. x \<in> A \<inter> B} \<in> sets M" by auto
 | |
| 180 |   also have "{x\<in>space M. x \<in> A \<inter> B} = A \<inter> B"
 | |
| 181 | using space by auto | |
| 182 | finally show ?thesis . | |
| 183 | qed | |
| 184 | ||
| 185 | lemma [measurable (raw generic)]: | |
| 186 |   assumes f: "f \<in> measurable M N" and c: "c \<in> space N \<Longrightarrow> {c} \<in> sets N"
 | |
| 187 | shows pred_eq_const1: "pred M (\<lambda>x. f x = c)" | |
| 188 | and pred_eq_const2: "pred M (\<lambda>x. c = f x)" | |
| 189 | proof - | |
| 190 | show "pred M (\<lambda>x. f x = c)" | |
| 191 | proof cases | |
| 192 | assume "c \<in> space N" | |
| 193 | with measurable_sets[OF f c] show ?thesis | |
| 194 | by (auto simp: Int_def conj_commute pred_def) | |
| 195 | next | |
| 196 | assume "c \<notin> space N" | |
| 197 |     with f[THEN measurable_space] have "{x \<in> space M. f x = c} = {}" by auto
 | |
| 198 | then show ?thesis by (auto simp: pred_def cong: conj_cong) | |
| 199 | qed | |
| 200 | then show "pred M (\<lambda>x. c = f x)" | |
| 201 | by (simp add: eq_commute) | |
| 202 | qed | |
| 203 | ||
| 59000 | 204 | lemma pred_count_space_const1[measurable (raw)]: | 
| 205 | "f \<in> measurable M (count_space UNIV) \<Longrightarrow> Measurable.pred M (\<lambda>x. f x = c)" | |
| 206 | by (intro pred_eq_const1[where N="count_space UNIV"]) (auto ) | |
| 207 | ||
| 208 | lemma pred_count_space_const2[measurable (raw)]: | |
| 209 | "f \<in> measurable M (count_space UNIV) \<Longrightarrow> Measurable.pred M (\<lambda>x. c = f x)" | |
| 210 | by (intro pred_eq_const2[where N="count_space UNIV"]) (auto ) | |
| 211 | ||
| 50387 | 212 | lemma pred_le_const[measurable (raw generic)]: | 
| 213 |   assumes f: "f \<in> measurable M N" and c: "{.. c} \<in> sets N" shows "pred M (\<lambda>x. f x \<le> c)"
 | |
| 214 | using measurable_sets[OF f c] | |
| 215 | by (auto simp: Int_def conj_commute eq_commute pred_def) | |
| 216 | ||
| 217 | lemma pred_const_le[measurable (raw generic)]: | |
| 218 |   assumes f: "f \<in> measurable M N" and c: "{c ..} \<in> sets N" shows "pred M (\<lambda>x. c \<le> f x)"
 | |
| 219 | using measurable_sets[OF f c] | |
| 220 | by (auto simp: Int_def conj_commute eq_commute pred_def) | |
| 221 | ||
| 222 | lemma pred_less_const[measurable (raw generic)]: | |
| 223 |   assumes f: "f \<in> measurable M N" and c: "{..< c} \<in> sets N" shows "pred M (\<lambda>x. f x < c)"
 | |
| 224 | using measurable_sets[OF f c] | |
| 225 | by (auto simp: Int_def conj_commute eq_commute pred_def) | |
| 226 | ||
| 227 | lemma pred_const_less[measurable (raw generic)]: | |
| 228 |   assumes f: "f \<in> measurable M N" and c: "{c <..} \<in> sets N" shows "pred M (\<lambda>x. c < f x)"
 | |
| 229 | using measurable_sets[OF f c] | |
| 230 | by (auto simp: Int_def conj_commute eq_commute pred_def) | |
| 231 | ||
| 232 | declare | |
| 233 | sets.Int[measurable (raw)] | |
| 234 | ||
| 235 | lemma pred_in_If[measurable (raw)]: | |
| 236 | "(P \<Longrightarrow> pred M (\<lambda>x. x \<in> A x)) \<Longrightarrow> (\<not> P \<Longrightarrow> pred M (\<lambda>x. x \<in> B x)) \<Longrightarrow> | |
| 237 | pred M (\<lambda>x. x \<in> (if P then A x else B x))" | |
| 238 | by auto | |
| 239 | ||
| 240 | lemma sets_range[measurable_dest]: | |
| 241 | "A ` I \<subseteq> sets M \<Longrightarrow> i \<in> I \<Longrightarrow> A i \<in> sets M" | |
| 242 | by auto | |
| 243 | ||
| 244 | lemma pred_sets_range[measurable_dest]: | |
| 245 | "A ` I \<subseteq> sets N \<Longrightarrow> i \<in> I \<Longrightarrow> f \<in> measurable M N \<Longrightarrow> pred M (\<lambda>x. f x \<in> A i)" | |
| 246 | using pred_sets2[OF sets_range] by auto | |
| 247 | ||
| 248 | lemma sets_All[measurable_dest]: | |
| 249 | "\<forall>i. A i \<in> sets (M i) \<Longrightarrow> A i \<in> sets (M i)" | |
| 250 | by auto | |
| 251 | ||
| 252 | lemma pred_sets_All[measurable_dest]: | |
| 253 | "\<forall>i. A i \<in> sets (N i) \<Longrightarrow> f \<in> measurable M (N i) \<Longrightarrow> pred M (\<lambda>x. f x \<in> A i)" | |
| 254 | using pred_sets2[OF sets_All, of A N f] by auto | |
| 255 | ||
| 256 | lemma sets_Ball[measurable_dest]: | |
| 257 | "\<forall>i\<in>I. A i \<in> sets (M i) \<Longrightarrow> i\<in>I \<Longrightarrow> A i \<in> sets (M i)" | |
| 258 | by auto | |
| 259 | ||
| 260 | lemma pred_sets_Ball[measurable_dest]: | |
| 261 | "\<forall>i\<in>I. A i \<in> sets (N i) \<Longrightarrow> i\<in>I \<Longrightarrow> f \<in> measurable M (N i) \<Longrightarrow> pred M (\<lambda>x. f x \<in> A i)" | |
| 262 | using pred_sets2[OF sets_Ball, of _ _ _ f] by auto | |
| 263 | ||
| 264 | lemma measurable_finite[measurable (raw)]: | |
| 265 | fixes S :: "'a \<Rightarrow> nat set" | |
| 266 |   assumes [measurable]: "\<And>i. {x\<in>space M. i \<in> S x} \<in> sets M"
 | |
| 267 | shows "pred M (\<lambda>x. finite (S x))" | |
| 268 | unfolding finite_nat_set_iff_bounded by (simp add: Ball_def) | |
| 269 | ||
| 270 | lemma measurable_Least[measurable]: | |
| 271 | assumes [measurable]: "(\<And>i::nat. (\<lambda>x. P i x) \<in> measurable M (count_space UNIV))"q | |
| 272 | shows "(\<lambda>x. LEAST i. P i x) \<in> measurable M (count_space UNIV)" | |
| 273 | unfolding measurable_def by (safe intro!: sets_Least) simp_all | |
| 274 | ||
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 275 | lemma measurable_Max_nat[measurable (raw)]: | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 276 | fixes P :: "nat \<Rightarrow> 'a \<Rightarrow> bool" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 277 | assumes [measurable]: "\<And>i. Measurable.pred M (P i)" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 278 |   shows "(\<lambda>x. Max {i. P i x}) \<in> measurable M (count_space UNIV)"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 279 | unfolding measurable_count_space_eq2_countable | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 280 | proof safe | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 281 | fix n | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 282 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 283 |   { fix x assume "\<forall>i. \<exists>n\<ge>i. P n x"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 284 |     then have "infinite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 285 | unfolding infinite_nat_iff_unbounded_le by auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 286 |     then have "Max {i. P i x} = the None"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 287 | by (rule Max.infinite) } | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 288 | note 1 = this | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 289 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 290 |   { fix x i j assume "P i x" "\<forall>n\<ge>j. \<not> P n x"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 291 |     then have "finite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 292 | by (auto simp: subset_eq not_le[symmetric] finite_nat_iff_bounded) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 293 |     with `P i x` have "P (Max {i. P i x}) x" "i \<le> Max {i. P i x}" "finite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 294 |       using Max_in[of "{i. P i x}"] by auto }
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 295 | note 2 = this | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 296 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 297 |   have "(\<lambda>x. Max {i. P i x}) -` {n} \<inter> space M = {x\<in>space M. Max {i. P i x} = n}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 298 | by auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 299 | also have "\<dots> = | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 300 |     {x\<in>space M. if (\<forall>i. \<exists>n\<ge>i. P n x) then the None = n else 
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 301 | if (\<exists>i. P i x) then P n x \<and> (\<forall>i>n. \<not> P i x) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 302 |       else Max {} = n}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 303 | by (intro arg_cong[where f=Collect] ext conj_cong) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 304 | (auto simp add: 1 2 not_le[symmetric] intro!: Max_eqI) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 305 | 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: 
56045diff
changeset | 306 | by measurable | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 307 |   finally show "(\<lambda>x. Max {i. P i x}) -` {n} \<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: 
56045diff
changeset | 308 | qed simp | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 309 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 310 | lemma measurable_Min_nat[measurable (raw)]: | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 311 | fixes P :: "nat \<Rightarrow> 'a \<Rightarrow> bool" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 312 | assumes [measurable]: "\<And>i. Measurable.pred M (P i)" | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 313 |   shows "(\<lambda>x. Min {i. P i x}) \<in> measurable M (count_space UNIV)"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 314 | unfolding measurable_count_space_eq2_countable | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 315 | proof safe | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 316 | fix n | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 317 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 318 |   { fix x assume "\<forall>i. \<exists>n\<ge>i. P n x"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 319 |     then have "infinite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 320 | unfolding infinite_nat_iff_unbounded_le by auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 321 |     then have "Min {i. P i x} = the None"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 322 | by (rule Min.infinite) } | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 323 | note 1 = this | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 324 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 325 |   { fix x i j assume "P i x" "\<forall>n\<ge>j. \<not> P n x"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 326 |     then have "finite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 327 | by (auto simp: subset_eq not_le[symmetric] finite_nat_iff_bounded) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 328 |     with `P i x` have "P (Min {i. P i x}) x" "Min {i. P i x} \<le> i" "finite {i. P i x}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 329 |       using Min_in[of "{i. P i x}"] by auto }
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 330 | note 2 = this | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 331 | |
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 332 |   have "(\<lambda>x. Min {i. P i x}) -` {n} \<inter> space M = {x\<in>space M. Min {i. P i x} = n}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 333 | by auto | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 334 | also have "\<dots> = | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 335 |     {x\<in>space M. if (\<forall>i. \<exists>n\<ge>i. P n x) then the None = n else 
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 336 | if (\<exists>i. P i x) then P n x \<and> (\<forall>i<n. \<not> P i x) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 337 |       else Min {} = n}"
 | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 338 | by (intro arg_cong[where f=Collect] ext conj_cong) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 339 | (auto simp add: 1 2 not_le[symmetric] intro!: Min_eqI) | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 340 | 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: 
56045diff
changeset | 341 | by measurable | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 342 |   finally show "(\<lambda>x. Min {i. P i x}) -` {n} \<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: 
56045diff
changeset | 343 | qed simp | 
| 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
56045diff
changeset | 344 | |
| 50387 | 345 | lemma measurable_count_space_insert[measurable (raw)]: | 
| 346 | "s \<in> S \<Longrightarrow> A \<in> sets (count_space S) \<Longrightarrow> insert s A \<in> sets (count_space S)" | |
| 347 | by simp | |
| 348 | ||
| 59000 | 349 | lemma sets_UNIV [measurable (raw)]: "A \<in> sets (count_space UNIV)" | 
| 350 | by simp | |
| 351 | ||
| 57025 | 352 | lemma measurable_card[measurable]: | 
| 353 | fixes S :: "'a \<Rightarrow> nat set" | |
| 354 |   assumes [measurable]: "\<And>i. {x\<in>space M. i \<in> S x} \<in> sets M"
 | |
| 355 | shows "(\<lambda>x. card (S x)) \<in> measurable M (count_space UNIV)" | |
| 356 | unfolding measurable_count_space_eq2_countable | |
| 357 | proof safe | |
| 358 |   fix n show "(\<lambda>x. card (S x)) -` {n} \<inter> space M \<in> sets M"
 | |
| 359 | proof (cases n) | |
| 360 | case 0 | |
| 361 |     then have "(\<lambda>x. card (S x)) -` {n} \<inter> space M = {x\<in>space M. infinite (S x) \<or> (\<forall>i. i \<notin> S x)}"
 | |
| 362 | by auto | |
| 363 | also have "\<dots> \<in> sets M" | |
| 364 | by measurable | |
| 365 | finally show ?thesis . | |
| 366 | next | |
| 367 | case (Suc i) | |
| 368 |     then have "(\<lambda>x. card (S x)) -` {n} \<inter> space M =
 | |
| 369 |       (\<Union>F\<in>{A\<in>{A. finite A}. card A = n}. {x\<in>space M. (\<forall>i. i \<in> S x \<longleftrightarrow> i \<in> F)})"
 | |
| 370 | unfolding set_eq_iff[symmetric] Collect_bex_eq[symmetric] by (auto intro: card_ge_0_finite) | |
| 371 | also have "\<dots> \<in> sets M" | |
| 372 | by (intro sets.countable_UN' countable_Collect countable_Collect_finite) auto | |
| 373 | finally show ?thesis . | |
| 374 | qed | |
| 375 | qed rule | |
| 376 | ||
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 377 | lemma measurable_pred_countable[measurable (raw)]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 378 | assumes "countable X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 379 | shows | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 380 | "(\<And>i. i \<in> X \<Longrightarrow> Measurable.pred M (\<lambda>x. P x i)) \<Longrightarrow> Measurable.pred M (\<lambda>x. \<forall>i\<in>X. P x i)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 381 | "(\<And>i. i \<in> X \<Longrightarrow> Measurable.pred M (\<lambda>x. P x i)) \<Longrightarrow> Measurable.pred M (\<lambda>x. \<exists>i\<in>X. P x i)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 382 | unfolding pred_def | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 383 | by (auto intro!: sets.sets_Collect_countable_All' sets.sets_Collect_countable_Ex' assms) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 384 | |
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 385 | subsection {* Measurability for (co)inductive predicates *}
 | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 386 | |
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 387 | lemma measurable_bot[measurable]: "bot \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 388 | by (simp add: bot_fun_def) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 389 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 390 | lemma measurable_top[measurable]: "top \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 391 | by (simp add: top_fun_def) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 392 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 393 | lemma measurable_SUP[measurable]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 394 |   fixes F :: "'i \<Rightarrow> 'a \<Rightarrow> 'b::{complete_lattice, countable}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 395 | assumes [simp]: "countable I" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 396 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 397 | shows "(\<lambda>x. SUP i:I. F i x) \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 398 | unfolding measurable_count_space_eq2_countable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 399 | proof (safe intro!: UNIV_I) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 400 | fix a | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 401 |   have "(\<lambda>x. SUP i:I. F i x) -` {a} \<inter> space M =
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 402 |     {x\<in>space M. (\<forall>i\<in>I. F i x \<le> a) \<and> (\<forall>b. (\<forall>i\<in>I. F i x \<le> b) \<longrightarrow> a \<le> b)}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 403 | unfolding SUP_le_iff[symmetric] by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 404 | also have "\<dots> \<in> sets M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 405 | by measurable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 406 |   finally show "(\<lambda>x. SUP i:I. F i x) -` {a} \<inter> space M \<in> sets M" .
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 407 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 408 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 409 | lemma measurable_INF[measurable]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 410 |   fixes F :: "'i \<Rightarrow> 'a \<Rightarrow> 'b::{complete_lattice, countable}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 411 | assumes [simp]: "countable I" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 412 | assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 413 | shows "(\<lambda>x. INF i:I. F i x) \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 414 | unfolding measurable_count_space_eq2_countable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 415 | proof (safe intro!: UNIV_I) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 416 | fix a | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 417 |   have "(\<lambda>x. INF i:I. F i x) -` {a} \<inter> space M =
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 418 |     {x\<in>space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 419 | unfolding le_INF_iff[symmetric] by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 420 | also have "\<dots> \<in> sets M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 421 | by measurable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 422 |   finally show "(\<lambda>x. INF i:I. F i x) -` {a} \<inter> space M \<in> sets M" .
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 423 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 424 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 425 | lemma measurable_lfp_coinduct[consumes 1, case_names continuity step]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 426 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 427 | assumes "P M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 428 | assumes F: "Order_Continuity.continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 429 | assumes *: "\<And>M A. P M \<Longrightarrow> (\<And>N. P N \<Longrightarrow> A \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 430 | shows "lfp F \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 431 | proof - | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 432 |   { fix i from `P M` have "((F ^^ i) bot) \<in> measurable M (count_space UNIV)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 433 | by (induct i arbitrary: M) (auto intro!: *) } | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 434 | then have "(\<lambda>x. SUP i. (F ^^ i) bot x) \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 435 | by measurable | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 436 | also have "(\<lambda>x. SUP i. (F ^^ i) bot x) = lfp F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 437 | by (subst continuous_lfp) (auto intro: F) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 438 | finally show ?thesis . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 439 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 440 | |
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 441 | lemma measurable_lfp: | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 442 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 443 | assumes F: "Order_Continuity.continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 444 | assumes *: "\<And>A. A \<in> measurable M (count_space UNIV) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 445 | shows "lfp F \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 446 | by (coinduction rule: measurable_lfp_coinduct[OF _ F]) (blast intro: *) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 447 | |
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 448 | lemma measurable_gfp_coinduct[consumes 1, case_names continuity step]: | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 449 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 450 | assumes "P M" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 451 | assumes F: "Order_Continuity.down_continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 452 | assumes *: "\<And>M A. P M \<Longrightarrow> (\<And>N. P N \<Longrightarrow> A \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 453 | shows "gfp F \<in> measurable M (count_space UNIV)" | 
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 454 | proof - | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 455 |   { fix i from `P M` have "((F ^^ i) top) \<in> measurable M (count_space UNIV)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 456 | by (induct i arbitrary: M) (auto intro!: *) } | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 457 | then have "(\<lambda>x. INF i. (F ^^ i) top x) \<in> measurable M (count_space UNIV)" | 
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 458 | by measurable | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 459 | also have "(\<lambda>x. INF i. (F ^^ i) top x) = gfp F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 460 | by (subst down_continuous_gfp) (auto intro: F) | 
| 56021 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 461 | finally show ?thesis . | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 462 | qed | 
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 463 | |
| 
e0c9d76c2a6d
add measurability rule for (co)inductive predicates
 hoelzl parents: 
53043diff
changeset | 464 | lemma measurable_gfp: | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 465 |   fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 466 | assumes F: "Order_Continuity.down_continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 467 | assumes *: "\<And>A. A \<in> measurable M (count_space UNIV) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 468 | shows "gfp F \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 469 | by (coinduction rule: measurable_gfp_coinduct[OF _ F]) (blast intro: *) | 
| 59000 | 470 | |
| 471 | lemma measurable_lfp2_coinduct[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: 
59048diff
changeset | 472 |   fixes F :: "('a \<Rightarrow> 'c \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'c \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 59000 | 473 | assumes "P M s" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 474 | assumes F: "Order_Continuity.continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 475 | assumes *: "\<And>M A s. P M s \<Longrightarrow> (\<And>N t. P N t \<Longrightarrow> A t \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A s \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 476 | shows "lfp F s \<in> measurable M (count_space UNIV)" | 
| 59000 | 477 | proof - | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 478 |   { fix i from `P M s` have "(\<lambda>x. (F ^^ i) bot s x) \<in> measurable M (count_space UNIV)"
 | 
| 59000 | 479 | by (induct i arbitrary: M s) (auto intro!: *) } | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 480 | then have "(\<lambda>x. SUP i. (F ^^ i) bot s x) \<in> measurable M (count_space UNIV)" | 
| 59000 | 481 | by measurable | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 482 | also have "(\<lambda>x. SUP i. (F ^^ i) bot s x) = lfp F s" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 483 | by (subst continuous_lfp) (auto simp: F) | 
| 59000 | 484 | finally show ?thesis . | 
| 485 | qed | |
| 486 | ||
| 487 | lemma measurable_gfp2_coinduct[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: 
59048diff
changeset | 488 |   fixes F :: "('a \<Rightarrow> 'c \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'c \<Rightarrow> 'b::{complete_lattice, countable})"
 | 
| 59000 | 489 | assumes "P M s" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 490 | assumes F: "Order_Continuity.down_continuous F" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 491 | assumes *: "\<And>M A s. P M s \<Longrightarrow> (\<And>N t. P N t \<Longrightarrow> A t \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A s \<in> measurable M (count_space UNIV)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 492 | shows "gfp F s \<in> measurable M (count_space UNIV)" | 
| 59000 | 493 | proof - | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 494 |   { fix i from `P M s` have "(\<lambda>x. (F ^^ i) top s x) \<in> measurable M (count_space UNIV)"
 | 
| 59000 | 495 | by (induct i arbitrary: M s) (auto intro!: *) } | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 496 | then have "(\<lambda>x. INF i. (F ^^ i) top s x) \<in> measurable M (count_space UNIV)" | 
| 59000 | 497 | by measurable | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 498 | also have "(\<lambda>x. INF i. (F ^^ i) top s x) = gfp F s" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 499 | by (subst down_continuous_gfp) (auto simp: F) | 
| 59000 | 500 | finally show ?thesis . | 
| 501 | qed | |
| 502 | ||
| 503 | lemma measurable_enat_coinduct: | |
| 504 | fixes f :: "'a \<Rightarrow> enat" | |
| 505 | assumes "R f" | |
| 506 | assumes *: "\<And>f. R f \<Longrightarrow> \<exists>g h i P. R g \<and> f = (\<lambda>x. if P x then h x else eSuc (g (i x))) \<and> | |
| 507 | Measurable.pred M P \<and> | |
| 508 | i \<in> measurable M M \<and> | |
| 509 | h \<in> measurable M (count_space UNIV)" | |
| 510 | shows "f \<in> measurable M (count_space UNIV)" | |
| 511 | proof (simp add: measurable_count_space_eq2_countable, rule ) | |
| 512 | fix a :: enat | |
| 513 |   have "f -` {a} \<inter> space M = {x\<in>space M. f x = a}"
 | |
| 514 | by auto | |
| 515 |   { fix i :: nat
 | |
| 516 | from `R f` have "Measurable.pred M (\<lambda>x. f x = enat i)" | |
| 517 | proof (induction i arbitrary: f) | |
| 518 | case 0 | |
| 519 | from *[OF this] obtain g h i P | |
| 520 | where f: "f = (\<lambda>x. if P x then h x else eSuc (g (i x)))" and | |
| 521 | [measurable]: "Measurable.pred M P" "i \<in> measurable M M" "h \<in> measurable M (count_space UNIV)" | |
| 522 | by auto | |
| 523 | have "Measurable.pred M (\<lambda>x. P x \<and> h x = 0)" | |
| 524 | by measurable | |
| 525 | also have "(\<lambda>x. P x \<and> h x = 0) = (\<lambda>x. f x = enat 0)" | |
| 526 | by (auto simp: f zero_enat_def[symmetric]) | |
| 527 | finally show ?case . | |
| 528 | next | |
| 529 | case (Suc n) | |
| 530 | from *[OF Suc.prems] obtain g h i P | |
| 531 | where f: "f = (\<lambda>x. if P x then h x else eSuc (g (i x)))" and "R g" and | |
| 532 | M[measurable]: "Measurable.pred M P" "i \<in> measurable M M" "h \<in> measurable M (count_space UNIV)" | |
| 533 | by auto | |
| 534 | have "(\<lambda>x. f x = enat (Suc n)) = | |
| 535 | (\<lambda>x. (P x \<longrightarrow> h x = enat (Suc n)) \<and> (\<not> P x \<longrightarrow> g (i x) = enat n))" | |
| 536 | by (auto simp: f zero_enat_def[symmetric] eSuc_enat[symmetric]) | |
| 537 | also have "Measurable.pred M \<dots>" | |
| 538 | by (intro pred_intros_logic measurable_compose[OF M(2)] Suc `R g`) measurable | |
| 539 | finally show ?case . | |
| 540 | qed | |
| 541 |     then have "f -` {enat i} \<inter> space M \<in> sets M"
 | |
| 542 | by (simp add: pred_def Int_def conj_commute) } | |
| 543 | note fin = this | |
| 544 |   show "f -` {a} \<inter> space M \<in> sets M"
 | |
| 545 | proof (cases a) | |
| 546 | case infinity | |
| 547 |     then have "f -` {a} \<inter> space M = space M - (\<Union>n. f -` {enat n} \<inter> space M)"
 | |
| 548 | by auto | |
| 549 | also have "\<dots> \<in> sets M" | |
| 550 | by (intro sets.Diff sets.top sets.Un sets.countable_UN) (auto intro!: fin) | |
| 551 | finally show ?thesis . | |
| 552 | qed (simp add: fin) | |
| 553 | qed | |
| 554 | ||
| 555 | lemma measurable_THE: | |
| 556 | fixes P :: "'a \<Rightarrow> 'b \<Rightarrow> bool" | |
| 557 | assumes [measurable]: "\<And>i. Measurable.pred M (P i)" | |
| 558 | assumes I[simp]: "countable I" "\<And>i x. x \<in> space M \<Longrightarrow> P i x \<Longrightarrow> i \<in> I" | |
| 559 | assumes unique: "\<And>x i j. x \<in> space M \<Longrightarrow> P i x \<Longrightarrow> P j x \<Longrightarrow> i = j" | |
| 560 | shows "(\<lambda>x. THE i. P i x) \<in> measurable M (count_space UNIV)" | |
| 561 | unfolding measurable_def | |
| 562 | proof safe | |
| 563 | fix X | |
| 564 | def f \<equiv> "\<lambda>x. THE i. P i x" def undef \<equiv> "THE i::'a. False" | |
| 565 |   { fix i x assume "x \<in> space M" "P i x" then have "f x = i"
 | |
| 566 | unfolding f_def using unique by auto } | |
| 567 | note f_eq = this | |
| 568 |   { fix x assume "x \<in> space M" "\<forall>i\<in>I. \<not> P i x"
 | |
| 569 | then have "\<And>i. \<not> P i x" | |
| 570 | using I(2)[of x] by auto | |
| 571 | then have "f x = undef" | |
| 572 | by (auto simp: undef_def f_def) } | |
| 573 |   then have "f -` X \<inter> space M = (\<Union>i\<in>I \<inter> X. {x\<in>space M. P i x}) \<union>
 | |
| 574 |      (if undef \<in> X then space M - (\<Union>i\<in>I. {x\<in>space M. P i x}) else {})"
 | |
| 575 | by (auto dest: f_eq) | |
| 576 | also have "\<dots> \<in> sets M" | |
| 577 | by (auto intro!: sets.Diff sets.countable_UN') | |
| 578 | finally show "f -` X \<inter> space M \<in> sets M" . | |
| 579 | qed simp | |
| 580 | ||
| 581 | lemma measurable_Ex1[measurable (raw)]: | |
| 582 | assumes [simp]: "countable I" and [measurable]: "\<And>i. i \<in> I \<Longrightarrow> Measurable.pred M (P i)" | |
| 583 | shows "Measurable.pred M (\<lambda>x. \<exists>!i\<in>I. P i x)" | |
| 584 | unfolding bex1_def by measurable | |
| 585 | ||
| 586 | lemma measurable_split_if[measurable (raw)]: | |
| 587 | "(c \<Longrightarrow> Measurable.pred M f) \<Longrightarrow> (\<not> c \<Longrightarrow> Measurable.pred M g) \<Longrightarrow> | |
| 588 | Measurable.pred M (if c then f else g)" | |
| 589 | by simp | |
| 590 | ||
| 591 | lemma pred_restrict_space: | |
| 592 | assumes "S \<in> sets M" | |
| 593 | shows "Measurable.pred (restrict_space M S) P \<longleftrightarrow> Measurable.pred M (\<lambda>x. x \<in> S \<and> P x)" | |
| 594 | unfolding pred_def sets_Collect_restrict_space_iff[OF assms] .. | |
| 595 | ||
| 596 | lemma measurable_predpow[measurable]: | |
| 597 | assumes "Measurable.pred M T" | |
| 598 | assumes "\<And>Q. Measurable.pred M Q \<Longrightarrow> Measurable.pred M (R Q)" | |
| 599 | shows "Measurable.pred M ((R ^^ n) T)" | |
| 600 | by (induct n) (auto intro: assms) | |
| 601 | ||
| 50387 | 602 | hide_const (open) pred | 
| 603 | ||
| 604 | end | |
| 59048 | 605 |