38656
|
1 |
|
|
2 |
header {* Lebsegue measure (defined via the gauge integral). *}
|
|
3 |
(* Author: John Harrison
|
|
4 |
Translation from HOL light: Robert Himmelmann, TU Muenchen *)
|
|
5 |
|
|
6 |
theory Gauge_Measure
|
|
7 |
imports Integration
|
|
8 |
begin
|
|
9 |
|
|
10 |
(* ------------------------------------------------------------------------- *)
|
|
11 |
(* Lebesgue measure (in the case where the measure is finite). *)
|
|
12 |
(* For the non-finite version, please see Probability/Lebesgue_Measure.thy *)
|
|
13 |
(* ------------------------------------------------------------------------- *)
|
|
14 |
|
|
15 |
definition has_gmeasure (infixr "has'_gmeasure" 80) where
|
|
16 |
"s has_gmeasure m \<equiv> ((\<lambda>x. 1::real) has_integral m) s"
|
|
17 |
|
|
18 |
definition gmeasurable :: "('n::ordered_euclidean_space) set \<Rightarrow> bool" where
|
|
19 |
"gmeasurable s \<equiv> (\<exists>m. s has_gmeasure m)"
|
|
20 |
|
|
21 |
lemma gmeasurableI[dest]:"s has_gmeasure m \<Longrightarrow> gmeasurable s"
|
|
22 |
unfolding gmeasurable_def by auto
|
|
23 |
|
|
24 |
definition gmeasure where
|
|
25 |
"gmeasure s \<equiv> (if gmeasurable s then (SOME m. s has_gmeasure m) else 0)"
|
|
26 |
|
|
27 |
lemma has_gmeasure_measure: "gmeasurable s \<longleftrightarrow> s has_gmeasure (gmeasure s)"
|
|
28 |
unfolding gmeasure_def gmeasurable_def
|
|
29 |
apply meson apply(subst if_P) defer apply(rule someI) by auto
|
|
30 |
|
|
31 |
lemma has_gmeasure_measureI[intro]:"gmeasurable s \<Longrightarrow> s has_gmeasure (gmeasure s)"
|
|
32 |
using has_gmeasure_measure by auto
|
|
33 |
|
|
34 |
lemma has_gmeasure_unique: "s has_gmeasure m1 \<Longrightarrow> s has_gmeasure m2 \<Longrightarrow> m1 = m2"
|
|
35 |
unfolding has_gmeasure_def apply(rule has_integral_unique) by auto
|
|
36 |
|
|
37 |
lemma measure_unique[intro]: assumes "s has_gmeasure m" shows "gmeasure s = m"
|
|
38 |
apply(rule has_gmeasure_unique[OF _ assms]) using assms
|
|
39 |
unfolding has_gmeasure_measure[THEN sym] by auto
|
|
40 |
|
|
41 |
lemma has_gmeasure_measurable_measure:
|
|
42 |
"s has_gmeasure m \<longleftrightarrow> gmeasurable s \<and> gmeasure s = m"
|
|
43 |
by(auto intro!:measure_unique simp:has_gmeasure_measure[THEN sym])
|
|
44 |
|
|
45 |
lemmas has_gmeasure_imp_measurable = gmeasurableI
|
|
46 |
|
|
47 |
lemma has_gmeasure:
|
|
48 |
"s has_gmeasure m \<longleftrightarrow> ((\<lambda>x. if x \<in> s then 1 else 0) has_integral m) UNIV"
|
|
49 |
unfolding has_integral_restrict_univ has_gmeasure_def ..
|
|
50 |
|
|
51 |
lemma gmeasurable: "gmeasurable s \<longleftrightarrow> (\<lambda>x. 1::real) integrable_on s"
|
|
52 |
unfolding gmeasurable_def integrable_on_def has_gmeasure_def by auto
|
|
53 |
|
|
54 |
lemma gmeasurable_integrable:
|
|
55 |
"gmeasurable s \<longleftrightarrow> (\<lambda>x. if x \<in> s then 1 else (0::real)) integrable_on UNIV"
|
|
56 |
unfolding gmeasurable_def integrable_on_def has_gmeasure ..
|
|
57 |
|
|
58 |
lemma measure_integral:
|
|
59 |
assumes "gmeasurable s" shows "gmeasure s = (integral s (\<lambda>x. 1))"
|
|
60 |
apply(rule integral_unique[THEN sym])
|
|
61 |
unfolding has_gmeasure_def[symmetric] using assms by auto
|
|
62 |
|
|
63 |
lemma measure_integral_univ: assumes "gmeasurable s"
|
|
64 |
shows "gmeasure s = (integral UNIV (\<lambda>x. if x \<in> s then 1 else 0))"
|
|
65 |
apply(rule integral_unique[THEN sym])
|
|
66 |
using assms by(auto simp:has_gmeasure[THEN sym])
|
|
67 |
|
|
68 |
lemmas integral_measure = measure_integral[THEN sym]
|
|
69 |
|
|
70 |
lemmas integral_measure_univ = measure_integral_univ[THEN sym]
|
|
71 |
|
|
72 |
lemma has_gmeasure_interval[intro]:
|
|
73 |
"{a..b} has_gmeasure content{a..b}" (is ?t1)
|
|
74 |
"{a<..<b} has_gmeasure content{a..b}" (is ?t2)
|
|
75 |
proof- show ?t1 unfolding has_gmeasure_def using has_integral_const[where c="1::real"] by auto
|
|
76 |
show ?t2 unfolding has_gmeasure apply(rule has_integral_spike[of "{a..b} - {a<..<b}",
|
|
77 |
where f="\<lambda>x. (if x \<in> {a..b} then 1 else 0)"]) apply(rule negligible_frontier_interval)
|
|
78 |
using interval_open_subset_closed[of a b]
|
|
79 |
using `?t1` unfolding has_gmeasure by auto
|
|
80 |
qed
|
|
81 |
|
|
82 |
lemma gmeasurable_interval[intro]: "gmeasurable {a..b}" "gmeasurable {a<..<b}"
|
|
83 |
by(auto intro:gmeasurableI)
|
|
84 |
|
|
85 |
lemma measure_interval[simp]: "gmeasure{a..b} = content{a..b}" "gmeasure({a<..<b}) = content{a..b}"
|
|
86 |
by(auto intro:measure_unique)
|
|
87 |
|
|
88 |
lemma nonnegative_absolutely_integrable: fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'm::ordered_euclidean_space"
|
|
89 |
assumes "\<forall>x\<in>s. \<forall>i<DIM('m). 0 \<le> f(x)$$i" "f integrable_on s"
|
|
90 |
shows "f absolutely_integrable_on s"
|
|
91 |
unfolding absolutely_integrable_abs_eq apply rule defer
|
|
92 |
apply(rule integrable_eq[of _ f]) using assms apply-apply(subst euclidean_eq) by auto
|
|
93 |
|
|
94 |
lemma gmeasurable_inter[dest]: assumes "gmeasurable s" "gmeasurable t" shows "gmeasurable (s \<inter> t)"
|
|
95 |
proof- have *:"(\<lambda>x. if x \<in> s \<inter> t then 1 else (0::real)) =
|
|
96 |
(\<lambda>x. \<chi>\<chi> i. min (((if x \<in> s then 1 else 0)::real)$$i) (((if x \<in> t then 1 else 0)::real)$$i))"
|
|
97 |
apply(rule ext) by auto
|
|
98 |
show ?thesis unfolding gmeasurable_integrable apply(rule absolutely_integrable_onD)
|
|
99 |
unfolding * apply(rule absolutely_integrable_min)
|
|
100 |
apply(rule_tac[!] nonnegative_absolutely_integrable)
|
|
101 |
using assms unfolding gmeasurable_integrable by auto
|
|
102 |
qed
|
|
103 |
|
|
104 |
lemma gmeasurable_union: assumes "gmeasurable s" "gmeasurable t"
|
|
105 |
shows "gmeasurable (s \<union> t)"
|
|
106 |
proof- have *:"(\<lambda>x. if x \<in> s \<union> t then 1 else (0::real)) =
|
|
107 |
(\<lambda>x. \<chi>\<chi> i. max (((if x \<in> s then 1 else 0)::real)$$i) (((if x \<in> t then 1 else 0)::real)$$i)) "
|
|
108 |
by(rule ext,auto)
|
|
109 |
show ?thesis unfolding gmeasurable_integrable apply(rule absolutely_integrable_onD)
|
|
110 |
unfolding * apply(rule absolutely_integrable_max)
|
|
111 |
apply(rule_tac[!]nonnegative_absolutely_integrable)
|
|
112 |
using assms unfolding gmeasurable_integrable by auto
|
|
113 |
qed
|
|
114 |
|
|
115 |
lemma has_gmeasure_disjoint_union:
|
|
116 |
assumes "s1 has_gmeasure m1" "s2 has_gmeasure m2" "s1 \<inter> s2 = {}"
|
|
117 |
shows "(s1 \<union> s2) has_gmeasure (m1 + m2)"
|
|
118 |
proof- have *:"\<And>x. (if x \<in> s1 then 1 else 0) + (if x \<in> s2 then 1 else 0) =
|
|
119 |
(if x \<in> s1 \<union> s2 then 1 else (0::real))" using assms(3) by auto
|
|
120 |
show ?thesis using has_integral_add[OF assms(1-2)[unfolded has_gmeasure]]
|
|
121 |
unfolding has_gmeasure * .
|
|
122 |
qed
|
|
123 |
|
|
124 |
lemma measure_disjoint_union: assumes "gmeasurable s" "gmeasurable t" "s \<inter> t = {}"
|
|
125 |
shows "gmeasure(s \<union> t) = gmeasure s + gmeasure t"
|
|
126 |
apply rule apply(rule has_gmeasure_disjoint_union) using assms by auto
|
|
127 |
|
|
128 |
lemma has_gmeasure_pos_le[dest]: assumes "s has_gmeasure m" shows "0 \<le> m"
|
|
129 |
apply(rule has_integral_nonneg) using assms unfolding has_gmeasure by auto
|
|
130 |
|
|
131 |
lemma not_measurable_measure:"\<not> gmeasurable s \<Longrightarrow> gmeasure s = 0"
|
|
132 |
unfolding gmeasure_def if_not_P ..
|
|
133 |
|
|
134 |
lemma measure_pos_le[intro]: "0 <= gmeasure s"
|
|
135 |
apply(cases "gmeasurable s") unfolding not_measurable_measure
|
|
136 |
unfolding has_gmeasure_measure by auto
|
|
137 |
|
|
138 |
lemma has_gmeasure_subset[dest]:
|
|
139 |
assumes "s1 has_gmeasure m1" "s2 has_gmeasure m2" "s1 \<subseteq> s2"
|
|
140 |
shows "m1 <= m2"
|
|
141 |
using has_integral_subset_le[OF assms(3,1,2)[unfolded has_gmeasure_def]] by auto
|
|
142 |
|
|
143 |
lemma measure_subset[dest]: assumes "gmeasurable s" "gmeasurable t" "s \<subseteq> t"
|
|
144 |
shows "gmeasure s \<le> gmeasure t"
|
|
145 |
using assms unfolding has_gmeasure_measure by auto
|
|
146 |
|
|
147 |
lemma has_gmeasure_0:"s has_gmeasure 0 \<longleftrightarrow> negligible s" (is "?l = ?r")
|
|
148 |
proof assume ?r thus ?l unfolding indicator_def_raw negligible apply(erule_tac x="UNIV" in allE)
|
|
149 |
unfolding has_integral_restrict_univ has_gmeasure_def .
|
|
150 |
next assume ?l note this[unfolded has_gmeasure_def has_integral_alt']
|
|
151 |
note * = conjunctD2[OF this,rule_format]
|
|
152 |
show ?r unfolding negligible_def
|
|
153 |
proof safe case goal1
|
|
154 |
from *(1)[of a b,unfolded integrable_on_def] guess y apply-
|
|
155 |
apply(subst (asm) has_integral_restrict_univ[THEN sym]) by (erule exE) note y=this
|
|
156 |
have "0 \<le> y" apply(rule has_integral_nonneg[OF y]) by auto
|
|
157 |
moreover have "y \<le> 0" apply(rule has_integral_le[OF y])
|
|
158 |
apply(rule `?l`[unfolded has_gmeasure_def has_integral_restrict_univ[THEN sym,of"\<lambda>x. 1"]]) by auto
|
|
159 |
ultimately have "y = 0" by auto
|
|
160 |
thus ?case using y unfolding has_integral_restrict_univ indicator_def_raw by auto
|
|
161 |
qed
|
|
162 |
qed
|
|
163 |
|
|
164 |
lemma measure_eq_0: "negligible s ==> gmeasure s = 0"
|
|
165 |
apply(rule measure_unique) unfolding has_gmeasure_0 by auto
|
|
166 |
|
|
167 |
lemma has_gmeasure_empty[intro]: "{} has_gmeasure 0"
|
|
168 |
unfolding has_gmeasure_0 by auto
|
|
169 |
|
|
170 |
lemma measure_empty[simp]: "gmeasure {} = 0"
|
|
171 |
apply(rule measure_eq_0) by auto
|
|
172 |
|
|
173 |
lemma gmeasurable_empty[intro]: "gmeasurable {}" by(auto intro:gmeasurableI)
|
|
174 |
|
|
175 |
lemma gmeasurable_measure_eq_0:
|
|
176 |
"gmeasurable s ==> (gmeasure s = 0 \<longleftrightarrow> negligible s)"
|
|
177 |
unfolding has_gmeasure_measure has_gmeasure_0[THEN sym] by(auto intro:measure_unique)
|
|
178 |
|
|
179 |
lemma gmeasurable_measure_pos_lt:
|
|
180 |
"gmeasurable s ==> (0 < gmeasure s \<longleftrightarrow> ~negligible s)"
|
|
181 |
unfolding gmeasurable_measure_eq_0[THEN sym]
|
|
182 |
using measure_pos_le[of s] unfolding le_less by fastsimp
|
|
183 |
|
|
184 |
lemma negligible_interval:True .. (*
|
|
185 |
"(!a b. negligible{a..b} \<longleftrightarrow> {a<..<b} = {}) \<and>
|
|
186 |
(!a b. negligible({a<..<b}) \<longleftrightarrow> {a<..<b} = {})"
|
|
187 |
qed REWRITE_TAC[GSYM HAS_GMEASURE_0] THEN
|
|
188 |
MESON_TAC[HAS_GMEASURE_INTERVAL; CONTENT_EQ_0_INTERIOR;
|
|
189 |
INTERIOR_CLOSED_INTERVAL; HAS_GMEASURE_UNIQUE]);;*)
|
|
190 |
|
|
191 |
lemma gmeasurable_finite_unions:
|
|
192 |
assumes "finite f" "\<And>s. s \<in> f \<Longrightarrow> gmeasurable s"
|
|
193 |
shows "gmeasurable (\<Union> f)" using assms(1,2)
|
|
194 |
proof induct case (insert s F)
|
|
195 |
show ?case unfolding Union_insert apply(rule gmeasurable_union)
|
|
196 |
using insert by auto
|
|
197 |
qed auto
|
|
198 |
|
|
199 |
lemma has_gmeasure_diff_subset: assumes "s1 has_gmeasure m1" "s2 has_gmeasure m2" "s2 \<subseteq> s1"
|
|
200 |
shows "(s1 - s2) has_gmeasure (m1 - m2)"
|
|
201 |
proof- have *:"(\<lambda>x. (if x \<in> s1 then 1 else 0) - (if x \<in> s2 then 1 else (0::real))) =
|
|
202 |
(\<lambda>x. if x \<in> s1 - s2 then 1 else 0)" apply(rule ext) using assms(3) by auto
|
|
203 |
show ?thesis using has_integral_sub[OF assms(1-2)[unfolded has_gmeasure]]
|
|
204 |
unfolding has_gmeasure * .
|
|
205 |
qed
|
|
206 |
|
|
207 |
lemma gmeasurable_diff: assumes "gmeasurable s" "gmeasurable t"
|
|
208 |
shows "gmeasurable (s - t)"
|
|
209 |
proof- have *:"\<And>s t. gmeasurable s \<Longrightarrow> gmeasurable t \<Longrightarrow> t \<subseteq> s ==> gmeasurable (s - t)"
|
|
210 |
unfolding gmeasurable_def apply(erule exE)+ apply(rule,rule has_gmeasure_diff_subset)
|
|
211 |
by assumption+
|
|
212 |
have **:"s - t = s - (s \<inter> t)" by auto
|
|
213 |
show ?thesis unfolding ** apply(rule *) using assms by auto
|
|
214 |
qed
|
|
215 |
|
|
216 |
lemma measure_diff_subset: True .. (*
|
|
217 |
"!s t. gmeasurable s \<and> gmeasurable t \<and> t \<subseteq> s
|
|
218 |
==> measure(s DIFF t) = gmeasure s - gmeasure t"
|
|
219 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
220 |
ASM_SIMP_TAC[HAS_GMEASURE_DIFF_SUBSET; GSYM HAS_GMEASURE_MEASURE]);; *)
|
|
221 |
|
|
222 |
lemma has_gmeasure_union_negligible[dest]:
|
|
223 |
assumes "s has_gmeasure m" "negligible t"
|
|
224 |
shows "(s \<union> t) has_gmeasure m" unfolding has_gmeasure
|
|
225 |
apply(rule has_integral_spike[OF assms(2) _ assms(1)[unfolded has_gmeasure]]) by auto
|
|
226 |
|
|
227 |
lemma has_gmeasure_diff_negligible[dest]:
|
|
228 |
assumes "s has_gmeasure m" "negligible t"
|
|
229 |
shows "(s - t) has_gmeasure m" unfolding has_gmeasure
|
|
230 |
apply(rule has_integral_spike[OF assms(2) _ assms(1)[unfolded has_gmeasure]]) by auto
|
|
231 |
|
|
232 |
lemma has_gmeasure_union_negligible_eq: True .. (*
|
|
233 |
"!s t:real^N->bool m.
|
|
234 |
negligible t ==> ((s \<union> t) has_gmeasure m \<longleftrightarrow> s has_gmeasure m)"
|
|
235 |
qed REPEAT STRIP_TAC THEN EQ_TAC THEN DISCH_TAC THEN
|
|
236 |
ASM_SIMP_TAC[HAS_GMEASURE_UNION_NEGLIGIBLE] THEN
|
|
237 |
SUBST1_TAC(SET_RULE `s:real^N->bool = (s \<union> t) DIFF (t DIFF s)`) THEN
|
|
238 |
MATCH_MP_TAC HAS_GMEASURE_DIFF_NEGLIGIBLE THEN ASM_REWRITE_TAC[] THEN
|
|
239 |
MATCH_MP_TAC NEGLIGIBLE_DIFF THEN ASM_REWRITE_TAC[]);; *)
|
|
240 |
|
|
241 |
lemma has_gmeasure_diff_negligible_eq: True .. (*
|
|
242 |
"!s t:real^N->bool m.
|
|
243 |
negligible t ==> ((s DIFF t) has_gmeasure m \<longleftrightarrow> s has_gmeasure m)"
|
|
244 |
qed REPEAT STRIP_TAC THEN EQ_TAC THEN DISCH_TAC THEN
|
|
245 |
ASM_SIMP_TAC[HAS_GMEASURE_DIFF_NEGLIGIBLE] THEN
|
|
246 |
SUBST1_TAC(SET_RULE `s:real^N->bool = (s DIFF t) \<union> (t \<inter> s)`) THEN
|
|
247 |
MATCH_MP_TAC HAS_GMEASURE_UNION_NEGLIGIBLE THEN
|
|
248 |
ASM_SIMP_TAC[NEGLIGIBLE_INTER]);; *)
|
|
249 |
|
|
250 |
lemma has_gmeasure_almost: assumes "s has_gmeasure m" "negligible t" "s \<union> t = s' \<union> t"
|
|
251 |
shows "s' has_gmeasure m"
|
|
252 |
proof- have *:"s' \<union> t - (t - s') = s'" by blast
|
|
253 |
show ?thesis using has_gmeasure_union_negligible[OF assms(1-2)] unfolding assms(3)
|
|
254 |
apply-apply(drule has_gmeasure_diff_negligible[where t="t - s'"])
|
|
255 |
apply(rule negligible_diff) using assms(2) unfolding * by auto
|
|
256 |
qed
|
|
257 |
|
|
258 |
lemma has_gmeasure_almost_eq: True .. (*
|
|
259 |
"!s s' t. negligible t \<and> s \<union> t = s' \<union> t
|
|
260 |
==> (s has_gmeasure m \<longleftrightarrow> s' has_gmeasure m)"
|
|
261 |
qed MESON_TAC[HAS_GMEASURE_ALMOST]);; *)
|
|
262 |
|
|
263 |
lemma gmeasurable_almost: True .. (*
|
|
264 |
"!s s' t. gmeasurable s \<and> negligible t \<and> s \<union> t = s' \<union> t
|
|
265 |
==> gmeasurable s'"
|
|
266 |
qed REWRITE_TAC[measurable] THEN MESON_TAC[HAS_GMEASURE_ALMOST]);; *)
|
|
267 |
|
|
268 |
lemma has_gmeasure_negligible_union:
|
|
269 |
assumes "s1 has_gmeasure m1" "s2 has_gmeasure m2" "negligible(s1 \<inter> s2)"
|
|
270 |
shows "(s1 \<union> s2) has_gmeasure (m1 + m2)"
|
|
271 |
apply(rule has_gmeasure_almost[of "(s1 - (s1 \<inter> s2)) \<union> (s2 - (s1 \<inter> s2))" _ "s1 \<inter> s2"])
|
|
272 |
apply(rule has_gmeasure_disjoint_union)
|
|
273 |
apply(rule has_gmeasure_almost[of s1,OF _ assms(3)]) prefer 3
|
|
274 |
apply(rule has_gmeasure_almost[of s2,OF _ assms(3)])
|
|
275 |
using assms by auto
|
|
276 |
|
|
277 |
lemma measure_negligible_union: True .. (*
|
|
278 |
"!s t. gmeasurable s \<and> gmeasurable t \<and> negligible(s \<inter> t)
|
|
279 |
==> measure(s \<union> t) = gmeasure s + gmeasure t"
|
|
280 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
281 |
ASM_SIMP_TAC[HAS_GMEASURE_NEGLIGIBLE_UNION; GSYM HAS_GMEASURE_MEASURE]);; *)
|
|
282 |
|
|
283 |
lemma has_gmeasure_negligible_symdiff: True .. (*
|
|
284 |
"!s t:real^N->bool m.
|
|
285 |
s has_gmeasure m \<and>
|
|
286 |
negligible((s DIFF t) \<union> (t DIFF s))
|
|
287 |
==> t has_gmeasure m"
|
|
288 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC HAS_GMEASURE_ALMOST THEN
|
|
289 |
MAP_EVERY EXISTS_TAC
|
|
290 |
[`s:real^N->bool`; `(s DIFF t) \<union> (t DIFF s):real^N->bool`] THEN
|
|
291 |
ASM_REWRITE_TAC[] THEN SET_TAC[]);; *)
|
|
292 |
|
|
293 |
lemma gmeasurable_negligible_symdiff: True .. (*
|
|
294 |
"!s t:real^N->bool.
|
|
295 |
gmeasurable s \<and> negligible((s DIFF t) \<union> (t DIFF s))
|
|
296 |
==> gmeasurable t"
|
|
297 |
qed REWRITE_TAC[measurable] THEN
|
|
298 |
MESON_TAC[HAS_GMEASURE_NEGLIGIBLE_SYMDIFF]);; *)
|
|
299 |
|
|
300 |
lemma measure_negligible_symdiff: True .. (*
|
|
301 |
"!s t:real^N->bool.
|
|
302 |
(measurable s \/ gmeasurable t) \<and>
|
|
303 |
negligible((s DIFF t) \<union> (t DIFF s))
|
|
304 |
==> gmeasure s = gmeasure t"
|
|
305 |
qed MESON_TAC[HAS_GMEASURE_NEGLIGIBLE_SYMDIFF; MEASURE_UNIQUE; UNION_COMM;
|
|
306 |
HAS_GMEASURE_MEASURE]);; *)
|
|
307 |
|
|
308 |
lemma has_gmeasure_negligible_unions: assumes "finite f"
|
|
309 |
"\<And>s. s \<in> f ==> s has_gmeasure (m s)"
|
|
310 |
"\<And>s t. s \<in> f \<Longrightarrow> t \<in> f \<Longrightarrow> ~(s = t) ==> negligible(s \<inter> t)"
|
|
311 |
shows "(\<Union> f) has_gmeasure (setsum m f)" using assms
|
|
312 |
proof induct case (insert x s)
|
|
313 |
have *:"(x \<inter> \<Union>s) = \<Union>{x \<inter> y| y. y\<in>s}"by auto
|
38794
|
314 |
show ?case unfolding Union_insert setsum.insert [OF insert(1-2)]
|
38656
|
315 |
apply(rule has_gmeasure_negligible_union) unfolding *
|
|
316 |
apply(rule insert) defer apply(rule insert) apply(rule insert) defer
|
|
317 |
apply(rule insert) prefer 4 apply(rule negligible_unions)
|
|
318 |
defer apply safe apply(rule insert) using insert by auto
|
|
319 |
qed auto
|
|
320 |
|
|
321 |
lemma measure_negligible_unions:
|
|
322 |
assumes "finite f" "\<And>s. s \<in> f ==> s has_gmeasure (m s)"
|
|
323 |
"\<And>s t. s \<in> f \<Longrightarrow> t \<in> f \<Longrightarrow> s \<noteq> t ==> negligible(s \<inter> t)"
|
|
324 |
shows "gmeasure(\<Union> f) = setsum m f"
|
|
325 |
apply rule apply(rule has_gmeasure_negligible_unions)
|
|
326 |
using assms by auto
|
|
327 |
|
|
328 |
lemma has_gmeasure_disjoint_unions:
|
|
329 |
assumes"finite f" "\<And>s. s \<in> f ==> s has_gmeasure (m s)"
|
|
330 |
"\<And>s t. s \<in> f \<Longrightarrow> t \<in> f \<Longrightarrow> s \<noteq> t ==> s \<inter> t = {}"
|
|
331 |
shows "(\<Union> f) has_gmeasure (setsum m f)"
|
|
332 |
apply(rule has_gmeasure_negligible_unions[OF assms(1-2)]) using assms(3) by auto
|
|
333 |
|
|
334 |
lemma measure_disjoint_unions:
|
|
335 |
assumes "finite f" "\<And>s. s \<in> f ==> s has_gmeasure (m s)"
|
|
336 |
"\<And>s t. s \<in> f \<Longrightarrow> t \<in> f \<Longrightarrow> s \<noteq> t ==> s \<inter> t = {}"
|
|
337 |
shows "gmeasure(\<Union> f) = setsum m f"
|
|
338 |
apply rule apply(rule has_gmeasure_disjoint_unions[OF assms]) by auto
|
|
339 |
|
|
340 |
lemma has_gmeasure_negligible_unions_image:
|
|
341 |
assumes "finite s" "\<And>x. x \<in> s ==> gmeasurable(f x)"
|
|
342 |
"\<And>x y. x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x \<noteq> y \<Longrightarrow> negligible((f x) \<inter> (f y))"
|
|
343 |
shows "(\<Union> (f ` s)) has_gmeasure (setsum (\<lambda>x. gmeasure(f x)) s)"
|
|
344 |
proof- have *:"setsum (\<lambda>x. gmeasure(f x)) s = setsum gmeasure (f ` s)"
|
|
345 |
apply(subst setsum_reindex_nonzero) defer
|
|
346 |
apply(subst gmeasurable_measure_eq_0)
|
|
347 |
proof- case goal2 thus ?case using assms(3)[of x y] by auto
|
|
348 |
qed(insert assms, auto)
|
|
349 |
show ?thesis unfolding * apply(rule has_gmeasure_negligible_unions) using assms by auto
|
|
350 |
qed
|
|
351 |
|
|
352 |
lemma measure_negligible_unions_image: True .. (*
|
|
353 |
"!f:A->real^N->bool s.
|
|
354 |
FINITE s \<and>
|
|
355 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
356 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> negligible((f x) \<inter> (f y)))
|
|
357 |
==> measure(UNIONS (IMAGE f s)) = sum s (\<lambda>x. measure(f x))"
|
|
358 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
359 |
ASM_SIMP_TAC[HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE]);;*)
|
|
360 |
|
|
361 |
lemma has_gmeasure_disjoint_unions_image: True .. (*
|
|
362 |
"!f:A->real^N->bool s.
|
|
363 |
FINITE s \<and>
|
|
364 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
365 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> DISJOINT (f x) (f y))
|
|
366 |
==> (UNIONS (IMAGE f s)) has_gmeasure (sum s (\<lambda>x. measure(f x)))"
|
|
367 |
qed REWRITE_TAC[DISJOINT] THEN REPEAT STRIP_TAC THEN
|
|
368 |
MATCH_MP_TAC HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE THEN
|
|
369 |
ASM_SIMP_TAC[NEGLIGIBLE_EMPTY]);;*)
|
|
370 |
|
|
371 |
lemma measure_disjoint_unions_image: True .. (*
|
|
372 |
"!f:A->real^N->bool s.
|
|
373 |
FINITE s \<and>
|
|
374 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
375 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> DISJOINT (f x) (f y))
|
|
376 |
==> measure(UNIONS (IMAGE f s)) = sum s (\<lambda>x. measure(f x))"
|
|
377 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
378 |
ASM_SIMP_TAC[HAS_GMEASURE_DISJOINT_UNIONS_IMAGE]);;*)
|
|
379 |
|
|
380 |
lemma has_gmeasure_negligible_unions_image_strong: True .. (*
|
|
381 |
"!f:A->real^N->bool s.
|
|
382 |
FINITE {x | x \<in> s \<and> ~(f x = {})} \<and>
|
|
383 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
384 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> negligible((f x) \<inter> (f y)))
|
|
385 |
==> (UNIONS (IMAGE f s)) has_gmeasure (sum s (\<lambda>x. measure(f x)))"
|
|
386 |
qed REPEAT STRIP_TAC THEN
|
|
387 |
MP_TAC(ISPECL [`f:A->real^N->bool`;
|
|
388 |
`{x | x \<in> s \<and> ~((f:A->real^N->bool) x = {})}`]
|
|
389 |
HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE) THEN
|
|
390 |
ASM_SIMP_TAC[IN_ELIM_THM; FINITE_RESTRICT] THEN
|
|
391 |
MATCH_MP_TAC EQ_IMP THEN BINOP_TAC THENL
|
|
392 |
[GEN_REWRITE_TAC I [EXTENSION] THEN
|
|
393 |
REWRITE_TAC[IN_UNIONS; IN_IMAGE; IN_ELIM_THM] THEN
|
|
394 |
MESON_TAC[NOT_IN_EMPTY];
|
|
395 |
CONV_TAC SYM_CONV THEN MATCH_MP_TAC SUM_SUPERSET THEN
|
|
396 |
SIMP_TAC[SUBSET; IN_ELIM_THM; TAUT `a \<and> ~(a \<and> b) \<longleftrightarrow> a \<and> ~b`] THEN
|
|
397 |
REWRITE_TAC[MEASURE_EMPTY]]);; *)
|
|
398 |
|
|
399 |
lemma measure_negligible_unions_image_strong: True .. (*
|
|
400 |
"!f:A->real^N->bool s.
|
|
401 |
FINITE {x | x \<in> s \<and> ~(f x = {})} \<and>
|
|
402 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
403 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> negligible((f x) \<inter> (f y)))
|
|
404 |
==> measure(UNIONS (IMAGE f s)) = sum s (\<lambda>x. measure(f x))"
|
|
405 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
406 |
ASM_SIMP_TAC[HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE_STRONG]);; *)
|
|
407 |
|
|
408 |
lemma has_gmeasure_disjoint_unions_image_strong: True .. (*
|
|
409 |
"!f:A->real^N->bool s.
|
|
410 |
FINITE {x | x \<in> s \<and> ~(f x = {})} \<and>
|
|
411 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
412 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> DISJOINT (f x) (f y))
|
|
413 |
==> (UNIONS (IMAGE f s)) has_gmeasure (sum s (\<lambda>x. measure(f x)))"
|
|
414 |
qed REWRITE_TAC[DISJOINT] THEN REPEAT STRIP_TAC THEN
|
|
415 |
MATCH_MP_TAC HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE_STRONG THEN
|
|
416 |
ASM_SIMP_TAC[NEGLIGIBLE_EMPTY]);; *)
|
|
417 |
|
|
418 |
lemma measure_disjoint_unions_image_strong: True .. (*
|
|
419 |
"!f:A->real^N->bool s.
|
|
420 |
FINITE {x | x \<in> s \<and> ~(f x = {})} \<and>
|
|
421 |
(!x. x \<in> s ==> gmeasurable(f x)) \<and>
|
|
422 |
(!x y. x \<in> s \<and> y \<in> s \<and> ~(x = y) ==> DISJOINT (f x) (f y))
|
|
423 |
==> measure(UNIONS (IMAGE f s)) = sum s (\<lambda>x. measure(f x))"
|
|
424 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
425 |
ASM_SIMP_TAC[HAS_GMEASURE_DISJOINT_UNIONS_IMAGE_STRONG]);; *)
|
|
426 |
|
|
427 |
lemma measure_union: True .. (*
|
|
428 |
"!s t:real^N->bool.
|
|
429 |
gmeasurable s \<and> gmeasurable t
|
|
430 |
==> measure(s \<union> t) = measure(s) + measure(t) - measure(s \<inter> t)"
|
|
431 |
qed REPEAT STRIP_TAC THEN
|
|
432 |
ONCE_REWRITE_TAC[SET_RULE
|
|
433 |
`s \<union> t = (s \<inter> t) \<union> (s DIFF t) \<union> (t DIFF s)`] THEN
|
|
434 |
ONCE_REWRITE_TAC[REAL_ARITH `a + b - c = c + (a - c) + (b - c)`] THEN
|
|
435 |
MP_TAC(ISPECL [`s DIFF t:real^N->bool`; `t DIFF s:real^N->bool`]
|
|
436 |
MEASURE_DISJOINT_UNION) THEN
|
|
437 |
ASM_SIMP_TAC[MEASURABLE_DIFF] THEN
|
|
438 |
ANTS_TAC THENL [SET_TAC[]; ALL_TAC] THEN
|
|
439 |
MP_TAC(ISPECL [`s \<inter> t:real^N->bool`;
|
|
440 |
`(s DIFF t) \<union> (t DIFF s):real^N->bool`]
|
|
441 |
MEASURE_DISJOINT_UNION) THEN
|
|
442 |
ASM_SIMP_TAC[MEASURABLE_DIFF; GMEASURABLE_UNION; GMEASURABLE_INTER] THEN
|
|
443 |
ANTS_TAC THENL [SET_TAC[]; ALL_TAC] THEN
|
|
444 |
REPEAT(DISCH_THEN SUBST1_TAC) THEN AP_TERM_TAC THEN BINOP_TAC THEN
|
|
445 |
REWRITE_TAC[REAL_EQ_SUB_LADD] THEN MATCH_MP_TAC EQ_TRANS THENL
|
|
446 |
[EXISTS_TAC `measure((s DIFF t) \<union> (s \<inter> t):real^N->bool)`;
|
|
447 |
EXISTS_TAC `measure((t DIFF s) \<union> (s \<inter> t):real^N->bool)`] THEN
|
|
448 |
(CONJ_TAC THENL
|
|
449 |
[CONV_TAC SYM_CONV THEN MATCH_MP_TAC MEASURE_DISJOINT_UNION THEN
|
|
450 |
ASM_SIMP_TAC[MEASURABLE_DIFF; GMEASURABLE_INTER];
|
|
451 |
AP_TERM_TAC] THEN
|
|
452 |
SET_TAC[]));; *)
|
|
453 |
|
|
454 |
lemma measure_union_le: True .. (*
|
|
455 |
"!s t:real^N->bool.
|
|
456 |
gmeasurable s \<and> gmeasurable t
|
|
457 |
==> measure(s \<union> t) <= gmeasure s + gmeasure t"
|
|
458 |
qed REPEAT STRIP_TAC THEN ASM_SIMP_TAC[MEASURE_UNION] THEN
|
|
459 |
REWRITE_TAC[REAL_ARITH `a + b - c <= a + b \<longleftrightarrow> 0 <= c`] THEN
|
|
460 |
MATCH_MP_TAC MEASURE_POS_LE THEN ASM_SIMP_TAC[MEASURABLE_INTER]);; *)
|
|
461 |
|
|
462 |
lemma measure_unions_le: True .. (*
|
|
463 |
"!f:(real^N->bool)->bool.
|
|
464 |
FINITE f \<and> (!s. s \<in> f ==> gmeasurable s)
|
|
465 |
==> measure(UNIONS f) <= sum f (\<lambda>s. gmeasure s)"
|
|
466 |
qed REWRITE_TAC[IMP_CONJ] THEN
|
|
467 |
MATCH_MP_TAC FINITE_INDUCT_STRONG THEN
|
|
468 |
SIMP_TAC[UNIONS_0; UNIONS_INSERT; SUM_CLAUSES] THEN
|
|
469 |
REWRITE_TAC[MEASURE_EMPTY; REAL_LE_REFL] THEN
|
|
470 |
MAP_EVERY X_GEN_TAC [`s:real^N->bool`; `f:(real^N->bool)->bool`] THEN
|
|
471 |
REWRITE_TAC[IN_INSERT] THEN REPEAT STRIP_TAC THEN
|
|
472 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
473 |
EXISTS_TAC `measure(s:real^N->bool) + measure(UNIONS f:real^N->bool)` THEN
|
|
474 |
ASM_SIMP_TAC[MEASURE_UNION_LE; GMEASURABLE_UNIONS] THEN
|
|
475 |
REWRITE_TAC[REAL_LE_LADD] THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
|
|
476 |
ASM_SIMP_TAC[]);; *)
|
|
477 |
|
|
478 |
lemma measure_unions_le_image: True .. (*
|
|
479 |
"!f:A->bool s:A->(real^N->bool).
|
|
480 |
FINITE f \<and> (!a. a \<in> f ==> gmeasurable(s a))
|
|
481 |
==> measure(UNIONS (IMAGE s f)) <= sum f (\<lambda>a. measure(s a))"
|
|
482 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
483 |
EXISTS_TAC `sum (IMAGE s (f:A->bool)) (\<lambda>k:real^N->bool. gmeasure k)` THEN
|
|
484 |
ASM_SIMP_TAC[MEASURE_UNIONS_LE; FORALL_IN_IMAGE; FINITE_IMAGE] THEN
|
|
485 |
GEN_REWRITE_TAC (RAND_CONV o RAND_CONV) [GSYM o_DEF] THEN
|
|
486 |
REWRITE_TAC[ETA_AX] THEN MATCH_MP_TAC SUM_IMAGE_LE THEN
|
|
487 |
ASM_SIMP_TAC[MEASURE_POS_LE]);; *)
|
|
488 |
|
|
489 |
lemma gmeasurable_inner_outer: True .. (*
|
|
490 |
"!s:real^N->bool.
|
|
491 |
gmeasurable s \<longleftrightarrow>
|
|
492 |
!e. 0 < e
|
|
493 |
==> ?t u. t \<subseteq> s \<and> s \<subseteq> u \<and>
|
|
494 |
gmeasurable t \<and> gmeasurable u \<and>
|
|
495 |
abs(measure t - gmeasure u) < e"
|
|
496 |
qed GEN_TAC THEN EQ_TAC THEN DISCH_TAC THENL
|
|
497 |
[GEN_TAC THEN DISCH_TAC THEN REPEAT(EXISTS_TAC `s:real^N->bool`) THEN
|
|
498 |
ASM_REWRITE_TAC[SUBSET_REFL; REAL_SUB_REFL; REAL_ABS_NUM];
|
|
499 |
ALL_TAC] THEN
|
|
500 |
REWRITE_TAC[MEASURABLE_INTEGRABLE] THEN MATCH_MP_TAC INTEGRABLE_STRADDLE THEN
|
|
501 |
X_GEN_TAC `e:real` THEN DISCH_TAC THEN
|
|
502 |
FIRST_X_ASSUM(MP_TAC o SPEC `e:real`) THEN
|
|
503 |
ASM_REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
|
|
504 |
MAP_EVERY X_GEN_TAC [`t:real^N->bool`; `u:real^N->bool`] THEN STRIP_TAC THEN
|
|
505 |
MAP_EVERY EXISTS_TAC
|
|
506 |
[`(\<lambda>x. if x \<in> t then 1 else 0):real^N->real^1`;
|
|
507 |
`(\<lambda>x. if x \<in> u then 1 else 0):real^N->real^1`;
|
|
508 |
`lift(measure(t:real^N->bool))`;
|
|
509 |
`lift(measure(u:real^N->bool))`] THEN
|
|
510 |
ASM_REWRITE_TAC[GSYM HAS_GMEASURE; GSYM HAS_GMEASURE_MEASURE] THEN
|
|
511 |
ASM_REWRITE_TAC[GSYM LIFT_SUB; NORM_LIFT] THEN REPEAT STRIP_TAC THEN
|
|
512 |
REPEAT(COND_CASES_TAC THEN
|
|
513 |
ASM_REWRITE_TAC[_VEC; REAL_POS; REAL_LE_REFL]) THEN
|
|
514 |
ASM SET_TAC[]);; *)
|
|
515 |
|
|
516 |
lemma has_gmeasure_inner_outer: True .. (*
|
|
517 |
"!s:real^N->bool m.
|
|
518 |
s has_gmeasure m \<longleftrightarrow>
|
|
519 |
(!e. 0 < e ==> ?t. t \<subseteq> s \<and> gmeasurable t \<and>
|
|
520 |
m - e < gmeasure t) \<and>
|
|
521 |
(!e. 0 < e ==> ?u. s \<subseteq> u \<and> gmeasurable u \<and>
|
|
522 |
gmeasure u < m + e)"
|
|
523 |
qed REPEAT GEN_TAC THEN
|
|
524 |
GEN_REWRITE_TAC LAND_CONV [HAS_GMEASURE_MEASURABLE_MEASURE] THEN EQ_TAC THENL
|
|
525 |
[REPEAT STRIP_TAC THEN EXISTS_TAC `s:real^N->bool` THEN
|
|
526 |
ASM_REWRITE_TAC[SUBSET_REFL] THEN ASM_REAL_ARITH_TAC;
|
|
527 |
ALL_TAC] THEN
|
|
528 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "t") (LABEL_TAC "u")) THEN
|
|
529 |
MATCH_MP_TAC(TAUT `a \<and> (a ==> b) ==> a \<and> b`) THEN CONJ_TAC THENL
|
|
530 |
[GEN_REWRITE_TAC I [MEASURABLE_INNER_OUTER] THEN
|
|
531 |
X_GEN_TAC `e:real` THEN DISCH_TAC THEN
|
|
532 |
REMOVE_THEN "u" (MP_TAC o SPEC `e / 2`) THEN
|
|
533 |
REMOVE_THEN "t" (MP_TAC o SPEC `e / 2`) THEN
|
|
534 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_OF_NUM_LT; ARITH] THEN
|
|
535 |
REWRITE_TAC[IMP_IMP; LEFT_AND_EXISTS_THM] THEN
|
|
536 |
REWRITE_TAC[RIGHT_AND_EXISTS_THM] THEN
|
|
537 |
REPEAT(MATCH_MP_TAC MONO_EXISTS THEN GEN_TAC) THEN
|
|
538 |
STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC(REAL_ARITH
|
|
539 |
`0 < e \<and> t <= u \<and> m - e / 2 < t \<and> u < m + e / 2
|
|
540 |
==> abs(t - u) < e`) THEN
|
|
541 |
ASM_REWRITE_TAC[] THEN MATCH_MP_TAC MEASURE_SUBSET THEN
|
|
542 |
ASM_REWRITE_TAC[] THEN ASM SET_TAC[];
|
|
543 |
DISCH_TAC THEN MATCH_MP_TAC(REAL_ARITH
|
|
544 |
`~(0 < x - y) \<and> ~(0 < y - x) ==> x = y`) THEN
|
|
545 |
CONJ_TAC THEN DISCH_TAC THENL
|
|
546 |
[REMOVE_THEN "u" (MP_TAC o SPEC `measure(s:real^N->bool) - m`) THEN
|
|
547 |
ASM_REWRITE_TAC[REAL_SUB_ADD2; GSYM REAL_NOT_LE];
|
|
548 |
REMOVE_THEN "t" (MP_TAC o SPEC `m - measure(s:real^N->bool)`) THEN
|
|
549 |
ASM_REWRITE_TAC[REAL_SUB_SUB2; GSYM REAL_NOT_LE]] THEN
|
|
550 |
ASM_MESON_TAC[MEASURE_SUBSET]]);; *)
|
|
551 |
|
|
552 |
lemma has_gmeasure_inner_outer_le: True .. (*
|
|
553 |
"!s:real^N->bool m.
|
|
554 |
s has_gmeasure m \<longleftrightarrow>
|
|
555 |
(!e. 0 < e ==> ?t. t \<subseteq> s \<and> gmeasurable t \<and>
|
|
556 |
m - e <= gmeasure t) \<and>
|
|
557 |
(!e. 0 < e ==> ?u. s \<subseteq> u \<and> gmeasurable u \<and>
|
|
558 |
gmeasure u <= m + e)"
|
|
559 |
qed REWRITE_TAC[HAS_GMEASURE_INNER_OUTER] THEN
|
|
560 |
MESON_TAC[REAL_ARITH `0 < e \<and> m - e / 2 <= t ==> m - e < t`;
|
|
561 |
REAL_ARITH `0 < e \<and> u <= m + e / 2 ==> u < m + e`;
|
|
562 |
REAL_ARITH `0 < e \<longleftrightarrow> 0 < e / 2`; REAL_LT_IMP_LE]);; *)
|
|
563 |
|
|
564 |
lemma has_gmeasure_limit: True .. (*
|
|
565 |
"!s. s has_gmeasure m \<longleftrightarrow>
|
|
566 |
!e. 0 < e
|
|
567 |
==> ?B. 0 < B \<and>
|
|
568 |
!a b. ball(0,B) \<subseteq> {a..b}
|
|
569 |
==> ?z. (s \<inter> {a..b}) has_gmeasure z \<and>
|
|
570 |
abs(z - m) < e"
|
|
571 |
qed GEN_TAC THEN REWRITE_TAC[HAS_GMEASURE] THEN
|
|
572 |
GEN_REWRITE_TAC LAND_CONV [HAS_INTEGRAL] THEN
|
|
573 |
REWRITE_TAC[IN_UNIV] THEN
|
|
574 |
GEN_REWRITE_TAC (LAND_CONV o ONCE_DEPTH_CONV)
|
|
575 |
[GSYM HAS_INTEGRAL_RESTRICT_UNIV] THEN
|
|
576 |
REWRITE_TAC[MESON[IN_INTER]
|
|
577 |
`(if x \<in> k \<inter> s then a else b) =
|
|
578 |
(if x \<in> s then if x \<in> k then a else b else b)`] THEN
|
|
579 |
REWRITE_TAC[EXISTS_LIFT; GSYM LIFT_SUB; NORM_LIFT]);; *)
|
|
580 |
|
|
581 |
(* ------------------------------------------------------------------------- *)
|
|
582 |
(* properties of gmeasure under simple affine transformations. *)
|
|
583 |
(* ------------------------------------------------------------------------- *)
|
|
584 |
|
|
585 |
lemma has_gmeasure_affinity: True .. (*
|
|
586 |
"!s m c y. s has_gmeasure y
|
|
587 |
==> (IMAGE (\<lambda>x:real^N. m % x + c) s)
|
|
588 |
has_gmeasure abs(m) pow (dimindex(:N)) * y"
|
|
589 |
qed REPEAT GEN_TAC THEN ASM_CASES_TAC `m = 0` THENL
|
|
590 |
[ASM_REWRITE_TAC[REAL_ABS_NUM; VECTOR_ADD_LID; VECTOR_MUL_LZERO] THEN
|
|
591 |
ONCE_REWRITE_TAC[MATCH_MP (ARITH_RULE `~(x = 0) ==> x = SUC(x - 1)`)
|
|
592 |
(SPEC_ALL DIMINDEX_NONZERO)] THEN DISCH_TAC THEN
|
|
593 |
REWRITE_TAC[real_pow; REAL_MUL_LZERO; HAS_GMEASURE_0] THEN
|
|
594 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `{c:real^N}` THEN
|
|
595 |
SIMP_TAC[NEGLIGIBLE_FINITE; FINITE_RULES] THEN SET_TAC[];
|
|
596 |
ALL_TAC] THEN
|
|
597 |
REWRITE_TAC[HAS_GMEASURE] THEN
|
|
598 |
ONCE_REWRITE_TAC[HAS_INTEGRAL] THEN REWRITE_TAC[IN_UNIV] THEN
|
|
599 |
DISCH_TAC THEN X_GEN_TAC `e:real` THEN DISCH_TAC THEN
|
|
600 |
FIRST_X_ASSUM(MP_TAC o SPEC `e:real / abs(m) pow dimindex(:N)`) THEN
|
|
601 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_POW_LT; GSYM REAL_ABS_NZ; REAL_POW_LT] THEN
|
|
602 |
DISCH_THEN(X_CHOOSE_THEN `B:real` STRIP_ASSUME_TAC) THEN
|
|
603 |
EXISTS_TAC `abs(m) * B + norm(c:real^N)` THEN
|
|
604 |
ASM_SIMP_TAC[REAL_ARITH `0 < B \<and> 0 <= x ==> 0 < B + x`;
|
|
605 |
NORM_POS_LE; REAL_LT_MUL; GSYM REAL_ABS_NZ; REAL_POW_LT] THEN
|
|
606 |
MAP_EVERY X_GEN_TAC [`u:real^N`; `v:real^N`] THEN DISCH_TAC THEN
|
|
607 |
REWRITE_TAC[IN_IMAGE] THEN
|
|
608 |
ASM_SIMP_TAC[VECTOR_EQ_AFFINITY; UNWIND_THM1] THEN
|
|
609 |
FIRST_X_ASSUM(MP_TAC o SPECL
|
|
610 |
[`if 0 <= m then inv m % u + --(inv m % c):real^N
|
|
611 |
else inv m % v + --(inv m % c)`;
|
|
612 |
`if 0 <= m then inv m % v + --(inv m % c):real^N
|
|
613 |
else inv m % u + --(inv m % c)`]) THEN
|
|
614 |
MATCH_MP_TAC(TAUT `a \<and> (a ==> b ==> c) ==> (a ==> b) ==> c`) THEN
|
|
615 |
CONJ_TAC THENL
|
|
616 |
[REWRITE_TAC[SUBSET] THEN X_GEN_TAC `x:real^N` THEN
|
|
617 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [SUBSET]) THEN
|
|
618 |
DISCH_THEN(MP_TAC o SPEC `m % x + c:real^N`) THEN
|
|
619 |
MATCH_MP_TAC MONO_IMP THEN REWRITE_TAC[IN_BALL; IN_INTERVAL] THEN
|
|
620 |
CONJ_TAC THENL
|
|
621 |
[REWRITE_TAC[NORM_ARITH `dist(0,x) = norm(x:real^N)`] THEN
|
|
622 |
DISCH_TAC THEN MATCH_MP_TAC(NORM_ARITH
|
|
623 |
`norm(x:real^N) < a ==> norm(x + y) < a + norm(y)`) THEN
|
|
624 |
ASM_SIMP_TAC[NORM_MUL; REAL_LT_LMUL; GSYM REAL_ABS_NZ];
|
|
625 |
ALL_TAC] THEN
|
|
626 |
SIMP_TAC[VECTOR_ADD_COMPONENT; VECTOR_MUL_COMPONENT; VECTOR_NEG_COMPONENT;
|
|
627 |
COND_COMPONENT] THEN
|
|
628 |
MATCH_MP_TAC MONO_FORALL THEN GEN_TAC THEN MATCH_MP_TAC MONO_IMP THEN
|
|
629 |
REWRITE_TAC[REAL_ARITH `m * u + --(m * c):real = (u - c) * m`] THEN
|
|
630 |
SUBST1_TAC(REAL_ARITH
|
|
631 |
`inv(m) = if 0 <= inv(m) then abs(inv m) else --(abs(inv m))`) THEN
|
|
632 |
SIMP_TAC[REAL_LE_INV_EQ] THEN
|
|
633 |
REWRITE_TAC[REAL_ARITH `(x - y:real) * --z = (y - x) * z`] THEN
|
|
634 |
REWRITE_TAC[REAL_ABS_INV; GSYM real_div] THEN COND_CASES_TAC THEN
|
|
635 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LE_RDIV_EQ; GSYM REAL_ABS_NZ] THEN
|
|
636 |
ASM_REWRITE_TAC[real_abs] THEN REAL_ARITH_TAC;
|
|
637 |
ALL_TAC] THEN
|
|
638 |
REWRITE_TAC[SUBSET] THEN DISCH_THEN(MP_TAC o SPEC `0:real^N`) THEN
|
|
639 |
ASM_REWRITE_TAC[CENTRE_IN_BALL] THEN DISCH_TAC THEN
|
|
640 |
DISCH_THEN(X_CHOOSE_THEN `z:real^1`
|
|
641 |
(fun th -> EXISTS_TAC `(abs m pow dimindex (:N)) % z:real^1` THEN
|
|
642 |
MP_TAC th)) THEN
|
|
643 |
DISCH_THEN(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC) THEN
|
|
644 |
FIRST_ASSUM(MP_TAC o MATCH_MP(REAL_FIELD `~(x = 0) ==> ~(inv x = 0)`)) THEN
|
|
645 |
REWRITE_TAC[TAUT `a ==> b ==> c \<longleftrightarrow> b \<and> a ==> c`] THEN
|
|
646 |
DISCH_THEN(MP_TAC o SPEC `--(inv m % c):real^N` o
|
|
647 |
MATCH_MP HAS_INTEGRAL_AFFINITY) THEN
|
|
648 |
ASM_REWRITE_TAC[IMAGE_AFFINITY_INTERVAL; REAL_INV_INV] THEN
|
|
649 |
SIMP_TAC[COND_ID] THEN COND_CASES_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
|
|
650 |
REWRITE_TAC[VECTOR_ADD_LDISTRIB; VECTOR_MUL_ASSOC;
|
|
651 |
VECTOR_MUL_LNEG; VECTOR_MUL_RNEG] THEN
|
|
652 |
ASM_SIMP_TAC[REAL_MUL_RINV; VECTOR_MUL_LID; VECTOR_NEG_NEG] THEN
|
|
653 |
REWRITE_TAC[VECTOR_ARITH `(u + --c) + c:real^N = u`] THEN
|
|
654 |
REWRITE_TAC[REAL_ABS_INV; REAL_INV_INV; GSYM REAL_POW_INV] THEN
|
|
655 |
DISCH_THEN(fun th -> REWRITE_TAC[th]) THEN
|
|
656 |
REWRITE_TAC[LIFT_CMUL; GSYM VECTOR_SUB_LDISTRIB] THEN
|
|
657 |
REWRITE_TAC[NORM_MUL; REAL_ABS_POW; REAL_ABS_ABS] THEN
|
|
658 |
ONCE_REWRITE_TAC[REAL_MUL_SYM] THEN
|
|
659 |
ASM_SIMP_TAC[GSYM REAL_LT_RDIV_EQ; REAL_POW_LT; GSYM REAL_ABS_NZ]);; *)
|
|
660 |
|
|
661 |
lemma stretch_galois: True .. (*
|
|
662 |
"!x:real^N y:real^N m.
|
|
663 |
(!k. 1 <= k \<and> k <= dimindex(:N) ==> ~(m k = 0))
|
|
664 |
==> ((y = (lambda k. m k * x$k)) \<longleftrightarrow> (lambda k. inv(m k) * y$k) = x)"
|
|
665 |
qed REPEAT GEN_TAC THEN SIMP_TAC[CART_EQ; LAMBDA_BETA] THEN
|
|
666 |
MATCH_MP_TAC(MESON[]
|
|
667 |
`(!x. p x ==> (q x \<longleftrightarrow> r x))
|
|
668 |
==> (!x. p x) ==> ((!x. q x) \<longleftrightarrow> (!x. r x))`) THEN
|
|
669 |
GEN_TAC THEN ASM_CASES_TAC `1 <= k \<and> k <= dimindex(:N)` THEN
|
|
670 |
ASM_REWRITE_TAC[] THEN CONV_TAC REAL_FIELD);; *)
|
|
671 |
|
|
672 |
lemma has_gmeasure_stretch: True .. (*
|
|
673 |
"!s m y. s has_gmeasure y
|
|
674 |
==> (IMAGE (\<lambda>x:real^N. lambda k. m k * x$k) s :real^N->bool)
|
|
675 |
has_gmeasure abs(product (1..dimindex(:N)) m) * y"
|
|
676 |
qed REPEAT STRIP_TAC THEN ASM_CASES_TAC
|
|
677 |
`!k. 1 <= k \<and> k <= dimindex(:N) ==> ~(m k = 0)`
|
|
678 |
THENL
|
|
679 |
[ALL_TAC;
|
|
680 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [NOT_FORALL_THM]) THEN
|
|
681 |
REWRITE_TAC[NOT_IMP; GSYM CONJ_ASSOC; LEFT_IMP_EXISTS_THM] THEN
|
|
682 |
X_GEN_TAC `k:num` THEN STRIP_TAC THEN
|
|
683 |
SUBGOAL_THEN `product(1..dimindex (:N)) m = 0` SUBST1_TAC THENL
|
|
684 |
[ASM_MESON_TAC[PRODUCT_EQ_0_NUMSEG]; ALL_TAC] THEN
|
|
685 |
REWRITE_TAC[REAL_ABS_NUM; REAL_MUL_LZERO; HAS_GMEASURE_0] THEN
|
|
686 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
687 |
EXISTS_TAC `{x:real^N | x$k = 0}` THEN
|
|
688 |
ASM_SIMP_TAC[NEGLIGIBLE_STANDARD_HYPERPLANE; SUBSET; FORALL_IN_IMAGE] THEN
|
|
689 |
ASM_SIMP_TAC[IN_ELIM_THM; LAMBDA_BETA; REAL_MUL_LZERO]] THEN
|
|
690 |
UNDISCH_TAC `(s:real^N->bool) has_gmeasure y` THEN
|
|
691 |
REWRITE_TAC[HAS_GMEASURE] THEN
|
|
692 |
ONCE_REWRITE_TAC[HAS_INTEGRAL] THEN REWRITE_TAC[IN_UNIV] THEN
|
|
693 |
DISCH_TAC THEN X_GEN_TAC `e:real` THEN DISCH_TAC THEN
|
|
694 |
SUBGOAL_THEN `0 < abs(product(1..dimindex(:N)) m)` ASSUME_TAC THENL
|
|
695 |
[ASM_MESON_TAC[REAL_ABS_NZ; REAL_LT_DIV; PRODUCT_EQ_0_NUMSEG];
|
|
696 |
ALL_TAC] THEN
|
|
697 |
FIRST_X_ASSUM(MP_TAC o SPEC `e:real / abs(product(1..dimindex(:N)) m)`) THEN
|
|
698 |
ASM_SIMP_TAC[REAL_LT_DIV] THEN
|
|
699 |
DISCH_THEN(X_CHOOSE_THEN `B:real` STRIP_ASSUME_TAC) THEN
|
|
700 |
EXISTS_TAC `sup(IMAGE (\<lambda>k. abs(m k) * B) (1..dimindex(:N)))` THEN
|
|
701 |
MATCH_MP_TAC(TAUT `a \<and> (a ==> b) ==> a \<and> b`) THEN CONJ_TAC THENL
|
|
702 |
[ASM_SIMP_TAC[REAL_LT_SUP_FINITE; FINITE_IMAGE; NUMSEG_EMPTY; FINITE_NUMSEG;
|
|
703 |
IN_NUMSEG; GSYM NOT_LE; DIMINDEX_GE_1; IMAGE_EQ_EMPTY;
|
|
704 |
EXISTS_IN_IMAGE] THEN
|
|
705 |
ASM_MESON_TAC[IN_NUMSEG; DIMINDEX_GE_1; LE_REFL; REAL_LT_MUL; REAL_ABS_NZ];
|
|
706 |
DISCH_TAC] THEN
|
|
707 |
MAP_EVERY X_GEN_TAC [`u:real^N`; `v:real^N`] THEN DISCH_TAC THEN
|
|
708 |
ASM_SIMP_TAC[IN_IMAGE; STRETCH_GALOIS; UNWIND_THM1] THEN
|
|
709 |
FIRST_X_ASSUM(MP_TAC o SPECL
|
|
710 |
[`(lambda k. min (inv(m k) * (u:real^N)$k)
|
|
711 |
(inv(m k) * (v:real^N)$k)):real^N`;
|
|
712 |
`(lambda k. max (inv(m k) * (u:real^N)$k)
|
|
713 |
(inv(m k) * (v:real^N)$k)):real^N`]) THEN
|
|
714 |
MATCH_MP_TAC(TAUT `a \<and> (b ==> a ==> c) ==> (a ==> b) ==> c`) THEN
|
|
715 |
CONJ_TAC THENL
|
|
716 |
[ALL_TAC;
|
|
717 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN X_GEN_TAC `z:real^1` THEN
|
|
718 |
DISCH_THEN(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC) THEN
|
|
719 |
SUBGOAL_THEN `!k. 1 <= k \<and> k <= dimindex (:N) ==> ~(inv(m k) = 0)`
|
|
720 |
MP_TAC THENL [ASM_SIMP_TAC[REAL_INV_EQ_0]; ALL_TAC] THEN
|
|
721 |
ONCE_REWRITE_TAC[GSYM IMP_CONJ_ALT] THEN
|
|
722 |
DISCH_THEN(MP_TAC o MATCH_MP HAS_INTEGRAL_STRETCH)] THEN
|
|
723 |
(MP_TAC(ISPECL [`u:real^N`; `v:real^N`; `\i:num. inv(m i)`]
|
|
724 |
IMAGE_STRETCH_INTERVAL) THEN
|
|
725 |
SUBGOAL_THEN `~(interval[u:real^N,v] = {})` ASSUME_TAC THENL
|
|
726 |
[FIRST_ASSUM(MATCH_MP_TAC o MATCH_MP (SET_RULE
|
|
727 |
`s \<subseteq> t ==> ~(s = {}) ==> ~(t = {})`)) THEN
|
|
728 |
ASM_REWRITE_TAC[BALL_EQ_EMPTY; GSYM REAL_NOT_LT];
|
|
729 |
ALL_TAC] THEN
|
|
730 |
ASM_REWRITE_TAC[] THEN DISCH_THEN(SUBST1_TAC o SYM))
|
|
731 |
THENL
|
|
732 |
[FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP (SET_RULE
|
|
733 |
`b \<subseteq> s ==> b' \<subseteq> IMAGE f b ==> b' \<subseteq> IMAGE f s`)) THEN
|
|
734 |
REWRITE_TAC[IN_BALL; SUBSET; NORM_ARITH `dist(0,x) = norm x`;
|
|
735 |
IN_IMAGE] THEN
|
|
736 |
ASM_SIMP_TAC[STRETCH_GALOIS; REAL_INV_EQ_0; UNWIND_THM1; REAL_INV_INV] THEN
|
|
737 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
|
|
738 |
MATCH_MP_TAC REAL_LET_TRANS THEN
|
|
739 |
EXISTS_TAC
|
|
740 |
`norm(sup(IMAGE(\<lambda>k. abs(m k)) (1..dimindex(:N))) % x:real^N)` THEN
|
|
741 |
CONJ_TAC THENL
|
|
742 |
[MATCH_MP_TAC NORM_LE_COMPONENTWISE THEN
|
|
743 |
SIMP_TAC[LAMBDA_BETA; VECTOR_MUL_COMPONENT; REAL_ABS_MUL] THEN
|
|
744 |
REPEAT STRIP_TAC THEN MATCH_MP_TAC REAL_LE_RMUL THEN
|
|
745 |
REWRITE_TAC[REAL_ABS_POS] THEN
|
|
746 |
MATCH_MP_TAC(REAL_ARITH `x <= y ==> x <= abs y`) THEN
|
|
747 |
ASM_SIMP_TAC[REAL_LE_SUP_FINITE; FINITE_IMAGE; IMAGE_EQ_EMPTY;
|
|
748 |
NUMSEG_EMPTY; FINITE_NUMSEG; GSYM NOT_LE; DIMINDEX_GE_1] THEN
|
|
749 |
REWRITE_TAC[EXISTS_IN_IMAGE; IN_NUMSEG] THEN ASM_MESON_TAC[REAL_LE_REFL];
|
|
750 |
ALL_TAC] THEN
|
|
751 |
REWRITE_TAC[NORM_MUL] THEN MATCH_MP_TAC REAL_LTE_TRANS THEN
|
|
752 |
EXISTS_TAC `abs(sup(IMAGE(\<lambda>k. abs(m k)) (1..dimindex(:N)))) * B` THEN
|
|
753 |
SUBGOAL_THEN `0 < sup(IMAGE(\<lambda>k. abs(m k)) (1..dimindex(:N)))`
|
|
754 |
ASSUME_TAC THENL
|
|
755 |
[ASM_SIMP_TAC[REAL_LT_SUP_FINITE; FINITE_IMAGE; IMAGE_EQ_EMPTY;
|
|
756 |
NUMSEG_EMPTY; FINITE_NUMSEG; GSYM NOT_LE; DIMINDEX_GE_1] THEN
|
|
757 |
REWRITE_TAC[EXISTS_IN_IMAGE; GSYM REAL_ABS_NZ; IN_NUMSEG] THEN
|
|
758 |
ASM_MESON_TAC[DIMINDEX_GE_1; LE_REFL];
|
|
759 |
ALL_TAC] THEN
|
|
760 |
ASM_SIMP_TAC[REAL_LT_LMUL_EQ; REAL_ARITH `0 < x ==> 0 < abs x`] THEN
|
|
761 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
762 |
EXISTS_TAC `sup(IMAGE(\<lambda>k. abs(m k)) (1..dimindex(:N))) * B` THEN
|
|
763 |
ASM_SIMP_TAC[REAL_LE_RMUL_EQ; REAL_ARITH `0 < x ==> abs x <= x`] THEN
|
|
764 |
ASM_SIMP_TAC[REAL_LE_SUP_FINITE; FINITE_IMAGE; IMAGE_EQ_EMPTY;
|
|
765 |
NUMSEG_EMPTY; FINITE_NUMSEG; GSYM NOT_LE; DIMINDEX_GE_1] THEN
|
|
766 |
ASM_SIMP_TAC[EXISTS_IN_IMAGE; REAL_LE_RMUL_EQ] THEN
|
|
767 |
ASM_SIMP_TAC[REAL_SUP_LE_FINITE; FINITE_IMAGE; IMAGE_EQ_EMPTY;
|
|
768 |
NUMSEG_EMPTY; FINITE_NUMSEG; GSYM NOT_LE; DIMINDEX_GE_1] THEN
|
|
769 |
MP_TAC(ISPEC `IMAGE (\<lambda>k. abs (m k)) (1..dimindex(:N))` SUP_FINITE) THEN
|
|
770 |
REWRITE_TAC[FORALL_IN_IMAGE] THEN
|
|
771 |
ASM_SIMP_TAC[FINITE_IMAGE; FINITE_NUMSEG; IMAGE_EQ_EMPTY; NUMSEG_EMPTY;
|
|
772 |
GSYM NOT_LE; DIMINDEX_GE_1] THEN
|
|
773 |
REWRITE_TAC[IN_IMAGE] THEN MESON_TAC[];
|
|
774 |
|
|
775 |
MATCH_MP_TAC(MESON[]
|
|
776 |
`s = t \<and> P z ==> (f has_integral z) s ==> Q
|
|
777 |
==> ?w. (f has_integral w) t \<and> P w`) THEN
|
|
778 |
SIMP_TAC[GSYM PRODUCT_INV; FINITE_NUMSEG; GSYM REAL_ABS_INV] THEN
|
|
779 |
REWRITE_TAC[REAL_INV_INV] THEN CONJ_TAC THENL
|
|
780 |
[REWRITE_TAC[GSYM IMAGE_o] THEN MATCH_MP_TAC(SET_RULE
|
|
781 |
`(!x. f x = x) ==> IMAGE f s = s`) THEN
|
|
782 |
SIMP_TAC[o_THM; LAMBDA_BETA; CART_EQ] THEN
|
|
783 |
ASM_SIMP_TAC[REAL_MUL_ASSOC; REAL_MUL_RINV; REAL_MUL_LID];
|
|
784 |
REWRITE_TAC[ABS_; _SUB; LIFT_; _CMUL] THEN
|
|
785 |
REWRITE_TAC[GSYM REAL_SUB_LDISTRIB; ETA_AX] THEN
|
|
786 |
REWRITE_TAC[REAL_ABS_MUL; REAL_ABS_ABS] THEN
|
|
787 |
ONCE_REWRITE_TAC[REAL_MUL_SYM] THEN
|
|
788 |
ASM_SIMP_TAC[GSYM REAL_LT_RDIV_EQ] THEN
|
|
789 |
ASM_MESON_TAC[ABS_; _SUB; LIFT_]]]);; *)
|
|
790 |
|
|
791 |
lemma has_gmeasure_translation: True .. (*
|
|
792 |
"!s m a. s has_gmeasure m ==> (IMAGE (\<lambda>x:real^N. a + x) s) has_gmeasure m"
|
|
793 |
qed REPEAT GEN_TAC THEN
|
|
794 |
MP_TAC(ISPECL [`s:real^N->bool`; `1`; `a:real^N`; `m:real`]
|
|
795 |
HAS_GMEASURE_AFFINITY) THEN
|
|
796 |
REWRITE_TAC[VECTOR_MUL_LID; REAL_ABS_NUM; REAL_POW_ONE; REAL_MUL_LID] THEN
|
|
797 |
REWRITE_TAC[VECTOR_ADD_SYM]);; *)
|
|
798 |
|
|
799 |
lemma negligible_translation: True .. (*
|
|
800 |
"!s a. negligible s ==> negligible (IMAGE (\<lambda>x:real^N. a + x) s)"
|
|
801 |
qed SIMP_TAC[GSYM HAS_GMEASURE_0; HAS_GMEASURE_TRANSLATION]);; *)
|
|
802 |
|
|
803 |
lemma has_gmeasure_translation_eq: True .. (*
|
|
804 |
"!s m. (IMAGE (\<lambda>x:real^N. a + x) s) has_gmeasure m \<longleftrightarrow> s has_gmeasure m"
|
|
805 |
qed REPEAT GEN_TAC THEN EQ_TAC THEN REWRITE_TAC[HAS_GMEASURE_TRANSLATION] THEN
|
|
806 |
DISCH_THEN(MP_TAC o SPEC `--a:real^N` o
|
|
807 |
MATCH_MP HAS_GMEASURE_TRANSLATION) THEN
|
|
808 |
MATCH_MP_TAC EQ_IMP THEN AP_THM_TAC THEN AP_TERM_TAC THEN
|
|
809 |
REWRITE_TAC[GSYM IMAGE_o; o_DEF; VECTOR_ARITH `--a + a + b:real^N = b`] THEN
|
|
810 |
SET_TAC[]);; *)
|
|
811 |
|
|
812 |
lemma negligible_translation_rev: True .. (*
|
|
813 |
"!s a. negligible (IMAGE (\<lambda>x:real^N. a + x) s) ==> negligible s"
|
|
814 |
qed SIMP_TAC[GSYM HAS_GMEASURE_0; HAS_GMEASURE_TRANSLATION_EQ]);; *)
|
|
815 |
|
|
816 |
lemma negligible_translation_eq: True .. (*
|
|
817 |
"!s a. negligible (IMAGE (\<lambda>x:real^N. a + x) s) \<longleftrightarrow> negligible s"
|
|
818 |
qed SIMP_TAC[GSYM HAS_GMEASURE_0; HAS_GMEASURE_TRANSLATION_EQ]);; *)
|
|
819 |
|
|
820 |
lemma gmeasurable_translation: True .. (*
|
|
821 |
"!s. gmeasurable (IMAGE (\<lambda>x. a + x) s) \<longleftrightarrow> gmeasurable s"
|
|
822 |
qed REWRITE_TAC[measurable; HAS_GMEASURE_TRANSLATION_EQ]);; *)
|
|
823 |
|
|
824 |
lemma measure_translation: True .. (*
|
|
825 |
"!s. gmeasurable s ==> measure(IMAGE (\<lambda>x. a + x) s) = gmeasure s"
|
|
826 |
qed REWRITE_TAC[HAS_GMEASURE_MEASURE] THEN REPEAT STRIP_TAC THEN
|
|
827 |
MATCH_MP_TAC MEASURE_UNIQUE THEN
|
|
828 |
ASM_REWRITE_TAC[HAS_GMEASURE_TRANSLATION_EQ]);; *)
|
|
829 |
|
|
830 |
lemma has_gmeasure_scaling: True .. (*
|
|
831 |
"!s m c. s has_gmeasure m
|
|
832 |
==> (IMAGE (\<lambda>x:real^N. c % x) s) has_gmeasure
|
|
833 |
(abs(c) pow dimindex(:N)) * m"
|
|
834 |
qed REPEAT GEN_TAC THEN
|
|
835 |
MP_TAC(ISPECL [`s:real^N->bool`; `c:real`; `0:real^N`; `m:real`]
|
|
836 |
HAS_GMEASURE_AFFINITY) THEN
|
|
837 |
REWRITE_TAC[VECTOR_ADD_RID]);; *)
|
|
838 |
|
|
839 |
lemma has_gmeasure_scaling_eq: True .. (*
|
|
840 |
"!s m c. ~(c = 0)
|
|
841 |
==> (IMAGE (\<lambda>x:real^N. c % x) s
|
|
842 |
has_gmeasure (abs(c) pow dimindex(:N)) * m \<longleftrightarrow>
|
|
843 |
s has_gmeasure m)"
|
|
844 |
qed REPEAT STRIP_TAC THEN EQ_TAC THEN REWRITE_TAC[HAS_GMEASURE_SCALING] THEN
|
|
845 |
DISCH_THEN(MP_TAC o SPEC `inv(c)` o MATCH_MP HAS_GMEASURE_SCALING) THEN
|
|
846 |
REWRITE_TAC[GSYM IMAGE_o; o_DEF; GSYM REAL_ABS_MUL] THEN
|
|
847 |
REWRITE_TAC[GSYM REAL_POW_MUL; VECTOR_MUL_ASSOC; REAL_MUL_ASSOC] THEN
|
|
848 |
ASM_SIMP_TAC[GSYM REAL_ABS_MUL; REAL_MUL_LINV] THEN
|
|
849 |
REWRITE_TAC[REAL_POW_ONE; REAL_ABS_NUM; REAL_MUL_LID; VECTOR_MUL_LID] THEN
|
|
850 |
MATCH_MP_TAC EQ_IMP THEN AP_THM_TAC THEN AP_TERM_TAC THEN SET_TAC[]);; *)
|
|
851 |
|
|
852 |
lemma gmeasurable_scaling: True .. (*
|
|
853 |
"!s c. gmeasurable s ==> gmeasurable (IMAGE (\<lambda>x. c % x) s)"
|
|
854 |
qed REWRITE_TAC[measurable] THEN MESON_TAC[HAS_GMEASURE_SCALING]);; *)
|
|
855 |
|
|
856 |
lemma gmeasurable_scaling_eq: True .. (*
|
|
857 |
"!s c. ~(c = 0) ==> (measurable (IMAGE (\<lambda>x. c % x) s) \<longleftrightarrow> gmeasurable s)"
|
|
858 |
qed REPEAT STRIP_TAC THEN EQ_TAC THEN REWRITE_TAC[MEASURABLE_SCALING] THEN
|
|
859 |
DISCH_THEN(MP_TAC o SPEC `inv c` o MATCH_MP GMEASURABLE_SCALING) THEN
|
|
860 |
REWRITE_TAC[GSYM IMAGE_o; o_DEF; GSYM REAL_ABS_MUL] THEN
|
|
861 |
MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
862 |
ASM_SIMP_TAC[VECTOR_MUL_ASSOC; REAL_MUL_LINV; VECTOR_MUL_LID] THEN
|
|
863 |
SET_TAC[]);; *)
|
|
864 |
|
|
865 |
lemma measure_scaling: True .. (*
|
|
866 |
"!s. gmeasurable s
|
|
867 |
==> measure(IMAGE (\<lambda>x:real^N. c % x) s) =
|
|
868 |
(abs(c) pow dimindex(:N)) * gmeasure s"
|
|
869 |
qed REWRITE_TAC[HAS_GMEASURE_MEASURE] THEN REPEAT STRIP_TAC THEN
|
|
870 |
MATCH_MP_TAC MEASURE_UNIQUE THEN ASM_SIMP_TAC[HAS_GMEASURE_SCALING]);; *)
|
|
871 |
|
|
872 |
(* ------------------------------------------------------------------------- *)
|
|
873 |
(* Measurability of countable unions and intersections of various kinds. *)
|
|
874 |
(* ------------------------------------------------------------------------- *)
|
|
875 |
|
|
876 |
lemma has_gmeasure_nested_unions:
|
|
877 |
assumes "\<And>n. gmeasurable(s n)" "\<And>n. gmeasure(s n) \<le> B" "\<And>n. s(n) \<subseteq> s(Suc n)"
|
|
878 |
shows "gmeasurable(\<Union> { s n | n. n \<in> UNIV }) \<and>
|
|
879 |
(\<lambda>n. gmeasure(s n)) ----> gmeasure(\<Union> { s(n) | n. n \<in> UNIV })"
|
|
880 |
proof- let ?g = "\<lambda>x. if x \<in> \<Union>{s n |n. n \<in> UNIV} then 1 else (0::real)"
|
|
881 |
have "?g integrable_on UNIV \<and> (\<lambda>k. integral UNIV (\<lambda>x. if x \<in> s k then 1 else 0)) ----> integral UNIV ?g"
|
|
882 |
proof(rule monotone_convergence_increasing)
|
|
883 |
case goal1 show ?case using assms(1) unfolding gmeasurable_integrable by auto
|
|
884 |
case goal2 show ?case using assms(3) by auto
|
|
885 |
have "\<forall>m n. m\<le>n \<longrightarrow> s m \<subseteq> s n" apply(subst transitive_stepwise_le_eq)
|
|
886 |
using assms(3) by auto note * = this[rule_format]
|
|
887 |
have **:"\<And>x e n. \<lbrakk>x \<in> s n; 0 < e\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. x \<notin> s n \<longrightarrow> N \<le> n \<longrightarrow> dist 0 1 < e"
|
|
888 |
apply(rule_tac x=n in exI) using * by auto
|
|
889 |
case goal3 show ?case unfolding Lim_sequentially by(auto intro!: **)
|
|
890 |
case goal4 show ?case unfolding bounded_def apply(rule_tac x=0 in exI)
|
|
891 |
apply(rule_tac x=B in exI) unfolding dist_real_def apply safe
|
|
892 |
unfolding measure_integral_univ[OF assms(1),THEN sym]
|
|
893 |
apply(subst abs_of_nonpos) using assms(1,2) by auto
|
|
894 |
qed note conjunctD2[OF this]
|
|
895 |
thus ?thesis unfolding gmeasurable_integrable[THEN sym] measure_integral_univ[OF assms(1)]
|
|
896 |
apply- unfolding measure_integral_univ by auto
|
|
897 |
qed
|
|
898 |
|
|
899 |
lemmas gmeasurable_nested_unions = has_gmeasure_nested_unions(1)
|
|
900 |
|
|
901 |
lemma sums_alt:"f sums s = (\<lambda>n. setsum f {0..n}) ----> s"
|
|
902 |
proof- have *:"\<And>n. {0..<Suc n} = {0..n}" by auto
|
|
903 |
show ?thesis unfolding sums_def apply(subst LIMSEQ_Suc_iff[THEN sym]) unfolding * ..
|
|
904 |
qed
|
|
905 |
|
|
906 |
lemma has_gmeasure_countable_negligible_unions:
|
|
907 |
assumes "\<And>n. gmeasurable(s n)" "\<And>m n. m \<noteq> n \<Longrightarrow> negligible(s m \<inter> s n)"
|
|
908 |
"\<And>n. setsum (\<lambda>k. gmeasure(s k)) {0..n} <= B"
|
|
909 |
shows "gmeasurable(\<Union> { s(n) |n. n \<in> UNIV })" (is ?m)
|
|
910 |
"((\<lambda>n. gmeasure(s n)) sums (gmeasure(\<Union> { s(n) |n. n \<in> UNIV })))" (is ?s)
|
|
911 |
proof- have *:"\<And>n. (\<Union> (s ` {0..n})) has_gmeasure (setsum (\<lambda>k. gmeasure(s k)) {0..n})"
|
|
912 |
apply(rule has_gmeasure_negligible_unions_image) using assms by auto
|
|
913 |
have **:"(\<Union>{\<Union>s ` {0..n} |n. n \<in> UNIV}) = (\<Union>{s n |n. n \<in> UNIV})" unfolding simple_image by fastsimp
|
|
914 |
have "gmeasurable (\<Union>{\<Union>s ` {0..n} |n. n \<in> UNIV}) \<and>
|
|
915 |
(\<lambda>n. gmeasure (\<Union>(s ` {0..n}))) ----> gmeasure (\<Union>{\<Union>s ` {0..n} |n. n \<in> UNIV})"
|
|
916 |
apply(rule has_gmeasure_nested_unions) apply(rule gmeasurableI,rule *)
|
|
917 |
unfolding measure_unique[OF *] defer apply(rule Union_mono,rule image_mono) using assms(3) by auto
|
|
918 |
note lem = conjunctD2[OF this,unfolded **]
|
|
919 |
show ?m using lem(1) .
|
|
920 |
show ?s using lem(2) unfolding sums_alt measure_unique[OF *] .
|
|
921 |
qed
|
|
922 |
|
|
923 |
lemma negligible_countable_unions: True .. (*
|
|
924 |
"!s:num->real^N->bool.
|
|
925 |
(!n. negligible(s n)) ==> negligible(UNIONS {s(n) | n \<in> (:num)})"
|
|
926 |
qed REPEAT STRIP_TAC THEN
|
|
927 |
MP_TAC(ISPECL [`s:num->real^N->bool`; `0`]
|
|
928 |
HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS) THEN
|
|
929 |
ASM_SIMP_TAC[MEASURE_EQ_0; SUM_0; REAL_LE_REFL; LIFT_NUM] THEN ANTS_TAC THENL
|
|
930 |
[ASM_MESON_TAC[HAS_GMEASURE_0; gmeasurable; INTER_SUBSET; NEGLIGIBLE_SUBSET];
|
|
931 |
ALL_TAC] THEN
|
|
932 |
SIMP_TAC[GSYM GMEASURABLE_MEASURE_EQ_0] THEN
|
|
933 |
STRIP_TAC THEN REWRITE_TAC[GSYM LIFT_EQ] THEN
|
|
934 |
MATCH_MP_TAC SERIES_UNIQUE THEN REWRITE_TAC[LIFT_NUM] THEN
|
|
935 |
MAP_EVERY EXISTS_TAC [`(\<lambda>k. 0):num->real^1`; `from 0`] THEN
|
|
936 |
ASM_REWRITE_TAC[SERIES_0]);; *)
|
|
937 |
|
|
938 |
lemma gmeasurable_countable_unions_strong:
|
|
939 |
assumes "\<And>n. gmeasurable(s n)" "\<And>n::nat. gmeasure(\<Union>{s k |k. k \<le> n}) \<le> B"
|
|
940 |
shows "gmeasurable(\<Union>{ s(n) |n. n \<in> UNIV })"
|
|
941 |
proof- have *:"\<Union>{\<Union>s ` {0..n} |n. n \<in> UNIV} = \<Union>range s" unfolding simple_image by fastsimp
|
|
942 |
show ?thesis unfolding simple_image
|
|
943 |
apply(rule gmeasurable_nested_unions[of "\<lambda>n. \<Union>(s ` {0..n})", THEN conjunct1,unfolded *])
|
|
944 |
proof- fix n::nat show "gmeasurable (\<Union>s ` {0..n})"
|
|
945 |
apply(rule gmeasurable_finite_unions) using assms(1) by auto
|
|
946 |
show "gmeasure (\<Union>s ` {0..n}) \<le> B"
|
|
947 |
using assms(2)[of n] unfolding simple_image[THEN sym] by auto
|
|
948 |
show "\<Union>s ` {0..n} \<subseteq> \<Union>s ` {0..Suc n}" apply(rule Union_mono) by auto
|
|
949 |
qed
|
|
950 |
qed
|
|
951 |
|
|
952 |
lemma has_gmeasure_countable_negligible_unions_bounded: True .. (*
|
|
953 |
"!s:num->real^N->bool.
|
|
954 |
(!n. gmeasurable(s n)) \<and>
|
|
955 |
(!m n. ~(m = n) ==> negligible(s m \<inter> s n)) \<and>
|
|
956 |
bounded(\<Union>{ s(n) | n \<in> (:num) })
|
|
957 |
==> gmeasurable(\<Union>{ s(n) | n \<in> (:num) }) \<and>
|
|
958 |
((\<lambda>n. lift(measure(s n))) sums
|
|
959 |
lift(measure(\<Union>{ s(n) | n \<in> (:num) }))) (from 0)"
|
|
960 |
qed REPEAT GEN_TAC THEN STRIP_TAC THEN
|
|
961 |
FIRST_ASSUM(MP_TAC o MATCH_MP BOUNDED_SUBSET_CLOSED_INTERVAL) THEN
|
|
962 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
|
|
963 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN DISCH_TAC THEN
|
|
964 |
MATCH_MP_TAC HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS THEN
|
|
965 |
EXISTS_TAC `measure(interval[a:real^N,b])` THEN
|
|
966 |
ASM_REWRITE_TAC[] THEN X_GEN_TAC `n:num` THEN MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
967 |
EXISTS_TAC `measure(UNIONS (IMAGE (s:num->real^N->bool) (0..n)))` THEN
|
|
968 |
CONJ_TAC THENL
|
|
969 |
[MATCH_MP_TAC REAL_EQ_IMP_LE THEN CONV_TAC SYM_CONV THEN
|
|
970 |
MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNIONS_IMAGE THEN
|
|
971 |
ASM_SIMP_TAC[FINITE_NUMSEG];
|
|
972 |
MATCH_MP_TAC MEASURE_SUBSET THEN REWRITE_TAC[MEASURABLE_INTERVAL] THEN
|
|
973 |
CONJ_TAC THENL
|
|
974 |
[MATCH_MP_TAC GMEASURABLE_UNIONS THEN
|
|
975 |
ASM_SIMP_TAC[FINITE_IMAGE; FINITE_NUMSEG; FORALL_IN_IMAGE];
|
|
976 |
ASM SET_TAC[]]]);; *)
|
|
977 |
|
|
978 |
lemma gmeasurable_countable_negligible_unions_bounded: True .. (*
|
|
979 |
"!s:num->real^N->bool.
|
|
980 |
(!n. gmeasurable(s n)) \<and>
|
|
981 |
(!m n. ~(m = n) ==> negligible(s m \<inter> s n)) \<and>
|
|
982 |
bounded(\<Union>{ s(n) | n \<in> (:num) })
|
|
983 |
==> gmeasurable(\<Union>{ s(n) | n \<in> (:num) })"
|
|
984 |
qed SIMP_TAC[HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS_BOUNDED]);; *)
|
|
985 |
|
|
986 |
lemma gmeasurable_countable_unions: True .. (*
|
|
987 |
"!s:num->real^N->bool B.
|
|
988 |
(!n. gmeasurable(s n)) \<and>
|
|
989 |
(!n. sum (0..n) (\<lambda>k. measure(s k)) \<le> B)
|
|
990 |
==> gmeasurable(\<Union>{ s(n) | n \<in> (:num) })"
|
|
991 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC GMEASURABLE_COUNTABLE_UNIONS_STRONG THEN
|
|
992 |
EXISTS_TAC `B:real` THEN ASM_REWRITE_TAC[] THEN
|
|
993 |
X_GEN_TAC `n:num` THEN MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
994 |
EXISTS_TAC `sum(0..n) (\<lambda>k. measure(s k:real^N->bool))` THEN
|
|
995 |
ASM_REWRITE_TAC[] THEN
|
|
996 |
W(MP_TAC o PART_MATCH (rand o rand) MEASURE_UNIONS_LE_IMAGE o
|
|
997 |
rand o snd) THEN
|
|
998 |
ASM_REWRITE_TAC[FINITE_NUMSEG] THEN
|
|
999 |
ONCE_REWRITE_TAC[GSYM SIMPLE_IMAGE] THEN
|
|
1000 |
REWRITE_TAC[IN_NUMSEG; LE_0]);; *)
|
|
1001 |
|
|
1002 |
lemma gmeasurable_countable_inters: True .. (*
|
|
1003 |
"!s:num->real^N->bool.
|
|
1004 |
(!n. gmeasurable(s n))
|
|
1005 |
==> gmeasurable(INTERS { s(n) | n \<in> (:num) })"
|
|
1006 |
qed REPEAT STRIP_TAC THEN
|
|
1007 |
SUBGOAL_THEN `INTERS { s(n):real^N->bool | n \<in> (:num) } =
|
|
1008 |
s 0 DIFF (\<Union>{s 0 DIFF s n | n \<in> (:num)})`
|
|
1009 |
SUBST1_TAC THENL
|
|
1010 |
[GEN_REWRITE_TAC I [EXTENSION] THEN
|
|
1011 |
REWRITE_TAC[IN_INTERS; IN_DIFF; IN_UNIONS] THEN
|
|
1012 |
REWRITE_TAC[SIMPLE_IMAGE; FORALL_IN_IMAGE; EXISTS_IN_IMAGE] THEN
|
|
1013 |
ASM SET_TAC[];
|
|
1014 |
ALL_TAC] THEN
|
|
1015 |
MATCH_MP_TAC GMEASURABLE_DIFF THEN ASM_REWRITE_TAC[] THEN
|
|
1016 |
MATCH_MP_TAC GMEASURABLE_COUNTABLE_UNIONS_STRONG THEN
|
|
1017 |
EXISTS_TAC `measure(s 0:real^N->bool)` THEN
|
|
1018 |
ASM_SIMP_TAC[MEASURABLE_DIFF; LE_0] THEN
|
|
1019 |
GEN_TAC THEN MATCH_MP_TAC MEASURE_SUBSET THEN
|
|
1020 |
ASM_REWRITE_TAC[] THEN CONJ_TAC THENL
|
|
1021 |
[ALL_TAC;
|
|
1022 |
REWRITE_TAC[SUBSET; FORALL_IN_UNIONS; IN_ELIM_THM; IN_DIFF] THEN
|
|
1023 |
MESON_TAC[IN_DIFF]] THEN
|
|
1024 |
ONCE_REWRITE_TAC[GSYM IN_NUMSEG_0] THEN
|
|
1025 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE] THEN
|
|
1026 |
ASM_SIMP_TAC[FORALL_IN_IMAGE; FINITE_IMAGE; FINITE_NUMSEG;
|
|
1027 |
GMEASURABLE_DIFF; GMEASURABLE_UNIONS]);; *)
|
|
1028 |
|
|
1029 |
(* ------------------------------------------------------------------------- *)
|
|
1030 |
(* measurability of compact and bounded open sets. *)
|
|
1031 |
(* ------------------------------------------------------------------------- *)
|
|
1032 |
|
|
1033 |
lemma gmeasurable_compact: True .. (*
|
|
1034 |
"!s:real^N->bool. compact s ==> gmeasurable s"
|
|
1035 |
qed lemma lemma = prove
|
|
1036 |
(`!f s:real^N->bool.
|
|
1037 |
(!n. FINITE(f n)) \<and>
|
|
1038 |
(!n. s \<subseteq> UNIONS(f n)) \<and>
|
|
1039 |
(!x. ~(x \<in> s) ==> ?n. ~(x \<in> UNIONS(f n))) \<and>
|
|
1040 |
(!n a. a \<in> f(SUC n) ==> ?b. b \<in> f(n) \<and> a \<subseteq> b) \<and>
|
|
1041 |
(!n a. a \<in> f(n) ==> gmeasurable a)
|
|
1042 |
==> gmeasurable s"
|
|
1043 |
qed REPEAT STRIP_TAC THEN
|
|
1044 |
SUBGOAL_THEN `!n. UNIONS(f(SUC n):(real^N->bool)->bool) \<subseteq> UNIONS(f n)`
|
|
1045 |
ASSUME_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
|
|
1046 |
SUBGOAL_THEN `s = INTERS { UNIONS(f n) | n \<in> (:num) }:real^N->bool`
|
|
1047 |
SUBST1_TAC THENL
|
|
1048 |
[ONCE_REWRITE_TAC[SIMPLE_IMAGE] THEN
|
|
1049 |
MATCH_MP_TAC SUBSET_ANTISYM THEN CONJ_TAC THEN
|
|
1050 |
REWRITE_TAC[SUBSET; IN_INTERS; FORALL_IN_IMAGE; IN_UNIV] THEN
|
|
1051 |
REWRITE_TAC[IN_IMAGE] THEN ASM SET_TAC[];
|
|
1052 |
MATCH_MP_TAC GMEASURABLE_COUNTABLE_INTERS THEN
|
|
1053 |
ASM_REWRITE_TAC[] THEN GEN_TAC THEN
|
|
1054 |
MATCH_MP_TAC GMEASURABLE_UNIONS THEN
|
|
1055 |
ASM_MESON_TAC[]]) in
|
|
1056 |
REPEAT STRIP_TAC THEN MATCH_MP_TAC lemma THEN
|
|
1057 |
EXISTS_TAC
|
|
1058 |
`\n. { k | ?u:real^N. (!i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1059 |
==> integer(u$i)) \<and>
|
|
1060 |
k = { x:real^N | !i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1061 |
==> u$i / 2 pow n \<le> x$i \<and>
|
|
1062 |
x$i < (u$i + 1) / 2 pow n } \<and>
|
|
1063 |
~(s \<inter> k = {})}` THEN
|
|
1064 |
REWRITE_TAC[IN_ELIM_THM] THEN REPEAT CONJ_TAC THENL
|
|
1065 |
[X_GEN_TAC `n:num` THEN
|
|
1066 |
SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LT_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1067 |
SUBGOAL_THEN
|
|
1068 |
`?N. !x:real^N i. x \<in> s \<and> 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1069 |
==> abs(x$i * 2 pow n) < N`
|
|
1070 |
STRIP_ASSUME_TAC THENL
|
|
1071 |
[FIRST_ASSUM(MP_TAC o MATCH_MP COMPACT_IMP_BOUNDED) THEN
|
|
1072 |
REWRITE_TAC[BOUNDED_POS; LEFT_IMP_EXISTS_THM] THEN
|
|
1073 |
X_GEN_TAC `B:real` THEN STRIP_TAC THEN
|
|
1074 |
MP_TAC(SPEC `B * 2 pow n` (MATCH_MP REAL_ARCH REAL_LT_01)) THEN
|
|
1075 |
MATCH_MP_TAC MONO_EXISTS THEN REWRITE_TAC[REAL_MUL_RID] THEN
|
|
1076 |
X_GEN_TAC `N:num` THEN
|
|
1077 |
REWRITE_TAC[REAL_ABS_MUL; REAL_ABS_POW; REAL_ABS_NUM] THEN
|
|
1078 |
SIMP_TAC[GSYM REAL_LT_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1079 |
ASM_MESON_TAC[COMPONENT_LE_NORM; REAL_LE_TRANS; REAL_LET_TRANS];
|
|
1080 |
ALL_TAC] THEN
|
|
1081 |
MATCH_MP_TAC FINITE_SUBSET THEN
|
|
1082 |
EXISTS_TAC
|
|
1083 |
`IMAGE (\<lambda>u. {x | !i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1084 |
==> (u:real^N)$i \<le> (x:real^N)$i * 2 pow n \<and>
|
|
1085 |
x$i * 2 pow n < u$i + 1})
|
|
1086 |
{u | !i. 1 \<le> i \<and> i \<le> dimindex(:N) ==> integer (u$i) \<and>
|
|
1087 |
abs(u$i) \<le> N}` THEN
|
|
1088 |
CONJ_TAC THENL
|
|
1089 |
[MATCH_MP_TAC FINITE_IMAGE THEN MATCH_MP_TAC FINITE_CART THEN
|
|
1090 |
REWRITE_TAC[GSYM REAL_BOUNDS_LE; FINITE_INTSEG];
|
|
1091 |
REWRITE_TAC[SUBSET; IN_ELIM_THM; IN_IMAGE] THEN
|
|
1092 |
X_GEN_TAC `l:real^N->bool` THEN
|
|
1093 |
MATCH_MP_TAC MONO_EXISTS THEN X_GEN_TAC `u:real^N` THEN
|
|
1094 |
STRIP_TAC THEN FIRST_X_ASSUM SUBST_ALL_TAC THEN ASM_SIMP_TAC[] THEN
|
|
1095 |
X_GEN_TAC `k:num` THEN STRIP_TAC THEN
|
|
1096 |
MATCH_MP_TAC REAL_LE_REVERSE_INTEGERS THEN
|
|
1097 |
ASM_SIMP_TAC[INTEGER_CLOSED] THEN
|
|
1098 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [GSYM MEMBER_NOT_EMPTY]) THEN
|
|
1099 |
DISCH_THEN(X_CHOOSE_THEN `x:real^N` MP_TAC) THEN
|
|
1100 |
REWRITE_TAC[IN_INTER; IN_ELIM_THM] THEN
|
|
1101 |
DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC (MP_TAC o SPEC `k:num`)) THEN
|
|
1102 |
ASM_REWRITE_TAC[] THEN
|
|
1103 |
FIRST_X_ASSUM(MP_TAC o SPECL [`x:real^N`; `k:num`]) THEN
|
|
1104 |
ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC];
|
|
1105 |
X_GEN_TAC `n:num` THEN REWRITE_TAC[SUBSET; IN_UNIONS; IN_ELIM_THM] THEN
|
|
1106 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
|
|
1107 |
REWRITE_TAC[LEFT_AND_EXISTS_THM] THEN
|
|
1108 |
ONCE_REWRITE_TAC[SWAP_EXISTS_THM] THEN
|
|
1109 |
EXISTS_TAC `(lambda i. floor(2 pow n * (x:real^N)$i)):real^N` THEN
|
|
1110 |
ONCE_REWRITE_TAC[TAUT `(a \<and> b \<and> c) \<and> d \<longleftrightarrow> b \<and> a \<and> c \<and> d`] THEN
|
|
1111 |
REWRITE_TAC[UNWIND_THM2] THEN SIMP_TAC[LAMBDA_BETA; FLOOR] THEN
|
|
1112 |
REWRITE_TAC[GSYM MEMBER_NOT_EMPTY; IN_INTER] THEN
|
|
1113 |
REWRITE_TAC[LEFT_AND_EXISTS_THM] THEN EXISTS_TAC `x:real^N` THEN
|
|
1114 |
ASM_REWRITE_TAC[IN_ELIM_THM] THEN
|
|
1115 |
SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LT_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1116 |
REWRITE_TAC[REAL_MUL_SYM; FLOOR];
|
|
1117 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
|
|
1118 |
FIRST_ASSUM(MP_TAC o MATCH_MP COMPACT_IMP_CLOSED) THEN
|
|
1119 |
REWRITE_TAC[closed; open_def] THEN
|
|
1120 |
DISCH_THEN(MP_TAC o SPEC `x:real^N`) THEN
|
|
1121 |
ASM_REWRITE_TAC[IN_DIFF; IN_UNIV] THEN
|
|
1122 |
DISCH_THEN(X_CHOOSE_THEN `e:real` STRIP_ASSUME_TAC) THEN
|
|
1123 |
MP_TAC(SPECL [`inv(2)`; `e / (dimindex(:N))`] REAL_ARCH_POW_INV) THEN
|
|
1124 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_LT_RDIV_EQ; REAL_OF_NUM_LT;
|
|
1125 |
DIMINDEX_GE_1; ARITH_RULE `0 < x \<longleftrightarrow> 1 \<le> x`] THEN
|
|
1126 |
CONV_TAC REAL_RAT_REDUCE_CONV THEN
|
|
1127 |
MATCH_MP_TAC MONO_EXISTS THEN X_GEN_TAC `n:num` THEN DISCH_TAC THEN
|
|
1128 |
REWRITE_TAC[IN_UNIONS; IN_ELIM_THM] THEN
|
|
1129 |
REWRITE_TAC[LEFT_AND_EXISTS_THM] THEN
|
|
1130 |
ONCE_REWRITE_TAC[SWAP_EXISTS_THM] THEN
|
|
1131 |
ONCE_REWRITE_TAC[TAUT `(a \<and> b \<and> c) \<and> d \<longleftrightarrow> b \<and> a \<and> c \<and> d`] THEN
|
|
1132 |
REWRITE_TAC[UNWIND_THM2] THEN REWRITE_TAC[NOT_EXISTS_THM] THEN
|
|
1133 |
X_GEN_TAC `u:real^N` THEN REWRITE_TAC[GSYM MEMBER_NOT_EMPTY] THEN
|
|
1134 |
REWRITE_TAC[IN_INTER; IN_ELIM_THM] THEN
|
|
1135 |
DISCH_THEN(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC o CONJUNCT2) THEN
|
|
1136 |
DISCH_THEN(X_CHOOSE_THEN `y:real^N`
|
|
1137 |
(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC)) THEN
|
|
1138 |
REWRITE_TAC[] THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
|
|
1139 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP (REAL_ARITH
|
|
1140 |
`d < e ==> x \<le> d ==> x < e`)) THEN
|
|
1141 |
REWRITE_TAC[dist] THEN
|
|
1142 |
W(MP_TAC o PART_MATCH lhand NORM_LE_L1 o lhand o snd) THEN
|
|
1143 |
MATCH_MP_TAC(REAL_ARITH `a \<le> b ==> x \<le> a ==> x \<le> b`) THEN
|
|
1144 |
GEN_REWRITE_TAC (funpow 3 RAND_CONV) [GSYM CARD_NUMSEG_1] THEN
|
|
1145 |
ONCE_REWRITE_TAC[REAL_MUL_SYM] THEN MATCH_MP_TAC SUM_BOUND THEN
|
|
1146 |
SIMP_TAC[FINITE_NUMSEG; IN_NUMSEG; VECTOR_SUB_COMPONENT] THEN
|
|
1147 |
X_GEN_TAC `k:num` THEN STRIP_TAC THEN
|
|
1148 |
REPEAT(FIRST_X_ASSUM(MP_TAC o SPEC `k:num`)) THEN
|
|
1149 |
ASM_REWRITE_TAC[real_div; REAL_ADD_RDISTRIB] THEN
|
|
1150 |
REWRITE_TAC[REAL_MUL_LID; GSYM REAL_POW_INV] THEN REAL_ARITH_TAC;
|
|
1151 |
MAP_EVERY X_GEN_TAC [`n:num`; `a:real^N->bool`] THEN
|
|
1152 |
DISCH_THEN(X_CHOOSE_THEN `u:real^N`
|
|
1153 |
(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC)) THEN
|
|
1154 |
DISCH_THEN(CONJUNCTS_THEN2 (ASSUME_TAC o SYM) ASSUME_TAC) THEN
|
|
1155 |
REWRITE_TAC[LEFT_AND_EXISTS_THM] THEN
|
|
1156 |
ONCE_REWRITE_TAC[SWAP_EXISTS_THM] THEN
|
|
1157 |
ONCE_REWRITE_TAC[TAUT `(a \<and> b \<and> c) \<and> d \<longleftrightarrow> b \<and> a \<and> c \<and> d`] THEN
|
|
1158 |
REWRITE_TAC[UNWIND_THM2] THEN
|
|
1159 |
EXISTS_TAC `(lambda i. floor((u:real^N)$i / 2)):real^N` THEN
|
|
1160 |
ASM_SIMP_TAC[VECTOR_MUL_COMPONENT; LAMBDA_BETA; FLOOR] THEN
|
|
1161 |
MATCH_MP_TAC(SET_RULE `~(s \<inter> a = {}) \<and> a \<subseteq> b
|
|
1162 |
==> ~(s \<inter> b = {}) \<and> a \<subseteq> b`) THEN
|
|
1163 |
ASM_REWRITE_TAC[] THEN EXPAND_TAC "a" THEN REWRITE_TAC[SUBSET] THEN
|
|
1164 |
X_GEN_TAC `x:real^N` THEN REWRITE_TAC[IN_ELIM_THM] THEN
|
|
1165 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `k:num` THEN
|
|
1166 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN ASM_REWRITE_TAC[] THEN
|
|
1167 |
REWRITE_TAC[real_pow; real_div; REAL_INV_MUL; REAL_MUL_ASSOC] THEN
|
|
1168 |
REWRITE_TAC[GSYM real_div] THEN
|
|
1169 |
SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LT_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1170 |
MP_TAC(SPEC `(u:real^N)$k / 2` FLOOR) THEN
|
|
1171 |
REWRITE_TAC[REAL_ARITH `u / 2 < floor(u / 2) + 1 \<longleftrightarrow>
|
|
1172 |
u < 2 * floor(u / 2) + 2`] THEN
|
|
1173 |
ASM_SIMP_TAC[REAL_LT_INTEGERS; INTEGER_CLOSED; FLOOR_FRAC] THEN
|
|
1174 |
REAL_ARITH_TAC;
|
|
1175 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
|
|
1176 |
MAP_EVERY X_GEN_TAC [`n:num`; `a:real^N->bool`; `u:real^N`] THEN
|
|
1177 |
DISCH_THEN(SUBST1_TAC o CONJUNCT1 o CONJUNCT2) THEN
|
|
1178 |
ONCE_REWRITE_TAC[MEASURABLE_INNER_OUTER] THEN
|
|
1179 |
GEN_TAC THEN DISCH_TAC THEN
|
|
1180 |
EXISTS_TAC `interval(inv(2 pow n) % u:real^N,
|
|
1181 |
inv(2 pow n) % (u + 1))` THEN
|
|
1182 |
EXISTS_TAC `interval[inv(2 pow n) % u:real^N,
|
|
1183 |
inv(2 pow n) % (u + 1)]` THEN
|
|
1184 |
REWRITE_TAC[MEASURABLE_INTERVAL; MEASURE_INTERVAL] THEN
|
|
1185 |
ASM_REWRITE_TAC[REAL_SUB_REFL; REAL_ABS_0] THEN
|
|
1186 |
REWRITE_TAC[SUBSET; IN_INTERVAL; IN_ELIM_THM] THEN
|
|
1187 |
CONJ_TAC THEN X_GEN_TAC `y:real^N` THEN
|
|
1188 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `k:num` THEN
|
|
1189 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN
|
|
1190 |
ASM_SIMP_TAC[VECTOR_MUL_COMPONENT; VECTOR_ADD_COMPONENT;
|
|
1191 |
VEC_COMPONENT] THEN
|
|
1192 |
REAL_ARITH_TAC]);; *)
|
|
1193 |
|
|
1194 |
lemma gmeasurable_open: True .. (*
|
|
1195 |
"!s:real^N->bool. bounded s \<and> open s ==> gmeasurable s"
|
|
1196 |
qed REPEAT STRIP_TAC THEN
|
|
1197 |
FIRST_X_ASSUM(MP_TAC o MATCH_MP BOUNDED_SUBSET_CLOSED_INTERVAL) THEN
|
|
1198 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
|
|
1199 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN DISCH_TAC THEN
|
|
1200 |
FIRST_ASSUM(SUBST1_TAC o MATCH_MP (SET_RULE
|
|
1201 |
`s \<subseteq> t ==> s = t DIFF (t DIFF s)`)) THEN
|
|
1202 |
MATCH_MP_TAC GMEASURABLE_DIFF THEN
|
|
1203 |
REWRITE_TAC[MEASURABLE_INTERVAL] THEN
|
|
1204 |
MATCH_MP_TAC GMEASURABLE_COMPACT THEN
|
|
1205 |
SIMP_TAC[COMPACT_EQ_BOUNDED_CLOSED; BOUNDED_DIFF; BOUNDED_INTERVAL] THEN
|
|
1206 |
MATCH_MP_TAC CLOSED_DIFF THEN ASM_REWRITE_TAC[CLOSED_INTERVAL]);; *)
|
|
1207 |
|
|
1208 |
lemma gmeasurable_closure: True .. (*
|
|
1209 |
"!s. bounded s ==> gmeasurable(closure s)"
|
|
1210 |
qed SIMP_TAC[MEASURABLE_COMPACT; COMPACT_EQ_BOUNDED_CLOSED; CLOSED_CLOSURE;
|
|
1211 |
BOUNDED_CLOSURE]);; *)
|
|
1212 |
|
|
1213 |
lemma gmeasurable_interior: True .. (*
|
|
1214 |
"!s. bounded s ==> gmeasurable(interior s)"
|
|
1215 |
qed SIMP_TAC[MEASURABLE_OPEN; OPEN_INTERIOR; BOUNDED_INTERIOR]);; *)
|
|
1216 |
|
|
1217 |
lemma gmeasurable_frontier: True .. (*
|
|
1218 |
"!s:real^N->bool. bounded s ==> gmeasurable(frontier s)"
|
|
1219 |
qed REPEAT STRIP_TAC THEN REWRITE_TAC[frontier] THEN
|
|
1220 |
MATCH_MP_TAC GMEASURABLE_DIFF THEN
|
|
1221 |
ASM_SIMP_TAC[MEASURABLE_CLOSURE; GMEASURABLE_INTERIOR] THEN
|
|
1222 |
MATCH_MP_TAC SUBSET_TRANS THEN EXISTS_TAC `s:real^N->bool` THEN
|
|
1223 |
REWRITE_TAC[INTERIOR_SUBSET; CLOSURE_SUBSET]);; *)
|
|
1224 |
|
|
1225 |
lemma measure_frontier: True .. (*
|
|
1226 |
"!s:real^N->bool.
|
|
1227 |
bounded s
|
|
1228 |
==> measure(frontier s) = measure(closure s) - measure(interior s)"
|
|
1229 |
qed REPEAT STRIP_TAC THEN REWRITE_TAC[frontier] THEN
|
|
1230 |
MATCH_MP_TAC MEASURE_DIFF_SUBSET THEN
|
|
1231 |
ASM_SIMP_TAC[MEASURABLE_CLOSURE; GMEASURABLE_INTERIOR] THEN
|
|
1232 |
MATCH_MP_TAC SUBSET_TRANS THEN EXISTS_TAC `s:real^N->bool` THEN
|
|
1233 |
REWRITE_TAC[INTERIOR_SUBSET; CLOSURE_SUBSET]);; *)
|
|
1234 |
|
|
1235 |
lemma gmeasurable_jordan: True .. (*
|
|
1236 |
"!s:real^N->bool. bounded s \<and> negligible(frontier s) ==> gmeasurable s"
|
|
1237 |
qed REPEAT STRIP_TAC THEN ONCE_REWRITE_TAC[MEASURABLE_INNER_OUTER] THEN
|
|
1238 |
GEN_TAC THEN DISCH_TAC THEN
|
|
1239 |
EXISTS_TAC `interior(s):real^N->bool` THEN
|
|
1240 |
EXISTS_TAC `closure(s):real^N->bool` THEN
|
|
1241 |
ASM_SIMP_TAC[MEASURABLE_INTERIOR; GMEASURABLE_CLOSURE] THEN
|
|
1242 |
REWRITE_TAC[INTERIOR_SUBSET; CLOSURE_SUBSET] THEN
|
|
1243 |
ONCE_REWRITE_TAC[REAL_ABS_SUB] THEN
|
|
1244 |
ASM_SIMP_TAC[GSYM MEASURE_FRONTIER; REAL_ABS_NUM; MEASURE_EQ_0]);; *)
|
|
1245 |
|
|
1246 |
lemma has_gmeasure_elementary: True .. (*
|
|
1247 |
"!d s. d division_of s ==> s has_gmeasure (sum d content)"
|
|
1248 |
qed REPEAT STRIP_TAC THEN REWRITE_TAC[has_gmeasure] THEN
|
|
1249 |
FIRST_ASSUM(ASSUME_TAC o MATCH_MP DIVISION_OF_FINITE) THEN
|
|
1250 |
ASM_SIMP_TAC[LIFT_SUM] THEN
|
|
1251 |
MATCH_MP_TAC HAS_INTEGRAL_COMBINE_DIVISION THEN
|
|
1252 |
ASM_REWRITE_TAC[o_THM] THEN REWRITE_TAC[GSYM has_gmeasure] THEN
|
|
1253 |
ASM_MESON_TAC[HAS_GMEASURE_INTERVAL; division_of]);; *)
|
|
1254 |
|
|
1255 |
lemma gmeasurable_elementary: True .. (*
|
|
1256 |
"!d s. d division_of s ==> gmeasurable s"
|
|
1257 |
qed REWRITE_TAC[measurable] THEN MESON_TAC[HAS_GMEASURE_ELEMENTARY]);; *)
|
|
1258 |
|
|
1259 |
lemma measure_elementary: True .. (*
|
|
1260 |
"!d s. d division_of s ==> gmeasure s = sum d content"
|
|
1261 |
qed MESON_TAC[HAS_GMEASURE_ELEMENTARY; MEASURE_UNIQUE]);; *)
|
|
1262 |
|
|
1263 |
lemma gmeasurable_inter_interval: True .. (*
|
|
1264 |
"!s a b:real^N. gmeasurable s ==> gmeasurable (s \<inter> {a..b})"
|
|
1265 |
qed SIMP_TAC[MEASURABLE_INTER; GMEASURABLE_INTERVAL]);; *)
|
|
1266 |
|
|
1267 |
(* ------------------------------------------------------------------------- *)
|
|
1268 |
(* A nice lemma for negligibility proofs. *)
|
|
1269 |
(* ------------------------------------------------------------------------- *)
|
|
1270 |
|
|
1271 |
lemma STARLIKE_NEGLIGIBLE_BOUNDED_MEASURABLE: True .. (*
|
|
1272 |
"!s. gmeasurable s \<and> bounded s \<and>
|
|
1273 |
(!c x:real^N. 0 \<le> c \<and> x \<in> s \<and> (c % x) \<in> s ==> c = 1)
|
|
1274 |
==> negligible s"
|
|
1275 |
qed REPEAT STRIP_TAC THEN
|
|
1276 |
SUBGOAL_THEN `~(0 < measure(s:real^N->bool))`
|
|
1277 |
(fun th -> ASM_MESON_TAC[th; GMEASURABLE_MEASURE_POS_LT]) THEN
|
|
1278 |
DISCH_TAC THEN
|
|
1279 |
MP_TAC(SPEC `(0:real^N) INSERT s`
|
|
1280 |
BOUNDED_SUBSET_CLOSED_INTERVAL_SYMMETRIC) THEN
|
|
1281 |
ASM_SIMP_TAC[BOUNDED_INSERT; COMPACT_IMP_BOUNDED; NOT_EXISTS_THM] THEN
|
|
1282 |
X_GEN_TAC `a:real^N` THEN REWRITE_TAC[INSERT_SUBSET] THEN STRIP_TAC THEN
|
|
1283 |
SUBGOAL_THEN
|
|
1284 |
`?N. EVEN N \<and> 0 < N \<and>
|
|
1285 |
measure(interval[--a:real^N,a])
|
|
1286 |
< (N * measure(s:real^N->bool)) / 4 pow dimindex (:N)`
|
|
1287 |
STRIP_ASSUME_TAC THENL
|
|
1288 |
[FIRST_ASSUM(MP_TAC o SPEC
|
|
1289 |
`measure(interval[--a:real^N,a]) * 4 pow (dimindex(:N))` o
|
|
1290 |
MATCH_MP REAL_ARCH) THEN
|
|
1291 |
SIMP_TAC[REAL_LT_RDIV_EQ; REAL_POW_LT; REAL_OF_NUM_LT; ARITH] THEN
|
|
1292 |
SIMP_TAC[GSYM REAL_LT_LDIV_EQ; ASSUME `0 < measure(s:real^N->bool)`] THEN
|
|
1293 |
DISCH_THEN(X_CHOOSE_THEN `N:num` STRIP_ASSUME_TAC) THEN
|
|
1294 |
EXISTS_TAC `2 * (N DIV 2 + 1)` THEN REWRITE_TAC[EVEN_MULT; ARITH] THEN
|
|
1295 |
CONJ_TAC THENL [ARITH_TAC; ALL_TAC] THEN
|
|
1296 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP (REAL_ARITH
|
|
1297 |
`x < a ==> a \<le> b ==> x < b`)) THEN
|
|
1298 |
REWRITE_TAC[REAL_OF_NUM_LE] THEN ARITH_TAC;
|
|
1299 |
ALL_TAC] THEN
|
|
1300 |
MP_TAC(ISPECL [`\<Union>(IMAGE (\<lambda>m. IMAGE (\<lambda>x:real^N. (m / N) % x) s)
|
|
1301 |
(1..N))`;
|
|
1302 |
`interval[--a:real^N,a]`] MEASURE_SUBSET) THEN
|
|
1303 |
MP_TAC(ISPECL [`measure:(real^N->bool)->real`;
|
|
1304 |
`IMAGE (\<lambda>m. IMAGE (\<lambda>x:real^N. (m / N) % x) s) (1..N)`]
|
|
1305 |
HAS_GMEASURE_DISJOINT_UNIONS) THEN
|
|
1306 |
SIMP_TAC[FINITE_IMAGE; FINITE_NUMSEG; IMP_CONJ] THEN
|
|
1307 |
REWRITE_TAC[RIGHT_FORALL_IMP_THM; FORALL_IN_IMAGE] THEN ANTS_TAC THENL
|
|
1308 |
[REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM HAS_GMEASURE_MEASURE] THEN
|
|
1309 |
MATCH_MP_TAC GMEASURABLE_SCALING THEN ASM_REWRITE_TAC[];
|
|
1310 |
ALL_TAC] THEN
|
|
1311 |
REWRITE_TAC[RIGHT_IMP_FORALL_THM; IMP_IMP] THEN
|
|
1312 |
ONCE_REWRITE_TAC[TAUT `(a \<and> b) \<and> ~c ==> d \<longleftrightarrow> a \<and> b \<and> ~d ==> c`] THEN
|
|
1313 |
SUBGOAL_THEN
|
|
1314 |
`!m n. m \<in> 1..N \<and> n \<in> 1..N \<and>
|
|
1315 |
~(DISJOINT (IMAGE (\<lambda>x:real^N. m / N % x) s)
|
|
1316 |
(IMAGE (\<lambda>x. n / N % x) s))
|
|
1317 |
==> m = n`
|
|
1318 |
ASSUME_TAC THENL
|
|
1319 |
[MAP_EVERY X_GEN_TAC [`m:num`; `n:num`] THEN
|
|
1320 |
REPEAT(DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC)) THEN
|
|
1321 |
REWRITE_TAC[DISJOINT; GSYM MEMBER_NOT_EMPTY] THEN
|
|
1322 |
REWRITE_TAC[EXISTS_IN_IMAGE; IN_INTER] THEN
|
|
1323 |
DISCH_THEN(X_CHOOSE_THEN `x:real^N`
|
|
1324 |
(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC)) THEN
|
|
1325 |
REWRITE_TAC[IN_IMAGE] THEN
|
|
1326 |
DISCH_THEN(X_CHOOSE_THEN `y:real^N`
|
|
1327 |
(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC)) THEN
|
|
1328 |
DISCH_THEN(MP_TAC o AP_TERM `(%) (N / m) :real^N->real^N`) THEN
|
|
1329 |
SUBGOAL_THEN `~(N = 0) \<and> ~(m = 0)` STRIP_ASSUME_TAC THENL
|
|
1330 |
[REWRITE_TAC[REAL_OF_NUM_EQ] THEN
|
|
1331 |
REPEAT(FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [IN_NUMSEG])) THEN
|
|
1332 |
ARITH_TAC;
|
|
1333 |
ALL_TAC] THEN
|
|
1334 |
FIRST_X_ASSUM(ASSUME_TAC o GEN_REWRITE_RULE (BINDER_CONV o BINDER_CONV)
|
|
1335 |
[GSYM CONTRAPOS_THM]) THEN
|
|
1336 |
ASM_SIMP_TAC[VECTOR_MUL_ASSOC; REAL_FIELD
|
|
1337 |
`~(x = 0) \<and> ~(y = 0) ==> x / y * y / x = 1`] THEN
|
|
1338 |
ASM_SIMP_TAC[REAL_FIELD
|
|
1339 |
`~(x = 0) \<and> ~(y = 0) ==> x / y * z / x = z / y`] THEN
|
|
1340 |
REWRITE_TAC[VECTOR_MUL_LID] THEN DISCH_THEN SUBST_ALL_TAC THEN
|
|
1341 |
FIRST_X_ASSUM(MP_TAC o SPECL [`n / m`; `y:real^N`]) THEN
|
|
1342 |
ASM_SIMP_TAC[REAL_LE_DIV; REAL_POS; REAL_FIELD
|
|
1343 |
`~(y = 0) ==> (x / y = 1 \<longleftrightarrow> x = y)`] THEN
|
|
1344 |
REWRITE_TAC[REAL_OF_NUM_EQ; EQ_SYM_EQ];
|
|
1345 |
ALL_TAC] THEN
|
|
1346 |
ANTS_TAC THENL [ASM_MESON_TAC[]; DISCH_TAC] THEN
|
|
1347 |
REWRITE_TAC[NOT_IMP] THEN REPEAT CONJ_TAC THENL
|
|
1348 |
[REWRITE_TAC[measurable] THEN ASM_MESON_TAC[];
|
|
1349 |
REWRITE_TAC[MEASURABLE_INTERVAL];
|
|
1350 |
REWRITE_TAC[UNIONS_SUBSET; FORALL_IN_IMAGE] THEN
|
|
1351 |
REWRITE_TAC[SUBSET; FORALL_IN_IMAGE] THEN
|
|
1352 |
X_GEN_TAC `n:num` THEN DISCH_TAC THEN X_GEN_TAC `x:real^N` THEN
|
|
1353 |
DISCH_TAC THEN
|
|
1354 |
MP_TAC(ISPECL [`--a:real^N`; `a:real^N`] CONVEX_INTERVAL) THEN
|
|
1355 |
DISCH_THEN(MP_TAC o REWRITE_RULE[CONVEX_ALT] o CONJUNCT1) THEN
|
|
1356 |
DISCH_THEN(MP_TAC o SPECL [`0:real^N`; `x:real^N`; `n / N`]) THEN
|
|
1357 |
ASM_REWRITE_TAC[VECTOR_MUL_RZERO; VECTOR_ADD_LID] THEN
|
|
1358 |
DISCH_THEN MATCH_MP_TAC THEN SIMP_TAC[REAL_LE_DIV; REAL_POS] THEN
|
|
1359 |
CONJ_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN
|
|
1360 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [IN_NUMSEG]) THEN
|
|
1361 |
DISCH_THEN(MP_TAC o MATCH_MP (ARITH_RULE
|
|
1362 |
`1 \<le> n \<and> n \<le> N ==> 0 < N \<and> n \<le> N`)) THEN
|
|
1363 |
SIMP_TAC[GSYM REAL_OF_NUM_LE; GSYM REAL_OF_NUM_LT; REAL_LE_LDIV_EQ] THEN
|
|
1364 |
SIMP_TAC[REAL_MUL_LID];
|
|
1365 |
ALL_TAC] THEN
|
|
1366 |
FIRST_X_ASSUM(SUBST1_TAC o MATCH_MP MEASURE_UNIQUE) THEN
|
|
1367 |
ASM_SIMP_TAC[MEASURE_SCALING; REAL_NOT_LE] THEN
|
|
1368 |
FIRST_X_ASSUM(K ALL_TAC o SPEC `0`) THEN
|
|
1369 |
MATCH_MP_TAC REAL_LTE_TRANS THEN EXISTS_TAC
|
|
1370 |
`sum (1..N) (measure o (\<lambda>m. IMAGE (\<lambda>x:real^N. m / N % x) s))` THEN
|
|
1371 |
CONJ_TAC THENL
|
|
1372 |
[ALL_TAC;
|
|
1373 |
MATCH_MP_TAC REAL_EQ_IMP_LE THEN CONV_TAC SYM_CONV THEN
|
|
1374 |
MATCH_MP_TAC SUM_IMAGE THEN REWRITE_TAC[] THEN
|
|
1375 |
REPEAT STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
|
|
1376 |
ASM_REWRITE_TAC[SET_RULE `DISJOINT s s \<longleftrightarrow> s = {}`; IMAGE_EQ_EMPTY] THEN
|
|
1377 |
DISCH_THEN SUBST_ALL_TAC THEN
|
|
1378 |
ASM_MESON_TAC[REAL_LT_REFL; MEASURE_EMPTY]] THEN
|
|
1379 |
FIRST_X_ASSUM(K ALL_TAC o SPEC `0`) THEN
|
|
1380 |
ASM_SIMP_TAC[o_DEF; MEASURE_SCALING; SUM_RMUL] THEN
|
|
1381 |
FIRST_ASSUM(MATCH_MP_TAC o MATCH_MP (REAL_ARITH
|
|
1382 |
`x < a ==> a \<le> b ==> x < b`)) THEN
|
|
1383 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_POW_LT; REAL_OF_NUM_LT; ARITH] THEN
|
|
1384 |
ONCE_REWRITE_TAC[REAL_ARITH `(a * b) * c:real = (a * c) * b`] THEN
|
|
1385 |
ASM_SIMP_TAC[REAL_LE_RMUL_EQ] THEN REWRITE_TAC[GSYM SUM_RMUL] THEN
|
|
1386 |
REWRITE_TAC[GSYM REAL_POW_MUL] THEN
|
|
1387 |
REWRITE_TAC[REAL_ABS_DIV; REAL_ABS_NUM] THEN
|
|
1388 |
FIRST_X_ASSUM(X_CHOOSE_THEN `M:num` SUBST_ALL_TAC o
|
|
1389 |
GEN_REWRITE_RULE I [EVEN_EXISTS]) THEN
|
|
1390 |
REWRITE_TAC[GSYM REAL_OF_NUM_MUL] THEN
|
|
1391 |
RULE_ASSUM_TAC(REWRITE_RULE[GSYM REAL_OF_NUM_MUL]) THEN
|
|
1392 |
RULE_ASSUM_TAC(REWRITE_RULE[REAL_ARITH `0 < 2 * x \<longleftrightarrow> 0 < x`]) THEN
|
|
1393 |
ASM_SIMP_TAC[REAL_FIELD `0 < y ==> x / (2 * y) * 4 = x * 2 / y`] THEN
|
|
1394 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
1395 |
EXISTS_TAC `sum(M..(2*M)) (\<lambda>i. (i * 2 / M) pow dimindex (:N))` THEN
|
|
1396 |
CONJ_TAC THENL
|
|
1397 |
[ALL_TAC;
|
|
1398 |
MATCH_MP_TAC SUM_SUBSET_SIMPLE THEN
|
|
1399 |
SIMP_TAC[REAL_POW_LE; REAL_LE_MUL; REAL_LE_DIV; REAL_POS] THEN
|
|
1400 |
REWRITE_TAC[IN_NUMSEG; FINITE_NUMSEG; SUBSET] THEN
|
|
1401 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [REAL_OF_NUM_LT]) THEN
|
|
1402 |
ARITH_TAC] THEN
|
|
1403 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
1404 |
EXISTS_TAC `sum(M..(2*M)) (\<lambda>i. 2)` THEN CONJ_TAC THENL
|
|
1405 |
[REWRITE_TAC[SUM_CONST_NUMSEG] THEN
|
|
1406 |
REWRITE_TAC[ARITH_RULE `(2 * M + 1) - M = M + 1`] THEN
|
|
1407 |
REWRITE_TAC[GSYM REAL_OF_NUM_ADD] THEN REAL_ARITH_TAC;
|
|
1408 |
ALL_TAC] THEN
|
|
1409 |
MATCH_MP_TAC SUM_LE THEN REWRITE_TAC[FINITE_NUMSEG; IN_NUMSEG] THEN
|
|
1410 |
X_GEN_TAC `n:num` THEN STRIP_TAC THEN
|
|
1411 |
MATCH_MP_TAC REAL_LE_TRANS THEN EXISTS_TAC `2 pow (dimindex(:N))` THEN
|
|
1412 |
CONJ_TAC THENL
|
|
1413 |
[GEN_REWRITE_TAC LAND_CONV [GSYM REAL_POW_1] THEN
|
|
1414 |
MATCH_MP_TAC REAL_POW_MONO THEN REWRITE_TAC[DIMINDEX_GE_1] THEN
|
|
1415 |
ARITH_TAC;
|
|
1416 |
ALL_TAC] THEN
|
|
1417 |
MATCH_MP_TAC REAL_POW_LE2 THEN
|
|
1418 |
REWRITE_TAC[REAL_POS; ARITH; real_div; REAL_MUL_ASSOC] THEN
|
|
1419 |
ASM_SIMP_TAC[GSYM real_div; REAL_LE_RDIV_EQ] THEN
|
|
1420 |
REWRITE_TAC[REAL_OF_NUM_MUL; REAL_OF_NUM_LE] THEN
|
|
1421 |
UNDISCH_TAC `M:num \<le> n` THEN ARITH_TAC);; *)
|
|
1422 |
|
|
1423 |
lemma STARLIKE_NEGLIGIBLE_LEMMA: True .. (*
|
|
1424 |
"!s. compact s \<and>
|
|
1425 |
(!c x:real^N. 0 \<le> c \<and> x \<in> s \<and> (c % x) \<in> s ==> c = 1)
|
|
1426 |
==> negligible s"
|
|
1427 |
qed REPEAT STRIP_TAC THEN
|
|
1428 |
MATCH_MP_TAC STARLIKE_NEGLIGIBLE_BOUNDED_MEASURABLE THEN
|
|
1429 |
ASM_MESON_TAC[MEASURABLE_COMPACT; COMPACT_IMP_BOUNDED]);; *)
|
|
1430 |
|
|
1431 |
lemma STARLIKE_NEGLIGIBLE: True .. (*
|
|
1432 |
"!s a. closed s \<and>
|
|
1433 |
(!c x:real^N. 0 \<le> c \<and> (a + x) \<in> s \<and> (a + c % x) \<in> s ==> c = 1)
|
|
1434 |
==> negligible s"
|
|
1435 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_TRANSLATION_REV THEN
|
|
1436 |
EXISTS_TAC `--a:real^N` THEN ONCE_REWRITE_TAC[NEGLIGIBLE_ON_INTERVALS] THEN
|
|
1437 |
MAP_EVERY X_GEN_TAC [`u:real^N`; `v:real^N`] THEN
|
|
1438 |
MATCH_MP_TAC STARLIKE_NEGLIGIBLE_LEMMA THEN CONJ_TAC THENL
|
|
1439 |
[MATCH_MP_TAC CLOSED_INTER_COMPACT THEN REWRITE_TAC[COMPACT_INTERVAL] THEN
|
|
1440 |
ASM_SIMP_TAC[CLOSED_TRANSLATION];
|
|
1441 |
REWRITE_TAC[IN_IMAGE; IN_INTER] THEN
|
|
1442 |
ONCE_REWRITE_TAC[VECTOR_ARITH `x:real^N = --a + y \<longleftrightarrow> y = a + x`] THEN
|
|
1443 |
REWRITE_TAC[UNWIND_THM2] THEN ASM MESON_TAC[]]);; *)
|
|
1444 |
|
|
1445 |
lemma STARLIKE_NEGLIGIBLE_STRONG: True .. (*
|
|
1446 |
"!s a. closed s \<and>
|
|
1447 |
(!c x:real^N. 0 \<le> c \<and> c < 1 \<and> (a + x) \<in> s
|
|
1448 |
==> ~((a + c % x) \<in> s))
|
|
1449 |
==> negligible s"
|
|
1450 |
qed REPEAT GEN_TAC THEN STRIP_TAC THEN MATCH_MP_TAC STARLIKE_NEGLIGIBLE THEN
|
|
1451 |
EXISTS_TAC `a:real^N` THEN ASM_REWRITE_TAC[] THEN
|
|
1452 |
MAP_EVERY X_GEN_TAC [`c:real`; `x:real^N`] THEN STRIP_TAC THEN
|
|
1453 |
MATCH_MP_TAC(REAL_ARITH `~(x < y) \<and> ~(y < x) ==> x = y`) THEN
|
|
1454 |
STRIP_TAC THENL [ASM_MESON_TAC[]; ALL_TAC] THEN DISCH_TAC THEN
|
|
1455 |
FIRST_X_ASSUM(MP_TAC o SPECL [`inv c`; `c % x:real^N`]) THEN
|
|
1456 |
ASM_REWRITE_TAC[REAL_LE_INV_EQ; VECTOR_MUL_ASSOC] THEN
|
|
1457 |
ASM_SIMP_TAC[REAL_MUL_LINV; REAL_ARITH `1 < c ==> ~(c = 0)`] THEN
|
|
1458 |
ASM_REWRITE_TAC[VECTOR_MUL_LID] THEN
|
|
1459 |
GEN_REWRITE_TAC RAND_CONV [GSYM REAL_INV_1] THEN
|
|
1460 |
MATCH_MP_TAC REAL_LT_INV2 THEN ASM_REWRITE_TAC[REAL_LT_01]);; *)
|
|
1461 |
|
|
1462 |
(* ------------------------------------------------------------------------- *)
|
|
1463 |
(* In particular. *)
|
|
1464 |
(* ------------------------------------------------------------------------- *)
|
|
1465 |
|
|
1466 |
lemma NEGLIGIBLE_HYPERPLANE: True .. (*
|
|
1467 |
"!a b. ~(a = 0 \<and> b = 0) ==> negligible {x:real^N | a dot x = b}"
|
|
1468 |
qed REPEAT GEN_TAC THEN ASM_CASES_TAC `a:real^N = 0` THEN
|
|
1469 |
ASM_SIMP_TAC[DOT_LZERO; SET_RULE `{x | F} = {}`; NEGLIGIBLE_EMPTY] THEN
|
|
1470 |
MATCH_MP_TAC STARLIKE_NEGLIGIBLE THEN
|
|
1471 |
SUBGOAL_THEN `?x:real^N. ~(a dot x = b)` MP_TAC THENL
|
|
1472 |
[MATCH_MP_TAC(MESON[] `!a:real^N. P a \/ P(--a) ==> ?x. P x`) THEN
|
|
1473 |
EXISTS_TAC `a:real^N` THEN REWRITE_TAC[DOT_RNEG] THEN
|
|
1474 |
MATCH_MP_TAC(REAL_ARITH `~(a = 0) ==> ~(a = b) \/ ~(--a = b)`) THEN
|
|
1475 |
ASM_REWRITE_TAC[DOT_EQ_0];
|
|
1476 |
ALL_TAC] THEN
|
|
1477 |
MATCH_MP_TAC MONO_EXISTS THEN X_GEN_TAC `c:real^N` THEN DISCH_TAC THEN
|
|
1478 |
REWRITE_TAC[CLOSED_HYPERPLANE; IN_ELIM_THM; DOT_RADD; DOT_RMUL] THEN
|
|
1479 |
MAP_EVERY X_GEN_TAC [`t:real`; `y:real^N`] THEN
|
|
1480 |
DISCH_THEN(MP_TAC o MATCH_MP (REAL_ARITH
|
|
1481 |
`0 \<le> t \<and> ac + ay = b \<and> ac + t * ay = b
|
|
1482 |
==> ((ay = 0 ==> ac = b) \<and> (t - 1) * ay = 0)`)) THEN
|
|
1483 |
ASM_SIMP_TAC[REAL_ENTIRE; REAL_SUB_0] THEN CONV_TAC TAUT);; *)
|
|
1484 |
|
|
1485 |
lemma NEGLIGIBLE_LOWDIM: True .. (*
|
|
1486 |
"!s:real^N->bool. dim(s) < dimindex(:N) ==> negligible s"
|
|
1487 |
qed GEN_TAC THEN DISCH_THEN(MP_TAC o MATCH_MP LOWDIM_SUBSET_HYPERPLANE) THEN
|
|
1488 |
DISCH_THEN(X_CHOOSE_THEN `a:real^N` STRIP_ASSUME_TAC) THEN
|
|
1489 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
1490 |
EXISTS_TAC `span(s):real^N->bool` THEN REWRITE_TAC[SPAN_INC] THEN
|
|
1491 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
1492 |
EXISTS_TAC `{x:real^N | a dot x = 0}` THEN
|
|
1493 |
ASM_SIMP_TAC[NEGLIGIBLE_HYPERPLANE]);; *)
|
|
1494 |
|
|
1495 |
(* ------------------------------------------------------------------------- *)
|
|
1496 |
(* Measurability of bounded convex sets. *)
|
|
1497 |
(* ------------------------------------------------------------------------- *)
|
|
1498 |
|
|
1499 |
lemma NEGLIGIBLE_CONVEX_FRONTIER: True .. (*
|
|
1500 |
"!s:real^N->bool. convex s ==> negligible(frontier s)"
|
|
1501 |
qed SUBGOAL_THEN
|
|
1502 |
`!s:real^N->bool. convex s \<and> (0) \<in> s ==> negligible(frontier s)`
|
|
1503 |
ASSUME_TAC THENL
|
|
1504 |
[ALL_TAC;
|
|
1505 |
X_GEN_TAC `s:real^N->bool` THEN DISCH_TAC THEN
|
|
1506 |
ASM_CASES_TAC `s:real^N->bool = {}` THEN
|
|
1507 |
ASM_REWRITE_TAC[FRONTIER_EMPTY; NEGLIGIBLE_EMPTY] THEN
|
|
1508 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [GSYM MEMBER_NOT_EMPTY]) THEN
|
|
1509 |
DISCH_THEN(X_CHOOSE_TAC `a:real^N`) THEN
|
|
1510 |
FIRST_X_ASSUM(MP_TAC o SPEC `IMAGE (\<lambda>x:real^N. --a + x) s`) THEN
|
|
1511 |
ASM_SIMP_TAC[CONVEX_TRANSLATION; IN_IMAGE] THEN
|
|
1512 |
ASM_REWRITE_TAC[UNWIND_THM2;
|
|
1513 |
VECTOR_ARITH `0:real^N = --a + x \<longleftrightarrow> x = a`] THEN
|
|
1514 |
REWRITE_TAC[FRONTIER_TRANSLATION; NEGLIGIBLE_TRANSLATION_EQ]] THEN
|
|
1515 |
REPEAT STRIP_TAC THEN MP_TAC(ISPEC `s:real^N->bool` DIM_SUBSET_UNIV) THEN
|
|
1516 |
REWRITE_TAC[ARITH_RULE `d:num \<le> e \<longleftrightarrow> d < e \/ d = e`] THEN STRIP_TAC THENL
|
|
1517 |
[MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
1518 |
EXISTS_TAC `closure s:real^N->bool` THEN
|
|
1519 |
REWRITE_TAC[frontier; SUBSET_DIFF] THEN
|
|
1520 |
MATCH_MP_TAC NEGLIGIBLE_LOWDIM THEN ASM_REWRITE_TAC[DIM_CLOSURE];
|
|
1521 |
ALL_TAC] THEN
|
|
1522 |
SUBGOAL_THEN `?a:real^N. a \<in> interior s` CHOOSE_TAC THENL
|
|
1523 |
[X_CHOOSE_THEN `b:real^N->bool` STRIP_ASSUME_TAC
|
|
1524 |
(ISPEC `s:real^N->bool` BASIS_EXISTS) THEN
|
|
1525 |
FIRST_X_ASSUM SUBST_ALL_TAC THEN
|
|
1526 |
MP_TAC(ISPEC `b:real^N->bool` INTERIOR_SIMPLEX_NONEMPTY) THEN
|
|
1527 |
ASM_REWRITE_TAC[] THEN
|
|
1528 |
MATCH_MP_TAC MONO_EXISTS THEN REWRITE_TAC[GSYM SUBSET] THEN
|
|
1529 |
MATCH_MP_TAC SUBSET_INTERIOR THEN MATCH_MP_TAC HULL_MINIMAL THEN
|
|
1530 |
ASM_REWRITE_TAC[INSERT_SUBSET];
|
|
1531 |
ALL_TAC] THEN
|
|
1532 |
MATCH_MP_TAC STARLIKE_NEGLIGIBLE_STRONG THEN
|
|
1533 |
EXISTS_TAC `a:real^N` THEN REWRITE_TAC[FRONTIER_CLOSED] THEN
|
|
1534 |
REPEAT GEN_TAC THEN STRIP_TAC THEN
|
|
1535 |
REWRITE_TAC[frontier; IN_DIFF; DE_MORGAN_THM] THEN DISJ2_TAC THEN
|
|
1536 |
SIMP_TAC[VECTOR_ARITH
|
|
1537 |
`a + c % x:real^N = (a + x) - (1 - c) % ((a + x) - a)`] THEN
|
|
1538 |
MATCH_MP_TAC IN_INTERIOR_CLOSURE_CONVEX_SHRINK THEN
|
|
1539 |
RULE_ASSUM_TAC(REWRITE_RULE[frontier; IN_DIFF]) THEN
|
|
1540 |
ASM_REWRITE_TAC[] THEN ASM_REAL_ARITH_TAC);; *)
|
|
1541 |
|
|
1542 |
lemma GMEASURABLE_CONVEX: True .. (*
|
|
1543 |
"!s:real^N->bool. convex s \<and> bounded s ==> gmeasurable s"
|
|
1544 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC GMEASURABLE_JORDAN THEN
|
|
1545 |
ASM_SIMP_TAC[NEGLIGIBLE_CONVEX_FRONTIER]);; *)
|
|
1546 |
|
|
1547 |
(* ------------------------------------------------------------------------- *)
|
|
1548 |
(* Various special cases. *)
|
|
1549 |
(* ------------------------------------------------------------------------- *)
|
|
1550 |
|
|
1551 |
lemma NEGLIGIBLE_SPHERE: True .. (*
|
|
1552 |
"!a r. negligible {x:real^N | dist(a,x) = r}"
|
|
1553 |
qed REWRITE_TAC[GSYM FRONTIER_CBALL] THEN
|
|
1554 |
SIMP_TAC[NEGLIGIBLE_CONVEX_FRONTIER; CONVEX_CBALL]);; *)
|
|
1555 |
|
|
1556 |
lemma GMEASURABLE_BALL: True .. (*
|
|
1557 |
"!a r. gmeasurable(ball(a,r))"
|
|
1558 |
qed SIMP_TAC[MEASURABLE_OPEN; BOUNDED_BALL; OPEN_BALL]);; *)
|
|
1559 |
|
|
1560 |
lemma GMEASURABLE_CBALL: True .. (*
|
|
1561 |
"!a r. gmeasurable(cball(a,r))"
|
|
1562 |
qed SIMP_TAC[MEASURABLE_COMPACT; COMPACT_CBALL]);; *)
|
|
1563 |
|
|
1564 |
(* ------------------------------------------------------------------------- *)
|
|
1565 |
(* Negligibility of image under non-injective linear map. *)
|
|
1566 |
(* ------------------------------------------------------------------------- *)
|
|
1567 |
|
|
1568 |
lemma NEGLIGIBLE_LINEAR_SINGULAR_IMAGE: True .. (*
|
|
1569 |
"!f:real^N->real^N s.
|
|
1570 |
linear f \<and> ~(!x y. f(x) = f(y) ==> x = y)
|
|
1571 |
==> negligible(IMAGE f s)"
|
|
1572 |
qed REPEAT GEN_TAC THEN
|
|
1573 |
DISCH_THEN(MP_TAC o MATCH_MP LINEAR_SINGULAR_IMAGE_HYPERPLANE) THEN
|
|
1574 |
DISCH_THEN(X_CHOOSE_THEN `a:real^N` STRIP_ASSUME_TAC) THEN
|
|
1575 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
1576 |
EXISTS_TAC `{x:real^N | a dot x = 0}` THEN
|
|
1577 |
ASM_SIMP_TAC[NEGLIGIBLE_HYPERPLANE]);; *)
|
|
1578 |
|
|
1579 |
(* ------------------------------------------------------------------------- *)
|
|
1580 |
(* Approximation of gmeasurable set by union of intervals. *)
|
|
1581 |
(* ------------------------------------------------------------------------- *)
|
|
1582 |
|
|
1583 |
lemma COVERING_LEMMA: True .. (*
|
|
1584 |
"!a b:real^N s g.
|
|
1585 |
s \<subseteq> {a..b} \<and> ~({a<..<b} = {}) \<and> gauge g
|
|
1586 |
==> ?d. COUNTABLE d \<and>
|
|
1587 |
(!k. k \<in> d ==> k \<subseteq> {a..b} \<and> ~(k = {}) \<and>
|
|
1588 |
(\<exists>c d. k = {c..d})) \<and>
|
|
1589 |
(!k1 k2. k1 \<in> d \<and> k2 \<in> d \<and> ~(k1 = k2)
|
|
1590 |
==> interior k1 \<inter> interior k2 = {}) \<and>
|
|
1591 |
(!k. k \<in> d ==> ?x. x \<in> (s \<inter> k) \<and> k \<subseteq> g(x)) \<and>
|
|
1592 |
s \<subseteq> \<Union>d"
|
|
1593 |
qed REPEAT STRIP_TAC THEN
|
|
1594 |
SUBGOAL_THEN
|
|
1595 |
`?d. COUNTABLE d \<and>
|
|
1596 |
(!k. k \<in> d ==> k \<subseteq> {a..b} \<and> ~(k = {}) \<and>
|
|
1597 |
(\<exists>c d:real^N. k = {c..d})) \<and>
|
|
1598 |
(!k1 k2. k1 \<in> d \<and> k2 \<in> d
|
|
1599 |
==> k1 \<subseteq> k2 \/ k2 \<subseteq> k1 \/
|
|
1600 |
interior k1 \<inter> interior k2 = {}) \<and>
|
|
1601 |
(!x. x \<in> s ==> ?k. k \<in> d \<and> x \<in> k \<and> k \<subseteq> g(x)) \<and>
|
|
1602 |
(!k. k \<in> d ==> FINITE {l | l \<in> d \<and> k \<subseteq> l})`
|
|
1603 |
ASSUME_TAC THENL
|
|
1604 |
[EXISTS_TAC
|
|
1605 |
`IMAGE (\<lambda>(n,v).
|
|
1606 |
interval[(lambda i. a$i + (v$i) / 2 pow n *
|
|
1607 |
((b:real^N)$i - (a:real^N)$i)):real^N,
|
|
1608 |
(lambda i. a$i + ((v$i) + 1) / 2 pow n * (b$i - a$i))])
|
|
1609 |
{n,v | n \<in> (:num) \<and>
|
|
1610 |
v \<in> {v:num^N | !i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1611 |
==> v$i < 2 EXP n}}` THEN
|
|
1612 |
CONJ_TAC THENL
|
|
1613 |
[MATCH_MP_TAC COUNTABLE_IMAGE THEN
|
|
1614 |
MATCH_MP_TAC COUNTABLE_PRODUCT_DEPENDENT THEN
|
|
1615 |
REWRITE_TAC[NUM_COUNTABLE; IN_UNIV] THEN
|
|
1616 |
GEN_TAC THEN MATCH_MP_TAC FINITE_IMP_COUNTABLE THEN
|
|
1617 |
MATCH_MP_TAC FINITE_CART THEN REWRITE_TAC[FINITE_NUMSEG_LT];
|
|
1618 |
ALL_TAC] THEN
|
|
1619 |
CONJ_TAC THENL
|
|
1620 |
[REWRITE_TAC[FORALL_IN_IMAGE; FORALL_PAIR_THM] THEN
|
|
1621 |
MAP_EVERY X_GEN_TAC [`n:num`; `v:num^N`] THEN
|
|
1622 |
REWRITE_TAC[IN_ELIM_PAIR_THM] THEN
|
|
1623 |
REWRITE_TAC[IN_ELIM_THM; IN_UNIV] THEN DISCH_TAC THEN
|
|
1624 |
REWRITE_TAC[CONJ_ASSOC] THEN CONJ_TAC THENL [ALL_TAC; MESON_TAC[]] THEN
|
|
1625 |
SIMP_TAC[INTERVAL_NE_EMPTY; SUBSET_INTERVAL; LAMBDA_BETA] THEN
|
|
1626 |
REWRITE_TAC[REAL_LE_LADD; REAL_LE_ADDR; REAL_ARITH
|
|
1627 |
`a + x * (b - a) \<le> b \<longleftrightarrow> 0 \<le> (1 - x) * (b - a)`] THEN
|
|
1628 |
RULE_ASSUM_TAC(REWRITE_RULE[INTERVAL_NE_EMPTY]) THEN
|
|
1629 |
REPEAT STRIP_TAC THEN
|
|
1630 |
(MATCH_MP_TAC REAL_LE_MUL ORELSE MATCH_MP_TAC REAL_LE_RMUL) THEN
|
|
1631 |
ASM_SIMP_TAC[REAL_SUB_LE; REAL_LE_DIV2_EQ; REAL_LT_POW2] THEN
|
|
1632 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LE_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1633 |
REWRITE_TAC[REAL_MUL_LZERO; REAL_POS; REAL_MUL_LID; REAL_LE_ADDR] THEN
|
|
1634 |
SIMP_TAC[REAL_OF_NUM_ADD; REAL_OF_NUM_POW; REAL_OF_NUM_LE] THEN
|
|
1635 |
ASM_SIMP_TAC[ARITH_RULE `x + 1 \<le> y \<longleftrightarrow> x < y`; REAL_LT_IMP_LE];
|
|
1636 |
ALL_TAC] THEN
|
|
1637 |
CONJ_TAC THENL
|
|
1638 |
[ONCE_REWRITE_TAC[IMP_CONJ] THEN
|
|
1639 |
REWRITE_TAC[FORALL_IN_IMAGE; FORALL_PAIR_THM; RIGHT_FORALL_IMP_THM] THEN
|
|
1640 |
REWRITE_TAC[IN_ELIM_PAIR_THM; IN_UNIV] THEN REWRITE_TAC[IN_ELIM_THM] THEN
|
|
1641 |
REWRITE_TAC[RIGHT_IMP_FORALL_THM] THEN
|
|
1642 |
GEN_REWRITE_TAC BINDER_CONV [SWAP_FORALL_THM] THEN
|
|
1643 |
MATCH_MP_TAC WLOG_LE THEN CONJ_TAC THENL
|
|
1644 |
[REPEAT GEN_TAC THEN
|
|
1645 |
GEN_REWRITE_TAC RAND_CONV [SWAP_FORALL_THM] THEN
|
|
1646 |
REPEAT(AP_TERM_TAC THEN ABS_TAC) THEN SET_TAC[];
|
|
1647 |
ALL_TAC] THEN
|
|
1648 |
MAP_EVERY X_GEN_TAC [`m:num`; `n:num`] THEN DISCH_TAC THEN
|
|
1649 |
MAP_EVERY X_GEN_TAC [`v:num^N`; `w:num^N`] THEN REPEAT DISCH_TAC THEN
|
|
1650 |
REWRITE_TAC[INTERIOR_CLOSED_INTERVAL; SUBSET_INTERVAL] THEN
|
|
1651 |
SIMP_TAC[DISJOINT_INTERVAL; LAMBDA_BETA] THEN
|
|
1652 |
MATCH_MP_TAC(TAUT `p \/ q \/ r ==> (a ==> p) \/ (b ==> q) \/ r`) THEN
|
|
1653 |
ONCE_REWRITE_TAC[TAUT `a \<and> b \<and> c \<longleftrightarrow> ~(a \<and> b ==> ~c)`] THEN
|
|
1654 |
RULE_ASSUM_TAC(REWRITE_RULE[INTERVAL_NE_EMPTY]) THEN
|
|
1655 |
ASM_SIMP_TAC[REAL_LE_LADD; REAL_LE_RMUL_EQ; REAL_SUB_LT; LAMBDA_BETA] THEN
|
|
1656 |
REWRITE_TAC[NOT_IMP; REAL_LE_LADD] THEN
|
|
1657 |
ASM_SIMP_TAC[REAL_LE_DIV2_EQ; REAL_LT_POW2] THEN
|
|
1658 |
REWRITE_TAC[REAL_ARITH `~(x + 1 \<le> x)`] THEN DISJ2_TAC THEN
|
|
1659 |
MATCH_MP_TAC(MESON[]
|
|
1660 |
`(!i. ~P i ==> Q i) ==> (!i. Q i) \/ (\<exists>i. P i)`) THEN
|
|
1661 |
X_GEN_TAC `i:num` THEN
|
|
1662 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN
|
|
1663 |
ASM_REWRITE_TAC[DE_MORGAN_THM; REAL_NOT_LE] THEN
|
|
1664 |
UNDISCH_TAC `m:num \<le> n` THEN REWRITE_TAC[LE_EXISTS] THEN
|
|
1665 |
DISCH_THEN(X_CHOOSE_THEN `p:num` SUBST1_TAC) THEN
|
|
1666 |
ONCE_REWRITE_TAC[ADD_SYM] THEN
|
|
1667 |
REWRITE_TAC[REAL_POW_ADD; real_div; REAL_INV_MUL] THEN
|
|
1668 |
REWRITE_TAC[REAL_MUL_ASSOC] THEN REWRITE_TAC[GSYM real_div] THEN
|
|
1669 |
ASM_SIMP_TAC[REAL_LE_DIV2_EQ; REAL_LT_POW2; REAL_LT_DIV2_EQ] THEN
|
|
1670 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LE_RDIV_EQ; REAL_LT_POW2;
|
|
1671 |
REAL_LT_LDIV_EQ; REAL_LT_RDIV_EQ] THEN
|
|
1672 |
SIMP_TAC[REAL_LT_INTEGERS; INTEGER_CLOSED] THEN REAL_ARITH_TAC;
|
|
1673 |
ALL_TAC] THEN
|
|
1674 |
CONJ_TAC THENL
|
|
1675 |
[X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
|
|
1676 |
SUBGOAL_THEN
|
|
1677 |
`?e. 0 < e \<and> !y. (!i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1678 |
==> abs((x:real^N)$i - (y:real^N)$i) \<le> e)
|
|
1679 |
==> y \<in> g(x)`
|
|
1680 |
STRIP_ASSUME_TAC THENL
|
|
1681 |
[FIRST_ASSUM(MP_TAC o SPEC `x:real^N` o GEN_REWRITE_RULE I [gauge]) THEN
|
|
1682 |
STRIP_TAC THEN
|
|
1683 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [OPEN_CONTAINS_BALL]) THEN
|
|
1684 |
DISCH_THEN(MP_TAC o SPEC `x:real^N`) THEN ASM_REWRITE_TAC[] THEN
|
|
1685 |
DISCH_THEN(X_CHOOSE_THEN `e:real` STRIP_ASSUME_TAC) THEN
|
|
1686 |
EXISTS_TAC `e / 2 / (dimindex(:N))` THEN
|
|
1687 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_OF_NUM_LT; LE_1; DIMINDEX_GE_1;
|
|
1688 |
ARITH] THEN
|
|
1689 |
X_GEN_TAC `y:real^N` THEN STRIP_TAC THEN
|
|
1690 |
MATCH_MP_TAC(SET_RULE `!s. s \<subseteq> t \<and> x \<in> s ==> x \<in> t`) THEN
|
|
1691 |
EXISTS_TAC `ball(x:real^N,e)` THEN ASM_REWRITE_TAC[IN_BALL] THEN
|
|
1692 |
MATCH_MP_TAC(REAL_ARITH `0 < e \<and> x \<le> e / 2 ==> x < e`) THEN
|
|
1693 |
ASM_REWRITE_TAC[dist] THEN MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
1694 |
EXISTS_TAC `sum(1..dimindex(:N)) (\<lambda>i. abs((x - y:real^N)$i))` THEN
|
|
1695 |
REWRITE_TAC[NORM_LE_L1] THEN MATCH_MP_TAC SUM_BOUND_GEN THEN
|
|
1696 |
ASM_SIMP_TAC[IN_NUMSEG; FINITE_NUMSEG; NUMSEG_EMPTY; NOT_LT;
|
|
1697 |
DIMINDEX_GE_1; VECTOR_SUB_COMPONENT; CARD_NUMSEG_1];
|
|
1698 |
ALL_TAC] THEN
|
|
1699 |
REWRITE_TAC[EXISTS_IN_IMAGE; EXISTS_PAIR_THM; IN_ELIM_PAIR_THM] THEN
|
|
1700 |
MP_TAC(SPECL [`1 / 2`; `e / norm(b - a:real^N)`]
|
|
1701 |
REAL_ARCH_POW_INV) THEN
|
|
1702 |
SUBGOAL_THEN `0 < norm(b - a:real^N)` ASSUME_TAC THENL
|
|
1703 |
[ASM_MESON_TAC[VECTOR_SUB_EQ; NORM_POS_LT; INTERVAL_SING]; ALL_TAC] THEN
|
|
1704 |
CONV_TAC REAL_RAT_REDUCE_CONV THEN ASM_SIMP_TAC[REAL_LT_DIV] THEN
|
|
1705 |
MATCH_MP_TAC MONO_EXISTS THEN X_GEN_TAC `n:num` THEN
|
|
1706 |
REWRITE_TAC[real_div; REAL_MUL_LID; REAL_POW_INV] THEN DISCH_TAC THEN
|
|
1707 |
SIMP_TAC[IN_ELIM_THM; IN_INTERVAL; SUBSET; LAMBDA_BETA] THEN
|
|
1708 |
MATCH_MP_TAC(MESON[]
|
|
1709 |
`(!x. Q x ==> R x) \<and> (\<exists>x. P x \<and> Q x) ==> ?x. P x \<and> Q x \<and> R x`) THEN
|
|
1710 |
CONJ_TAC THENL
|
|
1711 |
[REWRITE_TAC[RIGHT_IMP_FORALL_THM] THEN
|
|
1712 |
MAP_EVERY X_GEN_TAC [`w:num^N`; `y:real^N`] THEN
|
|
1713 |
REWRITE_TAC[IMP_IMP; AND_FORALL_THM] THEN
|
|
1714 |
DISCH_THEN(fun th -> FIRST_X_ASSUM MATCH_MP_TAC THEN MP_TAC th) THEN
|
|
1715 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `i:num` THEN
|
|
1716 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN
|
|
1717 |
ASM_REWRITE_TAC[] THEN DISCH_THEN(MP_TAC o MATCH_MP (REAL_ARITH
|
|
1718 |
`(a + n \<le> x \<and> x \<le> a + m) \<and>
|
|
1719 |
(a + n \<le> y \<and> y \<le> a + m) ==> abs(x - y) \<le> m - n`)) THEN
|
|
1720 |
MATCH_MP_TAC(REAL_ARITH
|
|
1721 |
`y * z \<le> e
|
|
1722 |
==> a \<le> ((x + 1) * y) * z - ((x * y) * z) ==> a \<le> e`) THEN
|
|
1723 |
RULE_ASSUM_TAC(REWRITE_RULE[INTERVAL_NE_EMPTY]) THEN
|
|
1724 |
ASM_SIMP_TAC[GSYM REAL_LE_RDIV_EQ; REAL_SUB_LT] THEN
|
|
1725 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP
|
|
1726 |
(REAL_ARITH `n < e * x ==> 0 \<le> e * (inv y - x) ==> n \<le> e / y`)) THEN
|
|
1727 |
MATCH_MP_TAC REAL_LE_MUL THEN ASM_SIMP_TAC[REAL_LT_IMP_LE] THEN
|
|
1728 |
REWRITE_TAC[REAL_SUB_LE] THEN MATCH_MP_TAC REAL_LE_INV2 THEN
|
|
1729 |
ASM_SIMP_TAC[REAL_SUB_LT] THEN
|
|
1730 |
MP_TAC(SPECL [`b - a:real^N`; `i:num`] COMPONENT_LE_NORM) THEN
|
|
1731 |
ASM_SIMP_TAC[VECTOR_SUB_COMPONENT] THEN REAL_ARITH_TAC;
|
|
1732 |
ALL_TAC] THEN
|
|
1733 |
REWRITE_TAC[IN_UNIV; AND_FORALL_THM] THEN
|
|
1734 |
REWRITE_TAC[TAUT `(a ==> c) \<and> (a ==> b) \<longleftrightarrow> a ==> b \<and> c`] THEN
|
|
1735 |
REWRITE_TAC[GSYM LAMBDA_SKOLEM] THEN X_GEN_TAC `i:num` THEN
|
|
1736 |
STRIP_TAC THEN
|
|
1737 |
SUBGOAL_THEN `(x:real^N) \<in> {a..b}` MP_TAC THENL
|
|
1738 |
[ASM SET_TAC[]; ALL_TAC] THEN REWRITE_TAC[IN_INTERVAL] THEN
|
|
1739 |
DISCH_THEN(MP_TAC o SPEC `i:num`) THEN ASM_REWRITE_TAC[] THEN
|
|
1740 |
RULE_ASSUM_TAC(REWRITE_RULE[INTERVAL_NE_EMPTY]) THEN STRIP_TAC THEN
|
|
1741 |
DISJ_CASES_TAC(MATCH_MP (REAL_ARITH `x \<le> y ==> x = y \/ x < y`)
|
|
1742 |
(ASSUME `(x:real^N)$i \<le> (b:real^N)$i`))
|
|
1743 |
THENL
|
|
1744 |
[EXISTS_TAC `2 EXP n - 1` THEN
|
|
1745 |
SIMP_TAC[GSYM REAL_OF_NUM_SUB; GSYM REAL_OF_NUM_LT;
|
|
1746 |
EXP_LT_0; LE_1; ARITH] THEN
|
|
1747 |
ASM_REWRITE_TAC[REAL_SUB_ADD; REAL_ARITH `a - 1 < a`] THEN
|
|
1748 |
MATCH_MP_TAC(REAL_ARITH
|
|
1749 |
`1 * (b - a) = x \<and> y \<le> x ==> a + y \<le> b \<and> b \<le> a + x`) THEN
|
|
1750 |
ASM_SIMP_TAC[REAL_EQ_MUL_RCANCEL; REAL_LT_IMP_NZ; REAL_LE_RMUL_EQ;
|
|
1751 |
REAL_SUB_LT; REAL_LT_INV_EQ; REAL_LT_POW2] THEN
|
|
1752 |
SIMP_TAC[GSYM REAL_OF_NUM_POW; REAL_MUL_RINV; REAL_POW_EQ_0;
|
|
1753 |
REAL_OF_NUM_EQ; ARITH_EQ] THEN REAL_ARITH_TAC;
|
|
1754 |
ALL_TAC] THEN
|
|
1755 |
MP_TAC(SPEC `2 pow n * ((x:real^N)$i - (a:real^N)$i) /
|
|
1756 |
((b:real^N)$i - (a:real^N)$i)` FLOOR_POS) THEN
|
|
1757 |
ANTS_TAC THENL
|
|
1758 |
[ASM_MESON_TAC[REAL_LE_MUL; REAL_LE_MUL; REAL_POW_LE; REAL_POS;
|
|
1759 |
REAL_SUB_LE; REAL_LT_IMP_LE; REAL_LE_DIV];
|
|
1760 |
ALL_TAC] THEN
|
|
1761 |
MATCH_MP_TAC MONO_EXISTS THEN X_GEN_TAC `m:num` THEN
|
|
1762 |
REWRITE_TAC[GSYM REAL_OF_NUM_LT; GSYM REAL_OF_NUM_POW] THEN
|
|
1763 |
DISCH_THEN(SUBST_ALL_TAC o SYM) THEN
|
|
1764 |
REWRITE_TAC[REAL_ARITH `a + b * c \<le> x \<and> x \<le> a + b' * c \<longleftrightarrow>
|
|
1765 |
b * c \<le> x - a \<and> x - a \<le> b' * c`] THEN
|
|
1766 |
ASM_SIMP_TAC[GSYM REAL_LE_LDIV_EQ; GSYM REAL_LE_RDIV_EQ;
|
|
1767 |
REAL_SUB_LT; GSYM real_div] THEN
|
|
1768 |
ONCE_REWRITE_TAC[REAL_MUL_SYM] THEN
|
|
1769 |
SIMP_TAC[REAL_LE_LDIV_EQ; REAL_LE_RDIV_EQ; REAL_LT_POW2] THEN
|
|
1770 |
SIMP_TAC[FLOOR; REAL_LT_IMP_LE] THEN MATCH_MP_TAC REAL_LET_TRANS THEN
|
|
1771 |
EXISTS_TAC `((x:real^N)$i - (a:real^N)$i) /
|
|
1772 |
((b:real^N)$i - (a:real^N)$i) *
|
|
1773 |
2 pow n` THEN
|
|
1774 |
REWRITE_TAC[FLOOR] THEN GEN_REWRITE_TAC RAND_CONV [GSYM REAL_MUL_LID] THEN
|
|
1775 |
ASM_SIMP_TAC[REAL_LT_RMUL_EQ; REAL_LT_POW2] THEN
|
|
1776 |
ASM_SIMP_TAC[REAL_LT_LDIV_EQ; REAL_MUL_LID; REAL_SUB_LT] THEN
|
|
1777 |
ASM_REAL_ARITH_TAC;
|
|
1778 |
ALL_TAC] THEN
|
|
1779 |
REWRITE_TAC[FORALL_IN_IMAGE; FORALL_PAIR_THM; IN_ELIM_PAIR_THM] THEN
|
|
1780 |
MAP_EVERY X_GEN_TAC [`n:num`; `v:num^N`] THEN
|
|
1781 |
REWRITE_TAC[IN_ELIM_THM; IN_UNIV] THEN DISCH_TAC THEN
|
|
1782 |
MATCH_MP_TAC FINITE_SUBSET THEN EXISTS_TAC
|
|
1783 |
`IMAGE (\<lambda>(n,v).
|
|
1784 |
interval[(lambda i. a$i + (v$i) / 2 pow n *
|
|
1785 |
((b:real^N)$i - (a:real^N)$i)):real^N,
|
|
1786 |
(lambda i. a$i + ((v$i) + 1) / 2 pow n * (b$i - a$i))])
|
|
1787 |
{m,v | m \<in> 0..n \<and>
|
|
1788 |
v \<in> {v:num^N | !i. 1 \<le> i \<and> i \<le> dimindex(:N)
|
|
1789 |
==> v$i < 2 EXP m}}` THEN
|
|
1790 |
CONJ_TAC THENL
|
|
1791 |
[MATCH_MP_TAC FINITE_IMAGE THEN
|
|
1792 |
MATCH_MP_TAC FINITE_PRODUCT_DEPENDENT THEN
|
|
1793 |
REWRITE_TAC[FINITE_NUMSEG] THEN REPEAT STRIP_TAC THEN
|
|
1794 |
MATCH_MP_TAC FINITE_CART THEN REWRITE_TAC[FINITE_NUMSEG_LT];
|
|
1795 |
ALL_TAC] THEN
|
|
1796 |
GEN_REWRITE_TAC I [SUBSET] THEN
|
|
1797 |
REWRITE_TAC[IN_ELIM_THM] THEN ONCE_REWRITE_TAC[IMP_CONJ] THEN
|
|
1798 |
REWRITE_TAC[FORALL_IN_IMAGE; FORALL_PAIR_THM; IN_ELIM_PAIR_THM] THEN
|
|
1799 |
MAP_EVERY X_GEN_TAC [`m:num`; `w:num^N`] THEN DISCH_TAC THEN
|
|
1800 |
DISCH_TAC THEN SIMP_TAC[IN_IMAGE; EXISTS_PAIR_THM; IN_ELIM_PAIR_THM] THEN
|
|
1801 |
MAP_EVERY EXISTS_TAC [`m:num`; `w:num^N`] THEN ASM_REWRITE_TAC[] THEN
|
|
1802 |
REWRITE_TAC[IN_NUMSEG; GSYM NOT_LT; LT] THEN DISCH_TAC THEN
|
|
1803 |
FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [SUBSET_INTERVAL]) THEN
|
|
1804 |
SIMP_TAC[NOT_IMP; LAMBDA_BETA] THEN
|
|
1805 |
RULE_ASSUM_TAC(REWRITE_RULE[INTERVAL_NE_EMPTY]) THEN
|
|
1806 |
ASM_SIMP_TAC[REAL_LE_LADD; REAL_LE_RMUL_EQ; REAL_SUB_LT] THEN
|
|
1807 |
ASM_SIMP_TAC[REAL_LE_DIV2_EQ; REAL_LT_POW2] THEN
|
|
1808 |
REWRITE_TAC[REAL_ARITH `x \<le> x + 1`] THEN
|
|
1809 |
DISCH_THEN(MP_TAC o SPEC `1`) THEN
|
|
1810 |
REWRITE_TAC[LE_REFL; DIMINDEX_GE_1] THEN
|
|
1811 |
DISCH_THEN(MP_TAC o MATCH_MP (REAL_ARITH
|
|
1812 |
`w / m \<le> v / n \<and> (v + 1) / n \<le> (w + 1) / m
|
|
1813 |
==> inv n \<le> inv m`)) THEN
|
|
1814 |
REWRITE_TAC[REAL_NOT_LE] THEN MATCH_MP_TAC REAL_LT_INV2 THEN
|
|
1815 |
ASM_REWRITE_TAC[REAL_LT_POW2] THEN MATCH_MP_TAC REAL_POW_MONO_LT THEN
|
|
1816 |
ASM_REWRITE_TAC[] THEN CONV_TAC REAL_RAT_REDUCE_CONV;
|
|
1817 |
ALL_TAC] THEN
|
|
1818 |
SUBGOAL_THEN
|
|
1819 |
`?d. COUNTABLE d \<and>
|
|
1820 |
(!k. k \<in> d ==> k \<subseteq> {a..b} \<and> ~(k = {}) \<and>
|
|
1821 |
(\<exists>c d:real^N. k = {c..d})) \<and>
|
|
1822 |
(!k1 k2. k1 \<in> d \<and> k2 \<in> d
|
|
1823 |
==> k1 \<subseteq> k2 \/ k2 \<subseteq> k1 \/
|
|
1824 |
interior k1 \<inter> interior k2 = {}) \<and>
|
|
1825 |
(!k. k \<in> d ==> (\<exists>x. x \<in> s \<inter> k \<and> k \<subseteq> g x)) \<and>
|
|
1826 |
(!k. k \<in> d ==> FINITE {l | l \<in> d \<and> k \<subseteq> l}) \<and>
|
|
1827 |
s \<subseteq> \<Union>d`
|
|
1828 |
MP_TAC THENL
|
|
1829 |
[FIRST_X_ASSUM(X_CHOOSE_THEN `d:(real^N->bool)->bool` STRIP_ASSUME_TAC) THEN
|
|
1830 |
EXISTS_TAC
|
|
1831 |
`{k:real^N->bool | k \<in> d \<and> ?x. x \<in> (s \<inter> k) \<and> k \<subseteq> g x}` THEN
|
|
1832 |
ASM_SIMP_TAC[IN_ELIM_THM] THEN REPEAT CONJ_TAC THENL
|
|
1833 |
[MATCH_MP_TAC COUNTABLE_SUBSET THEN
|
|
1834 |
EXISTS_TAC `d:(real^N->bool)->bool` THEN
|
|
1835 |
ASM_REWRITE_TAC[] THEN SET_TAC[];
|
|
1836 |
X_GEN_TAC `k:real^N->bool` THEN REPEAT STRIP_TAC THEN
|
|
1837 |
MATCH_MP_TAC FINITE_SUBSET THEN
|
|
1838 |
EXISTS_TAC `{l:real^N->bool | l \<in> d \<and> k \<subseteq> l}` THEN
|
|
1839 |
ASM_REWRITE_TAC[] THEN SET_TAC[];
|
|
1840 |
ASM SET_TAC[]];
|
|
1841 |
ALL_TAC] THEN
|
|
1842 |
DISCH_THEN(X_CHOOSE_THEN `d:(real^N->bool)->bool` STRIP_ASSUME_TAC) THEN
|
|
1843 |
EXISTS_TAC
|
|
1844 |
`{k:real^N->bool | k \<in> d \<and> !k'. k' \<in> d \<and> ~(k = k')
|
|
1845 |
==> ~(k \<subseteq> k')}` THEN
|
|
1846 |
ASM_SIMP_TAC[IN_ELIM_THM] THEN REPEAT CONJ_TAC THENL
|
|
1847 |
[MATCH_MP_TAC COUNTABLE_SUBSET THEN EXISTS_TAC `d:(real^N->bool)->bool` THEN
|
|
1848 |
ASM_REWRITE_TAC[] THEN SET_TAC[];
|
|
1849 |
ASM SET_TAC[];
|
|
1850 |
ALL_TAC] THEN
|
|
1851 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP
|
|
1852 |
(REWRITE_RULE[IMP_CONJ] SUBSET_TRANS)) THEN
|
|
1853 |
GEN_REWRITE_TAC I [SUBSET] THEN REWRITE_TAC[FORALL_IN_UNIONS] THEN
|
|
1854 |
MAP_EVERY X_GEN_TAC [`k:real^N->bool`; `x:real^N`] THEN DISCH_TAC THEN
|
|
1855 |
REWRITE_TAC[IN_UNIONS; IN_ELIM_THM] THEN
|
|
1856 |
MP_TAC(ISPEC `\k l:real^N->bool. k \<in> d \<and> l \<in> d \<and> l \<subseteq> k \<and> ~(k = l)`
|
|
1857 |
WF_FINITE) THEN
|
|
1858 |
REWRITE_TAC[WF] THEN ANTS_TAC THENL
|
|
1859 |
[CONJ_TAC THENL [SET_TAC[]; ALL_TAC] THEN X_GEN_TAC `l:real^N->bool` THEN
|
|
1860 |
ASM_CASES_TAC `(l:real^N->bool) \<in> d` THEN
|
|
1861 |
ASM_REWRITE_TAC[EMPTY_GSPEC; FINITE_RULES] THEN
|
|
1862 |
MATCH_MP_TAC FINITE_SUBSET THEN
|
|
1863 |
EXISTS_TAC `{m:real^N->bool | m \<in> d \<and> l \<subseteq> m}` THEN
|
|
1864 |
ASM_SIMP_TAC[] THEN SET_TAC[];
|
|
1865 |
ALL_TAC] THEN
|
|
1866 |
DISCH_THEN(MP_TAC o SPEC `\l:real^N->bool. l \<in> d \<and> x \<in> l`) THEN
|
|
1867 |
REWRITE_TAC[] THEN ANTS_TAC THENL [SET_TAC[]; ALL_TAC] THEN
|
|
1868 |
MATCH_MP_TAC MONO_EXISTS THEN ASM SET_TAC[]);; *)
|
|
1869 |
|
|
1870 |
lemma GMEASURABLE_OUTER_INTERVALS_BOUNDED: True .. (*
|
|
1871 |
"!s a b:real^N e.
|
|
1872 |
gmeasurable s \<and> s \<subseteq> {a..b} \<and> 0 < e
|
|
1873 |
==> ?d. COUNTABLE d \<and>
|
|
1874 |
(!k. k \<in> d ==> k \<subseteq> {a..b} \<and> ~(k = {}) \<and>
|
|
1875 |
(\<exists>c d. k = {c..d})) \<and>
|
|
1876 |
(!k1 k2. k1 \<in> d \<and> k2 \<in> d \<and> ~(k1 = k2)
|
|
1877 |
==> interior k1 \<inter> interior k2 = {}) \<and>
|
|
1878 |
s \<subseteq> \<Union>d \<and>
|
|
1879 |
gmeasurable (\<Union>d) \<and>
|
|
1880 |
gmeasure (\<Union>d) \<le> gmeasure s + e"
|
|
1881 |
qed lemma lemma = prove
|
|
1882 |
(`(!x y. (x,y) \<in> IMAGE (\<lambda>z. f z,g z) s ==> P x y) \<longleftrightarrow>
|
|
1883 |
(!z. z \<in> s ==> P (f z) (g z))"
|
|
1884 |
qed REWRITE_TAC[IN_IMAGE; PAIR_EQ] THEN MESON_TAC[]) in
|
|
1885 |
REPEAT GEN_TAC THEN
|
|
1886 |
ASM_CASES_TAC `interval[a:real^N,b] = {}` THENL
|
|
1887 |
[ASM_REWRITE_TAC[SUBSET_EMPTY] THEN STRIP_TAC THEN
|
|
1888 |
EXISTS_TAC `{}:(real^N->bool)->bool` THEN
|
|
1889 |
ASM_REWRITE_TAC[NOT_IN_EMPTY; UNIONS_0; MEASURE_EMPTY; REAL_ADD_LID;
|
|
1890 |
SUBSET_REFL; COUNTABLE_EMPTY; GMEASURABLE_EMPTY] THEN
|
|
1891 |
ASM_SIMP_TAC[REAL_LT_IMP_LE];
|
|
1892 |
ALL_TAC] THEN
|
|
1893 |
STRIP_TAC THEN ASM_CASES_TAC `interval(a:real^N,b) = {}` THENL
|
|
1894 |
[EXISTS_TAC `{interval[a:real^N,b]}` THEN
|
|
1895 |
REWRITE_TAC[UNIONS_1; COUNTABLE_SING] THEN
|
|
1896 |
ASM_REWRITE_TAC[IMP_CONJ; RIGHT_FORALL_IMP_THM; FORALL_IN_INSERT;
|
|
1897 |
NOT_IN_EMPTY; SUBSET_REFL; GMEASURABLE_INTERVAL] THEN
|
|
1898 |
CONJ_TAC THENL [MESON_TAC[]; ALL_TAC] THEN
|
|
1899 |
SUBGOAL_THEN
|
|
1900 |
`measure(interval[a:real^N,b]) = 0 \<and> measure(s:real^N->bool) = 0`
|
|
1901 |
(fun th -> ASM_SIMP_TAC[th; REAL_LT_IMP_LE; REAL_ADD_LID]) THEN
|
|
1902 |
SUBGOAL_THEN
|
|
1903 |
`interval[a:real^N,b] has_gmeasure 0 \<and> (s:real^N->bool) has_gmeasure 0`
|
|
1904 |
(fun th -> MESON_TAC[th; MEASURE_UNIQUE]) THEN
|
|
1905 |
REWRITE_TAC[HAS_GMEASURE_0] THEN
|
|
1906 |
MATCH_MP_TAC(TAUT `a \<and> (a ==> b) ==> a \<and> b`) THEN CONJ_TAC THENL
|
|
1907 |
[ASM_REWRITE_TAC[NEGLIGIBLE_INTERVAL];
|
|
1908 |
ASM_MESON_TAC[NEGLIGIBLE_SUBSET]];
|
|
1909 |
ALL_TAC] THEN
|
|
1910 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [measurable]) THEN
|
|
1911 |
DISCH_THEN(X_CHOOSE_TAC `m:real`) THEN
|
|
1912 |
FIRST_ASSUM(ASSUME_TAC o MATCH_MP MEASURE_UNIQUE) THEN
|
|
1913 |
SUBGOAL_THEN
|
|
1914 |
`((\<lambda>x:real^N. if x \<in> s then 1 else 0) has_integral (lift m))
|
|
1915 |
{a..b}`
|
|
1916 |
ASSUME_TAC THENL
|
|
1917 |
[ONCE_REWRITE_TAC[GSYM HAS_INTEGRAL_RESTRICT_UNIV] THEN
|
|
1918 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [HAS_GMEASURE]) THEN
|
|
1919 |
MATCH_MP_TAC(REWRITE_RULE[IMP_CONJ] HAS_INTEGRAL_EQ) THEN
|
|
1920 |
ASM SET_TAC[];
|
|
1921 |
ALL_TAC] THEN
|
|
1922 |
FIRST_ASSUM(ASSUME_TAC o MATCH_MP HAS_INTEGRAL_INTEGRABLE) THEN
|
|
1923 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [has_integral]) THEN
|
|
1924 |
DISCH_THEN(MP_TAC o SPEC `e:real`) THEN ASM_REWRITE_TAC[] THEN
|
|
1925 |
DISCH_THEN(X_CHOOSE_THEN `g:real^N->real^N->bool` STRIP_ASSUME_TAC) THEN
|
|
1926 |
MP_TAC(SPECL [`a:real^N`; `b:real^N`; `s:real^N->bool`;
|
|
1927 |
`g:real^N->real^N->bool`] COVERING_LEMMA) THEN
|
|
1928 |
ASM_REWRITE_TAC[] THEN MATCH_MP_TAC MONO_EXISTS THEN
|
|
1929 |
X_GEN_TAC `d:(real^N->bool)->bool` THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
1930 |
MP_TAC(ISPECL [`(\<lambda>x. if x \<in> s then 1 else 0):real^N->real^1`;
|
|
1931 |
`a:real^N`; `b:real^N`; `g:real^N->real^N->bool`;
|
|
1932 |
`e:real`]
|
|
1933 |
HENSTOCK_LEMMA_PART1) THEN
|
|
1934 |
ASM_REWRITE_TAC[] THEN
|
|
1935 |
FIRST_ASSUM(SUBST1_TAC o MATCH_MP INTEGRAL_UNIQUE) THEN
|
|
1936 |
ASM_REWRITE_TAC[] THEN DISCH_THEN(LABEL_TAC "*") THEN
|
|
1937 |
SUBGOAL_THEN
|
|
1938 |
`!k l:real^N->bool. k \<in> d \<and> l \<in> d \<and> ~(k = l)
|
|
1939 |
==> negligible(k \<inter> l)`
|
|
1940 |
ASSUME_TAC THENL
|
|
1941 |
[REPEAT STRIP_TAC THEN
|
|
1942 |
FIRST_X_ASSUM(MP_TAC o SPECL [`k:real^N->bool`; `l:real^N->bool`]) THEN
|
|
1943 |
ASM_SIMP_TAC[] THEN
|
|
1944 |
SUBGOAL_THEN
|
|
1945 |
`?x y:real^N u v:real^N. k = {x..y} \<and> l = {u..v}`
|
|
1946 |
MP_TAC THENL [ASM_MESON_TAC[SUBSET]; ALL_TAC] THEN
|
|
1947 |
DISCH_THEN(REPEAT_TCL CHOOSE_THEN (CONJUNCTS_THEN SUBST_ALL_TAC)) THEN
|
|
1948 |
REWRITE_TAC[INTERIOR_CLOSED_INTERVAL] THEN DISCH_TAC THEN
|
|
1949 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
1950 |
EXISTS_TAC `(interval[x:real^N,y] DIFF {x<..<y}) UNION
|
|
1951 |
(interval[u:real^N,v] DIFF {u<..<v}) UNION
|
|
1952 |
(interval (x,y) \<inter> interval (u,v))` THEN
|
|
1953 |
CONJ_TAC THENL [ALL_TAC; SET_TAC[]] THEN
|
|
1954 |
ASM_REWRITE_TAC[UNION_EMPTY] THEN
|
|
1955 |
SIMP_TAC[NEGLIGIBLE_UNION; NEGLIGIBLE_FRONTIER_INTERVAL];
|
|
1956 |
ALL_TAC] THEN
|
|
1957 |
SUBGOAL_THEN
|
|
1958 |
`!D. FINITE D \<and> D \<subseteq> d
|
|
1959 |
==> gmeasurable(\<Union>D :real^N->bool) \<and> measure(\<Union>D) \<le> m + e`
|
|
1960 |
ASSUME_TAC THENL
|
|
1961 |
[GEN_TAC THEN STRIP_TAC THEN
|
|
1962 |
SUBGOAL_THEN
|
|
1963 |
`?t:(real^N->bool)->real^N. !k. k \<in> D ==> t(k) \<in> (s \<inter> k) \<and>
|
|
1964 |
k \<subseteq> (g(t k))`
|
|
1965 |
(CHOOSE_THEN (LABEL_TAC "+")) THENL
|
|
1966 |
[REWRITE_TAC[GSYM SKOLEM_THM] THEN ASM SET_TAC[]; ALL_TAC] THEN
|
|
1967 |
REMOVE_THEN "*" (MP_TAC o SPEC
|
|
1968 |
`IMAGE (\<lambda>k. (t:(real^N->bool)->real^N) k,k) D`) THEN
|
|
1969 |
ASM_SIMP_TAC[VSUM_IMAGE; PAIR_EQ] THEN REWRITE_TAC[o_DEF] THEN
|
|
1970 |
ANTS_TAC THENL
|
|
1971 |
[REWRITE_TAC[tagged_partial_division_of; fine] THEN
|
|
1972 |
ASM_SIMP_TAC[FINITE_IMAGE; FORALL_IN_IMAGE] THEN
|
|
1973 |
REWRITE_TAC[lemma; RIGHT_FORALL_IMP_THM; IMP_CONJ; PAIR_EQ] THEN
|
|
1974 |
ASM_SIMP_TAC[] THEN
|
|
1975 |
CONJ_TAC THENL [ASM SET_TAC[]; ASM_MESON_TAC[SUBSET]];
|
|
1976 |
ALL_TAC] THEN
|
|
1977 |
USE_THEN "+" (MP_TAC o REWRITE_RULE[IN_INTER]) THEN
|
|
1978 |
SIMP_TAC[] THEN DISCH_THEN(K ALL_TAC) THEN
|
|
1979 |
ASM_SIMP_TAC[VSUM_SUB] THEN
|
|
1980 |
SUBGOAL_THEN `D division_of (\<Union>D:real^N->bool)` ASSUME_TAC THENL
|
|
1981 |
[REWRITE_TAC[division_of] THEN ASM SET_TAC[]; ALL_TAC] THEN
|
|
1982 |
FIRST_ASSUM(ASSUME_TAC o MATCH_MP GMEASURABLE_ELEMENTARY) THEN
|
|
1983 |
SUBGOAL_THEN `vsum D (\<lambda>k:real^N->bool. content k % 1) =
|
|
1984 |
lift(measure(\<Union>D))`
|
|
1985 |
SUBST1_TAC THENL
|
|
1986 |
[ONCE_REWRITE_TAC[GSYM _EQ] THEN
|
|
1987 |
ASM_SIMP_TAC[LIFT_; _VSUM; o_DEF; _CMUL; _VEC] THEN
|
|
1988 |
SIMP_TAC[REAL_MUL_RID; ETA_AX] THEN ASM_MESON_TAC[MEASURE_ELEMENTARY];
|
|
1989 |
ALL_TAC] THEN
|
|
1990 |
SUBGOAL_THEN
|
|
1991 |
`vsum D (\<lambda>k. integral k (\<lambda>x:real^N. if x \<in> s then 1 else 0)) =
|
|
1992 |
lift(sum D (\<lambda>k. measure(k \<inter> s)))`
|
|
1993 |
SUBST1_TAC THENL
|
|
1994 |
[ASM_SIMP_TAC[LIFT_SUM; o_DEF] THEN MATCH_MP_TAC VSUM_EQ THEN
|
|
1995 |
X_GEN_TAC `k:real^N->bool` THEN DISCH_TAC THEN REWRITE_TAC[] THEN
|
|
1996 |
SUBGOAL_THEN `measurable(k:real^N->bool)` ASSUME_TAC THENL
|
|
1997 |
[ASM_MESON_TAC[SUBSET; GMEASURABLE_INTERVAL]; ALL_TAC] THEN
|
|
1998 |
ASM_SIMP_TAC[GSYM INTEGRAL_MEASURE_UNIV; GMEASURABLE_INTER] THEN
|
|
1999 |
REWRITE_TAC[MESON[IN_INTER]
|
|
2000 |
`(if x \<in> k \<inter> s then a else b) =
|
|
2001 |
(if x \<in> k then if x \<in> s then a else b else b)`] THEN
|
|
2002 |
CONV_TAC SYM_CONV THEN MATCH_MP_TAC INTEGRAL_RESTRICT_UNIV THEN
|
|
2003 |
ONCE_REWRITE_TAC[GSYM INTEGRABLE_RESTRICT_UNIV] THEN
|
|
2004 |
REWRITE_TAC[MESON[IN_INTER]
|
|
2005 |
`(if x \<in> k then if x \<in> s then a else b else b) =
|
|
2006 |
(if x \<in> k \<inter> s then a else b)`] THEN
|
|
2007 |
ASM_SIMP_TAC[GSYM GMEASURABLE_INTEGRABLE; GMEASURABLE_INTER];
|
|
2008 |
ALL_TAC] THEN
|
|
2009 |
ASM_REWRITE_TAC[GSYM LIFT_SUB; NORM_LIFT] THEN
|
|
2010 |
MATCH_MP_TAC(REAL_ARITH `y \<le> m ==> abs(x - y) \<le> e ==> x \<le> m + e`) THEN
|
|
2011 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
2012 |
EXISTS_TAC `measure(\<Union>D \<inter> s:real^N->bool)` THEN
|
|
2013 |
CONJ_TAC THENL
|
|
2014 |
[ALL_TAC;
|
|
2015 |
EXPAND_TAC "m" THEN MATCH_MP_TAC MEASURE_SUBSET THEN
|
|
2016 |
ASM_REWRITE_TAC[] THEN CONJ_TAC THENL [ALL_TAC; SET_TAC[]] THEN
|
|
2017 |
MATCH_MP_TAC GMEASURABLE_INTER THEN ASM_REWRITE_TAC[]] THEN
|
|
2018 |
REWRITE_TAC[INTER_UNIONS] THEN MATCH_MP_TAC REAL_EQ_IMP_LE THEN
|
|
2019 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE] THEN CONV_TAC SYM_CONV THEN
|
|
2020 |
MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNIONS_IMAGE_STRONG THEN
|
|
2021 |
ASM_SIMP_TAC[FINITE_RESTRICT] THEN CONJ_TAC THENL
|
|
2022 |
[ASM_MESON_TAC[SUBSET; GMEASURABLE_INTERVAL; GMEASURABLE_INTER];
|
|
2023 |
ALL_TAC] THEN
|
|
2024 |
MAP_EVERY X_GEN_TAC [`k:real^N->bool`; `l:real^N->bool`] THEN
|
|
2025 |
STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
2026 |
EXISTS_TAC `k \<inter> l:real^N->bool` THEN ASM_SIMP_TAC[] THEN SET_TAC[];
|
|
2027 |
ALL_TAC] THEN
|
|
2028 |
ASM_CASES_TAC `FINITE(d:(real^N->bool)->bool)` THENL
|
|
2029 |
[ASM_MESON_TAC[SUBSET_REFL]; ALL_TAC] THEN
|
|
2030 |
MP_TAC(ISPEC `d:(real^N->bool)->bool` COUNTABLE_AS_INJECTIVE_IMAGE) THEN
|
|
2031 |
ASM_REWRITE_TAC[INFINITE] THEN
|
|
2032 |
DISCH_THEN(X_CHOOSE_THEN `s:num->real^N->bool`
|
|
2033 |
(CONJUNCTS_THEN2 SUBST_ALL_TAC ASSUME_TAC)) THEN
|
|
2034 |
MP_TAC(ISPECL [`s:num->real^N->bool`; `m + e:real`]
|
|
2035 |
HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS) THEN
|
|
2036 |
MATCH_MP_TAC(TAUT `a \<and> (a \<and> b ==> c) ==> (a ==> b) ==> c`) THEN
|
|
2037 |
REWRITE_TAC[GSYM CONJ_ASSOC] THEN
|
|
2038 |
RULE_ASSUM_TAC(REWRITE_RULE[IMP_CONJ; RIGHT_FORALL_IMP_THM;
|
|
2039 |
FORALL_IN_IMAGE; IN_UNIV]) THEN
|
|
2040 |
RULE_ASSUM_TAC(REWRITE_RULE[IMP_IMP; RIGHT_IMP_FORALL_THM]) THEN
|
|
2041 |
REPEAT CONJ_TAC THENL
|
|
2042 |
[ASM_MESON_TAC[MEASURABLE_INTERVAL; GMEASURABLE_INTER];
|
|
2043 |
ASM_MESON_TAC[];
|
|
2044 |
X_GEN_TAC `n:num` THEN
|
|
2045 |
FIRST_X_ASSUM(MP_TAC o SPEC `IMAGE (s:num->real^N->bool) (0..n)`) THEN
|
|
2046 |
SIMP_TAC[FINITE_IMAGE; FINITE_NUMSEG; IMAGE_SUBSET; SUBSET_UNIV] THEN
|
|
2047 |
DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC) THEN
|
|
2048 |
MATCH_MP_TAC(REAL_ARITH `x = y ==> x \<le> e ==> y \<le> e`) THEN
|
|
2049 |
MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNIONS_IMAGE THEN
|
|
2050 |
ASM_MESON_TAC[FINITE_NUMSEG; GMEASURABLE_INTERVAL];
|
|
2051 |
ALL_TAC] THEN
|
|
2052 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2053 |
GEN_REWRITE_TAC LAND_CONV [GSYM(CONJUNCT2 LIFT_)] THEN
|
|
2054 |
REWRITE_TAC[] THEN
|
|
2055 |
MATCH_MP_TAC(ISPEC `sequentially` LIM_COMPONENT_UBOUND) THEN
|
|
2056 |
EXISTS_TAC
|
|
2057 |
`\n. vsum(from 0 \<inter> (0..n)) (\<lambda>n. lift(measure(s n:real^N->bool)))` THEN
|
|
2058 |
ASM_REWRITE_TAC[GSYM sums; TRIVIAL_LIMIT_SEQUENTIALLY] THEN
|
|
2059 |
REWRITE_TAC[DIMINDEX_1; ARITH; EVENTUALLY_SEQUENTIALLY] THEN
|
|
2060 |
SIMP_TAC[VSUM_COMPONENT; ARITH; DIMINDEX_1] THEN
|
|
2061 |
ASM_REWRITE_TAC[GSYM ; LIFT_; FROM_INTER_NUMSEG]);; *)
|
|
2062 |
|
|
2063 |
(* ------------------------------------------------------------------------- *)
|
|
2064 |
(* Hence for linear transformation, suffices to check compact intervals. *)
|
|
2065 |
(* ------------------------------------------------------------------------- *)
|
|
2066 |
|
|
2067 |
lemma GMEASURABLE_LINEAR_IMAGE_INTERVAL: True .. (*
|
|
2068 |
"!f a b. linear f ==> gmeasurable(IMAGE f {a..b})"
|
|
2069 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC GMEASURABLE_CONVEX THEN CONJ_TAC THENL
|
|
2070 |
[MATCH_MP_TAC CONVEX_LINEAR_IMAGE THEN
|
|
2071 |
ASM_MESON_TAC[CONVEX_INTERVAL];
|
|
2072 |
MATCH_MP_TAC BOUNDED_LINEAR_IMAGE THEN
|
|
2073 |
ASM_MESON_TAC[BOUNDED_INTERVAL]]);; *)
|
|
2074 |
|
|
2075 |
lemma HAS_GMEASURE_LINEAR_SUFFICIENT: True .. (*
|
|
2076 |
"!f:real^N->real^N m.
|
|
2077 |
linear f \<and>
|
|
2078 |
(!a b. IMAGE f {a..b} has_gmeasure
|
|
2079 |
(m * measure{a..b}))
|
|
2080 |
==> !s. gmeasurable s ==> (IMAGE f s) has_gmeasure (m * gmeasure s)"
|
|
2081 |
qed REPEAT GEN_TAC THEN STRIP_TAC THEN
|
|
2082 |
DISJ_CASES_TAC(REAL_ARITH `m < 0 \/ 0 \<le> m`) THENL
|
|
2083 |
[FIRST_X_ASSUM(MP_TAC o SPECL [`0:real^N`; `1:real^N`]) THEN
|
|
2084 |
DISCH_THEN(MP_TAC o MATCH_MP HAS_GMEASURE_POS_LE) THEN
|
|
2085 |
MATCH_MP_TAC(TAUT `~a ==> a ==> b`) THEN
|
|
2086 |
MATCH_MP_TAC(REAL_ARITH `0 < --m * x ==> ~(0 \<le> m * x)`) THEN
|
|
2087 |
MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[REAL_NEG_GT0] THEN
|
|
2088 |
REWRITE_TAC[MEASURE_INTERVAL] THEN MATCH_MP_TAC CONTENT_POS_LT THEN
|
|
2089 |
SIMP_TAC[VEC_COMPONENT; REAL_LT_01];
|
|
2090 |
ALL_TAC] THEN
|
|
2091 |
ASM_CASES_TAC `!x y. (f:real^N->real^N) x = f y ==> x = y` THENL
|
|
2092 |
[ALL_TAC;
|
|
2093 |
SUBGOAL_THEN `!s. negligible(IMAGE (f:real^N->real^N) s)` ASSUME_TAC THENL
|
|
2094 |
[ASM_MESON_TAC[NEGLIGIBLE_LINEAR_SINGULAR_IMAGE]; ALL_TAC] THEN
|
|
2095 |
SUBGOAL_THEN `m * measure(interval[0:real^N,1]) = 0` MP_TAC THENL
|
|
2096 |
[MATCH_MP_TAC(ISPEC `IMAGE (f:real^N->real^N) {0..1}`
|
|
2097 |
HAS_GMEASURE_UNIQUE) THEN
|
|
2098 |
ASM_REWRITE_TAC[HAS_GMEASURE_0];
|
|
2099 |
REWRITE_TAC[REAL_ENTIRE; MEASURE_INTERVAL] THEN
|
|
2100 |
MATCH_MP_TAC(TAUT `~b \<and> (a ==> c) ==> a \/ b ==> c`) THEN CONJ_TAC THENL
|
|
2101 |
[SIMP_TAC[CONTENT_EQ_0_INTERIOR; INTERIOR_CLOSED_INTERVAL;
|
|
2102 |
INTERVAL_NE_EMPTY; VEC_COMPONENT; REAL_LT_01];
|
|
2103 |
ASM_SIMP_TAC[REAL_MUL_LZERO; HAS_GMEASURE_0]]]] THEN
|
|
2104 |
MP_TAC(ISPEC `f:real^N->real^N` LINEAR_INJECTIVE_ISOMORPHISM) THEN
|
|
2105 |
ASM_REWRITE_TAC[] THEN
|
|
2106 |
DISCH_THEN(X_CHOOSE_THEN `h:real^N->real^N` STRIP_ASSUME_TAC) THEN
|
|
2107 |
UNDISCH_THEN `!x y. (f:real^N->real^N) x = f y ==> x = y` (K ALL_TAC) THEN
|
|
2108 |
SUBGOAL_THEN
|
|
2109 |
`!s. bounded s \<and> gmeasurable s
|
|
2110 |
==> (IMAGE (f:real^N->real^N) s) has_gmeasure (m * gmeasure s)`
|
|
2111 |
ASSUME_TAC THENL
|
|
2112 |
[REPEAT STRIP_TAC THEN
|
|
2113 |
FIRST_ASSUM(MP_TAC o MATCH_MP BOUNDED_SUBSET_CLOSED_INTERVAL) THEN
|
|
2114 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN
|
|
2115 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN DISCH_TAC THEN
|
|
2116 |
SUBGOAL_THEN
|
|
2117 |
`!d. COUNTABLE d \<and>
|
|
2118 |
(!k. k \<in> d ==> k \<subseteq> {a..b} \<and> ~(k = {}) \<and>
|
|
2119 |
(\<exists>c d. k = {c..d})) \<and>
|
|
2120 |
(!k1 k2. k1 \<in> d \<and> k2 \<in> d \<and> ~(k1 = k2)
|
|
2121 |
==> interior k1 \<inter> interior k2 = {})
|
|
2122 |
==> IMAGE (f:real^N->real^N) (\<Union>d) has_gmeasure
|
|
2123 |
(m * measure(\<Union>d))`
|
|
2124 |
ASSUME_TAC THENL
|
|
2125 |
[REWRITE_TAC[IMAGE_UNIONS] THEN REPEAT STRIP_TAC THEN
|
|
2126 |
SUBGOAL_THEN
|
|
2127 |
`!g:real^N->real^N.
|
|
2128 |
linear g
|
|
2129 |
==> !k l. k \<in> d \<and> l \<in> d \<and> ~(k = l)
|
|
2130 |
==> negligible((IMAGE g k) \<inter> (IMAGE g l))`
|
|
2131 |
MP_TAC THENL
|
|
2132 |
[REPEAT STRIP_TAC THEN
|
|
2133 |
ASM_CASES_TAC `!x y. (g:real^N->real^N) x = g y ==> x = y` THENL
|
|
2134 |
[ALL_TAC;
|
|
2135 |
ASM_MESON_TAC[NEGLIGIBLE_LINEAR_SINGULAR_IMAGE;
|
|
2136 |
NEGLIGIBLE_INTER]] THEN
|
|
2137 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
2138 |
EXISTS_TAC `frontier(IMAGE (g:real^N->real^N) k \<inter> IMAGE g l) UNION
|
|
2139 |
interior(IMAGE g k \<inter> IMAGE g l)` THEN
|
|
2140 |
CONJ_TAC THENL
|
|
2141 |
[ALL_TAC;
|
|
2142 |
REWRITE_TAC[frontier] THEN MATCH_MP_TAC(SET_RULE
|
|
2143 |
`s \<subseteq> t ==> s \<subseteq> (t DIFF u) \<union> u`) THEN
|
|
2144 |
REWRITE_TAC[CLOSURE_SUBSET]] THEN
|
|
2145 |
MATCH_MP_TAC NEGLIGIBLE_UNION THEN CONJ_TAC THENL
|
|
2146 |
[MATCH_MP_TAC NEGLIGIBLE_CONVEX_FRONTIER THEN
|
|
2147 |
MATCH_MP_TAC CONVEX_INTER THEN CONJ_TAC THEN
|
|
2148 |
MATCH_MP_TAC CONVEX_LINEAR_IMAGE THEN ASM_MESON_TAC[CONVEX_INTERVAL];
|
|
2149 |
ALL_TAC] THEN
|
|
2150 |
REWRITE_TAC[INTERIOR_INTER] THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
2151 |
EXISTS_TAC `IMAGE (g:real^N->real^N) (interior k) INTER
|
|
2152 |
IMAGE g (interior l)` THEN
|
|
2153 |
CONJ_TAC THENL
|
|
2154 |
[MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
2155 |
EXISTS_TAC
|
|
2156 |
`IMAGE (g:real^N->real^N) (interior k \<inter> interior l)` THEN
|
|
2157 |
CONJ_TAC THENL
|
|
2158 |
[ASM_SIMP_TAC[IMAGE_CLAUSES; NEGLIGIBLE_EMPTY]; SET_TAC[]];
|
|
2159 |
MATCH_MP_TAC(SET_RULE
|
|
2160 |
`s \<subseteq> u \<and> t \<subseteq> v ==> (s \<inter> t) \<subseteq> (u \<inter> v)`) THEN
|
|
2161 |
CONJ_TAC THEN MATCH_MP_TAC INTERIOR_IMAGE_SUBSET THEN
|
|
2162 |
ASM_MESON_TAC[LINEAR_CONTINUOUS_AT]];
|
|
2163 |
ALL_TAC] THEN
|
|
2164 |
DISCH_THEN(fun th -> MP_TAC(SPEC `f:real^N->real^N` th) THEN
|
|
2165 |
MP_TAC(SPEC `\x:real^N. x` th)) THEN
|
|
2166 |
ASM_REWRITE_TAC[LINEAR_ID; SET_RULE `IMAGE (\<lambda>x. x) s = s`] THEN
|
|
2167 |
REPEAT STRIP_TAC THEN ASM_CASES_TAC `FINITE(d:(real^N->bool)->bool)` THENL
|
|
2168 |
[MP_TAC(ISPECL [`IMAGE (f:real^N->real^N)`; `d:(real^N->bool)->bool`]
|
|
2169 |
HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE) THEN
|
|
2170 |
ANTS_TAC THENL [ASM_MESON_TAC[measurable]; ALL_TAC] THEN
|
|
2171 |
MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2172 |
MATCH_MP_TAC EQ_TRANS THEN
|
|
2173 |
EXISTS_TAC `sum d (\<lambda>k:real^N->bool. m * gmeasure k)` THEN CONJ_TAC THENL
|
|
2174 |
[MATCH_MP_TAC SUM_EQ THEN ASM_MESON_TAC[MEASURE_UNIQUE]; ALL_TAC] THEN
|
|
2175 |
REWRITE_TAC[SUM_LMUL] THEN AP_TERM_TAC THEN
|
|
2176 |
CONV_TAC SYM_CONV THEN MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNIONS THEN
|
|
2177 |
ASM_REWRITE_TAC[GSYM HAS_GMEASURE_MEASURE] THEN
|
|
2178 |
ASM_MESON_TAC[MEASURABLE_INTERVAL];
|
|
2179 |
ALL_TAC] THEN
|
|
2180 |
MP_TAC(ISPEC `d:(real^N->bool)->bool` COUNTABLE_AS_INJECTIVE_IMAGE) THEN
|
|
2181 |
ASM_REWRITE_TAC[INFINITE] THEN
|
|
2182 |
DISCH_THEN(X_CHOOSE_THEN `s:num->real^N->bool`
|
|
2183 |
(CONJUNCTS_THEN2 SUBST_ALL_TAC ASSUME_TAC)) THEN
|
|
2184 |
MP_TAC(ISPEC `s:num->real^N->bool`
|
|
2185 |
HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS_BOUNDED) THEN
|
|
2186 |
MP_TAC(ISPEC `\n:num. IMAGE (f:real^N->real^N) (s n)`
|
|
2187 |
HAS_GMEASURE_COUNTABLE_NEGLIGIBLE_UNIONS_BOUNDED) THEN
|
|
2188 |
RULE_ASSUM_TAC(REWRITE_RULE[IMP_CONJ; RIGHT_FORALL_IMP_THM;
|
|
2189 |
FORALL_IN_IMAGE; IN_UNIV]) THEN
|
|
2190 |
RULE_ASSUM_TAC(REWRITE_RULE[IMP_IMP; RIGHT_IMP_FORALL_THM]) THEN
|
|
2191 |
ASM_SIMP_TAC[] THEN ONCE_REWRITE_TAC[SIMPLE_IMAGE] THEN ANTS_TAC THENL
|
|
2192 |
[REPEAT CONJ_TAC THENL
|
|
2193 |
[ASM_MESON_TAC[MEASURABLE_LINEAR_IMAGE_INTERVAL];
|
|
2194 |
ASM_MESON_TAC[];
|
|
2195 |
ONCE_REWRITE_TAC[GSYM o_DEF] THEN
|
|
2196 |
REWRITE_TAC[GSYM IMAGE_UNIONS; IMAGE_o] THEN
|
|
2197 |
MATCH_MP_TAC BOUNDED_LINEAR_IMAGE THEN ASM_REWRITE_TAC[] THEN
|
|
2198 |
MATCH_MP_TAC BOUNDED_SUBSET THEN REWRITE_TAC[UNIONS_SUBSET] THEN
|
|
2199 |
EXISTS_TAC `interval[a:real^N,b]` THEN
|
|
2200 |
REWRITE_TAC[BOUNDED_INTERVAL] THEN ASM SET_TAC[]];
|
|
2201 |
ALL_TAC] THEN
|
|
2202 |
STRIP_TAC THEN ANTS_TAC THENL
|
|
2203 |
[REPEAT CONJ_TAC THENL
|
|
2204 |
[ASM_MESON_TAC[MEASURABLE_INTERVAL];
|
|
2205 |
ASM_MESON_TAC[];
|
|
2206 |
MATCH_MP_TAC BOUNDED_SUBSET THEN REWRITE_TAC[UNIONS_SUBSET] THEN
|
|
2207 |
EXISTS_TAC `interval[a:real^N,b]` THEN
|
|
2208 |
REWRITE_TAC[BOUNDED_INTERVAL] THEN ASM SET_TAC[]];
|
|
2209 |
ALL_TAC] THEN
|
|
2210 |
STRIP_TAC THEN REWRITE_TAC[GSYM IMAGE_o; o_DEF] THEN
|
|
2211 |
SUBGOAL_THEN `m * gmeasure (\<Union>(IMAGE s (:num)):real^N->bool) =
|
|
2212 |
measure(\<Union>(IMAGE (\<lambda>x. IMAGE f (s x)) (:num)):real^N->bool)`
|
|
2213 |
(fun th -> ASM_REWRITE_TAC[GSYM HAS_GMEASURE_MEASURE; th]) THEN
|
|
2214 |
ONCE_REWRITE_TAC[GSYM LIFT_EQ] THEN
|
|
2215 |
MATCH_MP_TAC SERIES_UNIQUE THEN
|
|
2216 |
EXISTS_TAC `\n:num. lift(measure(IMAGE (f:real^N->real^N) (s n)))` THEN
|
|
2217 |
EXISTS_TAC `from 0` THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC SUMS_EQ THEN
|
|
2218 |
EXISTS_TAC `\n:num. m % lift(measure(s n:real^N->bool))` THEN
|
|
2219 |
CONJ_TAC THENL
|
|
2220 |
[REWRITE_TAC[GSYM LIFT_CMUL; LIFT_EQ] THEN
|
|
2221 |
ASM_MESON_TAC[MEASURE_UNIQUE];
|
|
2222 |
REWRITE_TAC[LIFT_CMUL] THEN MATCH_MP_TAC SERIES_CMUL THEN
|
|
2223 |
ASM_REWRITE_TAC[]];
|
|
2224 |
ALL_TAC] THEN
|
|
2225 |
REWRITE_TAC[HAS_GMEASURE_INNER_OUTER_LE] THEN CONJ_TAC THEN
|
|
2226 |
X_GEN_TAC `e:real` THEN DISCH_TAC THENL
|
|
2227 |
[MP_TAC(ISPECL [`{a..b} DIFF s:real^N->bool`; `a:real^N`;
|
|
2228 |
`b:real^N`; `e / (1 + abs m)`] GMEASURABLE_OUTER_INTERVALS_BOUNDED) THEN
|
|
2229 |
ANTS_TAC THENL
|
|
2230 |
[ASM_SIMP_TAC[MEASURABLE_DIFF; GMEASURABLE_INTERVAL] THEN
|
|
2231 |
ASM_SIMP_TAC[REAL_ARITH `0 < 1 + abs x`; REAL_LT_DIV] THEN SET_TAC[];
|
|
2232 |
ALL_TAC] THEN
|
|
2233 |
DISCH_THEN(X_CHOOSE_THEN `d:(real^N->bool)->bool` STRIP_ASSUME_TAC) THEN
|
|
2234 |
EXISTS_TAC `IMAGE f {a..b} DIFF
|
|
2235 |
IMAGE (f:real^N->real^N) (\<Union>d)` THEN
|
|
2236 |
FIRST_X_ASSUM(MP_TAC o SPEC `d:(real^N->bool)->bool`) THEN
|
|
2237 |
ASM_SIMP_TAC[IMAGE_SUBSET] THEN DISCH_TAC THEN
|
|
2238 |
CONJ_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN CONJ_TAC THENL
|
|
2239 |
[ASM_MESON_TAC[MEASURABLE_DIFF; gmeasurable]; ALL_TAC] THEN
|
|
2240 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
2241 |
EXISTS_TAC `measure(IMAGE f {a..b}) -
|
|
2242 |
measure(IMAGE (f:real^N->real^N) (\<Union>d))` THEN
|
|
2243 |
CONJ_TAC THENL
|
|
2244 |
[ALL_TAC;
|
|
2245 |
MATCH_MP_TAC REAL_EQ_IMP_LE THEN CONV_TAC SYM_CONV THEN
|
|
2246 |
MATCH_MP_TAC MEASURE_DIFF_SUBSET THEN
|
|
2247 |
REPEAT(CONJ_TAC THENL [ASM_MESON_TAC[measurable]; ALL_TAC]) THEN
|
|
2248 |
MATCH_MP_TAC IMAGE_SUBSET THEN ASM_SIMP_TAC[UNIONS_SUBSET]] THEN
|
|
2249 |
FIRST_ASSUM(ASSUME_TAC o SPECL [`a:real^N`; `b:real^N`]) THEN
|
|
2250 |
REPEAT(FIRST_X_ASSUM(SUBST1_TAC o MATCH_MP MEASURE_UNIQUE)) THEN
|
|
2251 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
2252 |
EXISTS_TAC `m * measure(s:real^N->bool) - m * e / (1 + abs m)` THEN
|
|
2253 |
CONJ_TAC THENL
|
|
2254 |
[REWRITE_TAC[REAL_ARITH `a - x \<le> a - y \<longleftrightarrow> y \<le> x`] THEN
|
|
2255 |
REWRITE_TAC[real_div; REAL_MUL_ASSOC] THEN
|
|
2256 |
REWRITE_TAC[GSYM real_div] THEN
|
|
2257 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_ARITH `0 < 1 + abs x`] THEN
|
|
2258 |
GEN_REWRITE_TAC RAND_CONV [REAL_MUL_SYM] THEN
|
|
2259 |
ASM_SIMP_TAC[REAL_LE_RMUL_EQ] THEN REAL_ARITH_TAC;
|
|
2260 |
ALL_TAC] THEN
|
|
2261 |
REWRITE_TAC[GSYM REAL_SUB_LDISTRIB] THEN MATCH_MP_TAC REAL_LE_LMUL THEN
|
|
2262 |
ASM_REWRITE_TAC[] THEN
|
|
2263 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP (REAL_ARITH
|
|
2264 |
`d \<le> a + e ==> a = i - s ==> s - e \<le> i - d`)) THEN
|
|
2265 |
MATCH_MP_TAC MEASURE_DIFF_SUBSET THEN
|
|
2266 |
ASM_REWRITE_TAC[MEASURABLE_INTERVAL];
|
|
2267 |
MP_TAC(ISPECL [`s:real^N->bool`; `a:real^N`; `b:real^N`;
|
|
2268 |
`e / (1 + abs m)`] GMEASURABLE_OUTER_INTERVALS_BOUNDED) THEN
|
|
2269 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_ARITH `0 < 1 + abs x`] THEN
|
|
2270 |
DISCH_THEN(X_CHOOSE_THEN `d:(real^N->bool)->bool` STRIP_ASSUME_TAC) THEN
|
|
2271 |
EXISTS_TAC `IMAGE (f:real^N->real^N) (\<Union>d)` THEN
|
|
2272 |
FIRST_X_ASSUM(MP_TAC o SPEC `d:(real^N->bool)->bool`) THEN
|
|
2273 |
ASM_SIMP_TAC[IMAGE_SUBSET] THEN
|
|
2274 |
SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE] THEN STRIP_TAC THEN
|
|
2275 |
MATCH_MP_TAC REAL_LE_TRANS THEN
|
|
2276 |
EXISTS_TAC `m * measure(s:real^N->bool) + m * e / (1 + abs m)` THEN
|
|
2277 |
CONJ_TAC THENL
|
|
2278 |
[REWRITE_TAC[GSYM REAL_ADD_LDISTRIB] THEN ASM_SIMP_TAC[REAL_LE_LMUL];
|
|
2279 |
REWRITE_TAC[REAL_LE_LADD] THEN
|
|
2280 |
REWRITE_TAC[real_div; REAL_MUL_ASSOC] THEN
|
|
2281 |
REWRITE_TAC[GSYM real_div] THEN
|
|
2282 |
ASM_SIMP_TAC[REAL_LE_LDIV_EQ; REAL_ARITH `0 < 1 + abs x`] THEN
|
|
2283 |
GEN_REWRITE_TAC RAND_CONV [REAL_MUL_SYM] THEN
|
|
2284 |
ASM_SIMP_TAC[REAL_LE_RMUL_EQ] THEN REAL_ARITH_TAC]];
|
|
2285 |
ALL_TAC] THEN
|
|
2286 |
REPEAT STRIP_TAC THEN ONCE_REWRITE_TAC[HAS_GMEASURE_LIMIT] THEN
|
|
2287 |
X_GEN_TAC `e:real` THEN DISCH_TAC THEN
|
|
2288 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [HAS_GMEASURE_MEASURE]) THEN
|
|
2289 |
GEN_REWRITE_TAC LAND_CONV [HAS_GMEASURE_LIMIT] THEN
|
|
2290 |
DISCH_THEN(MP_TAC o SPEC `e / (1 + abs m)`) THEN
|
|
2291 |
ASM_SIMP_TAC[REAL_LT_DIV; REAL_ARITH `0 < 1 + abs x`] THEN
|
|
2292 |
DISCH_THEN(X_CHOOSE_THEN `B:real`
|
|
2293 |
(CONJUNCTS_THEN2 ASSUME_TAC (LABEL_TAC "*"))) THEN
|
|
2294 |
MP_TAC(ISPEC `ball(0:real^N,B)` BOUNDED_SUBSET_CLOSED_INTERVAL) THEN
|
|
2295 |
REWRITE_TAC[BOUNDED_BALL; LEFT_IMP_EXISTS_THM] THEN
|
|
2296 |
REMOVE_THEN "*" MP_TAC THEN
|
|
2297 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `c:real^N` THEN
|
|
2298 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `d:real^N` THEN
|
|
2299 |
DISCH_THEN(fun th -> DISCH_TAC THEN MP_TAC th) THEN ASM_REWRITE_TAC[] THEN
|
|
2300 |
DISCH_THEN(X_CHOOSE_THEN `z:real` STRIP_ASSUME_TAC) THEN
|
|
2301 |
MP_TAC(ISPECL [`interval[c:real^N,d]`; `0:real^N`]
|
|
2302 |
BOUNDED_SUBSET_BALL) THEN
|
|
2303 |
REWRITE_TAC[BOUNDED_INTERVAL] THEN
|
|
2304 |
DISCH_THEN(X_CHOOSE_THEN `D:real` STRIP_ASSUME_TAC) THEN
|
|
2305 |
MP_TAC(ISPEC `f:real^N->real^N` LINEAR_BOUNDED_POS) THEN
|
|
2306 |
ASM_REWRITE_TAC[] THEN
|
|
2307 |
DISCH_THEN(X_CHOOSE_THEN `C:real` STRIP_ASSUME_TAC) THEN
|
|
2308 |
|
|
2309 |
EXISTS_TAC `D * C` THEN ASM_SIMP_TAC[REAL_LT_MUL] THEN
|
|
2310 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN DISCH_TAC THEN
|
|
2311 |
FIRST_X_ASSUM(MP_TAC o SPEC
|
|
2312 |
`s \<inter> (IMAGE (h:real^N->real^N) {a..b})`) THEN
|
|
2313 |
SUBGOAL_THEN
|
|
2314 |
`IMAGE (f:real^N->real^N) (s \<inter> IMAGE h (interval [a,b])) =
|
|
2315 |
(IMAGE f s) \<inter> {a..b}`
|
|
2316 |
SUBST1_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN ANTS_TAC THENL
|
|
2317 |
[ASM_SIMP_TAC[BOUNDED_INTER; BOUNDED_LINEAR_IMAGE; BOUNDED_INTERVAL] THEN
|
|
2318 |
ASM_SIMP_TAC[MEASURABLE_INTER; GMEASURABLE_LINEAR_IMAGE_INTERVAL];
|
|
2319 |
ALL_TAC] THEN
|
|
2320 |
DISCH_TAC THEN EXISTS_TAC
|
|
2321 |
`m * measure(s \<inter> (IMAGE (h:real^N->real^N) {a..b}))` THEN
|
|
2322 |
ASM_REWRITE_TAC[] THEN
|
|
2323 |
MATCH_MP_TAC REAL_LET_TRANS THEN EXISTS_TAC `m * e / (1 + abs m)` THEN
|
|
2324 |
CONJ_TAC THENL
|
|
2325 |
[ALL_TAC;
|
|
2326 |
REWRITE_TAC[real_div; REAL_MUL_ASSOC] THEN REWRITE_TAC[GSYM real_div] THEN
|
|
2327 |
ASM_SIMP_TAC[REAL_LT_LDIV_EQ; REAL_ARITH `0 < 1 + abs x`] THEN
|
|
2328 |
GEN_REWRITE_TAC RAND_CONV [REAL_MUL_SYM] THEN
|
|
2329 |
ASM_SIMP_TAC[REAL_LT_RMUL_EQ] THEN REAL_ARITH_TAC] THEN
|
|
2330 |
REWRITE_TAC[GSYM REAL_SUB_LDISTRIB; REAL_ABS_MUL] THEN
|
|
2331 |
GEN_REWRITE_TAC (LAND_CONV o LAND_CONV) [real_abs] THEN
|
|
2332 |
ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_LMUL THEN ASM_REWRITE_TAC[] THEN
|
|
2333 |
FIRST_ASSUM(MATCH_MP_TAC o MATCH_MP (REAL_ARITH
|
|
2334 |
`abs(z - m) < e ==> z \<le> w \<and> w \<le> m ==> abs(w - m) \<le> e`)) THEN
|
|
2335 |
SUBST1_TAC(SYM(MATCH_MP MEASURE_UNIQUE
|
|
2336 |
(ASSUME `s \<inter> interval [c:real^N,d] has_gmeasure z`))) THEN
|
|
2337 |
CONJ_TAC THEN MATCH_MP_TAC MEASURE_SUBSET THEN
|
|
2338 |
ASM_SIMP_TAC[MEASURABLE_INTER; GMEASURABLE_LINEAR_IMAGE_INTERVAL;
|
|
2339 |
GMEASURABLE_INTERVAL; INTER_SUBSET] THEN
|
|
2340 |
MATCH_MP_TAC(SET_RULE
|
|
2341 |
`!v. t \<subseteq> v \<and> v \<subseteq> u ==> s \<inter> t \<subseteq> s \<inter> u`) THEN
|
|
2342 |
EXISTS_TAC `ball(0:real^N,D)` THEN ASM_REWRITE_TAC[] THEN
|
|
2343 |
MATCH_MP_TAC(SET_RULE
|
|
2344 |
`!f. (!x. h(f x) = x) \<and> IMAGE f s \<subseteq> t ==> s \<subseteq> IMAGE h t`) THEN
|
|
2345 |
EXISTS_TAC `f:real^N->real^N` THEN ASM_REWRITE_TAC[] THEN
|
|
2346 |
MATCH_MP_TAC SUBSET_TRANS THEN EXISTS_TAC `ball(0:real^N,D * C)` THEN
|
|
2347 |
ASM_REWRITE_TAC[SUBSET; FORALL_IN_IMAGE; IN_BALL_0] THEN
|
|
2348 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN
|
|
2349 |
MATCH_MP_TAC REAL_LET_TRANS THEN EXISTS_TAC `C * norm(x:real^N)` THEN
|
|
2350 |
ASM_REWRITE_TAC[] THEN GEN_REWRITE_TAC RAND_CONV [REAL_MUL_SYM] THEN
|
|
2351 |
ASM_SIMP_TAC[REAL_LT_LMUL_EQ]);; *)
|
|
2352 |
|
|
2353 |
(* ------------------------------------------------------------------------- *)
|
|
2354 |
(* Some inductions by expressing mapping in terms of elementary matrices. *)
|
|
2355 |
(* ------------------------------------------------------------------------- *)
|
|
2356 |
|
|
2357 |
lemma INDUCT_MATRIX_ROW_OPERATIONS: True .. (*
|
|
2358 |
"!P:real^N^N->bool.
|
|
2359 |
(!A i. 1 \<le> i \<and> i \<le> dimindex(:N) \<and> row i A = 0 ==> P A) \<and>
|
|
2360 |
(!A. (!i j. 1 \<le> i \<and> i \<le> dimindex(:N) \<and>
|
|
2361 |
1 \<le> j \<and> j \<le> dimindex(:N) \<and> ~(i = j)
|
|
2362 |
==> A$i$j = 0) ==> P A) \<and>
|
|
2363 |
(!A m n. P A \<and> 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2364 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2365 |
==> P(lambda i j. A$i$(swap(m,n) j))) \<and>
|
|
2366 |
(!A m n c. P A \<and> 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2367 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2368 |
==> P(lambda i. if i = m then row m A + c % row n A
|
|
2369 |
else row i A))
|
|
2370 |
==> !A. P A"
|
|
2371 |
qed GEN_TAC THEN
|
|
2372 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "zero_row") MP_TAC) THEN
|
|
2373 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "diagonal") MP_TAC) THEN
|
|
2374 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "swap_cols") (LABEL_TAC "row_op")) THEN
|
|
2375 |
SUBGOAL_THEN
|
|
2376 |
`!k A:real^N^N.
|
|
2377 |
(!i j. 1 \<le> i \<and> i \<le> dimindex(:N) \<and>
|
|
2378 |
k \<le> j \<and> j \<le> dimindex(:N) \<and> ~(i = j)
|
|
2379 |
==> A$i$j = 0)
|
|
2380 |
==> P A`
|
|
2381 |
(fun th -> GEN_TAC THEN MATCH_MP_TAC th THEN
|
|
2382 |
EXISTS_TAC `dimindex(:N) + 1` THEN ARITH_TAC) THEN
|
|
2383 |
MATCH_MP_TAC num_INDUCTION THEN CONJ_TAC THENL
|
|
2384 |
[REPEAT STRIP_TAC THEN USE_THEN "diagonal" MATCH_MP_TAC THEN
|
|
2385 |
REPEAT STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN
|
|
2386 |
ASM_REWRITE_TAC[LE_0];
|
|
2387 |
ALL_TAC] THEN
|
|
2388 |
X_GEN_TAC `k:num` THEN DISCH_THEN(LABEL_TAC "ind_hyp") THEN
|
|
2389 |
DISJ_CASES_THEN2 SUBST1_TAC ASSUME_TAC (ARITH_RULE `k = 0 \/ 1 \<le> k`) THEN
|
|
2390 |
ASM_REWRITE_TAC[ARITH] THEN
|
|
2391 |
ASM_CASES_TAC `k \<le> dimindex(:N)` THENL
|
|
2392 |
[ALL_TAC;
|
|
2393 |
REPEAT STRIP_TAC THEN REMOVE_THEN "ind_hyp" MATCH_MP_TAC THEN
|
|
2394 |
ASM_ARITH_TAC] THEN
|
|
2395 |
SUBGOAL_THEN
|
|
2396 |
`!A:real^N^N.
|
|
2397 |
~(A$k$k = 0) \<and>
|
|
2398 |
(!i j. 1 \<le> i \<and> i \<le> dimindex (:N) \<and>
|
|
2399 |
SUC k \<le> j \<and> j \<le> dimindex (:N) \<and> ~(i = j)
|
|
2400 |
==> A$i$j = 0)
|
|
2401 |
==> P A`
|
|
2402 |
(LABEL_TAC "nonzero_hyp") THENL
|
|
2403 |
[ALL_TAC;
|
|
2404 |
X_GEN_TAC `A:real^N^N` THEN DISCH_TAC THEN
|
|
2405 |
ASM_CASES_TAC `row k (A:real^N^N) = 0` THENL
|
|
2406 |
[REMOVE_THEN "zero_row" MATCH_MP_TAC THEN ASM_MESON_TAC[];
|
|
2407 |
ALL_TAC] THEN
|
|
2408 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE RAND_CONV [CART_EQ]) THEN
|
|
2409 |
SIMP_TAC[VEC_COMPONENT; row; LAMBDA_BETA] THEN
|
|
2410 |
REWRITE_TAC[NOT_FORALL_THM; NOT_IMP; LEFT_IMP_EXISTS_THM] THEN
|
|
2411 |
X_GEN_TAC `l:num` THEN STRIP_TAC THEN
|
|
2412 |
ASM_CASES_TAC `l:num = k` THENL
|
|
2413 |
[REMOVE_THEN "nonzero_hyp" MATCH_MP_TAC THEN ASM_MESON_TAC[];
|
|
2414 |
ALL_TAC] THEN
|
|
2415 |
REMOVE_THEN "swap_cols" (MP_TAC o SPECL
|
|
2416 |
[`(lambda i j. (A:real^N^N)$i$swap(k,l) j):real^N^N`;
|
|
2417 |
`k:num`; `l:num`]) THEN
|
|
2418 |
ASM_SIMP_TAC[LAMBDA_BETA] THEN ANTS_TAC THENL
|
|
2419 |
[ALL_TAC;
|
|
2420 |
MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2421 |
SIMP_TAC[CART_EQ; LAMBDA_BETA] THEN
|
|
2422 |
REPEAT STRIP_TAC THEN REWRITE_TAC[swap] THEN
|
|
2423 |
REPEAT(COND_CASES_TAC THEN ASM_SIMP_TAC[LAMBDA_BETA])] THEN
|
|
2424 |
REMOVE_THEN "nonzero_hyp" MATCH_MP_TAC THEN
|
|
2425 |
ONCE_REWRITE_TAC[ARITH_RULE `SUC k \<le> i \<longleftrightarrow> 1 \<le> i \<and> SUC k \<le> i`] THEN
|
|
2426 |
ASM_SIMP_TAC[LAMBDA_BETA] THEN
|
|
2427 |
ASM_REWRITE_TAC[swap] THEN MAP_EVERY X_GEN_TAC [`i:num`; `j:num`] THEN
|
|
2428 |
STRIP_TAC THEN SUBGOAL_THEN `l:num \<le> k` ASSUME_TAC THENL
|
|
2429 |
[FIRST_X_ASSUM(MP_TAC o SPECL [`k:num`; `l:num`]) THEN
|
|
2430 |
ASM_REWRITE_TAC[] THEN ARITH_TAC;
|
|
2431 |
ALL_TAC] THEN
|
|
2432 |
REPEAT(COND_CASES_TAC THEN ASM_REWRITE_TAC[]) THEN
|
|
2433 |
FIRST_X_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2434 |
ASM_ARITH_TAC] THEN
|
|
2435 |
SUBGOAL_THEN
|
|
2436 |
`!l A:real^N^N.
|
|
2437 |
~(A$k$k = 0) \<and>
|
|
2438 |
(!i j. 1 \<le> i \<and> i \<le> dimindex (:N) \<and>
|
|
2439 |
SUC k \<le> j \<and> j \<le> dimindex (:N) \<and> ~(i = j)
|
|
2440 |
==> A$i$j = 0) \<and>
|
|
2441 |
(!i. l \<le> i \<and> i \<le> dimindex(:N) \<and> ~(i = k) ==> A$i$k = 0)
|
|
2442 |
==> P A`
|
|
2443 |
MP_TAC THENL
|
|
2444 |
[ALL_TAC;
|
|
2445 |
DISCH_THEN(MP_TAC o SPEC `dimindex(:N) + 1`) THEN
|
|
2446 |
REWRITE_TAC[CONJ_ASSOC; ARITH_RULE `~(n + 1 \<le> i \<and> i \<le> n)`]] THEN
|
|
2447 |
MATCH_MP_TAC num_INDUCTION THEN CONJ_TAC THENL
|
|
2448 |
[GEN_TAC THEN DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC) THEN
|
|
2449 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "main") (LABEL_TAC "aux")) THEN
|
|
2450 |
USE_THEN "ind_hyp" MATCH_MP_TAC THEN
|
|
2451 |
MAP_EVERY X_GEN_TAC [`i:num`; `j:num`] THEN STRIP_TAC THEN
|
|
2452 |
ASM_CASES_TAC `j:num = k` THENL
|
|
2453 |
[ASM_REWRITE_TAC[] THEN USE_THEN "aux" MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
2454 |
REMOVE_THEN "main" MATCH_MP_TAC THEN ASM_ARITH_TAC];
|
|
2455 |
ALL_TAC] THEN
|
|
2456 |
X_GEN_TAC `l:num` THEN DISCH_THEN(LABEL_TAC "inner_hyp") THEN
|
|
2457 |
GEN_TAC THEN DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC) THEN
|
|
2458 |
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "main") (LABEL_TAC "aux")) THEN
|
|
2459 |
ASM_CASES_TAC `l:num = k` THENL
|
|
2460 |
[REMOVE_THEN "inner_hyp" MATCH_MP_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2461 |
REPEAT STRIP_TAC THEN REMOVE_THEN "aux" MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
2462 |
ALL_TAC] THEN
|
|
2463 |
DISJ_CASES_TAC(ARITH_RULE `l = 0 \/ 1 \<le> l`) THENL
|
|
2464 |
[REMOVE_THEN "ind_hyp" MATCH_MP_TAC THEN
|
|
2465 |
MAP_EVERY X_GEN_TAC [`i:num`; `j:num`] THEN STRIP_TAC THEN
|
|
2466 |
ASM_CASES_TAC `j:num = k` THENL
|
|
2467 |
[ASM_REWRITE_TAC[] THEN REMOVE_THEN "aux" MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
2468 |
REMOVE_THEN "main" MATCH_MP_TAC THEN ASM_ARITH_TAC];
|
|
2469 |
ALL_TAC] THEN
|
|
2470 |
ASM_CASES_TAC `l \<le> dimindex(:N)` THENL
|
|
2471 |
[ALL_TAC;
|
|
2472 |
REMOVE_THEN "inner_hyp" MATCH_MP_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2473 |
ASM_ARITH_TAC] THEN
|
|
2474 |
REMOVE_THEN "inner_hyp" (MP_TAC o SPECL
|
|
2475 |
[`(lambda i. if i = l then row l (A:real^N^N) + --(A$l$k/A$k$k) % row k A
|
|
2476 |
else row i A):real^N^N`]) THEN
|
|
2477 |
ANTS_TAC THENL
|
|
2478 |
[SUBGOAL_THEN `!i. l \<le> i ==> 1 \<le> i` ASSUME_TAC THENL
|
|
2479 |
[ASM_ARITH_TAC; ALL_TAC] THEN
|
|
2480 |
ONCE_REWRITE_TAC[ARITH_RULE `SUC k \<le> j \<longleftrightarrow> 1 \<le> j \<and> SUC k \<le> j`] THEN
|
|
2481 |
ASM_SIMP_TAC[LAMBDA_BETA; row; COND_COMPONENT;
|
|
2482 |
VECTOR_ADD_COMPONENT; VECTOR_MUL_COMPONENT] THEN
|
|
2483 |
ASM_SIMP_TAC[REAL_FIELD `~(y = 0) ==> x + --(x / y) * y = 0`] THEN
|
|
2484 |
REWRITE_TAC[AND_FORALL_THM] THEN X_GEN_TAC `i:num` THEN
|
|
2485 |
ASM_CASES_TAC `i:num = l` THEN ASM_REWRITE_TAC[] THENL
|
|
2486 |
[REPEAT STRIP_TAC THEN
|
|
2487 |
MATCH_MP_TAC(REAL_RING `x = 0 \<and> y = 0 ==> x + z * y = 0`) THEN
|
|
2488 |
CONJ_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
2489 |
REPEAT STRIP_TAC THEN REMOVE_THEN "aux" MATCH_MP_TAC THEN ASM_ARITH_TAC];
|
|
2490 |
ALL_TAC] THEN
|
|
2491 |
DISCH_TAC THEN REMOVE_THEN "row_op" (MP_TAC o SPECL
|
|
2492 |
[`(lambda i. if i = l then row l A + --(A$l$k / A$k$k) % row k A
|
|
2493 |
else row i (A:real^N^N)):real^N^N`;
|
|
2494 |
`l:num`; `k:num`; `(A:real^N^N)$l$k / A$k$k`]) THEN
|
|
2495 |
ASM_REWRITE_TAC[] THEN MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2496 |
ASM_SIMP_TAC[CART_EQ; LAMBDA_BETA; VECTOR_ADD_COMPONENT;
|
|
2497 |
VECTOR_MUL_COMPONENT; row; COND_COMPONENT] THEN
|
|
2498 |
REPEAT STRIP_TAC THEN COND_CASES_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2499 |
REAL_ARITH_TAC);; *)
|
|
2500 |
|
|
2501 |
lemma INDUCT_MATRIX_ELEMENTARY: True .. (*
|
|
2502 |
"!P:real^N^N->bool.
|
|
2503 |
(!A B. P A \<and> P B ==> P(A ** B)) \<and>
|
|
2504 |
(!A i. 1 \<le> i \<and> i \<le> dimindex(:N) \<and> row i A = 0 ==> P A) \<and>
|
|
2505 |
(!A. (!i j. 1 \<le> i \<and> i \<le> dimindex(:N) \<and>
|
|
2506 |
1 \<le> j \<and> j \<le> dimindex(:N) \<and> ~(i = j)
|
|
2507 |
==> A$i$j = 0) ==> P A) \<and>
|
|
2508 |
(!m n. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2509 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2510 |
==> P(lambda i j. (mat 1:real^N^N)$i$(swap(m,n) j))) \<and>
|
|
2511 |
(!m n c. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2512 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2513 |
==> P(lambda i j. if i = m \<and> j = n then c
|
|
2514 |
else if i = j then 1 else 0))
|
|
2515 |
==> !A. P A"
|
|
2516 |
qed GEN_TAC THEN
|
|
2517 |
DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC) THEN
|
|
2518 |
DISCH_THEN(fun th ->
|
|
2519 |
MATCH_MP_TAC INDUCT_MATRIX_ROW_OPERATIONS THEN MP_TAC th) THEN
|
|
2520 |
REPEAT(MATCH_MP_TAC MONO_AND THEN CONJ_TAC) THEN REWRITE_TAC[] THEN
|
|
2521 |
DISCH_THEN(fun th -> X_GEN_TAC `A:real^N^N` THEN MP_TAC th) THEN
|
|
2522 |
REPEAT(MATCH_MP_TAC MONO_FORALL THEN GEN_TAC) THEN
|
|
2523 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN ASM_REWRITE_TAC[] THEN
|
|
2524 |
UNDISCH_TAC `(P:real^N^N->bool) A` THENL
|
|
2525 |
[REWRITE_TAC[GSYM IMP_CONJ]; REWRITE_TAC[GSYM IMP_CONJ_ALT]] THEN
|
|
2526 |
DISCH_THEN(ANTE_RES_THEN MP_TAC) THEN MATCH_MP_TAC EQ_IMP THEN
|
|
2527 |
AP_TERM_TAC THEN REWRITE_TAC[CART_EQ] THEN
|
|
2528 |
X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2529 |
X_GEN_TAC `j:num` THEN STRIP_TAC THEN
|
|
2530 |
ASM_SIMP_TAC[CART_EQ; LAMBDA_BETA; matrix_mul; row] THENL
|
|
2531 |
[ASM_SIMP_TAC[mat; IN_DIMINDEX_SWAP; LAMBDA_BETA] THEN
|
|
2532 |
ONCE_REWRITE_TAC[COND_RAND] THEN
|
|
2533 |
SIMP_TAC[SUM_DELTA; REAL_MUL_RZERO; REAL_MUL_RID] THEN
|
|
2534 |
COND_CASES_TAC THEN REWRITE_TAC[] THEN
|
|
2535 |
RULE_ASSUM_TAC(REWRITE_RULE[swap; IN_NUMSEG]) THEN ASM_ARITH_TAC;
|
|
2536 |
ALL_TAC] THEN
|
|
2537 |
ASM_CASES_TAC `i:num = m` THEN ASM_REWRITE_TAC[] THENL
|
|
2538 |
[ALL_TAC;
|
|
2539 |
ONCE_REWRITE_TAC[COND_RAND] THEN ONCE_REWRITE_TAC[COND_RATOR] THEN
|
|
2540 |
REWRITE_TAC[REAL_MUL_LZERO] THEN
|
|
2541 |
GEN_REWRITE_TAC (LAND_CONV o ONCE_DEPTH_CONV) [EQ_SYM_EQ] THEN
|
|
2542 |
ASM_SIMP_TAC[SUM_DELTA; LAMBDA_BETA; IN_NUMSEG; REAL_MUL_LID]] THEN
|
|
2543 |
ASM_SIMP_TAC[VECTOR_ADD_COMPONENT; VECTOR_MUL_COMPONENT; LAMBDA_BETA] THEN
|
|
2544 |
MATCH_MP_TAC EQ_TRANS THEN
|
|
2545 |
EXISTS_TAC
|
|
2546 |
`sum {m,n} (\<lambda>k. (if k = n then c else if m = k then 1 else 0) *
|
|
2547 |
(A:real^N^N)$k$j)` THEN
|
|
2548 |
CONJ_TAC THENL
|
|
2549 |
[MATCH_MP_TAC SUM_SUPERSET THEN
|
|
2550 |
ASM_SIMP_TAC[SUBSET; IN_INSERT; NOT_IN_EMPTY; DE_MORGAN_THM;
|
|
2551 |
IN_NUMSEG; REAL_MUL_LZERO] THEN
|
|
2552 |
ASM_ARITH_TAC;
|
|
2553 |
ASM_SIMP_TAC[SUM_CLAUSES; FINITE_RULES; IN_INSERT; NOT_IN_EMPTY] THEN
|
|
2554 |
REAL_ARITH_TAC]);; *)
|
|
2555 |
|
|
2556 |
lemma INDUCT_MATRIX_ELEMENTARY_ALT: True .. (*
|
|
2557 |
"!P:real^N^N->bool.
|
|
2558 |
(!A B. P A \<and> P B ==> P(A ** B)) \<and>
|
|
2559 |
(!A i. 1 \<le> i \<and> i \<le> dimindex(:N) \<and> row i A = 0 ==> P A) \<and>
|
|
2560 |
(!A. (!i j. 1 \<le> i \<and> i \<le> dimindex(:N) \<and>
|
|
2561 |
1 \<le> j \<and> j \<le> dimindex(:N) \<and> ~(i = j)
|
|
2562 |
==> A$i$j = 0) ==> P A) \<and>
|
|
2563 |
(!m n. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2564 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2565 |
==> P(lambda i j. (mat 1:real^N^N)$i$(swap(m,n) j))) \<and>
|
|
2566 |
(!m n. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2567 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2568 |
==> P(lambda i j. if i = m \<and> j = n \/ i = j then 1 else 0))
|
|
2569 |
==> !A. P A"
|
|
2570 |
qed GEN_TAC THEN STRIP_TAC THEN MATCH_MP_TAC INDUCT_MATRIX_ELEMENTARY THEN
|
|
2571 |
ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN
|
|
2572 |
ASM_CASES_TAC `c = 0` THENL
|
|
2573 |
[FIRST_X_ASSUM(fun th -> MATCH_MP_TAC th THEN
|
|
2574 |
MAP_EVERY X_GEN_TAC [`i:num`; `j:num`]) THEN
|
|
2575 |
ASM_SIMP_TAC[LAMBDA_BETA; COND_ID];
|
|
2576 |
ALL_TAC] THEN
|
|
2577 |
SUBGOAL_THEN
|
|
2578 |
`(lambda i j. if i = m \<and> j = n then c else if i = j then 1 else 0) =
|
|
2579 |
((lambda i j. if i = j then if j = n then inv c else 1 else 0):real^N^N) **
|
|
2580 |
((lambda i j. if i = m \<and> j = n \/ i = j then 1 else 0):real^N^N) **
|
|
2581 |
((lambda i j. if i = j then if j = n then c else 1 else 0):real^N^N)`
|
|
2582 |
SUBST1_TAC THENL
|
|
2583 |
[ALL_TAC;
|
|
2584 |
REPEAT(MATCH_MP_TAC(ASSUME `!A B:real^N^N. P A \<and> P B ==> P(A ** B)`) THEN
|
|
2585 |
CONJ_TAC) THEN
|
|
2586 |
ASM_SIMP_TAC[] THEN FIRST_X_ASSUM(fun th -> MATCH_MP_TAC th THEN
|
|
2587 |
MAP_EVERY X_GEN_TAC [`i:num`; `j:num`]) THEN
|
|
2588 |
ASM_SIMP_TAC[LAMBDA_BETA]] THEN
|
|
2589 |
SIMP_TAC[CART_EQ; matrix_mul; LAMBDA_BETA] THEN
|
|
2590 |
X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2591 |
X_GEN_TAC `j:num` THEN STRIP_TAC THEN
|
|
2592 |
ASM_SIMP_TAC[SUM_DELTA; IN_NUMSEG; REAL_ARITH
|
|
2593 |
`(if p then 1 else 0) * (if q then c else 0) =
|
|
2594 |
if q then if p then c else 0 else 0`] THEN
|
|
2595 |
REWRITE_TAC[REAL_ARITH
|
|
2596 |
`(if p then x else 0) * y = (if p then x * y else 0)`] THEN
|
|
2597 |
GEN_REWRITE_TAC (RAND_CONV o ONCE_DEPTH_CONV) [EQ_SYM_EQ] THEN
|
|
2598 |
ASM_SIMP_TAC[SUM_DELTA; IN_NUMSEG] THEN
|
|
2599 |
ASM_CASES_TAC `i:num = m` THEN ASM_REWRITE_TAC[] THEN
|
|
2600 |
ASM_CASES_TAC `j:num = n` THEN ASM_REWRITE_TAC[REAL_MUL_LID; EQ_SYM_EQ] THEN
|
|
2601 |
ASM_CASES_TAC `i:num = n` THEN
|
|
2602 |
ASM_SIMP_TAC[REAL_MUL_LINV; REAL_MUL_LID; REAL_MUL_RZERO]);; *)
|
|
2603 |
|
|
2604 |
(* ------------------------------------------------------------------------- *)
|
|
2605 |
(* The same thing in mapping form (might have been easier all along). *)
|
|
2606 |
(* ------------------------------------------------------------------------- *)
|
|
2607 |
|
|
2608 |
lemma INDUCT_LINEAR_ELEMENTARY: True .. (*
|
|
2609 |
"!P. (!f g. linear f \<and> linear g \<and> P f \<and> P g ==> P(f o g)) \<and>
|
|
2610 |
(!f i. linear f \<and> 1 \<le> i \<and> i \<le> dimindex(:N) \<and> (!x. (f x)$i = 0)
|
|
2611 |
==> P f) \<and>
|
|
2612 |
(!c. P(\<lambda>x. lambda i. c i * x$i)) \<and>
|
|
2613 |
(!m n. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2614 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2615 |
==> P(\<lambda>x. lambda i. x$swap(m,n) i)) \<and>
|
|
2616 |
(!m n. 1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2617 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and> ~(m = n)
|
|
2618 |
==> P(\<lambda>x. lambda i. if i = m then x$m + x$n else x$i))
|
|
2619 |
==> !f:real^N->real^N. linear f ==> P f"
|
|
2620 |
qed GEN_TAC THEN
|
|
2621 |
MP_TAC(ISPEC `\A:real^N^N. P(\<lambda>x:real^N. A ** x):bool`
|
|
2622 |
INDUCT_MATRIX_ELEMENTARY_ALT) THEN
|
|
2623 |
REWRITE_TAC[] THEN MATCH_MP_TAC MONO_IMP THEN CONJ_TAC THENL
|
|
2624 |
[ALL_TAC;
|
|
2625 |
DISCH_TAC THEN X_GEN_TAC `f:real^N->real^N` THEN DISCH_TAC THEN
|
|
2626 |
FIRST_X_ASSUM(MP_TAC o SPEC `matrix(f:real^N->real^N)`) THEN
|
|
2627 |
ASM_SIMP_TAC[MATRIX_WORKS] THEN REWRITE_TAC[ETA_AX]] THEN
|
|
2628 |
MATCH_MP_TAC MONO_AND THEN CONJ_TAC THENL
|
|
2629 |
[DISCH_TAC THEN MAP_EVERY X_GEN_TAC [`A:real^N^N`; `B:real^N^N`] THEN
|
|
2630 |
STRIP_TAC THEN FIRST_X_ASSUM(MP_TAC o SPECL
|
|
2631 |
[`\x:real^N. (A:real^N^N) ** x`; `\x:real^N. (B:real^N^N) ** x`]) THEN
|
|
2632 |
ASM_REWRITE_TAC[MATRIX_VECTOR_MUL_LINEAR; o_DEF] THEN
|
|
2633 |
REWRITE_TAC[MATRIX_VECTOR_MUL_ASSOC];
|
|
2634 |
ALL_TAC] THEN
|
|
2635 |
MATCH_MP_TAC MONO_AND THEN CONJ_TAC THENL
|
|
2636 |
[DISCH_TAC THEN MAP_EVERY X_GEN_TAC [`A:real^N^N`; `m:num`] THEN
|
|
2637 |
STRIP_TAC THEN FIRST_X_ASSUM(MP_TAC o SPECL
|
|
2638 |
[`\x:real^N. (A:real^N^N) ** x`; `m:num`]) THEN
|
|
2639 |
ASM_REWRITE_TAC[MATRIX_VECTOR_MUL_LINEAR] THEN
|
|
2640 |
DISCH_THEN MATCH_MP_TAC THEN
|
|
2641 |
UNDISCH_TAC `row m (A:real^N^N) = 0` THEN
|
|
2642 |
ASM_SIMP_TAC[CART_EQ; row; LAMBDA_BETA; VEC_COMPONENT; matrix_vector_mul;
|
|
2643 |
REAL_MUL_LZERO; SUM_0];
|
|
2644 |
ALL_TAC] THEN
|
|
2645 |
MATCH_MP_TAC MONO_AND THEN CONJ_TAC THENL
|
|
2646 |
[DISCH_TAC THEN X_GEN_TAC `A:real^N^N` THEN STRIP_TAC THEN
|
|
2647 |
FIRST_X_ASSUM(MP_TAC o SPEC `\i. (A:real^N^N)$i$i`) THEN
|
|
2648 |
MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2649 |
ASM_SIMP_TAC[CART_EQ; matrix_vector_mul; FUN_EQ_THM; LAMBDA_BETA] THEN
|
|
2650 |
MAP_EVERY X_GEN_TAC [`x:real^N`; `i:num`] THEN STRIP_TAC THEN
|
|
2651 |
MATCH_MP_TAC EQ_TRANS THEN EXISTS_TAC
|
|
2652 |
`sum(1..dimindex(:N)) (\<lambda>j. if j = i then (A:real^N^N)$i$j * (x:real^N)$j
|
|
2653 |
else 0)` THEN
|
|
2654 |
CONJ_TAC THENL [ASM_SIMP_TAC[SUM_DELTA; IN_NUMSEG]; ALL_TAC] THEN
|
|
2655 |
MATCH_MP_TAC SUM_EQ_NUMSEG THEN X_GEN_TAC `j:num` THEN STRIP_TAC THEN
|
|
2656 |
ASM_SIMP_TAC[] THEN COND_CASES_TAC THEN ASM_SIMP_TAC[REAL_MUL_LZERO];
|
|
2657 |
ALL_TAC] THEN
|
|
2658 |
MATCH_MP_TAC MONO_AND THEN CONJ_TAC THEN
|
|
2659 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `m:num` THEN
|
|
2660 |
MATCH_MP_TAC MONO_FORALL THEN X_GEN_TAC `n:num` THEN
|
|
2661 |
DISCH_THEN(fun th -> STRIP_TAC THEN MP_TAC th) THEN
|
|
2662 |
ASM_REWRITE_TAC[] THEN MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2663 |
ASM_SIMP_TAC[CART_EQ; matrix_vector_mul; FUN_EQ_THM; LAMBDA_BETA;
|
|
2664 |
mat; IN_DIMINDEX_SWAP]
|
|
2665 |
THENL
|
|
2666 |
[ONCE_REWRITE_TAC[SWAP_GALOIS] THEN ONCE_REWRITE_TAC[COND_RAND] THEN
|
|
2667 |
ONCE_REWRITE_TAC[COND_RATOR] THEN
|
|
2668 |
SIMP_TAC[SUM_DELTA; REAL_MUL_LID; REAL_MUL_LZERO; IN_NUMSEG] THEN
|
|
2669 |
REPEAT STRIP_TAC THEN REWRITE_TAC[swap] THEN
|
|
2670 |
COND_CASES_TAC THEN ASM_REWRITE_TAC[] THEN ASM_ARITH_TAC;
|
|
2671 |
MAP_EVERY X_GEN_TAC [`x:real^N`; `i:num`] THEN STRIP_TAC THEN
|
|
2672 |
ASM_CASES_TAC `i:num = m` THEN ASM_REWRITE_TAC[] THEN
|
|
2673 |
ONCE_REWRITE_TAC[COND_RAND] THEN ONCE_REWRITE_TAC[COND_RATOR] THEN
|
|
2674 |
GEN_REWRITE_TAC (RAND_CONV o ONCE_DEPTH_CONV) [EQ_SYM_EQ] THEN
|
|
2675 |
ASM_SIMP_TAC[SUM_DELTA; REAL_MUL_LZERO; REAL_MUL_LID; IN_NUMSEG] THEN
|
|
2676 |
MATCH_MP_TAC EQ_TRANS THEN EXISTS_TAC
|
|
2677 |
`sum {m,n} (\<lambda>j. if n = j \/ j = m then (x:real^N)$j else 0)` THEN
|
|
2678 |
CONJ_TAC THENL
|
|
2679 |
[SIMP_TAC[SUM_CLAUSES; FINITE_RULES; IN_INSERT; NOT_IN_EMPTY] THEN
|
|
2680 |
ASM_REWRITE_TAC[REAL_ADD_RID];
|
|
2681 |
CONV_TAC SYM_CONV THEN MATCH_MP_TAC SUM_SUPERSET THEN
|
|
2682 |
ASM_SIMP_TAC[SUBSET; IN_INSERT; NOT_IN_EMPTY; DE_MORGAN_THM;
|
|
2683 |
IN_NUMSEG; REAL_MUL_LZERO] THEN
|
|
2684 |
ASM_ARITH_TAC]]);; *)
|
|
2685 |
|
|
2686 |
(* ------------------------------------------------------------------------- *)
|
|
2687 |
(* Hence the effect of an arbitrary linear map on a gmeasurable set. *)
|
|
2688 |
(* ------------------------------------------------------------------------- *)
|
|
2689 |
|
|
2690 |
lemma LAMBDA_SWAP_GALOIS: True .. (*
|
|
2691 |
"!x:real^N y:real^N.
|
|
2692 |
1 \<le> m \<and> m \<le> dimindex(:N) \<and> 1 \<le> n \<and> n \<le> dimindex(:N)
|
|
2693 |
==> (x = (lambda i. y$swap(m,n) i) \<longleftrightarrow>
|
|
2694 |
(lambda i. x$swap(m,n) i) = y)"
|
|
2695 |
qed SIMP_TAC[CART_EQ; LAMBDA_BETA; IN_DIMINDEX_SWAP] THEN
|
|
2696 |
REPEAT GEN_TAC THEN STRIP_TAC THEN EQ_TAC THEN
|
|
2697 |
DISCH_TAC THEN X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2698 |
FIRST_X_ASSUM(MP_TAC o SPEC `swap(m,n) (i:num)`) THEN
|
|
2699 |
ASM_SIMP_TAC[IN_DIMINDEX_SWAP] THEN
|
|
2700 |
ASM_MESON_TAC[REWRITE_RULE[FUN_EQ_THM; o_THM; I_THM] SWAP_IDEMPOTENT]);; *)
|
|
2701 |
|
|
2702 |
lemma LAMBDA_ADD_GALOIS: True .. (*
|
|
2703 |
"!x:real^N y:real^N.
|
|
2704 |
1 \<le> m \<and> m \<le> dimindex(:N) \<and> 1 \<le> n \<and> n \<le> dimindex(:N) \<and>
|
|
2705 |
~(m = n)
|
|
2706 |
==> (x = (lambda i. if i = m then y$m + y$n else y$i) \<longleftrightarrow>
|
|
2707 |
(lambda i. if i = m then x$m - x$n else x$i) = y)"
|
|
2708 |
qed SIMP_TAC[CART_EQ; LAMBDA_BETA] THEN
|
|
2709 |
REPEAT GEN_TAC THEN STRIP_TAC THEN EQ_TAC THEN
|
|
2710 |
DISCH_TAC THEN X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2711 |
FIRST_ASSUM(MP_TAC o SPEC `n:num`) THEN
|
|
2712 |
FIRST_X_ASSUM(MP_TAC o SPEC `i:num`) THEN
|
|
2713 |
ASM_REWRITE_TAC[] THEN COND_CASES_TAC THEN ASM_REWRITE_TAC[] THEN
|
|
2714 |
REAL_ARITH_TAC);; *)
|
|
2715 |
|
|
2716 |
lemma HAS_GMEASURE_SHEAR_INTERVAL: True .. (*
|
|
2717 |
"!a b:real^N m n.
|
|
2718 |
1 \<le> m \<and> m \<le> dimindex(:N) \<and>
|
|
2719 |
1 \<le> n \<and> n \<le> dimindex(:N) \<and>
|
|
2720 |
~(m = n) \<and> ~({a..b} = {}) \<and>
|
|
2721 |
0 \<le> a$n
|
|
2722 |
==> (IMAGE (\<lambda>x. (lambda i. if i = m then x$m + x$n else x$i))
|
|
2723 |
{a..b}:real^N->bool)
|
|
2724 |
has_gmeasure gmeasure (interval [a,b])"
|
|
2725 |
qed lemma lemma = prove
|
|
2726 |
(`!s t u v:real^N->bool.
|
|
2727 |
gmeasurable s \<and> gmeasurable t \<and> gmeasurable u \<and>
|
|
2728 |
negligible(s \<inter> t) \<and> negligible(s \<inter> u) \<and>
|
|
2729 |
negligible(t \<inter> u) \<and>
|
|
2730 |
s \<union> t \<union> u = v
|
|
2731 |
==> v has_gmeasure (measure s) + (measure t) + (measure u)"
|
|
2732 |
qed REPEAT STRIP_TAC THEN
|
|
2733 |
ASM_SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE; GMEASURABLE_UNION] THEN
|
|
2734 |
FIRST_X_ASSUM(SUBST1_TAC o SYM) THEN
|
|
2735 |
ASM_SIMP_TAC[MEASURE_UNION; GMEASURABLE_UNION] THEN
|
|
2736 |
ASM_SIMP_TAC[MEASURE_EQ_0; UNION_OVER_INTER; MEASURE_UNION;
|
|
2737 |
GMEASURABLE_UNION; NEGLIGIBLE_INTER; GMEASURABLE_INTER] THEN
|
|
2738 |
REAL_ARITH_TAC)
|
|
2739 |
and lemma' = prove
|
|
2740 |
(`!s t u a.
|
|
2741 |
gmeasurable s \<and> gmeasurable t \<and>
|
|
2742 |
s \<union> (IMAGE (\<lambda>x. a + x) t) = u \<and>
|
|
2743 |
negligible(s \<inter> (IMAGE (\<lambda>x. a + x) t))
|
|
2744 |
==> gmeasure s + gmeasure t = gmeasure u"
|
|
2745 |
qed REPEAT STRIP_TAC THEN FIRST_X_ASSUM(SUBST_ALL_TAC o SYM) THEN
|
|
2746 |
ASM_SIMP_TAC[MEASURE_NEGLIGIBLE_UNION; GMEASURABLE_TRANSLATION;
|
|
2747 |
MEASURE_TRANSLATION]) in
|
|
2748 |
REWRITE_TAC[INTERVAL_NE_EMPTY] THEN REPEAT STRIP_TAC THEN
|
|
2749 |
SUBGOAL_THEN
|
|
2750 |
`linear((\<lambda>x. lambda i. if i = m then x$m + x$n else x$i):real^N->real^N)`
|
|
2751 |
ASSUME_TAC THENL
|
|
2752 |
[ASM_SIMP_TAC[linear; LAMBDA_BETA; VECTOR_ADD_COMPONENT;
|
|
2753 |
VECTOR_MUL_COMPONENT; CART_EQ] THEN REAL_ARITH_TAC;
|
|
2754 |
ALL_TAC] THEN
|
|
2755 |
MP_TAC(ISPECL
|
|
2756 |
[`IMAGE (\<lambda>x. lambda i. if i = m then x$m + x$n else x$i)
|
|
2757 |
(interval[a:real^N,b]):real^N->bool`;
|
|
2758 |
`interval[a,(lambda i. if i = m then (b:real^N)$m + b$n else b$i)] INTER
|
|
2759 |
{x:real^N | (basis m - basis n) dot x \<le> a$m}`;
|
|
2760 |
`interval[a,(lambda i. if i = m then b$m + b$n else b$i)] INTER
|
|
2761 |
{x:real^N | (basis m - basis n) dot x >= (b:real^N)$m}`;
|
|
2762 |
`interval[a:real^N,
|
|
2763 |
(lambda i. if i = m then (b:real^N)$m + b$n else b$i)]`]
|
|
2764 |
lemma) THEN
|
|
2765 |
ANTS_TAC THENL
|
|
2766 |
[ASM_SIMP_TAC[CONVEX_LINEAR_IMAGE; CONVEX_INTERVAL;
|
|
2767 |
CONVEX_HALFSPACE_LE; CONVEX_HALFSPACE_GE;
|
|
2768 |
CONVEX_INTER; GMEASURABLE_CONVEX; BOUNDED_INTER;
|
|
2769 |
BOUNDED_LINEAR_IMAGE; BOUNDED_INTERVAL] THEN
|
|
2770 |
REWRITE_TAC[INTER] THEN
|
|
2771 |
REWRITE_TAC[EXTENSION; IN_UNION; IN_INTER; IN_IMAGE] THEN
|
|
2772 |
ASM_SIMP_TAC[LAMBDA_ADD_GALOIS; UNWIND_THM1] THEN
|
|
2773 |
ASM_SIMP_TAC[IN_INTERVAL; IN_ELIM_THM; LAMBDA_BETA;
|
|
2774 |
DOT_BASIS; DOT_LSUB] THEN
|
|
2775 |
ONCE_REWRITE_TAC[MESON[]
|
|
2776 |
`(!i:num. P i) \<longleftrightarrow> P m \<and> (!i. ~(i = m) ==> P i)`] THEN
|
|
2777 |
ASM_SIMP_TAC[] THEN
|
|
2778 |
REWRITE_TAC[TAUT `(p \<and> x) \<and> (q \<and> x) \<and> r \<longleftrightarrow> x \<and> p \<and> q \<and> r`;
|
|
2779 |
TAUT `(p \<and> x) \<and> q \<and> (r \<and> x) \<longleftrightarrow> x \<and> p \<and> q \<and> r`;
|
|
2780 |
TAUT `((p \<and> x) \<and> q) \<and> (r \<and> x) \<and> s \<longleftrightarrow>
|
|
2781 |
x \<and> p \<and> q \<and> r \<and> s`;
|
|
2782 |
TAUT `(a \<and> x \/ (b \<and> x) \<and> c \/ (d \<and> x) \<and> e \<longleftrightarrow> f \<and> x) \<longleftrightarrow>
|
|
2783 |
x ==> (a \/ b \<and> c \/ d \<and> e \<longleftrightarrow> f)`] THEN
|
|
2784 |
ONCE_REWRITE_TAC[SET_RULE
|
|
2785 |
`{x | P x \<and> Q x} = {x | P x} \<inter> {x | Q x}`] THEN
|
|
2786 |
REWRITE_TAC[CONJ_ASSOC] THEN CONJ_TAC THENL
|
|
2787 |
[ALL_TAC;
|
|
2788 |
GEN_TAC THEN DISCH_THEN(MP_TAC o SPEC `n:num`) THEN
|
|
2789 |
ASM_REWRITE_TAC[] THEN ASM_REAL_ARITH_TAC] THEN
|
|
2790 |
REWRITE_TAC[GSYM CONJ_ASSOC] THEN REPEAT CONJ_TAC THEN
|
|
2791 |
MATCH_MP_TAC NEGLIGIBLE_INTER THEN DISJ2_TAC THEN
|
|
2792 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THENL
|
|
2793 |
[EXISTS_TAC `{x:real^N | (basis m - basis n) dot x = (a:real^N)$m}`;
|
|
2794 |
EXISTS_TAC `{x:real^N | (basis m - basis n) dot x = (b:real^N)$m}`;
|
|
2795 |
EXISTS_TAC `{x:real^N | (basis m - basis n) dot x = (b:real^N)$m}`]
|
|
2796 |
THEN (CONJ_TAC THENL
|
|
2797 |
[MATCH_MP_TAC NEGLIGIBLE_HYPERPLANE THEN
|
|
2798 |
REWRITE_TAC[VECTOR_SUB_EQ] THEN
|
|
2799 |
ASM_MESON_TAC[BASIS_INJ];
|
|
2800 |
ASM_SIMP_TAC[DOT_LSUB; DOT_BASIS; SUBSET; IN_ELIM_THM;
|
|
2801 |
NOT_IN_EMPTY] THEN
|
|
2802 |
FIRST_X_ASSUM(MP_TAC o SPEC `m:num`) THEN ASM_REWRITE_TAC[] THEN
|
|
2803 |
ASM_REAL_ARITH_TAC]);
|
|
2804 |
ALL_TAC] THEN
|
|
2805 |
ASM_SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE;
|
|
2806 |
GMEASURABLE_LINEAR_IMAGE_INTERVAL;
|
|
2807 |
GMEASURABLE_INTERVAL] THEN
|
|
2808 |
MP_TAC(ISPECL
|
|
2809 |
[`interval[a,(lambda i. if i = m then (b:real^N)$m + b$n else b$i)] INTER
|
|
2810 |
{x:real^N | (basis m - basis n) dot x \<le> a$m}`;
|
|
2811 |
`interval[a,(lambda i. if i = m then b$m + b$n else b$i)] INTER
|
|
2812 |
{x:real^N | (basis m - basis n) dot x >= (b:real^N)$m}`;
|
|
2813 |
`interval[a:real^N,
|
|
2814 |
(lambda i. if i = m then (a:real^N)$m + b$n
|
|
2815 |
else (b:real^N)$i)]`;
|
|
2816 |
`(lambda i. if i = m then (a:real^N)$m - (b:real^N)$m
|
|
2817 |
else 0):real^N`]
|
|
2818 |
lemma') THEN
|
|
2819 |
ANTS_TAC THENL
|
|
2820 |
[ASM_SIMP_TAC[CONVEX_LINEAR_IMAGE; CONVEX_INTERVAL;
|
|
2821 |
CONVEX_HALFSPACE_LE; CONVEX_HALFSPACE_GE;
|
|
2822 |
CONVEX_INTER; GMEASURABLE_CONVEX; BOUNDED_INTER;
|
|
2823 |
BOUNDED_LINEAR_IMAGE; BOUNDED_INTERVAL] THEN
|
|
2824 |
REWRITE_TAC[INTER] THEN
|
|
2825 |
REWRITE_TAC[EXTENSION; IN_UNION; IN_INTER; IN_IMAGE] THEN
|
|
2826 |
ONCE_REWRITE_TAC[VECTOR_ARITH `x:real^N = (lambda i. p i) + y \<longleftrightarrow>
|
|
2827 |
x - (lambda i. p i) = y`] THEN
|
|
2828 |
ASM_SIMP_TAC[IN_INTERVAL; IN_ELIM_THM; LAMBDA_BETA;
|
|
2829 |
DOT_BASIS; DOT_LSUB; UNWIND_THM1;
|
|
2830 |
VECTOR_SUB_COMPONENT] THEN
|
|
2831 |
ONCE_REWRITE_TAC[MESON[]
|
|
2832 |
`(!i:num. P i) \<longleftrightarrow> P m \<and> (!i. ~(i = m) ==> P i)`] THEN
|
|
2833 |
ASM_SIMP_TAC[REAL_SUB_RZERO] THEN CONJ_TAC THENL
|
|
2834 |
[X_GEN_TAC `x:real^N` THEN
|
|
2835 |
FIRST_ASSUM(MP_TAC o SPEC `n:num`) THEN
|
|
2836 |
FIRST_X_ASSUM(MP_TAC o SPEC `m:num`) THEN
|
|
2837 |
ASM_REWRITE_TAC[] THEN
|
|
2838 |
ASM_CASES_TAC
|
|
2839 |
`!i. ~(i = m)
|
|
2840 |
==> 1 \<le> i \<and> i \<le> dimindex (:N)
|
|
2841 |
==> (a:real^N)$i \<le> (x:real^N)$i \<and>
|
|
2842 |
x$i \<le> (b:real^N)$i` THEN
|
|
2843 |
ASM_REWRITE_TAC[] THEN
|
|
2844 |
FIRST_X_ASSUM(MP_TAC o SPEC `n:num`) THEN
|
|
2845 |
ASM_REWRITE_TAC[] THEN ASM_REAL_ARITH_TAC;
|
|
2846 |
ONCE_REWRITE_TAC[TAUT `((a \<and> b) \<and> c) \<and> (d \<and> e) \<and> f \<longleftrightarrow>
|
|
2847 |
(b \<and> e) \<and> a \<and> c \<and> d \<and> f`] THEN
|
|
2848 |
ONCE_REWRITE_TAC[SET_RULE
|
|
2849 |
`{x | P x \<and> Q x} = {x | P x} \<inter> {x | Q x}`] THEN
|
|
2850 |
MATCH_MP_TAC NEGLIGIBLE_INTER THEN DISJ2_TAC THEN
|
|
2851 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
2852 |
EXISTS_TAC `{x:real^N | (basis m - basis n) dot x = (a:real^N)$m}`
|
|
2853 |
THEN CONJ_TAC THENL
|
|
2854 |
[MATCH_MP_TAC NEGLIGIBLE_HYPERPLANE THEN
|
|
2855 |
REWRITE_TAC[VECTOR_SUB_EQ] THEN
|
|
2856 |
ASM_MESON_TAC[BASIS_INJ];
|
|
2857 |
ASM_SIMP_TAC[DOT_LSUB; DOT_BASIS; SUBSET; IN_ELIM_THM;
|
|
2858 |
NOT_IN_EMPTY] THEN
|
|
2859 |
FIRST_ASSUM(MP_TAC o SPEC `n:num`) THEN
|
|
2860 |
FIRST_X_ASSUM(MP_TAC o SPEC `m:num`) THEN
|
|
2861 |
ASM_REWRITE_TAC[] THEN ASM_REAL_ARITH_TAC]];
|
|
2862 |
ALL_TAC] THEN
|
|
2863 |
DISCH_THEN SUBST1_TAC THEN MATCH_MP_TAC(REAL_ARITH
|
|
2864 |
`a = b + c ==> a = x + b ==> x = c`) THEN
|
|
2865 |
ASM_SIMP_TAC[MEASURE_INTERVAL; CONTENT_CLOSED_INTERVAL_CASES;
|
|
2866 |
LAMBDA_BETA] THEN
|
|
2867 |
REPEAT(COND_CASES_TAC THENL
|
|
2868 |
[ALL_TAC;
|
|
2869 |
FIRST_X_ASSUM(MP_TAC o check (is_neg o concl)) THEN
|
|
2870 |
MATCH_MP_TAC(TAUT `p ==> ~p ==> q`) THEN
|
|
2871 |
X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2872 |
COND_CASES_TAC THEN ASM_SIMP_TAC[] THEN
|
|
2873 |
FIRST_ASSUM(MP_TAC o SPEC `n:num`) THEN
|
|
2874 |
FIRST_X_ASSUM(MP_TAC o SPEC `m:num`) THEN
|
|
2875 |
ASM_REWRITE_TAC[] THEN ASM_REAL_ARITH_TAC]) THEN
|
|
2876 |
SUBGOAL_THEN `1..dimindex(:N) = m INSERT ((1..dimindex(:N)) DELETE m)`
|
|
2877 |
SUBST1_TAC THENL
|
|
2878 |
[REWRITE_TAC[EXTENSION; IN_INSERT; IN_DELETE; IN_NUMSEG] THEN
|
|
2879 |
ASM_ARITH_TAC;
|
|
2880 |
ALL_TAC] THEN
|
|
2881 |
SIMP_TAC[PRODUCT_CLAUSES; FINITE_DELETE; FINITE_NUMSEG] THEN
|
|
2882 |
ASM_SIMP_TAC[IN_DELETE] THEN
|
|
2883 |
MATCH_MP_TAC(REAL_RING
|
|
2884 |
`s1 = s3 \<and> s2 = s3
|
|
2885 |
==> ((bm + bn) - am) * s1 =
|
|
2886 |
((am + bn) - am) * s2 + (bm - am) * s3`) THEN
|
|
2887 |
CONJ_TAC THEN MATCH_MP_TAC PRODUCT_EQ THEN
|
|
2888 |
SIMP_TAC[IN_DELETE] THEN REAL_ARITH_TAC);; *)
|
|
2889 |
|
|
2890 |
lemma HAS_GMEASURE_LINEAR_IMAGE: True .. (*
|
|
2891 |
"!f:real^N->real^N s.
|
|
2892 |
linear f \<and> gmeasurable s
|
|
2893 |
==> (IMAGE f s) has_gmeasure (abs(det(matrix f)) * gmeasure s)"
|
|
2894 |
qed REWRITE_TAC[IMP_CONJ; RIGHT_FORALL_IMP_THM] THEN
|
|
2895 |
MATCH_MP_TAC INDUCT_LINEAR_ELEMENTARY THEN REPEAT CONJ_TAC THENL
|
|
2896 |
[MAP_EVERY X_GEN_TAC [`f:real^N->real^N`; `g:real^N->real^N`] THEN
|
|
2897 |
REPLICATE_TAC 2 (DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC MP_TAC)) THEN
|
|
2898 |
DISCH_THEN(fun th -> REPEAT STRIP_TAC THEN MP_TAC th) THEN
|
|
2899 |
DISCH_THEN(CONJUNCTS_THEN2
|
|
2900 |
(MP_TAC o SPEC `IMAGE (g:real^N->real^N) s`)
|
|
2901 |
(MP_TAC o SPEC `s:real^N->bool`)) THEN
|
|
2902 |
ASM_REWRITE_TAC[] THEN
|
|
2903 |
GEN_REWRITE_TAC LAND_CONV [HAS_GMEASURE_MEASURABLE_MEASURE] THEN
|
|
2904 |
STRIP_TAC THEN ASM_SIMP_TAC[MATRIX_COMPOSE; DET_MUL; REAL_ABS_MUL] THEN
|
|
2905 |
REWRITE_TAC[IMAGE_o; GSYM REAL_MUL_ASSOC];
|
|
2906 |
|
|
2907 |
MAP_EVERY X_GEN_TAC [`f:real^N->real^N`; `m:num`] THEN STRIP_TAC THEN
|
|
2908 |
SUBGOAL_THEN `~(!x y. (f:real^N->real^N) x = f y ==> x = y)`
|
|
2909 |
ASSUME_TAC THENL
|
|
2910 |
[ASM_SIMP_TAC[LINEAR_SINGULAR_INTO_HYPERPLANE] THEN
|
|
2911 |
EXISTS_TAC `basis m:real^N` THEN
|
|
2912 |
ASM_SIMP_TAC[BASIS_NONZERO; DOT_BASIS];
|
|
2913 |
ALL_TAC] THEN
|
|
2914 |
MP_TAC(ISPEC `matrix f:real^N^N` INVERTIBLE_DET_NZ) THEN
|
|
2915 |
ASM_SIMP_TAC[INVERTIBLE_LEFT_INVERSE; MATRIX_LEFT_INVERTIBLE_INJECTIVE;
|
|
2916 |
MATRIX_WORKS; REAL_ABS_NUM; REAL_MUL_LZERO] THEN
|
|
2917 |
DISCH_THEN(K ALL_TAC) THEN REWRITE_TAC[HAS_GMEASURE_0] THEN
|
|
2918 |
ASM_SIMP_TAC[NEGLIGIBLE_LINEAR_SINGULAR_IMAGE];
|
|
2919 |
|
|
2920 |
MAP_EVERY X_GEN_TAC [`c:num->real`; `s:real^N->bool`] THEN
|
|
2921 |
DISCH_TAC THEN
|
|
2922 |
FIRST_ASSUM(ASSUME_TAC o REWRITE_RULE[HAS_GMEASURE_MEASURE]) THEN
|
|
2923 |
FIRST_ASSUM(MP_TAC o SPEC `c:num->real` o
|
|
2924 |
MATCH_MP HAS_GMEASURE_STRETCH) THEN
|
|
2925 |
MATCH_MP_TAC EQ_IMP THEN AP_TERM_TAC THEN
|
|
2926 |
AP_THM_TAC THEN AP_TERM_TAC THEN AP_TERM_TAC THEN
|
|
2927 |
SIMP_TAC[matrix; LAMBDA_BETA] THEN
|
|
2928 |
W(MP_TAC o PART_MATCH (lhs o rand) DET_DIAGONAL o rand o snd) THEN
|
|
2929 |
SIMP_TAC[LAMBDA_BETA; BASIS_COMPONENT; REAL_MUL_RZERO] THEN
|
|
2930 |
DISCH_THEN(K ALL_TAC) THEN MATCH_MP_TAC PRODUCT_EQ_NUMSEG THEN
|
|
2931 |
REWRITE_TAC[REAL_MUL_RID];
|
|
2932 |
|
|
2933 |
MAP_EVERY X_GEN_TAC [`m:num`; `n:num`] THEN STRIP_TAC THEN
|
|
2934 |
MATCH_MP_TAC HAS_GMEASURE_LINEAR_SUFFICIENT THEN
|
|
2935 |
ASM_SIMP_TAC[linear; LAMBDA_BETA; IN_DIMINDEX_SWAP; VECTOR_ADD_COMPONENT;
|
|
2936 |
VECTOR_MUL_COMPONENT; CART_EQ] THEN
|
|
2937 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN
|
|
2938 |
SUBGOAL_THEN `matrix (\<lambda>x:real^N. lambda i. x$swap (m,n) i):real^N^N =
|
|
2939 |
transp(lambda i j. (mat 1:real^N^N)$i$swap (m,n) j)`
|
|
2940 |
SUBST1_TAC THENL
|
|
2941 |
[ASM_SIMP_TAC[MATRIX_EQ; LAMBDA_BETA; IN_DIMINDEX_SWAP;
|
|
2942 |
matrix_vector_mul; CART_EQ; matrix; mat; basis;
|
|
2943 |
COND_COMPONENT; transp] THEN
|
|
2944 |
REWRITE_TAC[EQ_SYM_EQ];
|
|
2945 |
ALL_TAC] THEN
|
|
2946 |
REWRITE_TAC[DET_TRANSP] THEN
|
|
2947 |
W(MP_TAC o PART_MATCH (lhs o rand) DET_PERMUTE_COLUMNS o
|
|
2948 |
rand o lhand o rand o snd) THEN
|
|
2949 |
ASM_SIMP_TAC[PERMUTES_SWAP; IN_NUMSEG; ETA_AX] THEN
|
|
2950 |
DISCH_THEN(K ALL_TAC) THEN
|
|
2951 |
REWRITE_TAC[DET_I; REAL_ABS_SIGN; REAL_MUL_RID; REAL_MUL_LID] THEN
|
|
2952 |
ASM_CASES_TAC `interval[a:real^N,b] = {}` THENL
|
|
2953 |
[ASM_SIMP_TAC[IMAGE_CLAUSES; HAS_GMEASURE_EMPTY; MEASURE_EMPTY];
|
|
2954 |
ALL_TAC] THEN
|
|
2955 |
SUBGOAL_THEN
|
|
2956 |
`~(IMAGE (\<lambda>x:real^N. lambda i. x$swap (m,n) i)
|
|
2957 |
{a..b}:real^N->bool = {})`
|
|
2958 |
MP_TAC THENL [ASM_REWRITE_TAC[IMAGE_EQ_EMPTY]; ALL_TAC] THEN
|
|
2959 |
SUBGOAL_THEN
|
|
2960 |
`IMAGE (\<lambda>x:real^N. lambda i. x$swap (m,n) i)
|
|
2961 |
{a..b}:real^N->bool =
|
|
2962 |
interval[(lambda i. a$swap (m,n) i),
|
|
2963 |
(lambda i. b$swap (m,n) i)]`
|
|
2964 |
SUBST1_TAC THENL
|
|
2965 |
[REWRITE_TAC[EXTENSION; IN_INTERVAL; IN_IMAGE] THEN
|
|
2966 |
ASM_SIMP_TAC[LAMBDA_SWAP_GALOIS; UNWIND_THM1] THEN
|
|
2967 |
SIMP_TAC[LAMBDA_BETA] THEN GEN_TAC THEN EQ_TAC THEN
|
|
2968 |
DISCH_TAC THEN X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
2969 |
FIRST_X_ASSUM(MP_TAC o SPEC `swap(m,n) (i:num)`) THEN
|
|
2970 |
ASM_SIMP_TAC[IN_DIMINDEX_SWAP] THEN
|
|
2971 |
ASM_MESON_TAC[REWRITE_RULE[FUN_EQ_THM; o_THM; I_THM] SWAP_IDEMPOTENT];
|
|
2972 |
ALL_TAC] THEN
|
|
2973 |
REWRITE_TAC[HAS_GMEASURE_MEASURABLE_MEASURE; GMEASURABLE_INTERVAL] THEN
|
|
2974 |
REWRITE_TAC[MEASURE_INTERVAL] THEN
|
|
2975 |
ASM_SIMP_TAC[CONTENT_CLOSED_INTERVAL; GSYM INTERVAL_NE_EMPTY] THEN
|
|
2976 |
DISCH_THEN(K ALL_TAC) THEN SIMP_TAC[LAMBDA_BETA] THEN
|
|
2977 |
ASM_SIMP_TAC[GSYM VECTOR_SUB_COMPONENT; IN_DIMINDEX_SWAP] THEN
|
|
2978 |
MP_TAC(ISPECL [`\i. (b - a:real^N)$i`; `swap(m:num,n)`; `1..dimindex(:N)`]
|
|
2979 |
(GSYM PRODUCT_PERMUTE)) THEN
|
|
2980 |
REWRITE_TAC[o_DEF] THEN DISCH_THEN MATCH_MP_TAC THEN
|
|
2981 |
ASM_SIMP_TAC[PERMUTES_SWAP; IN_NUMSEG];
|
|
2982 |
|
|
2983 |
MAP_EVERY X_GEN_TAC [`m:num`; `n:num`] THEN STRIP_TAC THEN
|
|
2984 |
MATCH_MP_TAC HAS_GMEASURE_LINEAR_SUFFICIENT THEN
|
|
2985 |
MATCH_MP_TAC(TAUT `a \<and> (a ==> b) ==> a \<and> b`) THEN CONJ_TAC THENL
|
|
2986 |
[ASM_SIMP_TAC[linear; LAMBDA_BETA; VECTOR_ADD_COMPONENT;
|
|
2987 |
VECTOR_MUL_COMPONENT; CART_EQ] THEN REAL_ARITH_TAC;
|
|
2988 |
DISCH_TAC] THEN
|
|
2989 |
MAP_EVERY X_GEN_TAC [`a:real^N`; `b:real^N`] THEN
|
|
2990 |
SUBGOAL_THEN
|
|
2991 |
`det(matrix(\<lambda>x. lambda i. if i = m then (x:real^N)$m + x$n
|
|
2992 |
else x$i):real^N^N) = 1`
|
|
2993 |
SUBST1_TAC THENL
|
|
2994 |
[ASM_SIMP_TAC[matrix; basis; COND_COMPONENT; LAMBDA_BETA] THEN
|
|
2995 |
FIRST_ASSUM(DISJ_CASES_TAC o MATCH_MP (ARITH_RULE
|
|
2996 |
`~(m:num = n) ==> m < n \/ n < m`))
|
|
2997 |
THENL
|
|
2998 |
[W(MP_TAC o PART_MATCH (lhs o rand) DET_UPPERTRIANGULAR o lhs o snd);
|
|
2999 |
W(MP_TAC o PART_MATCH (lhs o rand) DET_LOWERTRIANGULAR o lhs o snd)]
|
|
3000 |
THEN ASM_SIMP_TAC[LAMBDA_BETA; BASIS_COMPONENT; COND_COMPONENT;
|
|
3001 |
matrix; REAL_ADD_RID; COND_ID;
|
|
3002 |
PRODUCT_CONST_NUMSEG; REAL_POW_ONE] THEN
|
|
3003 |
DISCH_THEN MATCH_MP_TAC THEN
|
|
3004 |
REPEAT GEN_TAC THEN REPEAT(COND_CASES_TAC THEN ASM_REWRITE_TAC[]) THEN
|
|
3005 |
ASM_ARITH_TAC;
|
|
3006 |
ALL_TAC] THEN
|
|
3007 |
REWRITE_TAC[REAL_ABS_NUM; REAL_MUL_LID] THEN
|
|
3008 |
ASM_CASES_TAC `interval[a:real^N,b] = {}` THENL
|
|
3009 |
[ASM_SIMP_TAC[IMAGE_CLAUSES; HAS_GMEASURE_EMPTY; MEASURE_EMPTY];
|
|
3010 |
ALL_TAC] THEN
|
|
3011 |
SUBGOAL_THEN
|
|
3012 |
`IMAGE (\<lambda>x. lambda i. if i = m then x$m + x$n else x$i) (interval [a,b]) =
|
|
3013 |
IMAGE (\<lambda>x:real^N. (lambda i. if i = m \/ i = n then a$n else 0) +
|
|
3014 |
x)
|
|
3015 |
(IMAGE (\<lambda>x:real^N. lambda i. if i = m then x$m + x$n else x$i)
|
|
3016 |
(IMAGE (\<lambda>x. (lambda i. if i = n then --(a$n) else 0) + x)
|
|
3017 |
{a..b}))`
|
|
3018 |
SUBST1_TAC THENL
|
|
3019 |
[REWRITE_TAC[GSYM IMAGE_o] THEN AP_THM_TAC THEN AP_TERM_TAC THEN
|
|
3020 |
ASM_SIMP_TAC[FUN_EQ_THM; o_THM; VECTOR_ADD_COMPONENT; LAMBDA_BETA;
|
|
3021 |
CART_EQ] THEN
|
|
3022 |
MAP_EVERY X_GEN_TAC [`x:real^N`; `i:num`] THEN
|
|
3023 |
STRIP_TAC THEN ASM_CASES_TAC `i:num = m` THEN ASM_REWRITE_TAC[] THEN
|
|
3024 |
ASM_CASES_TAC `i:num = n` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;
|
|
3025 |
ALL_TAC] THEN
|
|
3026 |
MATCH_MP_TAC HAS_GMEASURE_TRANSLATION THEN
|
|
3027 |
SUBGOAL_THEN
|
|
3028 |
`measure{a..b} =
|
|
3029 |
measure(IMAGE (\<lambda>x:real^N. (lambda i. if i = n then --(a$n) else 0) + x)
|
|
3030 |
{a..b}:real^N->bool)`
|
|
3031 |
SUBST1_TAC THENL
|
|
3032 |
[CONV_TAC SYM_CONV THEN MATCH_MP_TAC MEASURE_TRANSLATION THEN
|
|
3033 |
REWRITE_TAC[MEASURABLE_INTERVAL];
|
|
3034 |
ALL_TAC] THEN
|
|
3035 |
SUBGOAL_THEN
|
|
3036 |
`~(IMAGE (\<lambda>x:real^N. (lambda i. if i = n then --(a$n) else 0) + x)
|
|
3037 |
{a..b}:real^N->bool = {})`
|
|
3038 |
MP_TAC THENL [ASM_SIMP_TAC[IMAGE_EQ_EMPTY]; ALL_TAC] THEN
|
|
3039 |
ONCE_REWRITE_TAC[VECTOR_ARITH `c + x = 1 % x + c`] THEN
|
|
3040 |
ASM_REWRITE_TAC[IMAGE_AFFINITY_INTERVAL; REAL_POS] THEN
|
|
3041 |
DISCH_TAC THEN MATCH_MP_TAC HAS_GMEASURE_SHEAR_INTERVAL THEN
|
|
3042 |
ASM_SIMP_TAC[LAMBDA_BETA; VECTOR_ADD_COMPONENT; VECTOR_MUL_COMPONENT] THEN
|
|
3043 |
REAL_ARITH_TAC]);; *)
|
|
3044 |
|
|
3045 |
lemma GMEASURABLE_LINEAR_IMAGE: True .. (*
|
|
3046 |
"!f:real^N->real^N s.
|
|
3047 |
linear f \<and> gmeasurable s ==> gmeasurable(IMAGE f s)"
|
|
3048 |
qed REPEAT GEN_TAC THEN
|
|
3049 |
DISCH_THEN(MP_TAC o MATCH_MP HAS_GMEASURE_LINEAR_IMAGE) THEN
|
|
3050 |
SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE]);; *)
|
|
3051 |
|
|
3052 |
lemma MEASURE_LINEAR_IMAGE: True .. (*
|
|
3053 |
"!f:real^N->real^N s.
|
|
3054 |
linear f \<and> gmeasurable s
|
|
3055 |
==> measure(IMAGE f s) = abs(det(matrix f)) * gmeasure s"
|
|
3056 |
qed REPEAT GEN_TAC THEN
|
|
3057 |
DISCH_THEN(MP_TAC o MATCH_MP HAS_GMEASURE_LINEAR_IMAGE) THEN
|
|
3058 |
SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE]);; *)
|
|
3059 |
|
|
3060 |
lemma HAS_GMEASURE_LINEAR_IMAGE_SAME: True .. (*
|
|
3061 |
"!f s. linear f \<and> gmeasurable s \<and> abs(det(matrix f)) = 1
|
|
3062 |
==> (IMAGE f s) has_gmeasure (measure s)"
|
|
3063 |
qed MESON_TAC[HAS_GMEASURE_LINEAR_IMAGE; REAL_MUL_LID]);; *)
|
|
3064 |
|
|
3065 |
lemma MEASURE_LINEAR_IMAGE_SAME: True .. (*
|
|
3066 |
"!f:real^N->real^N s.
|
|
3067 |
linear f \<and> gmeasurable s \<and> abs(det(matrix f)) = 1
|
|
3068 |
==> measure(IMAGE f s) = gmeasure s"
|
|
3069 |
qed REPEAT GEN_TAC THEN
|
|
3070 |
DISCH_THEN(MP_TAC o MATCH_MP HAS_GMEASURE_LINEAR_IMAGE_SAME) THEN
|
|
3071 |
SIMP_TAC[HAS_GMEASURE_MEASURABLE_MEASURE]);; *)
|
|
3072 |
|
|
3073 |
(* ------------------------------------------------------------------------- *)
|
|
3074 |
(* gmeasure of a standard simplex. *)
|
|
3075 |
(* ------------------------------------------------------------------------- *)
|
|
3076 |
|
|
3077 |
lemma CONGRUENT_IMAGE_STD_SIMPLEX: True .. (*
|
|
3078 |
"!p. p permutes 1..dimindex(:N)
|
|
3079 |
==> {x:real^N | 0 \<le> x$(p 1) \<and> x$(p(dimindex(:N))) \<le> 1 \<and>
|
|
3080 |
(!i. 1 \<le> i \<and> i < dimindex(:N)
|
|
3081 |
==> x$(p i) \<le> x$(p(i + 1)))} =
|
|
3082 |
IMAGE (\<lambda>x:real^N. lambda i. sum(1..inverse p(i)) (\<lambda>j. x$j))
|
|
3083 |
{x | (!i. 1 \<le> i \<and> i \<le> dimindex (:N) ==> 0 \<le> x$i) \<and>
|
|
3084 |
sum (1..dimindex (:N)) (\<lambda>i. x$i) \<le> 1}"
|
|
3085 |
qed REPEAT STRIP_TAC THEN MATCH_MP_TAC SUBSET_ANTISYM THEN CONJ_TAC THENL
|
|
3086 |
[ALL_TAC;
|
|
3087 |
REWRITE_TAC[SUBSET; FORALL_IN_IMAGE] THEN X_GEN_TAC `x:real^N` THEN
|
|
3088 |
ASM_SIMP_TAC[IN_ELIM_THM; LAMBDA_BETA; LAMBDA_BETA_PERM; LE_REFL;
|
|
3089 |
ARITH_RULE `i < n ==> i \<le> n \<and> i + 1 \<le> n`;
|
|
3090 |
ARITH_RULE `1 \<le> n + 1`; DIMINDEX_GE_1] THEN
|
|
3091 |
STRIP_TAC THEN
|
|
3092 |
FIRST_ASSUM(fun th -> REWRITE_TAC[MATCH_MP PERMUTES_INVERSES th]) THEN
|
|
3093 |
ASM_SIMP_TAC[SUM_SING_NUMSEG; DIMINDEX_GE_1; LE_REFL] THEN
|
|
3094 |
REWRITE_TAC[GSYM ADD1; SUM_CLAUSES_NUMSEG; ARITH_RULE `1 \<le> SUC n`] THEN
|
|
3095 |
ASM_SIMP_TAC[REAL_LE_ADDR] THEN REPEAT STRIP_TAC THEN
|
|
3096 |
FIRST_X_ASSUM MATCH_MP_TAC THEN ASM_ARITH_TAC] THEN
|
|
3097 |
REWRITE_TAC[SUBSET; IN_IMAGE; IN_ELIM_THM] THEN X_GEN_TAC `x:real^N` THEN
|
|
3098 |
STRIP_TAC THEN
|
|
3099 |
EXISTS_TAC `(lambda i. if i = 1 then x$(p 1)
|
|
3100 |
else (x:real^N)$p(i) - x$p(i - 1)):real^N` THEN
|
|
3101 |
ASM_SIMP_TAC[IN_ELIM_THM; LAMBDA_BETA; LAMBDA_BETA_PERM; LE_REFL;
|
|
3102 |
ARITH_RULE `i < n ==> i \<le> n \<and> i + 1 \<le> n`;
|
|
3103 |
ARITH_RULE `1 \<le> n + 1`; DIMINDEX_GE_1; CART_EQ] THEN
|
|
3104 |
REPEAT CONJ_TAC THENL
|
|
3105 |
[X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
3106 |
SUBGOAL_THEN `1 \<le> inverse (p:num->num) i \<and>
|
|
3107 |
!x. x \<le> inverse p i ==> x \<le> dimindex(:N)`
|
|
3108 |
ASSUME_TAC THENL
|
|
3109 |
[ASM_MESON_TAC[PERMUTES_INVERSE; IN_NUMSEG; LE_TRANS; PERMUTES_IN_IMAGE];
|
|
3110 |
ASM_SIMP_TAC[LAMBDA_BETA] THEN ASM_SIMP_TAC[SUM_CLAUSES_LEFT; ARITH]] THEN
|
|
3111 |
SIMP_TAC[ARITH_RULE `2 \<le> n ==> ~(n = 1)`] THEN
|
|
3112 |
GEN_REWRITE_TAC (RAND_CONV o RAND_CONV o BINDER_CONV)
|
|
3113 |
[GSYM REAL_MUL_LID] THEN
|
|
3114 |
ONCE_REWRITE_TAC[SUM_PARTIAL_PRE] THEN
|
|
3115 |
REWRITE_TAC[REAL_SUB_REFL; REAL_MUL_RZERO; SUM_0; COND_ID] THEN
|
|
3116 |
REWRITE_TAC[REAL_MUL_LID; ARITH; REAL_SUB_RZERO] THEN
|
|
3117 |
FIRST_ASSUM(DISJ_CASES_TAC o MATCH_MP (ARITH_RULE
|
|
3118 |
`1 \<le> p ==> p = 1 \/ 2 \<le> p`) o CONJUNCT1) THEN
|
|
3119 |
ASM_SIMP_TAC[ARITH] THEN
|
|
3120 |
FIRST_ASSUM(fun th -> REWRITE_TAC[MATCH_MP PERMUTES_INVERSES th]) THEN
|
|
3121 |
REWRITE_TAC[REAL_ADD_RID] THEN TRY REAL_ARITH_TAC THEN
|
|
3122 |
ASM_MESON_TAC[PERMUTES_INVERSE_EQ; PERMUTES_INVERSE];
|
|
3123 |
|
|
3124 |
X_GEN_TAC `i:num` THEN STRIP_TAC THEN COND_CASES_TAC THEN
|
|
3125 |
ASM_REWRITE_TAC[REAL_SUB_LE] THEN
|
|
3126 |
FIRST_X_ASSUM(MP_TAC o SPEC `i - 1`) THEN
|
|
3127 |
ASM_SIMP_TAC[SUB_ADD] THEN DISCH_THEN MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
3128 |
|
|
3129 |
SIMP_TAC[SUM_CLAUSES_LEFT; DIMINDEX_GE_1; ARITH;
|
|
3130 |
ARITH_RULE `2 \<le> n ==> ~(n = 1)`] THEN
|
|
3131 |
GEN_REWRITE_TAC (LAND_CONV o RAND_CONV o RAND_CONV o BINDER_CONV)
|
|
3132 |
[GSYM REAL_MUL_LID] THEN
|
|
3133 |
ONCE_REWRITE_TAC[SUM_PARTIAL_PRE] THEN
|
|
3134 |
REWRITE_TAC[REAL_SUB_REFL; REAL_MUL_RZERO; SUM_0; COND_ID] THEN
|
|
3135 |
REWRITE_TAC[REAL_MUL_LID; ARITH; REAL_SUB_RZERO] THEN
|
|
3136 |
COND_CASES_TAC THEN ASM_SIMP_TAC[REAL_ADD_RID] THEN
|
|
3137 |
ASM_REWRITE_TAC[REAL_ARITH `x + y - x:real = y`] THEN
|
|
3138 |
ASM_MESON_TAC[DIMINDEX_GE_1;
|
|
3139 |
ARITH_RULE `1 \<le> n \<and> ~(2 \<le> n) ==> n = 1`]]);; *)
|
|
3140 |
|
|
3141 |
lemma HAS_GMEASURE_IMAGE_STD_SIMPLEX: True .. (*
|
|
3142 |
"!p. p permutes 1..dimindex(:N)
|
|
3143 |
==> {x:real^N | 0 \<le> x$(p 1) \<and> x$(p(dimindex(:N))) \<le> 1 \<and>
|
|
3144 |
(!i. 1 \<le> i \<and> i < dimindex(:N)
|
|
3145 |
==> x$(p i) \<le> x$(p(i + 1)))}
|
|
3146 |
has_gmeasure
|
|
3147 |
(measure (convex hull
|
|
3148 |
(0 INSERT {basis i:real^N | 1 \<le> i \<and> i \<le> dimindex(:N)})))"
|
|
3149 |
qed REPEAT STRIP_TAC THEN ASM_SIMP_TAC[CONGRUENT_IMAGE_STD_SIMPLEX] THEN
|
|
3150 |
ASM_SIMP_TAC[GSYM STD_SIMPLEX] THEN
|
|
3151 |
MATCH_MP_TAC HAS_GMEASURE_LINEAR_IMAGE_SAME THEN
|
|
3152 |
REPEAT CONJ_TAC THENL
|
|
3153 |
[REWRITE_TAC[linear; CART_EQ] THEN
|
|
3154 |
ASM_SIMP_TAC[LAMBDA_BETA; VECTOR_ADD_COMPONENT; VECTOR_MUL_COMPONENT;
|
|
3155 |
GSYM SUM_ADD_NUMSEG; GSYM SUM_LMUL] THEN
|
|
3156 |
REPEAT STRIP_TAC THEN MATCH_MP_TAC SUM_EQ_NUMSEG THEN
|
|
3157 |
REPEAT STRIP_TAC THEN REWRITE_TAC[] THENL
|
|
3158 |
[MATCH_MP_TAC VECTOR_ADD_COMPONENT;
|
|
3159 |
MATCH_MP_TAC VECTOR_MUL_COMPONENT] THEN
|
|
3160 |
ASM_MESON_TAC[PERMUTES_INVERSE; IN_NUMSEG; LE_TRANS; PERMUTES_IN_IMAGE];
|
|
3161 |
MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3162 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN REWRITE_TAC[BOUNDED_INSERT] THEN
|
|
3163 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE_GEN] THEN
|
|
3164 |
MATCH_MP_TAC FINITE_IMP_BOUNDED THEN MATCH_MP_TAC FINITE_IMAGE THEN
|
|
3165 |
REWRITE_TAC[GSYM numseg; FINITE_NUMSEG];
|
|
3166 |
MATCH_MP_TAC EQ_TRANS THEN EXISTS_TAC
|
|
3167 |
`abs(det
|
|
3168 |
((lambda i. ((lambda i j. if j \<le> i then 1 else 0):real^N^N)
|
|
3169 |
$inverse p i)
|
|
3170 |
:real^N^N))` THEN
|
|
3171 |
CONJ_TAC THENL
|
|
3172 |
[AP_TERM_TAC THEN AP_TERM_TAC THEN REWRITE_TAC[CART_EQ] THEN
|
|
3173 |
ASM_SIMP_TAC[matrix; LAMBDA_BETA; BASIS_COMPONENT; COND_COMPONENT;
|
|
3174 |
LAMBDA_BETA_PERM; PERMUTES_INVERSE] THEN
|
|
3175 |
X_GEN_TAC `i:num` THEN STRIP_TAC THEN
|
|
3176 |
X_GEN_TAC `j:num` THEN STRIP_TAC THEN MATCH_MP_TAC EQ_TRANS THEN
|
|
3177 |
EXISTS_TAC `sum (1..inverse (p:num->num) i)
|
|
3178 |
(\<lambda>k. if k = j then 1 else 0)` THEN
|
|
3179 |
CONJ_TAC THENL
|
|
3180 |
[MATCH_MP_TAC SUM_EQ THEN
|
|
3181 |
ASM_SIMP_TAC[IN_NUMSEG; PERMUTES_IN_IMAGE; basis] THEN
|
|
3182 |
REPEAT STRIP_TAC THEN MATCH_MP_TAC LAMBDA_BETA THEN
|
|
3183 |
ASM_MESON_TAC[PERMUTES_IN_IMAGE; IN_NUMSEG; LE_TRANS;
|
|
3184 |
PERMUTES_INVERSE];
|
|
3185 |
ASM_SIMP_TAC[SUM_DELTA; IN_NUMSEG]];
|
|
3186 |
ALL_TAC] THEN
|
|
3187 |
ASM_SIMP_TAC[PERMUTES_INVERSE; DET_PERMUTE_ROWS; ETA_AX] THEN
|
|
3188 |
REWRITE_TAC[REAL_ABS_MUL; REAL_ABS_SIGN; REAL_MUL_LID] THEN
|
|
3189 |
MATCH_MP_TAC(REAL_ARITH `x = 1 ==> abs x = 1`) THEN
|
|
3190 |
ASM_SIMP_TAC[DET_LOWERTRIANGULAR; GSYM NOT_LT; LAMBDA_BETA] THEN
|
|
3191 |
REWRITE_TAC[LT_REFL; PRODUCT_CONST_NUMSEG; REAL_POW_ONE]]);; *)
|
|
3192 |
|
|
3193 |
lemma HAS_GMEASURE_STD_SIMPLEX: True .. (*
|
|
3194 |
"(convex hull (0:real^N INSERT {basis i | 1 \<le> i \<and> i \<le> dimindex(:N)}))
|
|
3195 |
has_gmeasure inv((FACT(dimindex(:N))))"
|
|
3196 |
qed lemma lemma = prove
|
|
3197 |
(`!f:num->real. (!i. 1 \<le> i \<and> i < n ==> f i \<le> f(i + 1)) \<longleftrightarrow>
|
|
3198 |
(!i j. 1 \<le> i \<and> i \<le> j \<and> j \<le> n ==> f i \<le> f j)"
|
|
3199 |
qed GEN_TAC THEN EQ_TAC THEN DISCH_TAC THENL
|
|
3200 |
[GEN_TAC THEN INDUCT_TAC THEN
|
|
3201 |
SIMP_TAC[LE; REAL_LE_REFL] THEN
|
|
3202 |
STRIP_TAC THEN ASM_SIMP_TAC[REAL_LE_REFL] THEN
|
|
3203 |
MATCH_MP_TAC REAL_LE_TRANS THEN EXISTS_TAC `(f:num->real) j` THEN
|
|
3204 |
ASM_SIMP_TAC[ARITH_RULE `SUC x \<le> y ==> x \<le> y`] THEN
|
|
3205 |
REWRITE_TAC[ADD1] THEN FIRST_X_ASSUM MATCH_MP_TAC THEN ASM_ARITH_TAC;
|
|
3206 |
REPEAT STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN ASM_ARITH_TAC]) in
|
|
3207 |
MP_TAC(ISPECL
|
|
3208 |
[`\p. {x:real^N | 0 \<le> x$(p 1) \<and> x$(p(dimindex(:N))) \<le> 1 \<and>
|
|
3209 |
(!i. 1 \<le> i \<and> i < dimindex(:N)
|
|
3210 |
==> x$(p i) \<le> x$(p(i + 1)))}`;
|
|
3211 |
`{p | p permutes 1..dimindex(:N)}`]
|
|
3212 |
HAS_GMEASURE_NEGLIGIBLE_UNIONS_IMAGE) THEN
|
|
3213 |
ASM_SIMP_TAC[REWRITE_RULE[HAS_GMEASURE_MEASURABLE_MEASURE]
|
|
3214 |
HAS_GMEASURE_IMAGE_STD_SIMPLEX; IN_ELIM_THM] THEN
|
|
3215 |
ASM_SIMP_TAC[SUM_CONST; FINITE_PERMUTATIONS; FINITE_NUMSEG;
|
|
3216 |
CARD_PERMUTATIONS; CARD_NUMSEG_1] THEN
|
|
3217 |
ANTS_TAC THENL
|
|
3218 |
[MAP_EVERY X_GEN_TAC [`p:num->num`; `q:num->num`] THEN STRIP_TAC THEN
|
|
3219 |
SUBGOAL_THEN `?i. i \<in> 1..dimindex(:N) \<and> ~(p i:num = q i)` MP_TAC THENL
|
|
3220 |
[ASM_MESON_TAC[permutes; FUN_EQ_THM]; ALL_TAC] THEN
|
|
3221 |
GEN_REWRITE_TAC LAND_CONV [num_WOP] THEN
|
|
3222 |
REWRITE_TAC[TAUT `a ==> ~(b \<and> ~c) \<longleftrightarrow> a \<and> b ==> c`] THEN
|
|
3223 |
REWRITE_TAC[IN_NUMSEG] THEN
|
|
3224 |
DISCH_THEN(X_CHOOSE_THEN `k:num` STRIP_ASSUME_TAC) THEN
|
|
3225 |
MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN
|
|
3226 |
EXISTS_TAC `{x:real^N | (basis(p(k:num)) - basis(q k)) dot x = 0}` THEN
|
|
3227 |
CONJ_TAC THENL
|
|
3228 |
[MATCH_MP_TAC NEGLIGIBLE_HYPERPLANE THEN REWRITE_TAC[VECTOR_SUB_EQ] THEN
|
|
3229 |
MATCH_MP_TAC BASIS_NE THEN ASM_MESON_TAC[PERMUTES_IN_IMAGE; IN_NUMSEG];
|
|
3230 |
ALL_TAC] THEN
|
|
3231 |
REWRITE_TAC[SUBSET; IN_INTER; IN_ELIM_THM; DOT_LSUB; VECTOR_SUB_EQ] THEN
|
|
3232 |
ASM_SIMP_TAC[DOT_BASIS; GSYM IN_NUMSEG; PERMUTES_IN_IMAGE] THEN
|
|
3233 |
SUBGOAL_THEN `?l. (q:num->num) l = p(k:num)` STRIP_ASSUME_TAC THENL
|
|
3234 |
[ASM_MESON_TAC[permutes]; ALL_TAC] THEN
|
|
3235 |
SUBGOAL_THEN `1 \<le> l \<and> l \<le> dimindex(:N)` STRIP_ASSUME_TAC THENL
|
|
3236 |
[ASM_MESON_TAC[PERMUTES_IN_IMAGE; IN_NUMSEG]; ALL_TAC] THEN
|
|
3237 |
SUBGOAL_THEN `k:num < l` ASSUME_TAC THENL
|
|
3238 |
[REWRITE_TAC[GSYM NOT_LE] THEN REWRITE_TAC[LE_LT] THEN
|
|
3239 |
ASM_MESON_TAC[PERMUTES_INJECTIVE; IN_NUMSEG];
|
|
3240 |
ALL_TAC] THEN
|
|
3241 |
SUBGOAL_THEN `?m. (p:num->num) m = q(k:num)` STRIP_ASSUME_TAC THENL
|
|
3242 |
[ASM_MESON_TAC[permutes]; ALL_TAC] THEN
|
|
3243 |
SUBGOAL_THEN `1 \<le> m \<and> m \<le> dimindex(:N)` STRIP_ASSUME_TAC THENL
|
|
3244 |
[ASM_MESON_TAC[PERMUTES_IN_IMAGE; IN_NUMSEG]; ALL_TAC] THEN
|
|
3245 |
SUBGOAL_THEN `k:num < m` ASSUME_TAC THENL
|
|
3246 |
[REWRITE_TAC[GSYM NOT_LE] THEN REWRITE_TAC[LE_LT] THEN
|
|
3247 |
ASM_MESON_TAC[PERMUTES_INJECTIVE; IN_NUMSEG];
|
|
3248 |
ALL_TAC] THEN
|
|
3249 |
X_GEN_TAC `x:real^N` THEN REWRITE_TAC[lemma] THEN STRIP_TAC THEN
|
|
3250 |
FIRST_X_ASSUM(MP_TAC o SPECL [`k:num`; `l:num`]) THEN
|
|
3251 |
FIRST_X_ASSUM(MP_TAC o SPECL [`k:num`; `m:num`]) THEN
|
|
3252 |
ASM_SIMP_TAC[LT_IMP_LE; IMP_IMP; REAL_LE_ANTISYM; REAL_SUB_0] THEN
|
|
3253 |
MATCH_MP_TAC EQ_IMP THEN BINOP_TAC THEN
|
|
3254 |
ASM_MESON_TAC[PERMUTES_IN_IMAGE; IN_NUMSEG; DOT_BASIS];
|
|
3255 |
ALL_TAC] THEN
|
|
3256 |
REWRITE_TAC[HAS_GMEASURE_MEASURABLE_MEASURE] THEN
|
|
3257 |
DISCH_THEN(ASSUME_TAC o CONJUNCT2) THEN CONJ_TAC THENL
|
|
3258 |
[MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3259 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN REWRITE_TAC[BOUNDED_INSERT] THEN
|
|
3260 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE_GEN] THEN
|
|
3261 |
MATCH_MP_TAC FINITE_IMP_BOUNDED THEN MATCH_MP_TAC FINITE_IMAGE THEN
|
|
3262 |
REWRITE_TAC[GSYM numseg; FINITE_NUMSEG];
|
|
3263 |
ALL_TAC] THEN
|
|
3264 |
ASM_SIMP_TAC[REAL_FIELD `~(y = 0) ==> (x = inv y \<longleftrightarrow> y * x = 1)`;
|
|
3265 |
REAL_OF_NUM_EQ; FACT_NZ] THEN
|
|
3266 |
FIRST_X_ASSUM(SUBST1_TAC o SYM) THEN MATCH_MP_TAC EQ_TRANS THEN
|
|
3267 |
EXISTS_TAC `measure(interval[0:real^N,1])` THEN CONJ_TAC THENL
|
|
3268 |
[AP_TERM_TAC; REWRITE_TAC[MEASURE_INTERVAL; CONTENT_UNIT]] THEN
|
|
3269 |
REWRITE_TAC[lemma] THEN MATCH_MP_TAC SUBSET_ANTISYM THEN CONJ_TAC THENL
|
|
3270 |
[REWRITE_TAC[SUBSET; FORALL_IN_UNIONS; FORALL_IN_IMAGE; IMP_CONJ;
|
|
3271 |
RIGHT_FORALL_IMP_THM; IN_ELIM_THM] THEN
|
|
3272 |
SIMP_TAC[IMP_IMP; IN_INTERVAL; LAMBDA_BETA; VEC_COMPONENT] THEN
|
|
3273 |
X_GEN_TAC `p:num->num` THEN STRIP_TAC THEN X_GEN_TAC `x:real^N` THEN
|
|
3274 |
STRIP_TAC THEN X_GEN_TAC `i:num` THEN REPEAT STRIP_TAC THEN
|
|
3275 |
MATCH_MP_TAC REAL_LE_TRANS THENL
|
|
3276 |
[EXISTS_TAC `(x:real^N)$(p 1)`;
|
|
3277 |
EXISTS_TAC `(x:real^N)$(p(dimindex(:N)))`] THEN
|
|
3278 |
ASM_REWRITE_TAC[] THEN
|
|
3279 |
FIRST_ASSUM(MP_TAC o SPEC `i:num` o MATCH_MP PERMUTES_SURJECTIVE) THEN
|
|
3280 |
ASM_MESON_TAC[LE_REFL; PERMUTES_IN_IMAGE; IN_NUMSEG];
|
|
3281 |
ALL_TAC] THEN
|
|
3282 |
REWRITE_TAC[SET_RULE `s \<subseteq> UNIONS(IMAGE f t) \<longleftrightarrow>
|
|
3283 |
!x. x \<in> s ==> ?y. y \<in> t \<and> x \<in> f y`] THEN
|
|
3284 |
X_GEN_TAC `x:real^N` THEN REWRITE_TAC[IN_INTERVAL; IN_ELIM_THM] THEN
|
|
3285 |
SIMP_TAC[VEC_COMPONENT] THEN DISCH_TAC THEN
|
|
3286 |
MP_TAC(ISPEC `\i j. ~((x:real^N)$j \<le> x$i)` TOPOLOGICAL_SORT) THEN
|
|
3287 |
REWRITE_TAC[REAL_NOT_LE; REAL_NOT_LT] THEN
|
|
3288 |
ANTS_TAC THENL [REAL_ARITH_TAC; ALL_TAC] THEN
|
|
3289 |
DISCH_THEN(MP_TAC o SPECL [`dimindex(:N)`; `1..dimindex(:N)`]) THEN
|
|
3290 |
REWRITE_TAC[HAS_SIZE_NUMSEG_1; EXTENSION; IN_IMAGE; IN_NUMSEG] THEN
|
|
3291 |
DISCH_THEN(X_CHOOSE_THEN `f:num->num` (CONJUNCTS_THEN2
|
|
3292 |
(ASSUME_TAC o GSYM) ASSUME_TAC)) THEN
|
|
3293 |
EXISTS_TAC `\i. if i \<in> 1..dimindex(:N) then f(i) else i` THEN
|
|
3294 |
REWRITE_TAC[] THEN ONCE_REWRITE_TAC[ARITH_RULE
|
|
3295 |
`1 \<le> i \<and> i \<le> j \<and> j \<le> n \<longleftrightarrow>
|
|
3296 |
1 \<le> i \<and> 1 \<le> j \<and> i \<le> n \<and> j \<le> n \<and> i \<le> j`] THEN
|
|
3297 |
ASM_SIMP_TAC[IN_NUMSEG; LE_REFL; DIMINDEX_GE_1] THEN
|
|
3298 |
CONJ_TAC THENL
|
|
3299 |
[ALL_TAC;
|
|
3300 |
ASM_MESON_TAC[LE_REFL; DIMINDEX_GE_1; LE_LT; REAL_LE_LT]] THEN
|
|
3301 |
SIMP_TAC[PERMUTES_FINITE_SURJECTIVE; FINITE_NUMSEG] THEN
|
|
3302 |
SIMP_TAC[IN_NUMSEG] THEN ASM_MESON_TAC[]);; *)
|
|
3303 |
|
|
3304 |
(* ------------------------------------------------------------------------- *)
|
|
3305 |
(* Hence the gmeasure of a general simplex. *)
|
|
3306 |
(* ------------------------------------------------------------------------- *)
|
|
3307 |
|
|
3308 |
lemma HAS_GMEASURE_SIMPLEX_0: True .. (*
|
|
3309 |
"!l:(real^N)list.
|
|
3310 |
LENGTH l = dimindex(:N)
|
|
3311 |
==> (convex hull (0 INSERT set_of_list l)) has_gmeasure
|
|
3312 |
abs(det(vector l)) / (FACT(dimindex(:N)))"
|
|
3313 |
qed REPEAT STRIP_TAC THEN
|
|
3314 |
SUBGOAL_THEN
|
|
3315 |
`0 INSERT (set_of_list l) =
|
|
3316 |
IMAGE (\<lambda>x:real^N. transp(vector l:real^N^N) ** x)
|
|
3317 |
(0 INSERT {basis i:real^N | 1 \<le> i \<and> i \<le> dimindex(:N)})`
|
|
3318 |
SUBST1_TAC THENL
|
|
3319 |
[ONCE_REWRITE_TAC[SIMPLE_IMAGE_GEN] THEN
|
|
3320 |
REWRITE_TAC[IMAGE_CLAUSES; GSYM IMAGE_o; o_DEF] THEN
|
|
3321 |
REWRITE_TAC[MATRIX_VECTOR_MUL_RZERO] THEN AP_TERM_TAC THEN
|
|
3322 |
SIMP_TAC[matrix_vector_mul; vector; transp; LAMBDA_BETA; basis] THEN
|
|
3323 |
ONCE_REWRITE_TAC[COND_RAND] THEN
|
|
3324 |
SIMP_TAC[REAL_MUL_RZERO; SUM_DELTA] THEN
|
|
3325 |
REWRITE_TAC[EXTENSION; IN_IMAGE; IN_ELIM_THM; IN_NUMSEG] THEN
|
|
3326 |
ONCE_REWRITE_TAC[TAUT `a \<and> b \<and> c \<longleftrightarrow> ~(b \<and> c ==> ~a)`] THEN
|
|
3327 |
X_GEN_TAC `y:real^N` THEN SIMP_TAC[LAMBDA_BETA; REAL_MUL_RID] THEN
|
|
3328 |
SIMP_TAC[CART_EQ; LAMBDA_BETA] THEN
|
|
3329 |
REWRITE_TAC[NOT_IMP; REAL_MUL_RID; GSYM CART_EQ] THEN
|
|
3330 |
ASM_REWRITE_TAC[IN_SET_OF_LIST; MEM_EXISTS_EL] THEN
|
|
3331 |
EQ_TAC THEN DISCH_THEN(X_CHOOSE_THEN `i:num` STRIP_ASSUME_TAC) THENL
|
|
3332 |
[EXISTS_TAC `SUC i`; EXISTS_TAC `i - 1`] THEN
|
|
3333 |
ASM_REWRITE_TAC[SUC_SUB1] THEN ASM_ARITH_TAC;
|
|
3334 |
ALL_TAC] THEN
|
|
3335 |
ASM_SIMP_TAC[GSYM CONVEX_HULL_LINEAR_IMAGE; MATRIX_VECTOR_MUL_LINEAR] THEN
|
|
3336 |
SUBGOAL_THEN
|
|
3337 |
`det(vector l:real^N^N) = det(matrix(\<lambda>x:real^N. transp(vector l) ** x))`
|
|
3338 |
SUBST1_TAC THENL
|
|
3339 |
[REWRITE_TAC[MATRIX_OF_MATRIX_VECTOR_MUL; DET_TRANSP]; ALL_TAC] THEN
|
|
3340 |
REWRITE_TAC[real_div] THEN
|
|
3341 |
ASM_SIMP_TAC[GSYM(REWRITE_RULE[HAS_GMEASURE_MEASURABLE_MEASURE]
|
|
3342 |
HAS_GMEASURE_STD_SIMPLEX)] THEN
|
|
3343 |
MATCH_MP_TAC HAS_GMEASURE_LINEAR_IMAGE THEN
|
|
3344 |
REWRITE_TAC[MATRIX_VECTOR_MUL_LINEAR] THEN
|
|
3345 |
MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3346 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN REWRITE_TAC[BOUNDED_INSERT] THEN
|
|
3347 |
ONCE_REWRITE_TAC[SIMPLE_IMAGE_GEN] THEN
|
|
3348 |
MATCH_MP_TAC FINITE_IMP_BOUNDED THEN MATCH_MP_TAC FINITE_IMAGE THEN
|
|
3349 |
REWRITE_TAC[GSYM numseg; FINITE_NUMSEG]);; *)
|
|
3350 |
|
|
3351 |
lemma HAS_GMEASURE_SIMPLEX: True .. (*
|
|
3352 |
"!a l:(real^N)list.
|
|
3353 |
LENGTH l = dimindex(:N)
|
|
3354 |
==> (convex hull (set_of_list(CONS a l))) has_gmeasure
|
|
3355 |
abs(det(vector(MAP (\<lambda>x. x - a) l))) / (FACT(dimindex(:N)))"
|
|
3356 |
qed REPEAT STRIP_TAC THEN
|
|
3357 |
MP_TAC(ISPEC `MAP (\<lambda>x:real^N. x - a) l` HAS_GMEASURE_SIMPLEX_0) THEN
|
|
3358 |
ASM_REWRITE_TAC[LENGTH_MAP; set_of_list] THEN
|
|
3359 |
DISCH_THEN(MP_TAC o SPEC `a:real^N` o MATCH_MP HAS_GMEASURE_TRANSLATION) THEN
|
|
3360 |
REWRITE_TAC[GSYM CONVEX_HULL_TRANSLATION] THEN
|
|
3361 |
MATCH_MP_TAC EQ_IMP THEN AP_THM_TAC THEN AP_TERM_TAC THEN
|
|
3362 |
REWRITE_TAC[IMAGE_CLAUSES; VECTOR_ADD_RID; SET_OF_LIST_MAP] THEN
|
|
3363 |
REWRITE_TAC[GSYM IMAGE_o; o_DEF; VECTOR_ARITH `a + x - a:real^N = x`;
|
|
3364 |
SET_RULE `IMAGE (\<lambda>x. x) s = s`]);; *)
|
|
3365 |
|
|
3366 |
lemma GMEASURABLE_SIMPLEX: True .. (*
|
|
3367 |
"!l. gmeasurable(convex hull (set_of_list l))"
|
|
3368 |
qed GEN_TAC THEN
|
|
3369 |
MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3370 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN
|
|
3371 |
MATCH_MP_TAC FINITE_IMP_BOUNDED THEN REWRITE_TAC[FINITE_SET_OF_LIST]);; *)
|
|
3372 |
|
|
3373 |
lemma MEASURE_SIMPLEX: True .. (*
|
|
3374 |
"!a l:(real^N)list.
|
|
3375 |
LENGTH l = dimindex(:N)
|
|
3376 |
==> measure(convex hull (set_of_list(CONS a l))) =
|
|
3377 |
abs(det(vector(MAP (\<lambda>x. x - a) l))) / (FACT(dimindex(:N)))"
|
|
3378 |
qed MESON_TAC[HAS_GMEASURE_SIMPLEX; HAS_GMEASURE_MEASURABLE_MEASURE]);; *)
|
|
3379 |
|
|
3380 |
(* ------------------------------------------------------------------------- *)
|
|
3381 |
(* Area of a triangle. *)
|
|
3382 |
(* ------------------------------------------------------------------------- *)
|
|
3383 |
|
|
3384 |
lemma HAS_GMEASURE_TRIANGLE: True .. (*
|
|
3385 |
"!a b c:real^2.
|
|
3386 |
convex hull {a,b,c} has_gmeasure
|
|
3387 |
abs((b$1 - a$1) * (c$2 - a$2) - (b$2 - a$2) * (c$1 - a$1)) / 2"
|
|
3388 |
qed REPEAT STRIP_TAC THEN
|
|
3389 |
MP_TAC(ISPECL [`a:real^2`; `[b;c]:(real^2)list`] HAS_GMEASURE_SIMPLEX) THEN
|
|
3390 |
REWRITE_TAC[LENGTH; DIMINDEX_2; ARITH; set_of_list; MAP] THEN
|
|
3391 |
CONV_TAC NUM_REDUCE_CONV THEN SIMP_TAC[DET_2; VECTOR_2] THEN
|
|
3392 |
SIMP_TAC[VECTOR_SUB_COMPONENT; DIMINDEX_2; ARITH]);; *)
|
|
3393 |
|
|
3394 |
lemma GMEASURABLE_TRIANGLE: True .. (*
|
|
3395 |
"!a b c:real^N. gmeasurable(convex hull {a,b,c})"
|
|
3396 |
qed REPEAT GEN_TAC THEN
|
|
3397 |
MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3398 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN MATCH_MP_TAC FINITE_IMP_BOUNDED THEN
|
|
3399 |
REWRITE_TAC[FINITE_INSERT; FINITE_RULES]);; *)
|
|
3400 |
|
|
3401 |
lemma MEASURE_TRIANGLE: True .. (*
|
|
3402 |
"!a b c:real^2.
|
|
3403 |
measure(convex hull {a,b,c}) =
|
|
3404 |
abs((b$1 - a$1) * (c$2 - a$2) - (b$2 - a$2) * (c$1 - a$1)) / 2"
|
|
3405 |
qed REWRITE_TAC[REWRITE_RULE[HAS_GMEASURE_MEASURABLE_MEASURE]
|
|
3406 |
HAS_GMEASURE_TRIANGLE]);; *)
|
|
3407 |
|
|
3408 |
(* ------------------------------------------------------------------------- *)
|
|
3409 |
(* Volume of a tetrahedron. *)
|
|
3410 |
(* ------------------------------------------------------------------------- *)
|
|
3411 |
|
|
3412 |
lemma HAS_GMEASURE_TETRAHEDRON: True .. (*
|
|
3413 |
"!a b c d:real^3.
|
|
3414 |
convex hull {a,b,c,d} has_gmeasure
|
|
3415 |
abs((b$1 - a$1) * (c$2 - a$2) * (d$3 - a$3) +
|
|
3416 |
(b$2 - a$2) * (c$3 - a$3) * (d$1 - a$1) +
|
|
3417 |
(b$3 - a$3) * (c$1 - a$1) * (d$2 - a$2) -
|
|
3418 |
(b$1 - a$1) * (c$3 - a$3) * (d$2 - a$2) -
|
|
3419 |
(b$2 - a$2) * (c$1 - a$1) * (d$3 - a$3) -
|
|
3420 |
(b$3 - a$3) * (c$2 - a$2) * (d$1 - a$1)) /
|
|
3421 |
6"
|
|
3422 |
qed REPEAT STRIP_TAC THEN
|
|
3423 |
MP_TAC(ISPECL [`a:real^3`; `[b;c;d]:(real^3)list`] HAS_GMEASURE_SIMPLEX) THEN
|
|
3424 |
REWRITE_TAC[LENGTH; DIMINDEX_3; ARITH; set_of_list; MAP] THEN
|
|
3425 |
CONV_TAC NUM_REDUCE_CONV THEN SIMP_TAC[DET_3; VECTOR_3] THEN
|
|
3426 |
SIMP_TAC[VECTOR_SUB_COMPONENT; DIMINDEX_3; ARITH]);; *)
|
|
3427 |
|
|
3428 |
lemma GMEASURABLE_TETRAHEDRON: True .. (*
|
|
3429 |
"!a b c d:real^N. gmeasurable(convex hull {a,b,c,d})"
|
|
3430 |
qed REPEAT GEN_TAC THEN
|
|
3431 |
MATCH_MP_TAC GMEASURABLE_CONVEX THEN REWRITE_TAC[CONVEX_CONVEX_HULL] THEN
|
|
3432 |
MATCH_MP_TAC BOUNDED_CONVEX_HULL THEN MATCH_MP_TAC FINITE_IMP_BOUNDED THEN
|
|
3433 |
REWRITE_TAC[FINITE_INSERT; FINITE_RULES]);; *)
|
|
3434 |
|
|
3435 |
lemma MEASURE_TETRAHEDRON: True .. (*
|
|
3436 |
"!a b c d:real^3.
|
|
3437 |
measure(convex hull {a,b,c,d}) =
|
|
3438 |
abs((b$1 - a$1) * (c$2 - a$2) * (d$3 - a$3) +
|
|
3439 |
(b$2 - a$2) * (c$3 - a$3) * (d$1 - a$1) +
|
|
3440 |
(b$3 - a$3) * (c$1 - a$1) * (d$2 - a$2) -
|
|
3441 |
(b$1 - a$1) * (c$3 - a$3) * (d$2 - a$2) -
|
|
3442 |
(b$2 - a$2) * (c$1 - a$1) * (d$3 - a$3) -
|
|
3443 |
(b$3 - a$3) * (c$2 - a$2) * (d$1 - a$1)) / 6"
|
|
3444 |
qed REWRITE_TAC[REWRITE_RULE[HAS_GMEASURE_MEASURABLE_MEASURE]
|
|
3445 |
HAS_GMEASURE_TETRAHEDRON]);; *)
|
|
3446 |
|
|
3447 |
end
|