author | hoelzl |
Fri, 04 Nov 2016 18:18:30 +0100 | |
changeset 64462 | 96b56c98f346 |
parent 63885 | a6cd18af8bf9 |
child 66089 | def95e0bc529 |
permissions | -rw-r--r-- |
50091 | 1 |
(* Title: HOL/Probability/Fin_Map.thy |
50088 | 2 |
Author: Fabian Immler, TU München |
3 |
*) |
|
4 |
||
61808 | 5 |
section \<open>Finite Maps\<close> |
50091 | 6 |
|
50088 | 7 |
theory Fin_Map |
64462 | 8 |
imports "~~/src/HOL/Analysis/Finite_Product_Measure" "~~/src/HOL/Library/Finite_Map" |
50088 | 9 |
begin |
10 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
11 |
text \<open>The @{type fmap} type can be instantiated to @{class polish_space}, needed for the proof of |
50088 | 12 |
projective limit. @{const extensional} functions are used for the representation in order to |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
13 |
stay close to the developments of (finite) products @{const Pi\<^sub>E} and their sigma-algebra |
61808 | 14 |
@{const Pi\<^sub>M}.\<close> |
50088 | 15 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
16 |
type_notation fmap ("(_ \<Rightarrow>\<^sub>F /_)" [22, 21] 21) |
63577 | 17 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
18 |
unbundle fmap.lifting |
63577 | 19 |
|
50088 | 20 |
|
61808 | 21 |
subsection \<open>Domain and Application\<close> |
50088 | 22 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
23 |
lift_definition domain::"('i \<Rightarrow>\<^sub>F 'a) \<Rightarrow> 'i set" is dom . |
50088 | 24 |
|
25 |
lemma finite_domain[simp, intro]: "finite (domain P)" |
|
63577 | 26 |
by transfer simp |
50088 | 27 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
28 |
lift_definition proj :: "('i \<Rightarrow>\<^sub>F 'a) \<Rightarrow> 'i \<Rightarrow> 'a" ("'((_)')\<^sub>F" [0] 1000) is |
63577 | 29 |
"\<lambda>f x. if x \<in> dom f then the (f x) else undefined" . |
50088 | 30 |
|
31 |
declare [[coercion proj]] |
|
32 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
33 |
lemma extensional_proj[simp, intro]: "(P)\<^sub>F \<in> extensional (domain P)" |
63577 | 34 |
by transfer (auto simp: extensional_def) |
50088 | 35 |
|
36 |
lemma proj_undefined[simp, intro]: "i \<notin> domain P \<Longrightarrow> P i = undefined" |
|
37 |
using extensional_proj[of P] unfolding extensional_def by auto |
|
38 |
||
39 |
lemma finmap_eq_iff: "P = Q \<longleftrightarrow> (domain P = domain Q \<and> (\<forall>i\<in>domain P. P i = Q i))" |
|
63577 | 40 |
apply transfer |
41 |
apply (safe intro!: ext) |
|
42 |
subgoal for P Q x |
|
43 |
by (cases "x \<in> dom P"; cases "P x") (auto dest!: bspec[where x=x]) |
|
44 |
done |
|
45 |
||
50088 | 46 |
|
61808 | 47 |
subsection \<open>Countable Finite Maps\<close> |
50088 | 48 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
49 |
instance fmap :: (countable, countable) countable |
50088 | 50 |
proof |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
51 |
obtain mapper where mapper: "\<And>fm :: 'a \<Rightarrow>\<^sub>F 'b. set (mapper fm) = domain fm" |
50088 | 52 |
by (metis finite_list[OF finite_domain]) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
53 |
have "inj (\<lambda>fm. map (\<lambda>i. (i, (fm)\<^sub>F i)) (mapper fm))" (is "inj ?F") |
50088 | 54 |
proof (rule inj_onI) |
55 |
fix f1 f2 assume "?F f1 = ?F f2" |
|
56 |
then have "map fst (?F f1) = map fst (?F f2)" by simp |
|
57 |
then have "mapper f1 = mapper f2" by (simp add: comp_def) |
|
58 |
then have "domain f1 = domain f2" by (simp add: mapper[symmetric]) |
|
61808 | 59 |
with \<open>?F f1 = ?F f2\<close> show "f1 = f2" |
60 |
unfolding \<open>mapper f1 = mapper f2\<close> map_eq_conv mapper |
|
50088 | 61 |
by (simp add: finmap_eq_iff) |
62 |
qed |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
63 |
then show "\<exists>to_nat :: 'a \<Rightarrow>\<^sub>F 'b \<Rightarrow> nat. inj to_nat" |
50088 | 64 |
by (intro exI[of _ "to_nat \<circ> ?F"] inj_comp) auto |
65 |
qed |
|
66 |
||
61808 | 67 |
subsection \<open>Constructor of Finite Maps\<close> |
50088 | 68 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
69 |
lift_definition finmap_of::"'i set \<Rightarrow> ('i \<Rightarrow> 'a) \<Rightarrow> ('i \<Rightarrow>\<^sub>F 'a)" is |
63577 | 70 |
"\<lambda>I f x. if x \<in> I \<and> finite I then Some (f x) else None" |
71 |
by (simp add: dom_def) |
|
50088 | 72 |
|
73 |
lemma proj_finmap_of[simp]: |
|
74 |
assumes "finite inds" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
75 |
shows "(finmap_of inds f)\<^sub>F = restrict f inds" |
50088 | 76 |
using assms |
63577 | 77 |
by transfer force |
50088 | 78 |
|
79 |
lemma domain_finmap_of[simp]: |
|
80 |
assumes "finite inds" |
|
81 |
shows "domain (finmap_of inds f) = inds" |
|
82 |
using assms |
|
63577 | 83 |
by transfer (auto split: if_splits) |
50088 | 84 |
|
85 |
lemma finmap_of_eq_iff[simp]: |
|
86 |
assumes "finite i" "finite j" |
|
51104 | 87 |
shows "finmap_of i m = finmap_of j n \<longleftrightarrow> i = j \<and> (\<forall>k\<in>i. m k= n k)" |
88 |
using assms by (auto simp: finmap_eq_iff) |
|
50088 | 89 |
|
50124 | 90 |
lemma finmap_of_inj_on_extensional_finite: |
50088 | 91 |
assumes "finite K" |
92 |
assumes "S \<subseteq> extensional K" |
|
93 |
shows "inj_on (finmap_of K) S" |
|
94 |
proof (rule inj_onI) |
|
95 |
fix x y::"'a \<Rightarrow> 'b" |
|
96 |
assume "finmap_of K x = finmap_of K y" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
97 |
hence "(finmap_of K x)\<^sub>F = (finmap_of K y)\<^sub>F" by simp |
50088 | 98 |
moreover |
99 |
assume "x \<in> S" "y \<in> S" hence "x \<in> extensional K" "y \<in> extensional K" using assms by auto |
|
100 |
ultimately |
|
101 |
show "x = y" using assms by (simp add: extensional_restrict) |
|
102 |
qed |
|
103 |
||
61808 | 104 |
subsection \<open>Product set of Finite Maps\<close> |
50088 | 105 |
|
61808 | 106 |
text \<open>This is @{term Pi} for Finite Maps, most of this is copied\<close> |
50088 | 107 |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
108 |
definition Pi' :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a set) \<Rightarrow> ('i \<Rightarrow>\<^sub>F 'a) set" where |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
109 |
"Pi' I A = { P. domain P = I \<and> (\<forall>i. i \<in> I \<longrightarrow> (P)\<^sub>F i \<in> A i) } " |
50088 | 110 |
|
111 |
syntax |
|
112 |
"_Pi'" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set" ("(3\<Pi>' _\<in>_./ _)" 10) |
|
113 |
translations |
|
61988 | 114 |
"\<Pi>' x\<in>A. B" == "CONST Pi' A (\<lambda>x. B)" |
50088 | 115 |
|
61808 | 116 |
subsubsection\<open>Basic Properties of @{term Pi'}\<close> |
50088 | 117 |
|
118 |
lemma Pi'_I[intro!]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B" |
|
119 |
by (simp add: Pi'_def) |
|
120 |
||
121 |
lemma Pi'_I'[simp]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B" |
|
122 |
by (simp add:Pi'_def) |
|
123 |
||
124 |
lemma Pi'_mem: "f\<in> Pi' A B \<Longrightarrow> x \<in> A \<Longrightarrow> f x \<in> B x" |
|
125 |
by (simp add: Pi'_def) |
|
126 |
||
127 |
lemma Pi'_iff: "f \<in> Pi' I X \<longleftrightarrow> domain f = I \<and> (\<forall>i\<in>I. f i \<in> X i)" |
|
128 |
unfolding Pi'_def by auto |
|
129 |
||
130 |
lemma Pi'E [elim]: |
|
131 |
"f \<in> Pi' A B \<Longrightarrow> (f x \<in> B x \<Longrightarrow> domain f = A \<Longrightarrow> Q) \<Longrightarrow> (x \<notin> A \<Longrightarrow> Q) \<Longrightarrow> Q" |
|
132 |
by(auto simp: Pi'_def) |
|
133 |
||
134 |
lemma in_Pi'_cong: |
|
135 |
"domain f = domain g \<Longrightarrow> (\<And> w. w \<in> A \<Longrightarrow> f w = g w) \<Longrightarrow> f \<in> Pi' A B \<longleftrightarrow> g \<in> Pi' A B" |
|
136 |
by (auto simp: Pi'_def) |
|
137 |
||
138 |
lemma Pi'_eq_empty[simp]: |
|
139 |
assumes "finite A" shows "(Pi' A B) = {} \<longleftrightarrow> (\<exists>x\<in>A. B x = {})" |
|
140 |
using assms |
|
141 |
apply (simp add: Pi'_def, auto) |
|
142 |
apply (drule_tac x = "finmap_of A (\<lambda>u. SOME y. y \<in> B u)" in spec, auto) |
|
143 |
apply (cut_tac P= "%y. y \<in> B i" in some_eq_ex, auto) |
|
144 |
done |
|
145 |
||
146 |
lemma Pi'_mono: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C x) \<Longrightarrow> Pi' A B \<subseteq> Pi' A C" |
|
147 |
by (auto simp: Pi'_def) |
|
148 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
149 |
lemma Pi_Pi': "finite A \<Longrightarrow> (Pi\<^sub>E A B) = proj ` Pi' A B" |
50088 | 150 |
apply (auto simp: Pi'_def Pi_def extensional_def) |
151 |
apply (rule_tac x = "finmap_of A (restrict x A)" in image_eqI) |
|
152 |
apply auto |
|
153 |
done |
|
154 |
||
61808 | 155 |
subsection \<open>Topological Space of Finite Maps\<close> |
51105 | 156 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
157 |
instantiation fmap :: (type, topological_space) topological_space |
51105 | 158 |
begin |
159 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
160 |
definition open_fmap :: "('a \<Rightarrow>\<^sub>F 'b) set \<Rightarrow> bool" where |
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
161 |
[code del]: "open_fmap = generate_topology {Pi' a b|a b. \<forall>i\<in>a. open (b i)}" |
51105 | 162 |
|
163 |
lemma open_Pi'I: "(\<And>i. i \<in> I \<Longrightarrow> open (A i)) \<Longrightarrow> open (Pi' I A)" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
164 |
by (auto intro: generate_topology.Basis simp: open_fmap_def) |
51105 | 165 |
|
166 |
instance using topological_space_generate_topology |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
167 |
by intro_classes (auto simp: open_fmap_def class.topological_space_def) |
51105 | 168 |
|
169 |
end |
|
170 |
||
171 |
lemma open_restricted_space: |
|
172 |
shows "open {m. P (domain m)}" |
|
173 |
proof - |
|
174 |
have "{m. P (domain m)} = (\<Union>i \<in> Collect P. {m. domain m = i})" by auto |
|
175 |
also have "open \<dots>" |
|
176 |
proof (rule, safe, cases) |
|
177 |
fix i::"'a set" |
|
178 |
assume "finite i" |
|
179 |
hence "{m. domain m = i} = Pi' i (\<lambda>_. UNIV)" by (auto simp: Pi'_def) |
|
61808 | 180 |
also have "open \<dots>" by (auto intro: open_Pi'I simp: \<open>finite i\<close>) |
51105 | 181 |
finally show "open {m. domain m = i}" . |
182 |
next |
|
183 |
fix i::"'a set" |
|
184 |
assume "\<not> finite i" hence "{m. domain m = i} = {}" by auto |
|
185 |
also have "open \<dots>" by simp |
|
186 |
finally show "open {m. domain m = i}" . |
|
187 |
qed |
|
188 |
finally show ?thesis . |
|
189 |
qed |
|
190 |
||
191 |
lemma closed_restricted_space: |
|
192 |
shows "closed {m. P (domain m)}" |
|
193 |
using open_restricted_space[of "\<lambda>x. \<not> P x"] |
|
194 |
unfolding closed_def by (rule back_subst) auto |
|
195 |
||
61973 | 196 |
lemma tendsto_proj: "((\<lambda>x. x) \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. (x)\<^sub>F i) \<longlongrightarrow> (a)\<^sub>F i) F" |
51105 | 197 |
unfolding tendsto_def |
198 |
proof safe |
|
199 |
fix S::"'b set" |
|
200 |
let ?S = "Pi' (domain a) (\<lambda>x. if x = i then S else UNIV)" |
|
201 |
assume "open S" hence "open ?S" by (auto intro!: open_Pi'I) |
|
202 |
moreover assume "\<forall>S. open S \<longrightarrow> a \<in> S \<longrightarrow> eventually (\<lambda>x. x \<in> S) F" "a i \<in> S" |
|
203 |
ultimately have "eventually (\<lambda>x. x \<in> ?S) F" by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
204 |
thus "eventually (\<lambda>x. (x)\<^sub>F i \<in> S) F" |
62390 | 205 |
by eventually_elim (insert \<open>a i \<in> S\<close>, force simp: Pi'_iff split: if_split_asm) |
51105 | 206 |
qed |
207 |
||
208 |
lemma continuous_proj: |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
209 |
shows "continuous_on s (\<lambda>x. (x)\<^sub>F i)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51489
diff
changeset
|
210 |
unfolding continuous_on_def by (safe intro!: tendsto_proj tendsto_ident_at) |
51105 | 211 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
212 |
instance fmap :: (type, first_countable_topology) first_countable_topology |
51105 | 213 |
proof |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
214 |
fix x::"'a\<Rightarrow>\<^sub>F'b" |
51105 | 215 |
have "\<forall>i. \<exists>A. countable A \<and> (\<forall>a\<in>A. x i \<in> a) \<and> (\<forall>a\<in>A. open a) \<and> |
216 |
(\<forall>S. open S \<and> x i \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)) \<and> (\<forall>a b. a \<in> A \<longrightarrow> b \<in> A \<longrightarrow> a \<inter> b \<in> A)" (is "\<forall>i. ?th i") |
|
217 |
proof |
|
218 |
fix i from first_countable_basis_Int_stableE[of "x i"] guess A . |
|
219 |
thus "?th i" by (intro exI[where x=A]) simp |
|
220 |
qed |
|
221 |
then guess A unfolding choice_iff .. note A = this |
|
222 |
hence open_sub: "\<And>i S. i\<in>domain x \<Longrightarrow> open (S i) \<Longrightarrow> x i\<in>(S i) \<Longrightarrow> (\<exists>a\<in>A i. a\<subseteq>(S i))" by auto |
|
223 |
have A_notempty: "\<And>i. i \<in> domain x \<Longrightarrow> A i \<noteq> {}" using open_sub[of _ "\<lambda>_. UNIV"] by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
224 |
let ?A = "(\<lambda>f. Pi' (domain x) f) ` (Pi\<^sub>E (domain x) A)" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
225 |
show "\<exists>A::nat \<Rightarrow> ('a\<Rightarrow>\<^sub>F'b) set. (\<forall>i. x \<in> (A i) \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))" |
51473 | 226 |
proof (rule first_countableI[where A="?A"], safe) |
51105 | 227 |
show "countable ?A" using A by (simp add: countable_PiE) |
228 |
next |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
229 |
fix S::"('a \<Rightarrow>\<^sub>F 'b) set" assume "open S" "x \<in> S" |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
230 |
thus "\<exists>a\<in>?A. a \<subseteq> S" unfolding open_fmap_def |
51105 | 231 |
proof (induct rule: generate_topology.induct) |
232 |
case UNIV thus ?case by (auto simp add: ex_in_conv PiE_eq_empty_iff A_notempty) |
|
233 |
next |
|
234 |
case (Int a b) |
|
235 |
then obtain f g where |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
236 |
"f \<in> Pi\<^sub>E (domain x) A" "Pi' (domain x) f \<subseteq> a" "g \<in> Pi\<^sub>E (domain x) A" "Pi' (domain x) g \<subseteq> b" |
51105 | 237 |
by auto |
238 |
thus ?case using A |
|
239 |
by (auto simp: Pi'_iff PiE_iff extensional_def Int_stable_def |
|
240 |
intro!: bexI[where x="\<lambda>i. f i \<inter> g i"]) |
|
241 |
next |
|
242 |
case (UN B) |
|
243 |
then obtain b where "x \<in> b" "b \<in> B" by auto |
|
244 |
hence "\<exists>a\<in>?A. a \<subseteq> b" using UN by simp |
|
61808 | 245 |
thus ?case using \<open>b \<in> B\<close> by blast |
51105 | 246 |
next |
247 |
case (Basis s) |
|
248 |
then obtain a b where xs: "x\<in> Pi' a b" "s = Pi' a b" "\<And>i. i\<in>a \<Longrightarrow> open (b i)" by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
249 |
have "\<forall>i. \<exists>a. (i \<in> domain x \<and> open (b i) \<and> (x)\<^sub>F i \<in> b i) \<longrightarrow> (a\<in>A i \<and> a \<subseteq> b i)" |
51105 | 250 |
using open_sub[of _ b] by auto |
251 |
then obtain b' |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
252 |
where "\<And>i. i \<in> domain x \<Longrightarrow> open (b i) \<Longrightarrow> (x)\<^sub>F i \<in> b i \<Longrightarrow> (b' i \<in>A i \<and> b' i \<subseteq> b i)" |
51105 | 253 |
unfolding choice_iff by auto |
254 |
with xs have "\<And>i. i \<in> a \<Longrightarrow> (b' i \<in>A i \<and> b' i \<subseteq> b i)" "Pi' a b' \<subseteq> Pi' a b" |
|
255 |
by (auto simp: Pi'_iff intro!: Pi'_mono) |
|
256 |
thus ?case using xs |
|
257 |
by (intro bexI[where x="Pi' a b'"]) |
|
258 |
(auto simp: Pi'_iff intro!: image_eqI[where x="restrict b' (domain x)"]) |
|
259 |
qed |
|
260 |
qed (insert A,auto simp: PiE_iff intro!: open_Pi'I) |
|
261 |
qed |
|
262 |
||
61808 | 263 |
subsection \<open>Metric Space of Finite Maps\<close> |
50088 | 264 |
|
62101 | 265 |
(* TODO: Product of uniform spaces and compatibility with metric_spaces! *) |
266 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
267 |
instantiation fmap :: (type, metric_space) dist |
50088 | 268 |
begin |
269 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
270 |
definition dist_fmap where |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
271 |
"dist P Q = Max (range (\<lambda>i. dist ((P)\<^sub>F i) ((Q)\<^sub>F i))) + (if domain P = domain Q then 0 else 1)" |
50088 | 272 |
|
62101 | 273 |
instance .. |
274 |
end |
|
275 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
276 |
instantiation fmap :: (type, metric_space) uniformity_dist |
62101 | 277 |
begin |
278 |
||
279 |
definition [code del]: |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
280 |
"(uniformity :: (('a, 'b) fmap \<times> ('a \<Rightarrow>\<^sub>F 'b)) filter) = |
62101 | 281 |
(INF e:{0 <..}. principal {(x, y). dist x y < e})" |
282 |
||
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
283 |
instance |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
284 |
by standard (rule uniformity_fmap_def) |
62101 | 285 |
end |
286 |
||
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
287 |
declare uniformity_Abort[where 'a="('a \<Rightarrow>\<^sub>F 'b::metric_space)", code] |
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
288 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
289 |
instantiation fmap :: (type, metric_space) metric_space |
62101 | 290 |
begin |
291 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
292 |
lemma finite_proj_image': "x \<notin> domain P \<Longrightarrow> finite ((P)\<^sub>F ` S)" |
51104 | 293 |
by (rule finite_subset[of _ "proj P ` (domain P \<inter> S \<union> {x})"]) auto |
294 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
295 |
lemma finite_proj_image: "finite ((P)\<^sub>F ` S)" |
51104 | 296 |
by (cases "\<exists>x. x \<notin> domain P") (auto intro: finite_proj_image' finite_subset[where B="domain P"]) |
297 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
298 |
lemma finite_proj_diag: "finite ((\<lambda>i. d ((P)\<^sub>F i) ((Q)\<^sub>F i)) ` S)" |
50088 | 299 |
proof - |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
300 |
have "(\<lambda>i. d ((P)\<^sub>F i) ((Q)\<^sub>F i)) ` S = (\<lambda>(i, j). d i j) ` ((\<lambda>i. ((P)\<^sub>F i, (Q)\<^sub>F i)) ` S)" by auto |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
301 |
moreover have "((\<lambda>i. ((P)\<^sub>F i, (Q)\<^sub>F i)) ` S) \<subseteq> (\<lambda>i. (P)\<^sub>F i) ` S \<times> (\<lambda>i. (Q)\<^sub>F i) ` S" by auto |
51104 | 302 |
moreover have "finite \<dots>" using finite_proj_image[of P S] finite_proj_image[of Q S] |
303 |
by (intro finite_cartesian_product) simp_all |
|
304 |
ultimately show ?thesis by (simp add: finite_subset) |
|
50088 | 305 |
qed |
306 |
||
51104 | 307 |
lemma dist_le_1_imp_domain_eq: |
308 |
shows "dist P Q < 1 \<Longrightarrow> domain P = domain Q" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
309 |
by (simp add: dist_fmap_def finite_proj_diag split: if_split_asm) |
51104 | 310 |
|
50088 | 311 |
lemma dist_proj: |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
312 |
shows "dist ((x)\<^sub>F i) ((y)\<^sub>F i) \<le> dist x y" |
50088 | 313 |
proof - |
51104 | 314 |
have "dist (x i) (y i) \<le> Max (range (\<lambda>i. dist (x i) (y i)))" |
315 |
by (simp add: Max_ge_iff finite_proj_diag) |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
316 |
also have "\<dots> \<le> dist x y" by (simp add: dist_fmap_def) |
51104 | 317 |
finally show ?thesis . |
318 |
qed |
|
319 |
||
320 |
lemma dist_finmap_lessI: |
|
51105 | 321 |
assumes "domain P = domain Q" |
322 |
assumes "0 < e" |
|
323 |
assumes "\<And>i. i \<in> domain P \<Longrightarrow> dist (P i) (Q i) < e" |
|
51104 | 324 |
shows "dist P Q < e" |
325 |
proof - |
|
326 |
have "dist P Q = Max (range (\<lambda>i. dist (P i) (Q i)))" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
327 |
using assms by (simp add: dist_fmap_def finite_proj_diag) |
51104 | 328 |
also have "\<dots> < e" |
329 |
proof (subst Max_less_iff, safe) |
|
51105 | 330 |
fix i |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
331 |
show "dist ((P)\<^sub>F i) ((Q)\<^sub>F i) < e" using assms |
51105 | 332 |
by (cases "i \<in> domain P") simp_all |
51104 | 333 |
qed (simp add: finite_proj_diag) |
334 |
finally show ?thesis . |
|
50088 | 335 |
qed |
336 |
||
337 |
instance |
|
338 |
proof |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
339 |
fix S::"('a \<Rightarrow>\<^sub>F 'b) set" |
62101 | 340 |
have *: "open S = (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S)" (is "_ = ?od") |
51105 | 341 |
proof |
342 |
assume "open S" |
|
343 |
thus ?od |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
344 |
unfolding open_fmap_def |
51105 | 345 |
proof (induct rule: generate_topology.induct) |
346 |
case UNIV thus ?case by (auto intro: zero_less_one) |
|
347 |
next |
|
348 |
case (Int a b) |
|
349 |
show ?case |
|
350 |
proof safe |
|
351 |
fix x assume x: "x \<in> a" "x \<in> b" |
|
352 |
with Int x obtain e1 e2 where |
|
353 |
"e1>0" "\<forall>y. dist y x < e1 \<longrightarrow> y \<in> a" "e2>0" "\<forall>y. dist y x < e2 \<longrightarrow> y \<in> b" by force |
|
354 |
thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> a \<inter> b" |
|
355 |
by (auto intro!: exI[where x="min e1 e2"]) |
|
356 |
qed |
|
357 |
next |
|
358 |
case (UN K) |
|
359 |
show ?case |
|
360 |
proof safe |
|
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
361 |
fix x X assume "x \<in> X" and X: "X \<in> K" |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
362 |
with UN obtain e where "e>0" "\<And>y. dist y x < e \<longrightarrow> y \<in> X" by force |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
363 |
with X show "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> \<Union>K" by auto |
51105 | 364 |
qed |
365 |
next |
|
366 |
case (Basis s) then obtain a b where s: "s = Pi' a b" and b: "\<And>i. i\<in>a \<Longrightarrow> open (b i)" by auto |
|
367 |
show ?case |
|
368 |
proof safe |
|
369 |
fix x assume "x \<in> s" |
|
370 |
hence [simp]: "finite a" and a_dom: "a = domain x" using s by (auto simp: Pi'_iff) |
|
371 |
obtain es where es: "\<forall>i \<in> a. es i > 0 \<and> (\<forall>y. dist y (proj x i) < es i \<longrightarrow> y \<in> b i)" |
|
61808 | 372 |
using b \<open>x \<in> s\<close> by atomize_elim (intro bchoice, auto simp: open_dist s) |
51105 | 373 |
hence in_b: "\<And>i y. i \<in> a \<Longrightarrow> dist y (proj x i) < es i \<Longrightarrow> y \<in> b i" by auto |
374 |
show "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s" |
|
375 |
proof (cases, rule, safe) |
|
376 |
assume "a \<noteq> {}" |
|
61808 | 377 |
show "0 < min 1 (Min (es ` a))" using es by (auto simp: \<open>a \<noteq> {}\<close>) |
51105 | 378 |
fix y assume d: "dist y x < min 1 (Min (es ` a))" |
379 |
show "y \<in> s" unfolding s |
|
380 |
proof |
|
61808 | 381 |
show "domain y = a" using d s \<open>a \<noteq> {}\<close> by (auto simp: dist_le_1_imp_domain_eq a_dom) |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
382 |
fix i assume i: "i \<in> a" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
383 |
hence "dist ((y)\<^sub>F i) ((x)\<^sub>F i) < es i" using d |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
384 |
by (auto simp: dist_fmap_def \<open>a \<noteq> {}\<close> intro!: le_less_trans[OF dist_proj]) |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
385 |
with i show "y i \<in> b i" by (rule in_b) |
51105 | 386 |
qed |
387 |
next |
|
388 |
assume "\<not>a \<noteq> {}" |
|
389 |
thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s" |
|
61808 | 390 |
using s \<open>x \<in> s\<close> by (auto simp: Pi'_def dist_le_1_imp_domain_eq intro!: exI[where x=1]) |
51105 | 391 |
qed |
392 |
qed |
|
393 |
qed |
|
394 |
next |
|
395 |
assume "\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S" |
|
396 |
then obtain e where e_pos: "\<And>x. x \<in> S \<Longrightarrow> e x > 0" and |
|
397 |
e_in: "\<And>x y . x \<in> S \<Longrightarrow> dist y x < e x \<Longrightarrow> y \<in> S" |
|
398 |
unfolding bchoice_iff |
|
399 |
by auto |
|
400 |
have S_eq: "S = \<Union>{Pi' a b| a b. \<exists>x\<in>S. domain x = a \<and> b = (\<lambda>i. ball (x i) (e x))}" |
|
401 |
proof safe |
|
402 |
fix x assume "x \<in> S" |
|
403 |
thus "x \<in> \<Union>{Pi' a b| a b. \<exists>x\<in>S. domain x = a \<and> b = (\<lambda>i. ball (x i) (e x))}" |
|
404 |
using e_pos by (auto intro!: exI[where x="Pi' (domain x) (\<lambda>i. ball (x i) (e x))"]) |
|
405 |
next |
|
406 |
fix x y |
|
407 |
assume "y \<in> S" |
|
408 |
moreover |
|
409 |
assume "x \<in> (\<Pi>' i\<in>domain y. ball (y i) (e y))" |
|
61808 | 410 |
hence "dist x y < e y" using e_pos \<open>y \<in> S\<close> |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
411 |
by (auto simp: dist_fmap_def Pi'_iff finite_proj_diag dist_commute) |
51105 | 412 |
ultimately show "x \<in> S" by (rule e_in) |
413 |
qed |
|
414 |
also have "open \<dots>" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
415 |
unfolding open_fmap_def |
51105 | 416 |
by (intro generate_topology.UN) (auto intro: generate_topology.Basis) |
417 |
finally show "open S" . |
|
418 |
qed |
|
62101 | 419 |
show "open S = (\<forall>x\<in>S. \<forall>\<^sub>F (x', y) in uniformity. x' = x \<longrightarrow> y \<in> S)" |
420 |
unfolding * eventually_uniformity_metric |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
421 |
by (simp del: split_paired_All add: dist_fmap_def dist_commute eq_commute) |
50088 | 422 |
next |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
423 |
fix P Q::"'a \<Rightarrow>\<^sub>F 'b" |
51104 | 424 |
have Max_eq_iff: "\<And>A m. finite A \<Longrightarrow> A \<noteq> {} \<Longrightarrow> (Max A = m) = (m \<in> A \<and> (\<forall>a\<in>A. a \<le> m))" |
51489 | 425 |
by (auto intro: Max_in Max_eqI) |
50088 | 426 |
show "dist P Q = 0 \<longleftrightarrow> P = Q" |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
427 |
by (auto simp: finmap_eq_iff dist_fmap_def Max_ge_iff finite_proj_diag Max_eq_iff |
56633
18f50d5f84ef
remove add_eq_zero_iff, it is replaced by add_nonneg_eq_0_iff; also removes it from the simpset
hoelzl
parents:
56222
diff
changeset
|
428 |
add_nonneg_eq_0_iff |
51104 | 429 |
intro!: Max_eqI image_eqI[where x=undefined]) |
50088 | 430 |
next |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
431 |
fix P Q R::"'a \<Rightarrow>\<^sub>F 'b" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
432 |
let ?dists = "\<lambda>P Q i. dist ((P)\<^sub>F i) ((Q)\<^sub>F i)" |
51104 | 433 |
let ?dpq = "?dists P Q" and ?dpr = "?dists P R" and ?dqr = "?dists Q R" |
434 |
let ?dom = "\<lambda>P Q. (if domain P = domain Q then 0 else 1::real)" |
|
435 |
have "dist P Q = Max (range ?dpq) + ?dom P Q" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
436 |
by (simp add: dist_fmap_def) |
51104 | 437 |
also obtain t where "t \<in> range ?dpq" "t = Max (range ?dpq)" by (simp add: finite_proj_diag) |
438 |
then obtain i where "Max (range ?dpq) = ?dpq i" by auto |
|
439 |
also have "?dpq i \<le> ?dpr i + ?dqr i" by (rule dist_triangle2) |
|
440 |
also have "?dpr i \<le> Max (range ?dpr)" by (simp add: finite_proj_diag) |
|
441 |
also have "?dqr i \<le> Max (range ?dqr)" by (simp add: finite_proj_diag) |
|
442 |
also have "?dom P Q \<le> ?dom P R + ?dom Q R" by simp |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
443 |
finally show "dist P Q \<le> dist P R + dist Q R" by (simp add: dist_fmap_def ac_simps) |
50088 | 444 |
qed |
445 |
||
446 |
end |
|
447 |
||
61808 | 448 |
subsection \<open>Complete Space of Finite Maps\<close> |
50088 | 449 |
|
450 |
lemma tendsto_finmap: |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
451 |
fixes f::"nat \<Rightarrow> ('i \<Rightarrow>\<^sub>F ('a::metric_space))" |
50088 | 452 |
assumes ind_f: "\<And>n. domain (f n) = domain g" |
61969 | 453 |
assumes proj_g: "\<And>i. i \<in> domain g \<Longrightarrow> (\<lambda>n. (f n) i) \<longlonglongrightarrow> g i" |
454 |
shows "f \<longlonglongrightarrow> g" |
|
51104 | 455 |
unfolding tendsto_iff |
456 |
proof safe |
|
457 |
fix e::real assume "0 < e" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
458 |
let ?dists = "\<lambda>x i. dist ((f x)\<^sub>F i) ((g)\<^sub>F i)" |
51104 | 459 |
have "eventually (\<lambda>x. \<forall>i\<in>domain g. ?dists x i < e) sequentially" |
460 |
using finite_domain[of g] proj_g |
|
461 |
proof induct |
|
462 |
case (insert i G) |
|
61808 | 463 |
with \<open>0 < e\<close> have "eventually (\<lambda>x. ?dists x i < e) sequentially" by (auto simp add: tendsto_iff) |
51104 | 464 |
moreover |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
465 |
from insert have "eventually (\<lambda>x. \<forall>i\<in>G. dist ((f x)\<^sub>F i) ((g)\<^sub>F i) < e) sequentially" by simp |
51104 | 466 |
ultimately show ?case by eventually_elim auto |
467 |
qed simp |
|
468 |
thus "eventually (\<lambda>x. dist (f x) g < e) sequentially" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
469 |
by eventually_elim (auto simp add: dist_fmap_def finite_proj_diag ind_f \<open>0 < e\<close>) |
51104 | 470 |
qed |
50088 | 471 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
472 |
instance fmap :: (type, complete_space) complete_space |
50088 | 473 |
proof |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
474 |
fix P::"nat \<Rightarrow> 'a \<Rightarrow>\<^sub>F 'b" |
50088 | 475 |
assume "Cauchy P" |
476 |
then obtain Nd where Nd: "\<And>n. n \<ge> Nd \<Longrightarrow> dist (P n) (P Nd) < 1" |
|
477 |
by (force simp: cauchy) |
|
63040 | 478 |
define d where "d = domain (P Nd)" |
50088 | 479 |
with Nd have dim: "\<And>n. n \<ge> Nd \<Longrightarrow> domain (P n) = d" using dist_le_1_imp_domain_eq by auto |
480 |
have [simp]: "finite d" unfolding d_def by simp |
|
63040 | 481 |
define p where "p i n = P n i" for i n |
482 |
define q where "q i = lim (p i)" for i |
|
483 |
define Q where "Q = finmap_of d q" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
484 |
have q: "\<And>i. i \<in> d \<Longrightarrow> q i = Q i" by (auto simp add: Q_def Abs_fmap_inverse) |
50088 | 485 |
{ |
486 |
fix i assume "i \<in> d" |
|
487 |
have "Cauchy (p i)" unfolding cauchy p_def |
|
488 |
proof safe |
|
489 |
fix e::real assume "0 < e" |
|
61808 | 490 |
with \<open>Cauchy P\<close> obtain N where N: "\<And>n. n\<ge>N \<Longrightarrow> dist (P n) (P N) < min e 1" |
50088 | 491 |
by (force simp: cauchy min_def) |
492 |
hence "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = domain (P N)" using dist_le_1_imp_domain_eq by auto |
|
493 |
with dim have dim: "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = d" by (metis nat_le_linear) |
|
494 |
show "\<exists>N. \<forall>n\<ge>N. dist ((P n) i) ((P N) i) < e" |
|
495 |
proof (safe intro!: exI[where x="N"]) |
|
496 |
fix n assume "N \<le> n" have "N \<le> N" by simp |
|
497 |
have "dist ((P n) i) ((P N) i) \<le> dist (P n) (P N)" |
|
61808 | 498 |
using dim[OF \<open>N \<le> n\<close>] dim[OF \<open>N \<le> N\<close>] \<open>i \<in> d\<close> |
50088 | 499 |
by (auto intro!: dist_proj) |
61808 | 500 |
also have "\<dots> < e" using N[OF \<open>N \<le> n\<close>] by simp |
50088 | 501 |
finally show "dist ((P n) i) ((P N) i) < e" . |
502 |
qed |
|
503 |
qed |
|
504 |
hence "convergent (p i)" by (metis Cauchy_convergent_iff) |
|
61969 | 505 |
hence "p i \<longlonglongrightarrow> q i" unfolding q_def convergent_def by (metis limI) |
50088 | 506 |
} note p = this |
61969 | 507 |
have "P \<longlonglongrightarrow> Q" |
50088 | 508 |
proof (rule metric_LIMSEQ_I) |
509 |
fix e::real assume "0 < e" |
|
51104 | 510 |
have "\<exists>ni. \<forall>i\<in>d. \<forall>n\<ge>ni i. dist (p i n) (q i) < e" |
50088 | 511 |
proof (safe intro!: bchoice) |
512 |
fix i assume "i \<in> d" |
|
61808 | 513 |
from p[OF \<open>i \<in> d\<close>, THEN metric_LIMSEQ_D, OF \<open>0 < e\<close>] |
51104 | 514 |
show "\<exists>no. \<forall>n\<ge>no. dist (p i n) (q i) < e" . |
50088 | 515 |
qed then guess ni .. note ni = this |
63040 | 516 |
define N where "N = max Nd (Max (ni ` d))" |
50088 | 517 |
show "\<exists>N. \<forall>n\<ge>N. dist (P n) Q < e" |
518 |
proof (safe intro!: exI[where x="N"]) |
|
519 |
fix n assume "N \<le> n" |
|
51104 | 520 |
hence dom: "domain (P n) = d" "domain Q = d" "domain (P n) = domain Q" |
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
521 |
using dim by (simp_all add: N_def Q_def dim_def Abs_fmap_inverse) |
51104 | 522 |
show "dist (P n) Q < e" |
61808 | 523 |
proof (rule dist_finmap_lessI[OF dom(3) \<open>0 < e\<close>]) |
51104 | 524 |
fix i |
525 |
assume "i \<in> domain (P n)" |
|
526 |
hence "ni i \<le> Max (ni ` d)" using dom by simp |
|
50088 | 527 |
also have "\<dots> \<le> N" by (simp add: N_def) |
61808 | 528 |
finally show "dist ((P n)\<^sub>F i) ((Q)\<^sub>F i) < e" using ni \<open>i \<in> domain (P n)\<close> \<open>N \<le> n\<close> dom |
51104 | 529 |
by (auto simp: p_def q N_def less_imp_le) |
50088 | 530 |
qed |
531 |
qed |
|
532 |
qed |
|
533 |
thus "convergent P" by (auto simp: convergent_def) |
|
534 |
qed |
|
535 |
||
61808 | 536 |
subsection \<open>Second Countable Space of Finite Maps\<close> |
50088 | 537 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
538 |
instantiation fmap :: (countable, second_countable_topology) second_countable_topology |
50088 | 539 |
begin |
540 |
||
51106 | 541 |
definition basis_proj::"'b set set" |
542 |
where "basis_proj = (SOME B. countable B \<and> topological_basis B)" |
|
543 |
||
544 |
lemma countable_basis_proj: "countable basis_proj" and basis_proj: "topological_basis basis_proj" |
|
545 |
unfolding basis_proj_def by (intro is_basis countable_basis)+ |
|
546 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
547 |
definition basis_finmap::"('a \<Rightarrow>\<^sub>F 'b) set set" |
51106 | 548 |
where "basis_finmap = {Pi' I S|I S. finite I \<and> (\<forall>i \<in> I. S i \<in> basis_proj)}" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
549 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
550 |
lemma in_basis_finmapI: |
51106 | 551 |
assumes "finite I" assumes "\<And>i. i \<in> I \<Longrightarrow> S i \<in> basis_proj" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
552 |
shows "Pi' I S \<in> basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
553 |
using assms unfolding basis_finmap_def by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
554 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
555 |
lemma basis_finmap_eq: |
51106 | 556 |
assumes "basis_proj \<noteq> {}" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
557 |
shows "basis_finmap = (\<lambda>f. Pi' (domain f) (\<lambda>i. from_nat_into basis_proj ((f)\<^sub>F i))) ` |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
558 |
(UNIV::('a \<Rightarrow>\<^sub>F nat) set)" (is "_ = ?f ` _") |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
559 |
unfolding basis_finmap_def |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
560 |
proof safe |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
561 |
fix I::"'a set" and S::"'a \<Rightarrow> 'b set" |
51106 | 562 |
assume "finite I" "\<forall>i\<in>I. S i \<in> basis_proj" |
563 |
hence "Pi' I S = ?f (finmap_of I (\<lambda>x. to_nat_on basis_proj (S x)))" |
|
564 |
by (force simp: Pi'_def countable_basis_proj) |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
565 |
thus "Pi' I S \<in> range ?f" by simp |
51106 | 566 |
next |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
567 |
fix x and f::"'a \<Rightarrow>\<^sub>F nat" |
56222
6599c6278545
tuned -- no need for slightly obscure "local" prefix;
wenzelm
parents:
53374
diff
changeset
|
568 |
show "\<exists>I S. (\<Pi>' i\<in>domain f. from_nat_into basis_proj ((f)\<^sub>F i)) = Pi' I S \<and> |
6599c6278545
tuned -- no need for slightly obscure "local" prefix;
wenzelm
parents:
53374
diff
changeset
|
569 |
finite I \<and> (\<forall>i\<in>I. S i \<in> basis_proj)" |
51106 | 570 |
using assms by (auto intro: from_nat_into) |
571 |
qed |
|
572 |
||
573 |
lemma basis_finmap_eq_empty: "basis_proj = {} \<Longrightarrow> basis_finmap = {Pi' {} undefined}" |
|
574 |
by (auto simp: Pi'_iff basis_finmap_def) |
|
50088 | 575 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
576 |
lemma countable_basis_finmap: "countable basis_finmap" |
51106 | 577 |
by (cases "basis_proj = {}") (auto simp: basis_finmap_eq basis_finmap_eq_empty) |
50088 | 578 |
|
579 |
lemma finmap_topological_basis: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
580 |
"topological_basis basis_finmap" |
50088 | 581 |
proof (subst topological_basis_iff, safe) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
582 |
fix B' assume "B' \<in> basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
583 |
thus "open B'" |
51106 | 584 |
by (auto intro!: open_Pi'I topological_basis_open[OF basis_proj] |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
585 |
simp: topological_basis_def basis_finmap_def Let_def) |
50088 | 586 |
next |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
587 |
fix O'::"('a \<Rightarrow>\<^sub>F 'b) set" and x |
51105 | 588 |
assume O': "open O'" "x \<in> O'" |
589 |
then obtain a where a: |
|
590 |
"x \<in> Pi' (domain x) a" "Pi' (domain x) a \<subseteq> O'" "\<And>i. i\<in>domain x \<Longrightarrow> open (a i)" |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
591 |
unfolding open_fmap_def |
51105 | 592 |
proof (atomize_elim, induct rule: generate_topology.induct) |
593 |
case (Int a b) |
|
594 |
let ?p="\<lambda>a f. x \<in> Pi' (domain x) f \<and> Pi' (domain x) f \<subseteq> a \<and> (\<forall>i. i \<in> domain x \<longrightarrow> open (f i))" |
|
595 |
from Int obtain f g where "?p a f" "?p b g" by auto |
|
596 |
thus ?case by (force intro!: exI[where x="\<lambda>i. f i \<inter> g i"] simp: Pi'_def) |
|
597 |
next |
|
598 |
case (UN k) |
|
599 |
then obtain kk a where "x \<in> kk" "kk \<in> k" "x \<in> Pi' (domain x) a" "Pi' (domain x) a \<subseteq> kk" |
|
600 |
"\<And>i. i\<in>domain x \<Longrightarrow> open (a i)" |
|
601 |
by force |
|
602 |
thus ?case by blast |
|
603 |
qed (auto simp: Pi'_def) |
|
50088 | 604 |
have "\<exists>B. |
51106 | 605 |
(\<forall>i\<in>domain x. x i \<in> B i \<and> B i \<subseteq> a i \<and> B i \<in> basis_proj)" |
50088 | 606 |
proof (rule bchoice, safe) |
607 |
fix i assume "i \<in> domain x" |
|
51105 | 608 |
hence "open (a i)" "x i \<in> a i" using a by auto |
51106 | 609 |
from topological_basisE[OF basis_proj this] guess b' . |
610 |
thus "\<exists>y. x i \<in> y \<and> y \<subseteq> a i \<and> y \<in> basis_proj" by auto |
|
50088 | 611 |
qed |
612 |
then guess B .. note B = this |
|
63040 | 613 |
define B' where "B' = Pi' (domain x) (\<lambda>i. (B i)::'b set)" |
51105 | 614 |
have "B' \<subseteq> Pi' (domain x) a" using B by (auto intro!: Pi'_mono simp: B'_def) |
61808 | 615 |
also note \<open>\<dots> \<subseteq> O'\<close> |
51105 | 616 |
finally show "\<exists>B'\<in>basis_finmap. x \<in> B' \<and> B' \<subseteq> O'" using B |
617 |
by (auto intro!: bexI[where x=B'] Pi'_mono in_basis_finmapI simp: B'_def) |
|
50088 | 618 |
qed |
619 |
||
620 |
lemma range_enum_basis_finmap_imp_open: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
621 |
assumes "x \<in> basis_finmap" |
50088 | 622 |
shows "open x" |
623 |
using finmap_topological_basis assms by (auto simp: topological_basis_def) |
|
624 |
||
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51106
diff
changeset
|
625 |
instance proof qed (blast intro: finmap_topological_basis countable_basis_finmap topological_basis_imp_subbasis) |
50088 | 626 |
|
627 |
end |
|
628 |
||
61808 | 629 |
subsection \<open>Polish Space of Finite Maps\<close> |
51105 | 630 |
|
63885
a6cd18af8bf9
new type for finite maps; use it in HOL-Probability
Lars Hupel <lars.hupel@mytum.de>
parents:
63577
diff
changeset
|
631 |
instance fmap :: (countable, polish_space) polish_space proof qed |
51105 | 632 |
|
633 |
||
61808 | 634 |
subsection \<open>Product Measurable Space of Finite Maps\<close> |
50088 | 635 |
|
636 |
definition "PiF I M \<equiv> |
|
50124 | 637 |
sigma (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j))) {(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}" |
50088 | 638 |
|
639 |
abbreviation |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
640 |
"Pi\<^sub>F I M \<equiv> PiF I M" |
50088 | 641 |
|
642 |
syntax |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
643 |
"_PiF" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure" ("(3\<Pi>\<^sub>F _\<in>_./ _)" 10) |
50088 | 644 |
translations |
61988 | 645 |
"\<Pi>\<^sub>F x\<in>I. M" == "CONST PiF I (%x. M)" |
50088 | 646 |
|
647 |
lemma PiF_gen_subset: "{(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))} \<subseteq> |
|
648 |
Pow (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j)))" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
649 |
by (auto simp: Pi'_def) (blast dest: sets.sets_into_space) |
50088 | 650 |
|
651 |
lemma space_PiF: "space (PiF I M) = (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j)))" |
|
652 |
unfolding PiF_def using PiF_gen_subset by (rule space_measure_of) |
|
653 |
||
654 |
lemma sets_PiF: |
|
655 |
"sets (PiF I M) = sigma_sets (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j))) |
|
656 |
{(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}" |
|
657 |
unfolding PiF_def using PiF_gen_subset by (rule sets_measure_of) |
|
658 |
||
659 |
lemma sets_PiF_singleton: |
|
660 |
"sets (PiF {I} M) = sigma_sets (\<Pi>' j\<in>I. space (M j)) |
|
661 |
{(\<Pi>' j\<in>I. X j) |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
662 |
unfolding sets_PiF by simp |
|
663 |
||
664 |
lemma in_sets_PiFI: |
|
665 |
assumes "X = (Pi' J S)" "J \<in> I" "\<And>i. i\<in>J \<Longrightarrow> S i \<in> sets (M i)" |
|
666 |
shows "X \<in> sets (PiF I M)" |
|
667 |
unfolding sets_PiF |
|
668 |
using assms by blast |
|
669 |
||
670 |
lemma product_in_sets_PiFI: |
|
671 |
assumes "J \<in> I" "\<And>i. i\<in>J \<Longrightarrow> S i \<in> sets (M i)" |
|
672 |
shows "(Pi' J S) \<in> sets (PiF I M)" |
|
673 |
unfolding sets_PiF |
|
674 |
using assms by blast |
|
675 |
||
676 |
lemma singleton_space_subset_in_sets: |
|
677 |
fixes J |
|
678 |
assumes "J \<in> I" |
|
679 |
assumes "finite J" |
|
680 |
shows "space (PiF {J} M) \<in> sets (PiF I M)" |
|
681 |
using assms |
|
682 |
by (intro in_sets_PiFI[where J=J and S="\<lambda>i. space (M i)"]) |
|
683 |
(auto simp: product_def space_PiF) |
|
684 |
||
685 |
lemma singleton_subspace_set_in_sets: |
|
686 |
assumes A: "A \<in> sets (PiF {J} M)" |
|
687 |
assumes "finite J" |
|
688 |
assumes "J \<in> I" |
|
689 |
shows "A \<in> sets (PiF I M)" |
|
690 |
using A[unfolded sets_PiF] |
|
691 |
apply (induct A) |
|
692 |
unfolding sets_PiF[symmetric] unfolding space_PiF[symmetric] |
|
693 |
using assms |
|
694 |
by (auto intro: in_sets_PiFI intro!: singleton_space_subset_in_sets) |
|
695 |
||
50124 | 696 |
lemma finite_measurable_singletonI: |
50088 | 697 |
assumes "finite I" |
698 |
assumes "\<And>J. J \<in> I \<Longrightarrow> finite J" |
|
699 |
assumes MN: "\<And>J. J \<in> I \<Longrightarrow> A \<in> measurable (PiF {J} M) N" |
|
700 |
shows "A \<in> measurable (PiF I M) N" |
|
701 |
unfolding measurable_def |
|
702 |
proof safe |
|
703 |
fix y assume "y \<in> sets N" |
|
704 |
have "A -` y \<inter> space (PiF I M) = (\<Union>J\<in>I. A -` y \<inter> space (PiF {J} M))" |
|
705 |
by (auto simp: space_PiF) |
|
706 |
also have "\<dots> \<in> sets (PiF I M)" |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62102
diff
changeset
|
707 |
proof (rule sets.finite_UN) |
50088 | 708 |
show "finite I" by fact |
709 |
fix J assume "J \<in> I" |
|
710 |
with assms have "finite J" by simp |
|
711 |
show "A -` y \<inter> space (PiF {J} M) \<in> sets (PiF I M)" |
|
712 |
by (rule singleton_subspace_set_in_sets[OF measurable_sets[OF assms(3)]]) fact+ |
|
713 |
qed |
|
714 |
finally show "A -` y \<inter> space (PiF I M) \<in> sets (PiF I M)" . |
|
715 |
next |
|
716 |
fix x assume "x \<in> space (PiF I M)" thus "A x \<in> space N" |
|
717 |
using MN[of "domain x"] |
|
718 |
by (auto simp: space_PiF measurable_space Pi'_def) |
|
719 |
qed |
|
720 |
||
50124 | 721 |
lemma countable_finite_comprehension: |
50088 | 722 |
fixes f :: "'a::countable set \<Rightarrow> _" |
723 |
assumes "\<And>s. P s \<Longrightarrow> finite s" |
|
724 |
assumes "\<And>s. P s \<Longrightarrow> f s \<in> sets M" |
|
725 |
shows "\<Union>{f s|s. P s} \<in> sets M" |
|
726 |
proof - |
|
727 |
have "\<Union>{f s|s. P s} = (\<Union>n::nat. let s = set (from_nat n) in if P s then f s else {})" |
|
728 |
proof safe |
|
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
729 |
fix x X s assume *: "x \<in> f s" "P s" |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53015
diff
changeset
|
730 |
with assms obtain l where "s = set l" using finite_list by blast |
61808 | 731 |
with * show "x \<in> (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" using \<open>P s\<close> |
50088 | 732 |
by (auto intro!: exI[where x="to_nat l"]) |
733 |
next |
|
734 |
fix x n assume "x \<in> (let s = set (from_nat n) in if P s then f s else {})" |
|
62390 | 735 |
thus "x \<in> \<Union>{f s|s. P s}" using assms by (auto simp: Let_def split: if_split_asm) |
50088 | 736 |
qed |
737 |
hence "\<Union>{f s|s. P s} = (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" by simp |
|
738 |
also have "\<dots> \<in> sets M" using assms by (auto simp: Let_def) |
|
739 |
finally show ?thesis . |
|
740 |
qed |
|
741 |
||
742 |
lemma space_subset_in_sets: |
|
743 |
fixes J::"'a::countable set set" |
|
744 |
assumes "J \<subseteq> I" |
|
745 |
assumes "\<And>j. j \<in> J \<Longrightarrow> finite j" |
|
746 |
shows "space (PiF J M) \<in> sets (PiF I M)" |
|
747 |
proof - |
|
748 |
have "space (PiF J M) = \<Union>{space (PiF {j} M)|j. j \<in> J}" |
|
749 |
unfolding space_PiF by blast |
|
750 |
also have "\<dots> \<in> sets (PiF I M)" using assms |
|
751 |
by (intro countable_finite_comprehension) (auto simp: singleton_space_subset_in_sets) |
|
752 |
finally show ?thesis . |
|
753 |
qed |
|
754 |
||
755 |
lemma subspace_set_in_sets: |
|
756 |
fixes J::"'a::countable set set" |
|
757 |
assumes A: "A \<in> sets (PiF J M)" |
|
758 |
assumes "J \<subseteq> I" |
|
759 |
assumes "\<And>j. j \<in> J \<Longrightarrow> finite j" |
|
760 |
shows "A \<in> sets (PiF I M)" |
|
761 |
using A[unfolded sets_PiF] |
|
762 |
apply (induct A) |
|
763 |
unfolding sets_PiF[symmetric] unfolding space_PiF[symmetric] |
|
764 |
using assms |
|
765 |
by (auto intro: in_sets_PiFI intro!: space_subset_in_sets) |
|
766 |
||
50124 | 767 |
lemma countable_measurable_PiFI: |
50088 | 768 |
fixes I::"'a::countable set set" |
769 |
assumes MN: "\<And>J. J \<in> I \<Longrightarrow> finite J \<Longrightarrow> A \<in> measurable (PiF {J} M) N" |
|
770 |
shows "A \<in> measurable (PiF I M) N" |
|
771 |
unfolding measurable_def |
|
772 |
proof safe |
|
773 |
fix y assume "y \<in> sets N" |
|
774 |
have "A -` y = (\<Union>{A -` y \<inter> {x. domain x = J}|J. finite J})" by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
775 |
{ fix x::"'a \<Rightarrow>\<^sub>F 'b" |
50088 | 776 |
from finite_list[of "domain x"] obtain xs where "set xs = domain x" by auto |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
777 |
hence "\<exists>n. domain x = set (from_nat n)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
778 |
by (intro exI[where x="to_nat xs"]) auto } |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
779 |
hence "A -` y \<inter> space (PiF I M) = (\<Union>n. A -` y \<inter> space (PiF ({set (from_nat n)}\<inter>I) M))" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
780 |
by (auto simp: space_PiF Pi'_def) |
50088 | 781 |
also have "\<dots> \<in> sets (PiF I M)" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
782 |
apply (intro sets.Int sets.countable_nat_UN subsetI, safe) |
50088 | 783 |
apply (case_tac "set (from_nat i) \<in> I") |
784 |
apply simp_all |
|
785 |
apply (rule singleton_subspace_set_in_sets[OF measurable_sets[OF MN]]) |
|
61808 | 786 |
using assms \<open>y \<in> sets N\<close> |
50088 | 787 |
apply (auto simp: space_PiF) |
788 |
done |
|
789 |
finally show "A -` y \<inter> space (PiF I M) \<in> sets (PiF I M)" . |
|
790 |
next |
|
791 |
fix x assume "x \<in> space (PiF I M)" thus "A x \<in> space N" |
|
792 |
using MN[of "domain x"] by (auto simp: space_PiF measurable_space Pi'_def) |
|
793 |
qed |
|
794 |
||
795 |
lemma measurable_PiF: |
|
796 |
assumes f: "\<And>x. x \<in> space N \<Longrightarrow> domain (f x) \<in> I \<and> (\<forall>i\<in>domain (f x). (f x) i \<in> space (M i))" |
|
797 |
assumes S: "\<And>J S. J \<in> I \<Longrightarrow> (\<And>i. i \<in> J \<Longrightarrow> S i \<in> sets (M i)) \<Longrightarrow> |
|
798 |
f -` (Pi' J S) \<inter> space N \<in> sets N" |
|
799 |
shows "f \<in> measurable N (PiF I M)" |
|
800 |
unfolding PiF_def |
|
801 |
using PiF_gen_subset |
|
802 |
apply (rule measurable_measure_of) |
|
803 |
using f apply force |
|
804 |
apply (insert S, auto) |
|
805 |
done |
|
806 |
||
50124 | 807 |
lemma restrict_sets_measurable: |
50088 | 808 |
assumes A: "A \<in> sets (PiF I M)" and "J \<subseteq> I" |
809 |
shows "A \<inter> {m. domain m \<in> J} \<in> sets (PiF J M)" |
|
810 |
using A[unfolded sets_PiF] |
|
50124 | 811 |
proof (induct A) |
812 |
case (Basic a) |
|
50088 | 813 |
then obtain K S where S: "a = Pi' K S" "K \<in> I" "(\<forall>i\<in>K. S i \<in> sets (M i))" |
814 |
by auto |
|
50124 | 815 |
show ?case |
50088 | 816 |
proof cases |
817 |
assume "K \<in> J" |
|
818 |
hence "a \<inter> {m. domain m \<in> J} \<in> {Pi' K X |X K. K \<in> J \<and> X \<in> (\<Pi> j\<in>K. sets (M j))}" using S |
|
819 |
by (auto intro!: exI[where x=K] exI[where x=S] simp: Pi'_def) |
|
820 |
also have "\<dots> \<subseteq> sets (PiF J M)" unfolding sets_PiF by auto |
|
821 |
finally show ?thesis . |
|
822 |
next |
|
823 |
assume "K \<notin> J" |
|
824 |
hence "a \<inter> {m. domain m \<in> J} = {}" using S by (auto simp: Pi'_def) |
|
825 |
also have "\<dots> \<in> sets (PiF J M)" by simp |
|
826 |
finally show ?thesis . |
|
827 |
qed |
|
828 |
next |
|
50124 | 829 |
case (Union a) |
50088 | 830 |
have "UNION UNIV a \<inter> {m. domain m \<in> J} = (\<Union>i. (a i \<inter> {m. domain m \<in> J}))" |
831 |
by simp |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
832 |
also have "\<dots> \<in> sets (PiF J M)" using Union by (intro sets.countable_nat_UN) auto |
50124 | 833 |
finally show ?case . |
50088 | 834 |
next |
50124 | 835 |
case (Compl a) |
50088 | 836 |
have "(space (PiF I M) - a) \<inter> {m. domain m \<in> J} = (space (PiF J M) - (a \<inter> {m. domain m \<in> J}))" |
61808 | 837 |
using \<open>J \<subseteq> I\<close> by (auto simp: space_PiF Pi'_def) |
50124 | 838 |
also have "\<dots> \<in> sets (PiF J M)" using Compl by auto |
839 |
finally show ?case by (simp add: space_PiF) |
|
840 |
qed simp |
|
50088 | 841 |
|
842 |
lemma measurable_finmap_of: |
|
843 |
assumes f: "\<And>i. (\<exists>x \<in> space N. i \<in> J x) \<Longrightarrow> (\<lambda>x. f x i) \<in> measurable N (M i)" |
|
844 |
assumes J: "\<And>x. x \<in> space N \<Longrightarrow> J x \<in> I" "\<And>x. x \<in> space N \<Longrightarrow> finite (J x)" |
|
845 |
assumes JN: "\<And>S. {x. J x = S} \<inter> space N \<in> sets N" |
|
846 |
shows "(\<lambda>x. finmap_of (J x) (f x)) \<in> measurable N (PiF I M)" |
|
847 |
proof (rule measurable_PiF) |
|
848 |
fix x assume "x \<in> space N" |
|
849 |
with J[of x] measurable_space[OF f] |
|
850 |
show "domain (finmap_of (J x) (f x)) \<in> I \<and> |
|
851 |
(\<forall>i\<in>domain (finmap_of (J x) (f x)). (finmap_of (J x) (f x)) i \<in> space (M i))" |
|
852 |
by auto |
|
853 |
next |
|
854 |
fix K S assume "K \<in> I" and *: "\<And>i. i \<in> K \<Longrightarrow> S i \<in> sets (M i)" |
|
855 |
with J have eq: "(\<lambda>x. finmap_of (J x) (f x)) -` Pi' K S \<inter> space N = |
|
856 |
(if \<exists>x \<in> space N. K = J x \<and> finite K then if K = {} then {x \<in> space N. J x = K} |
|
857 |
else (\<Inter>i\<in>K. (\<lambda>x. f x i) -` S i \<inter> {x \<in> space N. J x = K}) else {})" |
|
858 |
by (auto simp: Pi'_def) |
|
859 |
have r: "{x \<in> space N. J x = K} = space N \<inter> ({x. J x = K} \<inter> space N)" by auto |
|
860 |
show "(\<lambda>x. finmap_of (J x) (f x)) -` Pi' K S \<inter> space N \<in> sets N" |
|
861 |
unfolding eq r |
|
862 |
apply (simp del: INT_simps add: ) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
863 |
apply (intro conjI impI sets.finite_INT JN sets.Int[OF sets.top]) |
50088 | 864 |
apply simp apply assumption |
865 |
apply (subst Int_assoc[symmetric]) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
866 |
apply (rule sets.Int) |
50088 | 867 |
apply (intro measurable_sets[OF f] *) apply force apply assumption |
868 |
apply (intro JN) |
|
869 |
done |
|
870 |
qed |
|
871 |
||
872 |
lemma measurable_PiM_finmap_of: |
|
873 |
assumes "finite J" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
874 |
shows "finmap_of J \<in> measurable (Pi\<^sub>M J M) (PiF {J} M)" |
50088 | 875 |
apply (rule measurable_finmap_of) |
876 |
apply (rule measurable_component_singleton) |
|
877 |
apply simp |
|
878 |
apply rule |
|
61808 | 879 |
apply (rule \<open>finite J\<close>) |
50088 | 880 |
apply simp |
881 |
done |
|
882 |
||
883 |
lemma proj_measurable_singleton: |
|
50124 | 884 |
assumes "A \<in> sets (M i)" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
885 |
shows "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space (PiF {I} M) \<in> sets (PiF {I} M)" |
50088 | 886 |
proof cases |
887 |
assume "i \<in> I" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
888 |
hence "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space (PiF {I} M) = |
50088 | 889 |
Pi' I (\<lambda>x. if x = i then A else space (M x))" |
61808 | 890 |
using sets.sets_into_space[OF ] \<open>A \<in> sets (M i)\<close> assms |
50088 | 891 |
by (auto simp: space_PiF Pi'_def) |
61808 | 892 |
thus ?thesis using assms \<open>A \<in> sets (M i)\<close> |
50088 | 893 |
by (intro in_sets_PiFI) auto |
894 |
next |
|
895 |
assume "i \<notin> I" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
896 |
hence "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space (PiF {I} M) = |
50088 | 897 |
(if undefined \<in> A then space (PiF {I} M) else {})" by (auto simp: space_PiF Pi'_def) |
898 |
thus ?thesis by simp |
|
899 |
qed |
|
900 |
||
901 |
lemma measurable_proj_singleton: |
|
50124 | 902 |
assumes "i \<in> I" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
903 |
shows "(\<lambda>x. (x)\<^sub>F i) \<in> measurable (PiF {I} M) (M i)" |
50124 | 904 |
by (unfold measurable_def, intro CollectI conjI ballI proj_measurable_singleton assms) |
61808 | 905 |
(insert \<open>i \<in> I\<close>, auto simp: space_PiF) |
50088 | 906 |
|
907 |
lemma measurable_proj_countable: |
|
908 |
fixes I::"'a::countable set set" |
|
909 |
assumes "y \<in> space (M i)" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
910 |
shows "(\<lambda>x. if i \<in> domain x then (x)\<^sub>F i else y) \<in> measurable (PiF I M) (M i)" |
50088 | 911 |
proof (rule countable_measurable_PiFI) |
912 |
fix J assume "J \<in> I" "finite J" |
|
913 |
show "(\<lambda>x. if i \<in> domain x then x i else y) \<in> measurable (PiF {J} M) (M i)" |
|
914 |
unfolding measurable_def |
|
915 |
proof safe |
|
916 |
fix z assume "z \<in> sets (M i)" |
|
917 |
have "(\<lambda>x. if i \<in> domain x then x i else y) -` z \<inter> space (PiF {J} M) = |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
918 |
(\<lambda>x. if i \<in> J then (x)\<^sub>F i else y) -` z \<inter> space (PiF {J} M)" |
50088 | 919 |
by (auto simp: space_PiF Pi'_def) |
61808 | 920 |
also have "\<dots> \<in> sets (PiF {J} M)" using \<open>z \<in> sets (M i)\<close> \<open>finite J\<close> |
50088 | 921 |
by (cases "i \<in> J") (auto intro!: measurable_sets[OF measurable_proj_singleton]) |
922 |
finally show "(\<lambda>x. if i \<in> domain x then x i else y) -` z \<inter> space (PiF {J} M) \<in> |
|
923 |
sets (PiF {J} M)" . |
|
61808 | 924 |
qed (insert \<open>y \<in> space (M i)\<close>, auto simp: space_PiF Pi'_def) |
50088 | 925 |
qed |
926 |
||
927 |
lemma measurable_restrict_proj: |
|
928 |
assumes "J \<in> II" "finite J" |
|
929 |
shows "finmap_of J \<in> measurable (PiM J M) (PiF II M)" |
|
930 |
using assms |
|
931 |
by (intro measurable_finmap_of measurable_component_singleton) auto |
|
932 |
||
50124 | 933 |
lemma measurable_proj_PiM: |
50088 | 934 |
fixes J K ::"'a::countable set" and I::"'a set set" |
935 |
assumes "finite J" "J \<in> I" |
|
936 |
assumes "x \<in> space (PiM J M)" |
|
50124 | 937 |
shows "proj \<in> measurable (PiF {J} M) (PiM J M)" |
50088 | 938 |
proof (rule measurable_PiM_single) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
939 |
show "proj \<in> space (PiF {J} M) \<rightarrow> (\<Pi>\<^sub>E i \<in> J. space (M i))" |
50088 | 940 |
using assms by (auto simp add: space_PiM space_PiF extensional_def sets_PiF Pi'_def) |
941 |
next |
|
942 |
fix A i assume A: "i \<in> J" "A \<in> sets (M i)" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
943 |
show "{\<omega> \<in> space (PiF {J} M). (\<omega>)\<^sub>F i \<in> A} \<in> sets (PiF {J} M)" |
50088 | 944 |
proof |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
945 |
have "{\<omega> \<in> space (PiF {J} M). (\<omega>)\<^sub>F i \<in> A} = |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
946 |
(\<lambda>\<omega>. (\<omega>)\<^sub>F i) -` A \<inter> space (PiF {J} M)" by auto |
50088 | 947 |
also have "\<dots> \<in> sets (PiF {J} M)" |
948 |
using assms A by (auto intro: measurable_sets[OF measurable_proj_singleton] simp: space_PiM) |
|
949 |
finally show ?thesis . |
|
950 |
qed simp |
|
951 |
qed |
|
952 |
||
953 |
lemma space_PiF_singleton_eq_product: |
|
954 |
assumes "finite I" |
|
955 |
shows "space (PiF {I} M) = (\<Pi>' i\<in>I. space (M i))" |
|
956 |
by (auto simp: product_def space_PiF assms) |
|
957 |
||
61808 | 958 |
text \<open>adapted from @{thm sets_PiM_single}\<close> |
50088 | 959 |
|
960 |
lemma sets_PiF_single: |
|
961 |
assumes "finite I" "I \<noteq> {}" |
|
962 |
shows "sets (PiF {I} M) = |
|
963 |
sigma_sets (\<Pi>' i\<in>I. space (M i)) |
|
964 |
{{f\<in>\<Pi>' i\<in>I. space (M i). f i \<in> A} | i A. i \<in> I \<and> A \<in> sets (M i)}" |
|
965 |
(is "_ = sigma_sets ?\<Omega> ?R") |
|
966 |
unfolding sets_PiF_singleton |
|
967 |
proof (rule sigma_sets_eqI) |
|
968 |
interpret R: sigma_algebra ?\<Omega> "sigma_sets ?\<Omega> ?R" by (rule sigma_algebra_sigma_sets) auto |
|
969 |
fix A assume "A \<in> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
970 |
then obtain X where X: "A = Pi' I X" "X \<in> (\<Pi> j\<in>I. sets (M j))" by auto |
|
971 |
show "A \<in> sigma_sets ?\<Omega> ?R" |
|
972 |
proof - |
|
61808 | 973 |
from \<open>I \<noteq> {}\<close> X have "A = (\<Inter>j\<in>I. {f\<in>space (PiF {I} M). f j \<in> X j})" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
974 |
using sets.sets_into_space |
50088 | 975 |
by (auto simp: space_PiF product_def) blast |
976 |
also have "\<dots> \<in> sigma_sets ?\<Omega> ?R" |
|
61808 | 977 |
using X \<open>I \<noteq> {}\<close> assms by (intro R.finite_INT) (auto simp: space_PiF) |
50088 | 978 |
finally show "A \<in> sigma_sets ?\<Omega> ?R" . |
979 |
qed |
|
980 |
next |
|
981 |
fix A assume "A \<in> ?R" |
|
982 |
then obtain i B where A: "A = {f\<in>\<Pi>' i\<in>I. space (M i). f i \<in> B}" "i \<in> I" "B \<in> sets (M i)" |
|
983 |
by auto |
|
984 |
then have "A = (\<Pi>' j \<in> I. if j = i then B else space (M j))" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
985 |
using sets.sets_into_space[OF A(3)] |
62390 | 986 |
apply (auto simp: Pi'_iff split: if_split_asm) |
50088 | 987 |
apply blast |
988 |
done |
|
989 |
also have "\<dots> \<in> sigma_sets ?\<Omega> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
990 |
using A |
|
991 |
by (intro sigma_sets.Basic ) |
|
992 |
(auto intro: exI[where x="\<lambda>j. if j = i then B else space (M j)"]) |
|
993 |
finally show "A \<in> sigma_sets ?\<Omega> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" . |
|
994 |
qed |
|
995 |
||
61808 | 996 |
text \<open>adapted from @{thm PiE_cong}\<close> |
50088 | 997 |
|
998 |
lemma Pi'_cong: |
|
999 |
assumes "finite I" |
|
1000 |
assumes "\<And>i. i \<in> I \<Longrightarrow> f i = g i" |
|
1001 |
shows "Pi' I f = Pi' I g" |
|
1002 |
using assms by (auto simp: Pi'_def) |
|
1003 |
||
61808 | 1004 |
text \<open>adapted from @{thm Pi_UN}\<close> |
50088 | 1005 |
|
1006 |
lemma Pi'_UN: |
|
1007 |
fixes A :: "nat \<Rightarrow> 'i \<Rightarrow> 'a set" |
|
1008 |
assumes "finite I" |
|
1009 |
assumes mono: "\<And>i n m. i \<in> I \<Longrightarrow> n \<le> m \<Longrightarrow> A n i \<subseteq> A m i" |
|
1010 |
shows "(\<Union>n. Pi' I (A n)) = Pi' I (\<lambda>i. \<Union>n. A n i)" |
|
1011 |
proof (intro set_eqI iffI) |
|
1012 |
fix f assume "f \<in> Pi' I (\<lambda>i. \<Union>n. A n i)" |
|
61808 | 1013 |
then have "\<forall>i\<in>I. \<exists>n. f i \<in> A n i" "domain f = I" by (auto simp: \<open>finite I\<close> Pi'_def) |
50088 | 1014 |
from bchoice[OF this(1)] obtain n where n: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> (A (n i) i)" by auto |
1015 |
obtain k where k: "\<And>i. i \<in> I \<Longrightarrow> n i \<le> k" |
|
61808 | 1016 |
using \<open>finite I\<close> finite_nat_set_iff_bounded_le[of "n`I"] by auto |
50088 | 1017 |
have "f \<in> Pi' I (\<lambda>i. A k i)" |
1018 |
proof |
|
1019 |
fix i assume "i \<in> I" |
|
61808 | 1020 |
from mono[OF this, of "n i" k] k[OF this] n[OF this] \<open>domain f = I\<close> \<open>i \<in> I\<close> |
1021 |
show "f i \<in> A k i " by (auto simp: \<open>finite I\<close>) |
|
1022 |
qed (simp add: \<open>domain f = I\<close> \<open>finite I\<close>) |
|
50088 | 1023 |
then show "f \<in> (\<Union>n. Pi' I (A n))" by auto |
61808 | 1024 |
qed (auto simp: Pi'_def \<open>finite I\<close>) |
50088 | 1025 |
|
61808 | 1026 |
text \<open>adapted from @{thm sets_PiM_sigma}\<close> |
50088 | 1027 |
|
1028 |
lemma sigma_fprod_algebra_sigma_eq: |
|
51106 | 1029 |
fixes E :: "'i \<Rightarrow> 'a set set" and S :: "'i \<Rightarrow> nat \<Rightarrow> 'a set" |
50088 | 1030 |
assumes [simp]: "finite I" "I \<noteq> {}" |
1031 |
and S_union: "\<And>i. i \<in> I \<Longrightarrow> (\<Union>j. S i j) = space (M i)" |
|
1032 |
and S_in_E: "\<And>i. i \<in> I \<Longrightarrow> range (S i) \<subseteq> E i" |
|
1033 |
assumes E_closed: "\<And>i. i \<in> I \<Longrightarrow> E i \<subseteq> Pow (space (M i))" |
|
1034 |
and E_generates: "\<And>i. i \<in> I \<Longrightarrow> sets (M i) = sigma_sets (space (M i)) (E i)" |
|
1035 |
defines "P == { Pi' I F | F. \<forall>i\<in>I. F i \<in> E i }" |
|
1036 |
shows "sets (PiF {I} M) = sigma_sets (space (PiF {I} M)) P" |
|
1037 |
proof |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1038 |
let ?P = "sigma (space (Pi\<^sub>F {I} M)) P" |
61808 | 1039 |
from \<open>finite I\<close>[THEN ex_bij_betw_finite_nat] guess T .. |
51106 | 1040 |
then have T: "\<And>i. i \<in> I \<Longrightarrow> T i < card I" "\<And>i. i\<in>I \<Longrightarrow> the_inv_into I T (T i) = i" |
61808 | 1041 |
by (auto simp add: bij_betw_def set_eq_iff image_iff the_inv_into_f_f simp del: \<open>finite I\<close>) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1042 |
have P_closed: "P \<subseteq> Pow (space (Pi\<^sub>F {I} M))" |
50088 | 1043 |
using E_closed by (auto simp: space_PiF P_def Pi'_iff subset_eq) |
1044 |
then have space_P: "space ?P = (\<Pi>' i\<in>I. space (M i))" |
|
1045 |
by (simp add: space_PiF) |
|
1046 |
have "sets (PiF {I} M) = |
|
1047 |
sigma_sets (space ?P) {{f \<in> \<Pi>' i\<in>I. space (M i). f i \<in> A} |i A. i \<in> I \<and> A \<in> sets (M i)}" |
|
1048 |
using sets_PiF_single[of I M] by (simp add: space_P) |
|
1049 |
also have "\<dots> \<subseteq> sets (sigma (space (PiF {I} M)) P)" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1050 |
proof (safe intro!: sets.sigma_sets_subset) |
50088 | 1051 |
fix i A assume "i \<in> I" and A: "A \<in> sets (M i)" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1052 |
have "(\<lambda>x. (x)\<^sub>F i) \<in> measurable ?P (sigma (space (M i)) (E i))" |
50088 | 1053 |
proof (subst measurable_iff_measure_of) |
61808 | 1054 |
show "E i \<subseteq> Pow (space (M i))" using \<open>i \<in> I\<close> by fact |
1055 |
from space_P \<open>i \<in> I\<close> show "(\<lambda>x. (x)\<^sub>F i) \<in> space ?P \<rightarrow> space (M i)" |
|
50088 | 1056 |
by auto |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1057 |
show "\<forall>A\<in>E i. (\<lambda>x. (x)\<^sub>F i) -` A \<inter> space ?P \<in> sets ?P" |
50088 | 1058 |
proof |
1059 |
fix A assume A: "A \<in> E i" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1060 |
then have "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space ?P = (\<Pi>' j\<in>I. if i = j then A else space (M j))" |
62390 | 1061 |
using E_closed \<open>i \<in> I\<close> by (auto simp: space_P Pi_iff subset_eq split: if_split_asm) |
50088 | 1062 |
also have "\<dots> = (\<Pi>' j\<in>I. \<Union>n. if i = j then A else S j n)" |
1063 |
by (intro Pi'_cong) (simp_all add: S_union) |
|
51106 | 1064 |
also have "\<dots> = (\<Union>xs\<in>{xs. length xs = card I}. \<Pi>' j\<in>I. if i = j then A else S j (xs ! T j))" |
1065 |
using T |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62102
diff
changeset
|
1066 |
apply (auto simp del: Union_iff) |
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62102
diff
changeset
|
1067 |
apply (simp_all add: Pi'_iff bchoice_iff del: Union_iff) |
51106 | 1068 |
apply (erule conjE exE)+ |
1069 |
apply (rule_tac x="map (\<lambda>n. f (the_inv_into I T n)) [0..<card I]" in exI) |
|
1070 |
apply (auto simp: bij_betw_def) |
|
1071 |
done |
|
50088 | 1072 |
also have "\<dots> \<in> sets ?P" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1073 |
proof (safe intro!: sets.countable_UN) |
51106 | 1074 |
fix xs show "(\<Pi>' j\<in>I. if i = j then A else S j (xs ! T j)) \<in> sets ?P" |
50088 | 1075 |
using A S_in_E |
1076 |
by (simp add: P_closed) |
|
51106 | 1077 |
(auto simp: P_def subset_eq intro!: exI[of _ "\<lambda>j. if i = j then A else S j (xs ! T j)"]) |
50088 | 1078 |
qed |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1079 |
finally show "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space ?P \<in> sets ?P" |
50088 | 1080 |
using P_closed by simp |
1081 |
qed |
|
1082 |
qed |
|
61808 | 1083 |
from measurable_sets[OF this, of A] A \<open>i \<in> I\<close> E_closed |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1084 |
have "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space ?P \<in> sets ?P" |
50088 | 1085 |
by (simp add: E_generates) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1086 |
also have "(\<lambda>x. (x)\<^sub>F i) -` A \<inter> space ?P = {f \<in> \<Pi>' i\<in>I. space (M i). f i \<in> A}" |
50088 | 1087 |
using P_closed by (auto simp: space_PiF) |
1088 |
finally show "\<dots> \<in> sets ?P" . |
|
1089 |
qed |
|
1090 |
finally show "sets (PiF {I} M) \<subseteq> sigma_sets (space (PiF {I} M)) P" |
|
1091 |
by (simp add: P_closed) |
|
1092 |
show "sigma_sets (space (PiF {I} M)) P \<subseteq> sets (PiF {I} M)" |
|
61808 | 1093 |
using \<open>finite I\<close> \<open>I \<noteq> {}\<close> |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1094 |
by (auto intro!: sets.sigma_sets_subset product_in_sets_PiFI simp: E_generates P_def) |
50088 | 1095 |
qed |
1096 |
||
1097 |
lemma product_open_generates_sets_PiF_single: |
|
1098 |
assumes "I \<noteq> {}" |
|
1099 |
assumes [simp]: "finite I" |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50251
diff
changeset
|
1100 |
shows "sets (PiF {I} (\<lambda>_. borel::'b::second_countable_topology measure)) = |
50088 | 1101 |
sigma_sets (space (PiF {I} (\<lambda>_. borel))) {Pi' I F |F. (\<forall>i\<in>I. F i \<in> Collect open)}" |
1102 |
proof - |
|
51106 | 1103 |
from open_countable_basisE[OF open_UNIV] guess S::"'b set set" . note S = this |
50088 | 1104 |
show ?thesis |
1105 |
proof (rule sigma_fprod_algebra_sigma_eq) |
|
1106 |
show "finite I" by simp |
|
1107 |
show "I \<noteq> {}" by fact |
|
63040 | 1108 |
define S' where "S' = from_nat_into S" |
51106 | 1109 |
show "(\<Union>j. S' j) = space borel" |
1110 |
using S |
|
1111 |
apply (auto simp add: from_nat_into countable_basis_proj S'_def basis_proj_def) |
|
1112 |
apply (metis (lifting, mono_tags) UNIV_I UnionE basis_proj_def countable_basis_proj countable_subset from_nat_into_surj) |
|
1113 |
done |
|
1114 |
show "range S' \<subseteq> Collect open" |
|
1115 |
using S |
|
1116 |
apply (auto simp add: from_nat_into countable_basis_proj S'_def) |
|
1117 |
apply (metis UNIV_not_empty Union_empty from_nat_into set_mp topological_basis_open[OF basis_proj] basis_proj_def) |
|
1118 |
done |
|
50088 | 1119 |
show "Collect open \<subseteq> Pow (space borel)" by simp |
1120 |
show "sets borel = sigma_sets (space borel) (Collect open)" |
|
1121 |
by (simp add: borel_def) |
|
1122 |
qed |
|
1123 |
qed |
|
1124 |
||
61988 | 1125 |
lemma finmap_UNIV[simp]: "(\<Union>J\<in>Collect finite. \<Pi>' j\<in>J. UNIV) = UNIV" by auto |
50088 | 1126 |
|
1127 |
lemma borel_eq_PiF_borel: |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1128 |
shows "(borel :: ('i::countable \<Rightarrow>\<^sub>F 'a::polish_space) measure) = |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1129 |
PiF (Collect finite) (\<lambda>_. borel :: 'a measure)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1130 |
unfolding borel_def PiF_def |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1131 |
proof (rule measure_eqI, clarsimp, rule sigma_sets_eqI) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1132 |
fix a::"('i \<Rightarrow>\<^sub>F 'a) set" assume "a \<in> Collect open" hence "open a" by simp |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1133 |
then obtain B' where B': "B'\<subseteq>basis_finmap" "a = \<Union>B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1134 |
using finmap_topological_basis by (force simp add: topological_basis_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1135 |
have "a \<in> sigma UNIV {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
61808 | 1136 |
unfolding \<open>a = \<Union>B'\<close> |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1137 |
proof (rule sets.countable_Union) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1138 |
from B' countable_basis_finmap show "countable B'" by (metis countable_subset) |
50088 | 1139 |
next |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1140 |
show "B' \<subseteq> sets (sigma UNIV |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1141 |
{Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)})" (is "_ \<subseteq> sets ?s") |
50088 | 1142 |
proof |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1143 |
fix x assume "x \<in> B'" with B' have "x \<in> basis_finmap" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1144 |
then obtain J X where "x = Pi' J X" "finite J" "X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)" |
51106 | 1145 |
by (auto simp: basis_finmap_def topological_basis_open[OF basis_proj]) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1146 |
thus "x \<in> sets ?s" by auto |
50088 | 1147 |
qed |
1148 |
qed |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1149 |
thus "a \<in> sigma_sets UNIV {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1150 |
by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1151 |
next |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1152 |
fix b::"('i \<Rightarrow>\<^sub>F 'a) set" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1153 |
assume "b \<in> {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1154 |
hence b': "b \<in> sets (Pi\<^sub>F (Collect finite) (\<lambda>_. borel))" by (auto simp: sets_PiF borel_def) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1155 |
let ?b = "\<lambda>J. b \<inter> {x. domain x = J}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1156 |
have "b = \<Union>((\<lambda>J. ?b J) ` Collect finite)" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1157 |
also have "\<dots> \<in> sets borel" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1158 |
proof (rule sets.countable_Union, safe) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1159 |
fix J::"'i set" assume "finite J" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1160 |
{ assume ef: "J = {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1161 |
have "?b J \<in> sets borel" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1162 |
proof cases |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1163 |
assume "?b J \<noteq> {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1164 |
then obtain f where "f \<in> b" "domain f = {}" using ef by auto |
61808 | 1165 |
hence "?b J = {f}" using \<open>J = {}\<close> |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1166 |
by (auto simp: finmap_eq_iff) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1167 |
also have "{f} \<in> sets borel" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1168 |
finally show ?thesis . |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1169 |
qed simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1170 |
} moreover { |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1171 |
assume "J \<noteq> ({}::'i set)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1172 |
have "(?b J) = b \<inter> {m. domain m \<in> {J}}" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1173 |
also have "\<dots> \<in> sets (PiF {J} (\<lambda>_. borel))" |
61808 | 1174 |
using b' by (rule restrict_sets_measurable) (auto simp: \<open>finite J\<close>) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1175 |
also have "\<dots> = sigma_sets (space (PiF {J} (\<lambda>_. borel))) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1176 |
{Pi' (J) F |F. (\<forall>j\<in>J. F j \<in> Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1177 |
(is "_ = sigma_sets _ ?P") |
61808 | 1178 |
by (rule product_open_generates_sets_PiF_single[OF \<open>J \<noteq> {}\<close> \<open>finite J\<close>]) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1179 |
also have "\<dots> \<subseteq> sigma_sets UNIV (Collect open)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1180 |
by (intro sigma_sets_mono'') (auto intro!: open_Pi'I simp: space_PiF) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1181 |
finally have "(?b J) \<in> sets borel" by (simp add: borel_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1182 |
} ultimately show "(?b J) \<in> sets borel" by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1183 |
qed (simp add: countable_Collect_finite) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1184 |
finally show "b \<in> sigma_sets UNIV (Collect open)" by (simp add: borel_def) |
50088 | 1185 |
qed (simp add: emeasure_sigma borel_def PiF_def) |
1186 |
||
61808 | 1187 |
subsection \<open>Isomorphism between Functions and Finite Maps\<close> |
50088 | 1188 |
|
50124 | 1189 |
lemma measurable_finmap_compose: |
50088 | 1190 |
shows "(\<lambda>m. compose J m f) \<in> measurable (PiM (f ` J) (\<lambda>_. M)) (PiM J (\<lambda>_. M))" |
50124 | 1191 |
unfolding compose_def by measurable |
50088 | 1192 |
|
50124 | 1193 |
lemma measurable_compose_inv: |
50088 | 1194 |
assumes inj: "\<And>j. j \<in> J \<Longrightarrow> f' (f j) = j" |
1195 |
shows "(\<lambda>m. compose (f ` J) m f') \<in> measurable (PiM J (\<lambda>_. M)) (PiM (f ` J) (\<lambda>_. M))" |
|
50124 | 1196 |
unfolding compose_def by (rule measurable_restrict) (auto simp: inj) |
50088 | 1197 |
|
1198 |
locale function_to_finmap = |
|
1199 |
fixes J::"'a set" and f :: "'a \<Rightarrow> 'b::countable" and f' |
|
1200 |
assumes [simp]: "finite J" |
|
1201 |
assumes inv: "i \<in> J \<Longrightarrow> f' (f i) = i" |
|
1202 |
begin |
|
1203 |
||
61808 | 1204 |
text \<open>to measure finmaps\<close> |
50088 | 1205 |
|
1206 |
definition "fm = (finmap_of (f ` J)) o (\<lambda>g. compose (f ` J) g f')" |
|
1207 |
||
1208 |
lemma domain_fm[simp]: "domain (fm x) = f ` J" |
|
1209 |
unfolding fm_def by simp |
|
1210 |
||
1211 |
lemma fm_restrict[simp]: "fm (restrict y J) = fm y" |
|
1212 |
unfolding fm_def by (auto simp: compose_def inv intro: restrict_ext) |
|
1213 |
||
1214 |
lemma fm_product: |
|
1215 |
assumes "\<And>i. space (M i) = UNIV" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1216 |
shows "fm -` Pi' (f ` J) S \<inter> space (Pi\<^sub>M J M) = (\<Pi>\<^sub>E j \<in> J. S (f j))" |
50088 | 1217 |
using assms |
1218 |
by (auto simp: inv fm_def compose_def space_PiM Pi'_def) |
|
1219 |
||
1220 |
lemma fm_measurable: |
|
1221 |
assumes "f ` J \<in> N" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1222 |
shows "fm \<in> measurable (Pi\<^sub>M J (\<lambda>_. M)) (Pi\<^sub>F N (\<lambda>_. M))" |
50088 | 1223 |
unfolding fm_def |
1224 |
proof (rule measurable_comp, rule measurable_compose_inv) |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1225 |
show "finmap_of (f ` J) \<in> measurable (Pi\<^sub>M (f ` J) (\<lambda>_. M)) (PiF N (\<lambda>_. M)) " |
50088 | 1226 |
using assms by (intro measurable_finmap_of measurable_component_singleton) auto |
1227 |
qed (simp_all add: inv) |
|
1228 |
||
1229 |
lemma proj_fm: |
|
1230 |
assumes "x \<in> J" |
|
1231 |
shows "fm m (f x) = m x" |
|
1232 |
using assms by (auto simp: fm_def compose_def o_def inv) |
|
1233 |
||
1234 |
lemma inj_on_compose_f': "inj_on (\<lambda>g. compose (f ` J) g f') (extensional J)" |
|
1235 |
proof (rule inj_on_inverseI) |
|
1236 |
fix x::"'a \<Rightarrow> 'c" assume "x \<in> extensional J" |
|
1237 |
thus "(\<lambda>x. compose J x f) (compose (f ` J) x f') = x" |
|
1238 |
by (auto simp: compose_def inv extensional_def) |
|
1239 |
qed |
|
1240 |
||
1241 |
lemma inj_on_fm: |
|
1242 |
assumes "\<And>i. space (M i) = UNIV" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1243 |
shows "inj_on fm (space (Pi\<^sub>M J M))" |
50088 | 1244 |
using assms |
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1245 |
apply (auto simp: fm_def space_PiM PiE_def) |
50088 | 1246 |
apply (rule comp_inj_on) |
1247 |
apply (rule inj_on_compose_f') |
|
1248 |
apply (rule finmap_of_inj_on_extensional_finite) |
|
1249 |
apply simp |
|
1250 |
apply (auto) |
|
1251 |
done |
|
1252 |
||
61808 | 1253 |
text \<open>to measure functions\<close> |
50088 | 1254 |
|
1255 |
definition "mf = (\<lambda>g. compose J g f) o proj" |
|
1256 |
||
1257 |
lemma mf_fm: |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1258 |
assumes "x \<in> space (Pi\<^sub>M J (\<lambda>_. M))" |
50088 | 1259 |
shows "mf (fm x) = x" |
1260 |
proof - |
|
1261 |
have "mf (fm x) \<in> extensional J" |
|
1262 |
by (auto simp: mf_def extensional_def compose_def) |
|
1263 |
moreover |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1264 |
have "x \<in> extensional J" using assms sets.sets_into_space |
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1265 |
by (force simp: space_PiM PiE_def) |
50088 | 1266 |
moreover |
1267 |
{ fix i assume "i \<in> J" |
|
1268 |
hence "mf (fm x) i = x i" |
|
1269 |
by (auto simp: inv mf_def compose_def fm_def) |
|
1270 |
} |
|
1271 |
ultimately |
|
1272 |
show ?thesis by (rule extensionalityI) |
|
1273 |
qed |
|
1274 |
||
1275 |
lemma mf_measurable: |
|
1276 |
assumes "space M = UNIV" |
|
1277 |
shows "mf \<in> measurable (PiF {f ` J} (\<lambda>_. M)) (PiM J (\<lambda>_. M))" |
|
1278 |
unfolding mf_def |
|
1279 |
proof (rule measurable_comp, rule measurable_proj_PiM) |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1280 |
show "(\<lambda>g. compose J g f) \<in> measurable (Pi\<^sub>M (f ` J) (\<lambda>x. M)) (Pi\<^sub>M J (\<lambda>_. M))" |
50124 | 1281 |
by (rule measurable_finmap_compose) |
50088 | 1282 |
qed (auto simp add: space_PiM extensional_def assms) |
1283 |
||
1284 |
lemma fm_image_measurable: |
|
1285 |
assumes "space M = UNIV" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1286 |
assumes "X \<in> sets (Pi\<^sub>M J (\<lambda>_. M))" |
50088 | 1287 |
shows "fm ` X \<in> sets (PiF {f ` J} (\<lambda>_. M))" |
1288 |
proof - |
|
1289 |
have "fm ` X = (mf) -` X \<inter> space (PiF {f ` J} (\<lambda>_. M))" |
|
1290 |
proof safe |
|
1291 |
fix x assume "x \<in> X" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1292 |
with mf_fm[of x] sets.sets_into_space[OF assms(2)] show "fm x \<in> mf -` X" by auto |
50088 | 1293 |
show "fm x \<in> space (PiF {f ` J} (\<lambda>_. M))" by (simp add: space_PiF assms) |
1294 |
next |
|
1295 |
fix y x |
|
1296 |
assume x: "mf y \<in> X" |
|
1297 |
assume y: "y \<in> space (PiF {f ` J} (\<lambda>_. M))" |
|
1298 |
thus "y \<in> fm ` X" |
|
1299 |
by (intro image_eqI[OF _ x], unfold finmap_eq_iff) |
|
1300 |
(auto simp: space_PiF fm_def mf_def compose_def inv Pi'_def) |
|
1301 |
qed |
|
1302 |
also have "\<dots> \<in> sets (PiF {f ` J} (\<lambda>_. M))" |
|
1303 |
using assms |
|
1304 |
by (intro measurable_sets[OF mf_measurable]) auto |
|
1305 |
finally show ?thesis . |
|
1306 |
qed |
|
1307 |
||
1308 |
lemma fm_image_measurable_finite: |
|
1309 |
assumes "space M = UNIV" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1310 |
assumes "X \<in> sets (Pi\<^sub>M J (\<lambda>_. M::'c measure))" |
50088 | 1311 |
shows "fm ` X \<in> sets (PiF (Collect finite) (\<lambda>_. M::'c measure))" |
1312 |
using fm_image_measurable[OF assms] |
|
1313 |
by (rule subspace_set_in_sets) (auto simp: finite_subset) |
|
1314 |
||
61808 | 1315 |
text \<open>measure on finmaps\<close> |
50088 | 1316 |
|
1317 |
definition "mapmeasure M N = distr M (PiF (Collect finite) N) (fm)" |
|
1318 |
||
1319 |
lemma sets_mapmeasure[simp]: "sets (mapmeasure M N) = sets (PiF (Collect finite) N)" |
|
1320 |
unfolding mapmeasure_def by simp |
|
1321 |
||
1322 |
lemma space_mapmeasure[simp]: "space (mapmeasure M N) = space (PiF (Collect finite) N)" |
|
1323 |
unfolding mapmeasure_def by simp |
|
1324 |
||
1325 |
lemma mapmeasure_PiF: |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1326 |
assumes s1: "space M = space (Pi\<^sub>M J (\<lambda>_. N))" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1327 |
assumes s2: "sets M = sets (Pi\<^sub>M J (\<lambda>_. N))" |
50088 | 1328 |
assumes "space N = UNIV" |
1329 |
assumes "X \<in> sets (PiF (Collect finite) (\<lambda>_. N))" |
|
1330 |
shows "emeasure (mapmeasure M (\<lambda>_. N)) X = emeasure M ((fm -` X \<inter> extensional J))" |
|
1331 |
using assms |
|
59048 | 1332 |
by (auto simp: measurable_cong_sets[OF s2 refl] mapmeasure_def emeasure_distr |
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1333 |
fm_measurable space_PiM PiE_def) |
50088 | 1334 |
|
1335 |
lemma mapmeasure_PiM: |
|
1336 |
fixes N::"'c measure" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1337 |
assumes s1: "space M = space (Pi\<^sub>M J (\<lambda>_. N))" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1338 |
assumes s2: "sets M = (Pi\<^sub>M J (\<lambda>_. N))" |
50088 | 1339 |
assumes N: "space N = UNIV" |
1340 |
assumes X: "X \<in> sets M" |
|
1341 |
shows "emeasure M X = emeasure (mapmeasure M (\<lambda>_. N)) (fm ` X)" |
|
1342 |
unfolding mapmeasure_def |
|
59048 | 1343 |
proof (subst emeasure_distr, subst measurable_cong_sets[OF s2 refl], rule fm_measurable) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1344 |
have "X \<subseteq> space (Pi\<^sub>M J (\<lambda>_. N))" using assms by (simp add: sets.sets_into_space) |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51641
diff
changeset
|
1345 |
from assms inj_on_fm[of "\<lambda>_. N"] set_mp[OF this] have "fm -` fm ` X \<inter> space (Pi\<^sub>M J (\<lambda>_. N)) = X" |
50088 | 1346 |
by (auto simp: vimage_image_eq inj_on_def) |
1347 |
thus "emeasure M X = emeasure M (fm -` fm ` X \<inter> space M)" using s1 |
|
1348 |
by simp |
|
1349 |
show "fm ` X \<in> sets (PiF (Collect finite) (\<lambda>_. N))" |
|
1350 |
by (rule fm_image_measurable_finite[OF N X[simplified s2]]) |
|
1351 |
qed simp |
|
1352 |
||
1353 |
end |
|
1354 |
||
1355 |
end |