author | Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> |
Wed, 16 Jan 2019 21:27:33 +0000 | |
changeset 69677 | a06b204527e6 |
parent 69661 | a03a63b81f44 |
child 69679 | a8faf6f15da7 |
permissions | -rw-r--r-- |
68017 | 1 |
(* Title: HOL/Analysis/Change_Of_Vars.thy |
2 |
Authors: LC Paulson, based on material from HOL Light |
|
3 |
*) |
|
4 |
||
5 |
section\<open>Change of Variables Theorems\<close> |
|
6 |
||
67998 | 7 |
theory Change_Of_Vars |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
8 |
imports Vitali_Covering_Theorem Determinants |
67998 | 9 |
|
10 |
begin |
|
11 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
12 |
subsection%important\<open>Induction on matrix row operations\<close> |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
13 |
(*FIX move first 3 lemmas of subsection to linear algebra, contain technical tools on matrix operations. |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
14 |
Keep the rest of the subsection contents in this theory but rename the subsection, they refer |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
15 |
to lebesgue measure |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
16 |
*) |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
17 |
lemma induct_matrix_row_operations: |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
18 |
fixes P :: "real^'n^'n \<Rightarrow> bool" |
67998 | 19 |
assumes zero_row: "\<And>A i. row i A = 0 \<Longrightarrow> P A" |
20 |
and diagonal: "\<And>A. (\<And>i j. i \<noteq> j \<Longrightarrow> A$i$j = 0) \<Longrightarrow> P A" |
|
21 |
and swap_cols: "\<And>A m n. \<lbrakk>P A; m \<noteq> n\<rbrakk> \<Longrightarrow> P(\<chi> i j. A $ i $ Fun.swap m n id j)" |
|
22 |
and row_op: "\<And>A m n c. \<lbrakk>P A; m \<noteq> n\<rbrakk> |
|
23 |
\<Longrightarrow> P(\<chi> i. if i = m then row m A + c *\<^sub>R row n A else row i A)" |
|
24 |
shows "P A" |
|
25 |
proof - |
|
26 |
have "P A" if "(\<And>i j. \<lbrakk>j \<in> -K; i \<noteq> j\<rbrakk> \<Longrightarrow> A$i$j = 0)" for A K |
|
27 |
proof - |
|
28 |
have "finite K" |
|
29 |
by simp |
|
30 |
then show ?thesis using that |
|
31 |
proof (induction arbitrary: A rule: finite_induct) |
|
32 |
case empty |
|
33 |
with diagonal show ?case |
|
34 |
by simp |
|
35 |
next |
|
36 |
case (insert k K) |
|
37 |
note insertK = insert |
|
38 |
have "P A" if kk: "A$k$k \<noteq> 0" |
|
39 |
and 0: "\<And>i j. \<lbrakk>j \<in> - insert k K; i \<noteq> j\<rbrakk> \<Longrightarrow> A$i$j = 0" |
|
40 |
"\<And>i. \<lbrakk>i \<in> -L; i \<noteq> k\<rbrakk> \<Longrightarrow> A$i$k = 0" for A L |
|
41 |
proof - |
|
42 |
have "finite L" |
|
43 |
by simp |
|
44 |
then show ?thesis using 0 kk |
|
45 |
proof (induction arbitrary: A rule: finite_induct) |
|
46 |
case (empty B) |
|
47 |
show ?case |
|
48 |
proof (rule insertK) |
|
49 |
fix i j |
|
50 |
assume "i \<in> - K" "j \<noteq> i" |
|
51 |
show "B $ j $ i = 0" |
|
52 |
using \<open>j \<noteq> i\<close> \<open>i \<in> - K\<close> empty |
|
53 |
by (metis ComplD ComplI Compl_eq_Diff_UNIV Diff_empty UNIV_I insert_iff) |
|
54 |
qed |
|
55 |
next |
|
56 |
case (insert l L B) |
|
57 |
show ?case |
|
58 |
proof (cases "k = l") |
|
59 |
case True |
|
60 |
with insert show ?thesis |
|
61 |
by auto |
|
62 |
next |
|
63 |
case False |
|
64 |
let ?C = "\<chi> i. if i = l then row l B - (B $ l $ k / B $ k $ k) *\<^sub>R row k B else row i B" |
|
65 |
have 1: "\<lbrakk>j \<in> - insert k K; i \<noteq> j\<rbrakk> \<Longrightarrow> ?C $ i $ j = 0" for j i |
|
66 |
by (auto simp: insert.prems(1) row_def) |
|
67 |
have 2: "?C $ i $ k = 0" |
|
68 |
if "i \<in> - L" "i \<noteq> k" for i |
|
69 |
proof (cases "i=l") |
|
70 |
case True |
|
71 |
with that insert.prems show ?thesis |
|
72 |
by (simp add: row_def) |
|
73 |
next |
|
74 |
case False |
|
75 |
with that show ?thesis |
|
76 |
by (simp add: insert.prems(2) row_def) |
|
77 |
qed |
|
78 |
have 3: "?C $ k $ k \<noteq> 0" |
|
79 |
by (auto simp: insert.prems row_def \<open>k \<noteq> l\<close>) |
|
80 |
have PC: "P ?C" |
|
81 |
using insert.IH [OF 1 2 3] by auto |
|
82 |
have eqB: "(\<chi> i. if i = l then row l ?C + (B $ l $ k / B $ k $ k) *\<^sub>R row k ?C else row i ?C) = B" |
|
83 |
using \<open>k \<noteq> l\<close> by (simp add: vec_eq_iff row_def) |
|
84 |
show ?thesis |
|
85 |
using row_op [OF PC, of l k, where c = "B$l$k / B$k$k"] eqB \<open>k \<noteq> l\<close> |
|
86 |
by (simp add: cong: if_cong) |
|
87 |
qed |
|
88 |
qed |
|
89 |
qed |
|
90 |
then have nonzero_hyp: "P A" |
|
91 |
if kk: "A$k$k \<noteq> 0" and zeroes: "\<And>i j. j \<in> - insert k K \<and> i\<noteq>j \<Longrightarrow> A$i$j = 0" for A |
|
92 |
by (auto simp: intro!: kk zeroes) |
|
93 |
show ?case |
|
94 |
proof (cases "row k A = 0") |
|
95 |
case True |
|
96 |
with zero_row show ?thesis by auto |
|
97 |
next |
|
98 |
case False |
|
99 |
then obtain l where l: "A$k$l \<noteq> 0" |
|
100 |
by (auto simp: row_def zero_vec_def vec_eq_iff) |
|
101 |
show ?thesis |
|
102 |
proof (cases "k = l") |
|
103 |
case True |
|
104 |
with l nonzero_hyp insert.prems show ?thesis |
|
105 |
by blast |
|
106 |
next |
|
107 |
case False |
|
108 |
have *: "A $ i $ Fun.swap k l id j = 0" if "j \<noteq> k" "j \<notin> K" "i \<noteq> j" for i j |
|
109 |
using False l insert.prems that |
|
110 |
by (auto simp: swap_def insert split: if_split_asm) |
|
111 |
have "P (\<chi> i j. (\<chi> i j. A $ i $ Fun.swap k l id j) $ i $ Fun.swap k l id j)" |
|
112 |
by (rule swap_cols [OF nonzero_hyp False]) (auto simp: l *) |
|
113 |
moreover |
|
114 |
have "(\<chi> i j. (\<chi> i j. A $ i $ Fun.swap k l id j) $ i $ Fun.swap k l id j) = A" |
|
115 |
by (metis (no_types, lifting) id_apply o_apply swap_id_idempotent vec_lambda_unique vec_lambda_unique) |
|
116 |
ultimately show ?thesis |
|
117 |
by simp |
|
118 |
qed |
|
119 |
qed |
|
120 |
qed |
|
121 |
qed |
|
122 |
then show ?thesis |
|
123 |
by blast |
|
124 |
qed |
|
125 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
126 |
lemma induct_matrix_elementary: |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
127 |
fixes P :: "real^'n^'n \<Rightarrow> bool" |
67998 | 128 |
assumes mult: "\<And>A B. \<lbrakk>P A; P B\<rbrakk> \<Longrightarrow> P(A ** B)" |
129 |
and zero_row: "\<And>A i. row i A = 0 \<Longrightarrow> P A" |
|
130 |
and diagonal: "\<And>A. (\<And>i j. i \<noteq> j \<Longrightarrow> A$i$j = 0) \<Longrightarrow> P A" |
|
131 |
and swap1: "\<And>m n. m \<noteq> n \<Longrightarrow> P(\<chi> i j. mat 1 $ i $ Fun.swap m n id j)" |
|
132 |
and idplus: "\<And>m n c. m \<noteq> n \<Longrightarrow> P(\<chi> i j. if i = m \<and> j = n then c else of_bool (i = j))" |
|
133 |
shows "P A" |
|
134 |
proof - |
|
135 |
have swap: "P (\<chi> i j. A $ i $ Fun.swap m n id j)" (is "P ?C") |
|
136 |
if "P A" "m \<noteq> n" for A m n |
|
137 |
proof - |
|
138 |
have "A ** (\<chi> i j. mat 1 $ i $ Fun.swap m n id j) = ?C" |
|
139 |
by (simp add: matrix_matrix_mult_def mat_def vec_eq_iff if_distrib sum.delta_remove) |
|
140 |
then show ?thesis |
|
141 |
using mult swap1 that by metis |
|
142 |
qed |
|
143 |
have row: "P (\<chi> i. if i = m then row m A + c *\<^sub>R row n A else row i A)" (is "P ?C") |
|
144 |
if "P A" "m \<noteq> n" for A m n c |
|
145 |
proof - |
|
146 |
let ?B = "\<chi> i j. if i = m \<and> j = n then c else of_bool (i = j)" |
|
147 |
have "?B ** A = ?C" |
|
148 |
using \<open>m \<noteq> n\<close> unfolding matrix_matrix_mult_def row_def of_bool_def |
|
149 |
by (auto simp: vec_eq_iff if_distrib [of "\<lambda>x. x * y" for y] sum.remove cong: if_cong) |
|
150 |
then show ?thesis |
|
151 |
by (rule subst) (auto simp: that mult idplus) |
|
152 |
qed |
|
153 |
show ?thesis |
|
154 |
by (rule induct_matrix_row_operations [OF zero_row diagonal swap row]) |
|
155 |
qed |
|
156 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
157 |
lemma induct_matrix_elementary_alt: |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
158 |
fixes P :: "real^'n^'n \<Rightarrow> bool" |
67998 | 159 |
assumes mult: "\<And>A B. \<lbrakk>P A; P B\<rbrakk> \<Longrightarrow> P(A ** B)" |
160 |
and zero_row: "\<And>A i. row i A = 0 \<Longrightarrow> P A" |
|
161 |
and diagonal: "\<And>A. (\<And>i j. i \<noteq> j \<Longrightarrow> A$i$j = 0) \<Longrightarrow> P A" |
|
162 |
and swap1: "\<And>m n. m \<noteq> n \<Longrightarrow> P(\<chi> i j. mat 1 $ i $ Fun.swap m n id j)" |
|
163 |
and idplus: "\<And>m n. m \<noteq> n \<Longrightarrow> P(\<chi> i j. of_bool (i = m \<and> j = n \<or> i = j))" |
|
164 |
shows "P A" |
|
165 |
proof - |
|
166 |
have *: "P (\<chi> i j. if i = m \<and> j = n then c else of_bool (i = j))" |
|
167 |
if "m \<noteq> n" for m n c |
|
168 |
proof (cases "c = 0") |
|
169 |
case True |
|
170 |
with diagonal show ?thesis by auto |
|
171 |
next |
|
172 |
case False |
|
173 |
then have eq: "(\<chi> i j. if i = m \<and> j = n then c else of_bool (i = j)) = |
|
174 |
(\<chi> i j. if i = j then (if j = n then inverse c else 1) else 0) ** |
|
175 |
(\<chi> i j. of_bool (i = m \<and> j = n \<or> i = j)) ** |
|
176 |
(\<chi> i j. if i = j then if j = n then c else 1 else 0)" |
|
177 |
using \<open>m \<noteq> n\<close> |
|
178 |
apply (simp add: matrix_matrix_mult_def vec_eq_iff of_bool_def if_distrib [of "\<lambda>x. y * x" for y] cong: if_cong) |
|
179 |
apply (simp add: if_if_eq_conj sum.neutral conj_commute cong: conj_cong) |
|
180 |
done |
|
181 |
show ?thesis |
|
182 |
apply (subst eq) |
|
183 |
apply (intro mult idplus that) |
|
184 |
apply (auto intro: diagonal) |
|
185 |
done |
|
186 |
qed |
|
187 |
show ?thesis |
|
188 |
by (rule induct_matrix_elementary) (auto intro: assms *) |
|
189 |
qed |
|
190 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
191 |
lemma matrix_vector_mult_matrix_matrix_mult_compose: |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
192 |
"(*v) (A ** B) = (*v) A \<circ> (*v) B" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
193 |
by (auto simp: matrix_vector_mul_assoc) |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
194 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
195 |
lemma induct_linear_elementary: |
67998 | 196 |
fixes f :: "real^'n \<Rightarrow> real^'n" |
197 |
assumes "linear f" |
|
198 |
and comp: "\<And>f g. \<lbrakk>linear f; linear g; P f; P g\<rbrakk> \<Longrightarrow> P(f \<circ> g)" |
|
199 |
and zeroes: "\<And>f i. \<lbrakk>linear f; \<And>x. (f x) $ i = 0\<rbrakk> \<Longrightarrow> P f" |
|
200 |
and const: "\<And>c. P(\<lambda>x. \<chi> i. c i * x$i)" |
|
201 |
and swap: "\<And>m n::'n. m \<noteq> n \<Longrightarrow> P(\<lambda>x. \<chi> i. x $ Fun.swap m n id i)" |
|
202 |
and idplus: "\<And>m n::'n. m \<noteq> n \<Longrightarrow> P(\<lambda>x. \<chi> i. if i = m then x$m + x$n else x$i)" |
|
203 |
shows "P f" |
|
204 |
proof - |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
205 |
have "P ((*v) A)" for A |
67998 | 206 |
proof (rule induct_matrix_elementary_alt) |
207 |
fix A B |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
208 |
assume "P ((*v) A)" and "P ((*v) B)" |
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
209 |
then show "P ((*v) (A ** B))" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
210 |
by (auto simp add: matrix_vector_mult_matrix_matrix_mult_compose matrix_vector_mul_linear |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
211 |
intro!: comp) |
67998 | 212 |
next |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
213 |
fix A :: "real^'n^'n" and i |
67998 | 214 |
assume "row i A = 0" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
215 |
show "P ((*v) A)" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
216 |
using matrix_vector_mul_linear |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
217 |
by (rule zeroes[where i=i]) |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
218 |
(metis \<open>row i A = 0\<close> inner_zero_left matrix_vector_mul_component row_def vec_lambda_eta) |
67998 | 219 |
next |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
220 |
fix A :: "real^'n^'n" |
67998 | 221 |
assume 0: "\<And>i j. i \<noteq> j \<Longrightarrow> A $ i $ j = 0" |
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
222 |
have "A $ i $ i * x $ i = (\<Sum>j\<in>UNIV. A $ i $ j * x $ j)" for x and i :: "'n" |
67998 | 223 |
by (simp add: 0 comm_monoid_add_class.sum.remove [where x=i]) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
224 |
then have "(\<lambda>x. \<chi> i. A $ i $ i * x $ i) = ((*v) A)" |
67998 | 225 |
by (auto simp: 0 matrix_vector_mult_def) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
226 |
then show "P ((*v) A)" |
67998 | 227 |
using const [of "\<lambda>i. A $ i $ i"] by simp |
228 |
next |
|
229 |
fix m n :: "'n" |
|
230 |
assume "m \<noteq> n" |
|
231 |
have eq: "(\<Sum>j\<in>UNIV. if i = Fun.swap m n id j then x $ j else 0) = |
|
232 |
(\<Sum>j\<in>UNIV. if j = Fun.swap m n id i then x $ j else 0)" |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
233 |
for i and x :: "real^'n" |
67998 | 234 |
unfolding swap_def by (rule sum.cong) auto |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
235 |
have "(\<lambda>x::real^'n. \<chi> i. x $ Fun.swap m n id i) = ((*v) (\<chi> i j. if i = Fun.swap m n id j then 1 else 0))" |
67998 | 236 |
by (auto simp: mat_def matrix_vector_mult_def eq if_distrib [of "\<lambda>x. x * y" for y] cong: if_cong) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
237 |
with swap [OF \<open>m \<noteq> n\<close>] show "P ((*v) (\<chi> i j. mat 1 $ i $ Fun.swap m n id j))" |
67998 | 238 |
by (simp add: mat_def matrix_vector_mult_def) |
239 |
next |
|
240 |
fix m n :: "'n" |
|
241 |
assume "m \<noteq> n" |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
242 |
then have "x $ m + x $ n = (\<Sum>j\<in>UNIV. of_bool (j = n \<or> m = j) * x $ j)" for x :: "real^'n" |
67998 | 243 |
by (auto simp: of_bool_def if_distrib [of "\<lambda>x. x * y" for y] sum.remove cong: if_cong) |
244 |
then have "(\<lambda>x::real^'n. \<chi> i. if i = m then x $ m + x $ n else x $ i) = |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
245 |
((*v) (\<chi> i j. of_bool (i = m \<and> j = n \<or> i = j)))" |
67998 | 246 |
unfolding matrix_vector_mult_def of_bool_def |
247 |
by (auto simp: vec_eq_iff if_distrib [of "\<lambda>x. x * y" for y] cong: if_cong) |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
248 |
then show "P ((*v) (\<chi> i j. of_bool (i = m \<and> j = n \<or> i = j)))" |
67998 | 249 |
using idplus [OF \<open>m \<noteq> n\<close>] by simp |
250 |
qed |
|
251 |
then show ?thesis |
|
252 |
by (metis \<open>linear f\<close> matrix_vector_mul) |
|
253 |
qed |
|
254 |
||
255 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
256 |
proposition (*FIX needs name *) |
67998 | 257 |
fixes a :: "real^'n" |
258 |
assumes "m \<noteq> n" and ab_ne: "cbox a b \<noteq> {}" and an: "0 \<le> a$n" |
|
259 |
shows measurable_shear_interval: "(\<lambda>x. \<chi> i. if i = m then x$m + x$n else x$i) ` (cbox a b) \<in> lmeasurable" |
|
260 |
(is "?f ` _ \<in> _") |
|
261 |
and measure_shear_interval: "measure lebesgue ((\<lambda>x. \<chi> i. if i = m then x$m + x$n else x$i) ` cbox a b) |
|
262 |
= measure lebesgue (cbox a b)" (is "?Q") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
263 |
proof - |
67998 | 264 |
have lin: "linear ?f" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
265 |
by (rule linearI) (auto simp: plus_vec_def scaleR_vec_def algebra_simps) |
67998 | 266 |
show fab: "?f ` cbox a b \<in> lmeasurable" |
267 |
by (simp add: lin measurable_linear_image_interval) |
|
268 |
let ?c = "\<chi> i. if i = m then b$m + b$n else b$i" |
|
269 |
let ?mn = "axis m 1 - axis n (1::real)" |
|
270 |
have eq1: "measure lebesgue (cbox a ?c) |
|
271 |
= measure lebesgue (?f ` cbox a b) |
|
272 |
+ measure lebesgue (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a$m}) |
|
273 |
+ measure lebesgue (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m})" |
|
274 |
proof (rule measure_Un3_negligible) |
|
275 |
show "cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a$m} \<in> lmeasurable" "cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m} \<in> lmeasurable" |
|
276 |
by (auto simp: convex_Int convex_halfspace_le convex_halfspace_ge bounded_Int measurable_convex) |
|
277 |
have "negligible {x. ?mn \<bullet> x = a$m}" |
|
278 |
by (metis \<open>m \<noteq> n\<close> axis_index_axis eq_iff_diff_eq_0 negligible_hyperplane) |
|
279 |
moreover have "?f ` cbox a b \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m}) \<subseteq> {x. ?mn \<bullet> x = a$m}" |
|
280 |
using \<open>m \<noteq> n\<close> antisym_conv by (fastforce simp: algebra_simps mem_box_cart inner_axis') |
|
281 |
ultimately show "negligible ((?f ` cbox a b) \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m}))" |
|
282 |
by (rule negligible_subset) |
|
283 |
have "negligible {x. ?mn \<bullet> x = b$m}" |
|
284 |
by (metis \<open>m \<noteq> n\<close> axis_index_axis eq_iff_diff_eq_0 negligible_hyperplane) |
|
285 |
moreover have "(?f ` cbox a b) \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m}) \<subseteq> {x. ?mn \<bullet> x = b$m}" |
|
286 |
using \<open>m \<noteq> n\<close> antisym_conv by (fastforce simp: algebra_simps mem_box_cart inner_axis') |
|
287 |
ultimately show "negligible (?f ` cbox a b \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m}))" |
|
288 |
by (rule negligible_subset) |
|
289 |
have "negligible {x. ?mn \<bullet> x = b$m}" |
|
290 |
by (metis \<open>m \<noteq> n\<close> axis_index_axis eq_iff_diff_eq_0 negligible_hyperplane) |
|
291 |
moreover have "(cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m})) \<subseteq> {x. ?mn \<bullet> x = b$m}" |
|
292 |
using \<open>m \<noteq> n\<close> ab_ne |
|
293 |
apply (auto simp: algebra_simps mem_box_cart inner_axis') |
|
294 |
apply (drule_tac x=m in spec)+ |
|
295 |
apply simp |
|
296 |
done |
|
297 |
ultimately show "negligible (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<inter> (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m}))" |
|
298 |
by (rule negligible_subset) |
|
299 |
show "?f ` cbox a b \<union> cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<union> cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m} = cbox a ?c" (is "?lhs = _") |
|
300 |
proof |
|
301 |
show "?lhs \<subseteq> cbox a ?c" |
|
302 |
by (auto simp: mem_box_cart add_mono) (meson add_increasing2 an order_trans) |
|
303 |
show "cbox a ?c \<subseteq> ?lhs" |
|
304 |
apply (auto simp: algebra_simps image_iff inner_axis' lambda_add_Galois [OF \<open>m \<noteq> n\<close>]) |
|
305 |
apply (auto simp: mem_box_cart split: if_split_asm) |
|
306 |
done |
|
307 |
qed |
|
308 |
qed (fact fab) |
|
309 |
let ?d = "\<chi> i. if i = m then a $ m - b $ m else 0" |
|
310 |
have eq2: "measure lebesgue (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m}) + measure lebesgue (cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m}) |
|
311 |
= measure lebesgue (cbox a (\<chi> i. if i = m then a $ m + b $ n else b $ i))" |
|
312 |
proof (rule measure_translate_add[of "cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a$m}" "cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m}" |
|
313 |
"(\<chi> i. if i = m then a$m - b$m else 0)" "cbox a (\<chi> i. if i = m then a$m + b$n else b$i)"]) |
|
314 |
show "(cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a$m}) \<in> lmeasurable" |
|
315 |
"cbox a ?c \<inter> {x. ?mn \<bullet> x \<ge> b$m} \<in> lmeasurable" |
|
316 |
by (auto simp: convex_Int convex_halfspace_le convex_halfspace_ge bounded_Int measurable_convex) |
|
317 |
have "\<And>x. \<lbrakk>x $ n + a $ m \<le> x $ m\<rbrakk> |
|
318 |
\<Longrightarrow> x \<in> (+) (\<chi> i. if i = m then a $ m - b $ m else 0) ` {x. x $ n + b $ m \<le> x $ m}" |
|
319 |
using \<open>m \<noteq> n\<close> |
|
320 |
by (rule_tac x="x - (\<chi> i. if i = m then a$m - b$m else 0)" in image_eqI) |
|
321 |
(simp_all add: mem_box_cart) |
|
322 |
then have imeq: "(+) ?d ` {x. b $ m \<le> ?mn \<bullet> x} = {x. a $ m \<le> ?mn \<bullet> x}" |
|
323 |
using \<open>m \<noteq> n\<close> by (auto simp: mem_box_cart inner_axis' algebra_simps) |
|
324 |
have "\<And>x. \<lbrakk>0 \<le> a $ n; x $ n + a $ m \<le> x $ m; |
|
325 |
\<forall>i. i \<noteq> m \<longrightarrow> a $ i \<le> x $ i \<and> x $ i \<le> b $ i\<rbrakk> |
|
326 |
\<Longrightarrow> a $ m \<le> x $ m" |
|
327 |
using \<open>m \<noteq> n\<close> by force |
|
328 |
then have "(+) ?d ` (cbox a ?c \<inter> {x. b $ m \<le> ?mn \<bullet> x}) |
|
329 |
= cbox a (\<chi> i. if i = m then a $ m + b $ n else b $ i) \<inter> {x. a $ m \<le> ?mn \<bullet> x}" |
|
330 |
using an ab_ne |
|
331 |
apply (simp add: cbox_translation [symmetric] translation_Int interval_ne_empty_cart imeq) |
|
332 |
apply (auto simp: mem_box_cart inner_axis' algebra_simps if_distrib all_if_distrib) |
|
333 |
by (metis (full_types) add_mono mult_2_right) |
|
334 |
then show "cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<union> |
|
335 |
(+) ?d ` (cbox a ?c \<inter> {x. b $ m \<le> ?mn \<bullet> x}) = |
|
336 |
cbox a (\<chi> i. if i = m then a $ m + b $ n else b $ i)" (is "?lhs = ?rhs") |
|
337 |
using an \<open>m \<noteq> n\<close> |
|
338 |
apply (auto simp: mem_box_cart inner_axis' algebra_simps if_distrib all_if_distrib, force) |
|
339 |
apply (drule_tac x=n in spec)+ |
|
340 |
by (meson ab_ne add_mono_thms_linordered_semiring(3) dual_order.trans interval_ne_empty_cart(1)) |
|
341 |
have "negligible{x. ?mn \<bullet> x = a$m}" |
|
342 |
by (metis \<open>m \<noteq> n\<close> axis_index_axis eq_iff_diff_eq_0 negligible_hyperplane) |
|
343 |
moreover have "(cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<inter> |
|
344 |
(+) ?d ` (cbox a ?c \<inter> {x. b $ m \<le> ?mn \<bullet> x})) \<subseteq> {x. ?mn \<bullet> x = a$m}" |
|
345 |
using \<open>m \<noteq> n\<close> antisym_conv by (fastforce simp: algebra_simps mem_box_cart inner_axis') |
|
346 |
ultimately show "negligible (cbox a ?c \<inter> {x. ?mn \<bullet> x \<le> a $ m} \<inter> |
|
347 |
(+) ?d ` (cbox a ?c \<inter> {x. b $ m \<le> ?mn \<bullet> x}))" |
|
348 |
by (rule negligible_subset) |
|
349 |
qed |
|
350 |
have ac_ne: "cbox a ?c \<noteq> {}" |
|
351 |
using ab_ne an |
|
352 |
by (clarsimp simp: interval_eq_empty_cart) (meson add_less_same_cancel1 le_less_linear less_le_trans) |
|
353 |
have ax_ne: "cbox a (\<chi> i. if i = m then a $ m + b $ n else b $ i) \<noteq> {}" |
|
354 |
using ab_ne an |
|
355 |
by (clarsimp simp: interval_eq_empty_cart) (meson add_less_same_cancel1 le_less_linear less_le_trans) |
|
356 |
have eq3: "measure lebesgue (cbox a ?c) = measure lebesgue (cbox a (\<chi> i. if i = m then a$m + b$n else b$i)) + measure lebesgue (cbox a b)" |
|
357 |
by (simp add: content_cbox_if_cart ab_ne ac_ne ax_ne algebra_simps prod.delta_remove |
|
358 |
if_distrib [of "\<lambda>u. u - z" for z] prod.remove) |
|
359 |
show ?Q |
|
360 |
using eq1 eq2 eq3 |
|
361 |
by (simp add: algebra_simps) |
|
362 |
qed |
|
363 |
||
364 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
365 |
proposition (*FIX needs name *) |
67998 | 366 |
fixes S :: "(real^'n) set" |
367 |
assumes "S \<in> lmeasurable" |
|
368 |
shows measurable_stretch: "((\<lambda>x. \<chi> k. m k * x$k) ` S) \<in> lmeasurable" (is "?f ` S \<in> _") |
|
369 |
and measure_stretch: "measure lebesgue ((\<lambda>x. \<chi> k. m k * x$k) ` S) = \<bar>prod m UNIV\<bar> * measure lebesgue S" |
|
370 |
(is "?MEQ") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
371 |
proof - |
67998 | 372 |
have "(?f ` S) \<in> lmeasurable \<and> ?MEQ" |
373 |
proof (cases "\<forall>k. m k \<noteq> 0") |
|
374 |
case True |
|
375 |
have m0: "0 < \<bar>prod m UNIV\<bar>" |
|
376 |
using True by simp |
|
377 |
have "(indicat_real (?f ` S) has_integral \<bar>prod m UNIV\<bar> * measure lebesgue S) UNIV" |
|
378 |
proof (clarsimp simp add: has_integral_alt [where i=UNIV]) |
|
379 |
fix e :: "real" |
|
380 |
assume "e > 0" |
|
381 |
have "(indicat_real S has_integral (measure lebesgue S)) UNIV" |
|
382 |
using assms lmeasurable_iff_has_integral by blast |
|
383 |
then obtain B where "B>0" |
|
384 |
and B: "\<And>a b. ball 0 B \<subseteq> cbox a b \<Longrightarrow> |
|
385 |
\<exists>z. (indicat_real S has_integral z) (cbox a b) \<and> |
|
386 |
\<bar>z - measure lebesgue S\<bar> < e / \<bar>prod m UNIV\<bar>" |
|
387 |
by (simp add: has_integral_alt [where i=UNIV]) (metis (full_types) divide_pos_pos m0 m0 \<open>e > 0\<close>) |
|
388 |
show "\<exists>B>0. \<forall>a b. ball 0 B \<subseteq> cbox a b \<longrightarrow> |
|
389 |
(\<exists>z. (indicat_real (?f ` S) has_integral z) (cbox a b) \<and> |
|
390 |
\<bar>z - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e)" |
|
391 |
proof (intro exI conjI allI) |
|
392 |
let ?C = "Max (range (\<lambda>k. \<bar>m k\<bar>)) * B" |
|
393 |
show "?C > 0" |
|
394 |
using True \<open>B > 0\<close> by (simp add: Max_gr_iff) |
|
395 |
show "ball 0 ?C \<subseteq> cbox u v \<longrightarrow> |
|
396 |
(\<exists>z. (indicat_real (?f ` S) has_integral z) (cbox u v) \<and> |
|
397 |
\<bar>z - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e)" for u v |
|
398 |
proof |
|
399 |
assume uv: "ball 0 ?C \<subseteq> cbox u v" |
|
400 |
with \<open>?C > 0\<close> have cbox_ne: "cbox u v \<noteq> {}" |
|
401 |
using centre_in_ball by blast |
|
402 |
let ?\<alpha> = "\<lambda>k. u$k / m k" |
|
403 |
let ?\<beta> = "\<lambda>k. v$k / m k" |
|
404 |
have invm0: "\<And>k. inverse (m k) \<noteq> 0" |
|
405 |
using True by auto |
|
406 |
have "ball 0 B \<subseteq> (\<lambda>x. \<chi> k. x $ k / m k) ` ball 0 ?C" |
|
407 |
proof clarsimp |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
408 |
fix x :: "real^'n" |
67998 | 409 |
assume x: "norm x < B" |
410 |
have [simp]: "\<bar>Max (range (\<lambda>k. \<bar>m k\<bar>))\<bar> = Max (range (\<lambda>k. \<bar>m k\<bar>))" |
|
411 |
by (meson Max_ge abs_ge_zero abs_of_nonneg finite finite_imageI order_trans rangeI) |
|
412 |
have "norm (\<chi> k. m k * x $ k) \<le> norm (Max (range (\<lambda>k. \<bar>m k\<bar>)) *\<^sub>R x)" |
|
413 |
by (rule norm_le_componentwise_cart) (auto simp: abs_mult intro: mult_right_mono) |
|
414 |
also have "\<dots> < ?C" |
|
415 |
using x by simp (metis \<open>B > 0\<close> \<open>?C > 0\<close> mult.commute real_mult_less_iff1 zero_less_mult_pos) |
|
416 |
finally have "norm (\<chi> k. m k * x $ k) < ?C" . |
|
417 |
then show "x \<in> (\<lambda>x. \<chi> k. x $ k / m k) ` ball 0 ?C" |
|
418 |
using stretch_Galois [of "inverse \<circ> m"] True by (auto simp: image_iff field_simps) |
|
419 |
qed |
|
420 |
then have Bsub: "ball 0 B \<subseteq> cbox (\<chi> k. min (?\<alpha> k) (?\<beta> k)) (\<chi> k. max (?\<alpha> k) (?\<beta> k))" |
|
421 |
using cbox_ne uv image_stretch_interval_cart [of "inverse \<circ> m" u v, symmetric] |
|
422 |
by (force simp: field_simps) |
|
423 |
obtain z where zint: "(indicat_real S has_integral z) (cbox (\<chi> k. min (?\<alpha> k) (?\<beta> k)) (\<chi> k. max (?\<alpha> k) (?\<beta> k)))" |
|
424 |
and zless: "\<bar>z - measure lebesgue S\<bar> < e / \<bar>prod m UNIV\<bar>" |
|
425 |
using B [OF Bsub] by blast |
|
426 |
have ind: "indicat_real (?f ` S) = (\<lambda>x. indicator S (\<chi> k. x$k / m k))" |
|
427 |
using True stretch_Galois [of m] by (force simp: indicator_def) |
|
428 |
show "\<exists>z. (indicat_real (?f ` S) has_integral z) (cbox u v) \<and> |
|
429 |
\<bar>z - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e" |
|
430 |
proof (simp add: ind, intro conjI exI) |
|
431 |
have "((\<lambda>x. indicat_real S (\<chi> k. x $ k/ m k)) has_integral z *\<^sub>R \<bar>prod m UNIV\<bar>) |
|
432 |
((\<lambda>x. \<chi> k. x $ k * m k) ` cbox (\<chi> k. min (?\<alpha> k) (?\<beta> k)) (\<chi> k. max (?\<alpha> k) (?\<beta> k)))" |
|
433 |
using True has_integral_stretch_cart [OF zint, of "inverse \<circ> m"] |
|
434 |
by (simp add: field_simps prod_dividef) |
|
435 |
moreover have "((\<lambda>x. \<chi> k. x $ k * m k) ` cbox (\<chi> k. min (?\<alpha> k) (?\<beta> k)) (\<chi> k. max (?\<alpha> k) (?\<beta> k))) = cbox u v" |
|
436 |
using True image_stretch_interval_cart [of "inverse \<circ> m" u v, symmetric] |
|
437 |
image_stretch_interval_cart [of "\<lambda>k. 1" u v, symmetric] \<open>cbox u v \<noteq> {}\<close> |
|
438 |
by (simp add: field_simps image_comp o_def) |
|
439 |
ultimately show "((\<lambda>x. indicat_real S (\<chi> k. x $ k/ m k)) has_integral z *\<^sub>R \<bar>prod m UNIV\<bar>) (cbox u v)" |
|
440 |
by simp |
|
441 |
have "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> |
|
442 |
= \<bar>prod m UNIV\<bar> * \<bar>z - measure lebesgue S\<bar>" |
|
443 |
by (metis (no_types, hide_lams) abs_abs abs_scaleR mult.commute real_scaleR_def right_diff_distrib') |
|
444 |
also have "\<dots> < e" |
|
445 |
using zless True by (simp add: field_simps) |
|
446 |
finally show "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e" . |
|
447 |
qed |
|
448 |
qed |
|
449 |
qed |
|
450 |
qed |
|
451 |
then show ?thesis |
|
452 |
by (auto simp: has_integral_integrable integral_unique lmeasure_integral_UNIV measurable_integrable) |
|
453 |
next |
|
454 |
case False |
|
455 |
then obtain k where "m k = 0" and prm: "prod m UNIV = 0" |
|
456 |
by auto |
|
457 |
have nfS: "negligible (?f ` S)" |
|
458 |
by (rule negligible_subset [OF negligible_standard_hyperplane_cart]) (use \<open>m k = 0\<close> in auto) |
|
459 |
then have "(?f ` S) \<in> lmeasurable" |
|
460 |
by (simp add: negligible_iff_measure) |
|
461 |
with nfS show ?thesis |
|
462 |
by (simp add: prm negligible_iff_measure0) |
|
463 |
qed |
|
464 |
then show "(?f ` S) \<in> lmeasurable" ?MEQ |
|
465 |
by metis+ |
|
466 |
qed |
|
467 |
||
468 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
469 |
proposition (*FIX needs name *) |
67998 | 470 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
471 |
assumes "linear f" "S \<in> lmeasurable" |
|
472 |
shows measurable_linear_image: "(f ` S) \<in> lmeasurable" |
|
473 |
and measure_linear_image: "measure lebesgue (f ` S) = \<bar>det (matrix f)\<bar> * measure lebesgue S" (is "?Q f S") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
474 |
proof - |
67998 | 475 |
have "\<forall>S \<in> lmeasurable. (f ` S) \<in> lmeasurable \<and> ?Q f S" |
476 |
proof (rule induct_linear_elementary [OF \<open>linear f\<close>]; intro ballI) |
|
477 |
fix f g and S :: "(real,'n) vec set" |
|
478 |
assume "linear f" and "linear g" |
|
479 |
and f [rule_format]: "\<forall>S \<in> lmeasurable. f ` S \<in> lmeasurable \<and> ?Q f S" |
|
480 |
and g [rule_format]: "\<forall>S \<in> lmeasurable. g ` S \<in> lmeasurable \<and> ?Q g S" |
|
481 |
and S: "S \<in> lmeasurable" |
|
482 |
then have gS: "g ` S \<in> lmeasurable" |
|
483 |
by blast |
|
484 |
show "(f \<circ> g) ` S \<in> lmeasurable \<and> ?Q (f \<circ> g) S" |
|
485 |
using f [OF gS] g [OF S] matrix_compose [OF \<open>linear g\<close> \<open>linear f\<close>] |
|
486 |
by (simp add: o_def image_comp abs_mult det_mul) |
|
487 |
next |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
488 |
fix f :: "real^'n::_ \<Rightarrow> real^'n::_" and i and S :: "(real^'n::_) set" |
67998 | 489 |
assume "linear f" and 0: "\<And>x. f x $ i = 0" and "S \<in> lmeasurable" |
490 |
then have "\<not> inj f" |
|
491 |
by (metis (full_types) linear_injective_imp_surjective one_neq_zero surjE vec_component) |
|
492 |
have detf: "det (matrix f) = 0" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
493 |
using \<open>\<not> inj f\<close> det_nz_iff_inj[OF \<open>linear f\<close>] by blast |
67998 | 494 |
show "f ` S \<in> lmeasurable \<and> ?Q f S" |
495 |
proof |
|
496 |
show "f ` S \<in> lmeasurable" |
|
497 |
using lmeasurable_iff_indicator_has_integral \<open>linear f\<close> \<open>\<not> inj f\<close> negligible_UNIV negligible_linear_singular_image by blast |
|
498 |
have "measure lebesgue (f ` S) = 0" |
|
499 |
by (meson \<open>\<not> inj f\<close> \<open>linear f\<close> negligible_imp_measure0 negligible_linear_singular_image) |
|
500 |
also have "\<dots> = \<bar>det (matrix f)\<bar> * measure lebesgue S" |
|
501 |
by (simp add: detf) |
|
502 |
finally show "?Q f S" . |
|
503 |
qed |
|
504 |
next |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
505 |
fix c and S :: "(real^'n::_) set" |
67998 | 506 |
assume "S \<in> lmeasurable" |
507 |
show "(\<lambda>a. \<chi> i. c i * a $ i) ` S \<in> lmeasurable \<and> ?Q (\<lambda>a. \<chi> i. c i * a $ i) S" |
|
508 |
proof |
|
509 |
show "(\<lambda>a. \<chi> i. c i * a $ i) ` S \<in> lmeasurable" |
|
510 |
by (simp add: \<open>S \<in> lmeasurable\<close> measurable_stretch) |
|
511 |
show "?Q (\<lambda>a. \<chi> i. c i * a $ i) S" |
|
512 |
by (simp add: measure_stretch [OF \<open>S \<in> lmeasurable\<close>, of c] axis_def matrix_def det_diagonal) |
|
513 |
qed |
|
514 |
next |
|
515 |
fix m :: "'n" and n :: "'n" and S :: "(real, 'n) vec set" |
|
516 |
assume "m \<noteq> n" and "S \<in> lmeasurable" |
|
517 |
let ?h = "\<lambda>v::(real, 'n) vec. \<chi> i. v $ Fun.swap m n id i" |
|
518 |
have lin: "linear ?h" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
519 |
by (rule linearI) (simp_all add: plus_vec_def scaleR_vec_def) |
67998 | 520 |
have meq: "measure lebesgue ((\<lambda>v::(real, 'n) vec. \<chi> i. v $ Fun.swap m n id i) ` cbox a b) |
521 |
= measure lebesgue (cbox a b)" for a b |
|
522 |
proof (cases "cbox a b = {}") |
|
523 |
case True then show ?thesis |
|
524 |
by simp |
|
525 |
next |
|
526 |
case False |
|
527 |
then have him: "?h ` (cbox a b) \<noteq> {}" |
|
528 |
by blast |
|
529 |
have eq: "?h ` (cbox a b) = cbox (?h a) (?h b)" |
|
530 |
by (auto simp: image_iff lambda_swap_Galois mem_box_cart) (metis swap_id_eq)+ |
|
531 |
show ?thesis |
|
532 |
using him prod.permute [OF permutes_swap_id, where S=UNIV and g="\<lambda>i. (b - a)$i", symmetric] |
|
533 |
by (simp add: eq content_cbox_cart False) |
|
534 |
qed |
|
535 |
have "(\<chi> i j. if Fun.swap m n id i = j then 1 else 0) = (\<chi> i j. if j = Fun.swap m n id i then 1 else (0::real))" |
|
536 |
by (auto intro!: Cart_lambda_cong) |
|
537 |
then have "matrix ?h = transpose(\<chi> i j. mat 1 $ i $ Fun.swap m n id j)" |
|
538 |
by (auto simp: matrix_eq transpose_def axis_def mat_def matrix_def) |
|
539 |
then have 1: "\<bar>det (matrix ?h)\<bar> = 1" |
|
540 |
by (simp add: det_permute_columns permutes_swap_id sign_swap_id abs_mult) |
|
541 |
show "?h ` S \<in> lmeasurable \<and> ?Q ?h S" |
|
542 |
proof |
|
543 |
show "?h ` S \<in> lmeasurable" "?Q ?h S" |
|
544 |
using measure_linear_sufficient [OF lin \<open>S \<in> lmeasurable\<close>] meq 1 by force+ |
|
545 |
qed |
|
546 |
next |
|
67999
1b05f74f2e5f
tidying up including contributions from Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents:
67998
diff
changeset
|
547 |
fix m n :: "'n" and S :: "(real, 'n) vec set" |
67998 | 548 |
assume "m \<noteq> n" and "S \<in> lmeasurable" |
549 |
let ?h = "\<lambda>v::(real, 'n) vec. \<chi> i. if i = m then v $ m + v $ n else v $ i" |
|
550 |
have lin: "linear ?h" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
551 |
by (rule linearI) (auto simp: algebra_simps plus_vec_def scaleR_vec_def vec_eq_iff) |
67998 | 552 |
consider "m < n" | " n < m" |
553 |
using \<open>m \<noteq> n\<close> less_linear by blast |
|
554 |
then have 1: "det(matrix ?h) = 1" |
|
555 |
proof cases |
|
556 |
assume "m < n" |
|
557 |
have *: "matrix ?h $ i $ j = (0::real)" if "j < i" for i j :: 'n |
|
558 |
proof - |
|
559 |
have "axis j 1 = (\<chi> n. if n = j then 1 else (0::real))" |
|
560 |
using axis_def by blast |
|
561 |
then have "(\<chi> p q. if p = m then axis q 1 $ m + axis q 1 $ n else axis q 1 $ p) $ i $ j = (0::real)" |
|
562 |
using \<open>j < i\<close> axis_def \<open>m < n\<close> by auto |
|
563 |
with \<open>m < n\<close> show ?thesis |
|
564 |
by (auto simp: matrix_def axis_def cong: if_cong) |
|
565 |
qed |
|
566 |
show ?thesis |
|
567 |
using \<open>m \<noteq> n\<close> by (subst det_upperdiagonal [OF *]) (auto simp: matrix_def axis_def cong: if_cong) |
|
568 |
next |
|
569 |
assume "n < m" |
|
570 |
have *: "matrix ?h $ i $ j = (0::real)" if "j > i" for i j :: 'n |
|
571 |
proof - |
|
572 |
have "axis j 1 = (\<chi> n. if n = j then 1 else (0::real))" |
|
573 |
using axis_def by blast |
|
574 |
then have "(\<chi> p q. if p = m then axis q 1 $ m + axis q 1 $ n else axis q 1 $ p) $ i $ j = (0::real)" |
|
575 |
using \<open>j > i\<close> axis_def \<open>m > n\<close> by auto |
|
576 |
with \<open>m > n\<close> show ?thesis |
|
577 |
by (auto simp: matrix_def axis_def cong: if_cong) |
|
578 |
qed |
|
579 |
show ?thesis |
|
580 |
using \<open>m \<noteq> n\<close> |
|
581 |
by (subst det_lowerdiagonal [OF *]) (auto simp: matrix_def axis_def cong: if_cong) |
|
582 |
qed |
|
583 |
have meq: "measure lebesgue (?h ` (cbox a b)) = measure lebesgue (cbox a b)" for a b |
|
584 |
proof (cases "cbox a b = {}") |
|
585 |
case True then show ?thesis by simp |
|
586 |
next |
|
587 |
case False |
|
588 |
then have ne: "(+) (\<chi> i. if i = n then - a $ n else 0) ` cbox a b \<noteq> {}" |
|
589 |
by auto |
|
590 |
let ?v = "\<chi> i. if i = n then - a $ n else 0" |
|
591 |
have "?h ` cbox a b |
|
592 |
= (+) (\<chi> i. if i = m \<or> i = n then a $ n else 0) ` ?h ` (+) ?v ` (cbox a b)" |
|
593 |
using \<open>m \<noteq> n\<close> unfolding image_comp o_def by (force simp: vec_eq_iff) |
|
594 |
then have "measure lebesgue (?h ` (cbox a b)) |
|
595 |
= measure lebesgue ((\<lambda>v. \<chi> i. if i = m then v $ m + v $ n else v $ i) ` |
|
596 |
(+) ?v ` cbox a b)" |
|
597 |
by (rule ssubst) (rule measure_translation) |
|
598 |
also have "\<dots> = measure lebesgue ((\<lambda>v. \<chi> i. if i = m then v $ m + v $ n else v $ i) ` cbox (?v +a) (?v + b))" |
|
599 |
by (metis (no_types, lifting) cbox_translation) |
|
600 |
also have "\<dots> = measure lebesgue ((+) (\<chi> i. if i = n then - a $ n else 0) ` cbox a b)" |
|
601 |
apply (subst measure_shear_interval) |
|
602 |
using \<open>m \<noteq> n\<close> ne apply auto |
|
603 |
apply (simp add: cbox_translation) |
|
604 |
by (metis cbox_borel cbox_translation measure_completion sets_lborel) |
|
605 |
also have "\<dots> = measure lebesgue (cbox a b)" |
|
606 |
by (rule measure_translation) |
|
607 |
finally show ?thesis . |
|
608 |
qed |
|
609 |
show "?h ` S \<in> lmeasurable \<and> ?Q ?h S" |
|
610 |
using measure_linear_sufficient [OF lin \<open>S \<in> lmeasurable\<close>] meq 1 by force |
|
611 |
qed |
|
612 |
with assms show "(f ` S) \<in> lmeasurable" "?Q f S" |
|
613 |
by metis+ |
|
614 |
qed |
|
615 |
||
616 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
617 |
lemma (* needs name *) |
67998 | 618 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
619 |
assumes f: "orthogonal_transformation f" and S: "S \<in> lmeasurable" |
|
620 |
shows measurable_orthogonal_image: "f ` S \<in> lmeasurable" |
|
621 |
and measure_orthogonal_image: "measure lebesgue (f ` S) = measure lebesgue S" |
|
622 |
proof - |
|
623 |
have "linear f" |
|
624 |
by (simp add: f orthogonal_transformation_linear) |
|
625 |
then show "f ` S \<in> lmeasurable" |
|
626 |
by (metis S measurable_linear_image) |
|
627 |
show "measure lebesgue (f ` S) = measure lebesgue S" |
|
628 |
by (simp add: measure_linear_image \<open>linear f\<close> S f) |
|
629 |
qed |
|
630 |
||
69272 | 631 |
subsection%important\<open>\<open>F_sigma\<close> and \<open>G_delta\<close> sets.\<close>(*FIX ME mv *) |
67998 | 632 |
|
633 |
(*https://en.wikipedia.org/wiki/F\<sigma>_set*) |
|
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
634 |
inductive%important fsigma :: "'a::topological_space set \<Rightarrow> bool" where |
69313 | 635 |
"(\<And>n::nat. closed (F n)) \<Longrightarrow> fsigma (\<Union>(F ` UNIV))" |
67998 | 636 |
|
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
637 |
inductive%important gdelta :: "'a::topological_space set \<Rightarrow> bool" where |
69313 | 638 |
"(\<And>n::nat. open (F n)) \<Longrightarrow> gdelta (\<Inter>(F ` UNIV))" |
67998 | 639 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
640 |
proposition fsigma_Union_compact: |
67998 | 641 |
fixes S :: "'a::{real_normed_vector,heine_borel} set" |
69313 | 642 |
shows "fsigma S \<longleftrightarrow> (\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = \<Union>(F ` UNIV))" |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
643 |
proof safe |
67998 | 644 |
assume "fsigma S" |
69313 | 645 |
then obtain F :: "nat \<Rightarrow> 'a set" where F: "range F \<subseteq> Collect closed" "S = \<Union>(F ` UNIV)" |
67998 | 646 |
by (meson fsigma.cases image_subsetI mem_Collect_eq) |
69313 | 647 |
then have "\<exists>D::nat \<Rightarrow> 'a set. range D \<subseteq> Collect compact \<and> \<Union>(D ` UNIV) = F i" for i |
67998 | 648 |
using closed_Union_compact_subsets [of "F i"] |
649 |
by (metis image_subsetI mem_Collect_eq range_subsetD) |
|
650 |
then obtain D :: "nat \<Rightarrow> nat \<Rightarrow> 'a set" |
|
69313 | 651 |
where D: "\<And>i. range (D i) \<subseteq> Collect compact \<and> \<Union>((D i) ` UNIV) = F i" |
67998 | 652 |
by metis |
653 |
let ?DD = "\<lambda>n. (\<lambda>(i,j). D i j) (prod_decode n)" |
|
69313 | 654 |
show "\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = \<Union>(F ` UNIV)" |
67998 | 655 |
proof (intro exI conjI) |
656 |
show "range ?DD \<subseteq> Collect compact" |
|
657 |
using D by clarsimp (metis mem_Collect_eq rangeI split_conv subsetCE surj_pair) |
|
69325 | 658 |
show "S = \<Union> (range ?DD)" |
67998 | 659 |
proof |
69325 | 660 |
show "S \<subseteq> \<Union> (range ?DD)" |
67998 | 661 |
using D F |
662 |
by clarsimp (metis UN_iff old.prod.case prod_decode_inverse prod_encode_eq) |
|
69325 | 663 |
show "\<Union> (range ?DD) \<subseteq> S" |
67998 | 664 |
using D F by fastforce |
665 |
qed |
|
666 |
qed |
|
667 |
next |
|
668 |
fix F :: "nat \<Rightarrow> 'a set" |
|
69313 | 669 |
assume "range F \<subseteq> Collect compact" and "S = \<Union>(F ` UNIV)" |
670 |
then show "fsigma (\<Union>(F ` UNIV))" |
|
67998 | 671 |
by (simp add: compact_imp_closed fsigma.intros image_subset_iff) |
672 |
qed |
|
673 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
674 |
lemma gdelta_imp_fsigma: "gdelta S \<Longrightarrow> fsigma (- S)" |
67998 | 675 |
proof (induction rule: gdelta.induct) |
676 |
case (1 F) |
|
69313 | 677 |
have "- \<Inter>(F ` UNIV) = (\<Union>i. -(F i))" |
67998 | 678 |
by auto |
679 |
then show ?case |
|
680 |
by (simp add: fsigma.intros closed_Compl 1) |
|
681 |
qed |
|
682 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
683 |
lemma fsigma_imp_gdelta: "fsigma S \<Longrightarrow> gdelta (- S)" |
67998 | 684 |
proof (induction rule: fsigma.induct) |
685 |
case (1 F) |
|
69313 | 686 |
have "- \<Union>(F ` UNIV) = (\<Inter>i. -(F i))" |
67998 | 687 |
by auto |
688 |
then show ?case |
|
689 |
by (simp add: 1 gdelta.intros open_closed) |
|
690 |
qed |
|
691 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
692 |
lemma gdelta_complement: "gdelta(- S) \<longleftrightarrow> fsigma S" |
67998 | 693 |
using fsigma_imp_gdelta gdelta_imp_fsigma by force |
694 |
||
69272 | 695 |
text\<open>A Lebesgue set is almost an \<open>F_sigma\<close> or \<open>G_delta\<close>.\<close> |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
696 |
lemma lebesgue_set_almost_fsigma: |
67998 | 697 |
assumes "S \<in> sets lebesgue" |
698 |
obtains C T where "fsigma C" "negligible T" "C \<union> T = S" "disjnt C T" |
|
699 |
proof - |
|
700 |
{ fix n::nat |
|
701 |
have "\<exists>T. closed T \<and> T \<subseteq> S \<and> S - T \<in> lmeasurable \<and> measure lebesgue (S-T) < 1 / Suc n" |
|
702 |
using sets_lebesgue_inner_closed [OF assms] |
|
703 |
by (metis divide_pos_pos less_numeral_extra(1) of_nat_0_less_iff zero_less_Suc) |
|
704 |
} |
|
705 |
then obtain F where F: "\<And>n::nat. closed (F n) \<and> F n \<subseteq> S \<and> S - F n \<in> lmeasurable \<and> measure lebesgue (S - F n) < 1 / Suc n" |
|
706 |
by metis |
|
69313 | 707 |
let ?C = "\<Union>(F ` UNIV)" |
67998 | 708 |
show thesis |
709 |
proof |
|
710 |
show "fsigma ?C" |
|
711 |
using F by (simp add: fsigma.intros) |
|
712 |
show "negligible (S - ?C)" |
|
713 |
proof (clarsimp simp add: negligible_outer_le) |
|
714 |
fix e :: "real" |
|
715 |
assume "0 < e" |
|
716 |
then obtain n where n: "1 / Suc n < e" |
|
717 |
using nat_approx_posE by metis |
|
718 |
show "\<exists>T. S - (\<Union>x. F x) \<subseteq> T \<and> T \<in> lmeasurable \<and> measure lebesgue T \<le> e" |
|
719 |
proof (intro exI conjI) |
|
720 |
show "measure lebesgue (S - F n) \<le> e" |
|
721 |
by (meson F n less_trans not_le order.asym) |
|
722 |
qed (use F in auto) |
|
723 |
qed |
|
724 |
show "?C \<union> (S - ?C) = S" |
|
725 |
using F by blast |
|
726 |
show "disjnt ?C (S - ?C)" |
|
727 |
by (auto simp: disjnt_def) |
|
728 |
qed |
|
729 |
qed |
|
730 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
731 |
lemma lebesgue_set_almost_gdelta: |
67998 | 732 |
assumes "S \<in> sets lebesgue" |
733 |
obtains C T where "gdelta C" "negligible T" "S \<union> T = C" "disjnt S T" |
|
734 |
proof - |
|
735 |
have "-S \<in> sets lebesgue" |
|
736 |
using assms Compl_in_sets_lebesgue by blast |
|
737 |
then obtain C T where C: "fsigma C" "negligible T" "C \<union> T = -S" "disjnt C T" |
|
738 |
using lebesgue_set_almost_fsigma by metis |
|
739 |
show thesis |
|
740 |
proof |
|
741 |
show "gdelta (-C)" |
|
742 |
by (simp add: \<open>fsigma C\<close> fsigma_imp_gdelta) |
|
743 |
show "S \<union> T = -C" "disjnt S T" |
|
744 |
using C by (auto simp: disjnt_def) |
|
745 |
qed (use C in auto) |
|
746 |
qed |
|
747 |
||
748 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
749 |
proposition measure_semicontinuous_with_hausdist_explicit: |
67998 | 750 |
assumes "bounded S" and neg: "negligible(frontier S)" and "e > 0" |
751 |
obtains d where "d > 0" |
|
752 |
"\<And>T. \<lbrakk>T \<in> lmeasurable; \<And>y. y \<in> T \<Longrightarrow> \<exists>x. x \<in> S \<and> dist x y < d\<rbrakk> |
|
753 |
\<Longrightarrow> measure lebesgue T < measure lebesgue S + e" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
754 |
proof (cases "S = {}") |
67998 | 755 |
case True |
756 |
with that \<open>e > 0\<close> show ?thesis by force |
|
757 |
next |
|
758 |
case False |
|
759 |
then have frS: "frontier S \<noteq> {}" |
|
760 |
using \<open>bounded S\<close> frontier_eq_empty not_bounded_UNIV by blast |
|
761 |
have "S \<in> lmeasurable" |
|
762 |
by (simp add: \<open>bounded S\<close> measurable_Jordan neg) |
|
763 |
have null: "(frontier S) \<in> null_sets lebesgue" |
|
764 |
by (metis neg negligible_iff_null_sets) |
|
765 |
have "frontier S \<in> lmeasurable" and mS0: "measure lebesgue (frontier S) = 0" |
|
766 |
using neg negligible_imp_measurable negligible_iff_measure by blast+ |
|
767 |
with \<open>e > 0\<close> lmeasurable_outer_open |
|
768 |
obtain U where "open U" |
|
769 |
and U: "frontier S \<subseteq> U" "U - frontier S \<in> lmeasurable" "measure lebesgue (U - frontier S) < e" |
|
770 |
by (metis fmeasurableD) |
|
771 |
with null have "U \<in> lmeasurable" |
|
772 |
by (metis borel_open measurable_Diff_null_set sets_completionI_sets sets_lborel) |
|
773 |
have "measure lebesgue (U - frontier S) = measure lebesgue U" |
|
774 |
using mS0 by (simp add: \<open>U \<in> lmeasurable\<close> fmeasurableD measure_Diff_null_set null) |
|
775 |
with U have mU: "measure lebesgue U < e" |
|
776 |
by simp |
|
777 |
show ?thesis |
|
778 |
proof |
|
779 |
have "U \<noteq> UNIV" |
|
780 |
using \<open>U \<in> lmeasurable\<close> by auto |
|
781 |
then have "- U \<noteq> {}" |
|
782 |
by blast |
|
783 |
with \<open>open U\<close> \<open>frontier S \<subseteq> U\<close> show "setdist (frontier S) (- U) > 0" |
|
784 |
by (auto simp: \<open>bounded S\<close> open_closed compact_frontier_bounded setdist_gt_0_compact_closed frS) |
|
785 |
fix T |
|
786 |
assume "T \<in> lmeasurable" |
|
787 |
and T: "\<And>t. t \<in> T \<Longrightarrow> \<exists>y. y \<in> S \<and> dist y t < setdist (frontier S) (- U)" |
|
788 |
then have "measure lebesgue T - measure lebesgue S \<le> measure lebesgue (T - S)" |
|
789 |
by (simp add: \<open>S \<in> lmeasurable\<close> measure_diff_le_measure_setdiff) |
|
790 |
also have "\<dots> \<le> measure lebesgue U" |
|
791 |
proof - |
|
792 |
have "T - S \<subseteq> U" |
|
793 |
proof clarify |
|
794 |
fix x |
|
795 |
assume "x \<in> T" and "x \<notin> S" |
|
796 |
then obtain y where "y \<in> S" and y: "dist y x < setdist (frontier S) (- U)" |
|
797 |
using T by blast |
|
798 |
have "closed_segment x y \<inter> frontier S \<noteq> {}" |
|
799 |
using connected_Int_frontier \<open>x \<notin> S\<close> \<open>y \<in> S\<close> by blast |
|
800 |
then obtain z where z: "z \<in> closed_segment x y" "z \<in> frontier S" |
|
801 |
by auto |
|
802 |
with y have "dist z x < setdist(frontier S) (- U)" |
|
803 |
by (auto simp: dist_commute dest!: dist_in_closed_segment) |
|
804 |
with z have False if "x \<in> -U" |
|
805 |
using setdist_le_dist [OF \<open>z \<in> frontier S\<close> that] by auto |
|
806 |
then show "x \<in> U" |
|
807 |
by blast |
|
808 |
qed |
|
809 |
then show ?thesis |
|
810 |
by (simp add: \<open>S \<in> lmeasurable\<close> \<open>T \<in> lmeasurable\<close> \<open>U \<in> lmeasurable\<close> fmeasurableD measure_mono_fmeasurable sets.Diff) |
|
811 |
qed |
|
812 |
finally have "measure lebesgue T - measure lebesgue S \<le> measure lebesgue U" . |
|
813 |
with mU show "measure lebesgue T < measure lebesgue S + e" |
|
814 |
by linarith |
|
815 |
qed |
|
816 |
qed |
|
817 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
818 |
proposition lebesgue_regular_inner: |
67998 | 819 |
assumes "S \<in> sets lebesgue" |
820 |
obtains K C where "negligible K" "\<And>n::nat. compact(C n)" "S = (\<Union>n. C n) \<union> K" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
821 |
proof - |
67998 | 822 |
have "\<exists>T. closed T \<and> T \<subseteq> S \<and> (S - T) \<in> lmeasurable \<and> measure lebesgue (S - T) < (1/2)^n" for n |
823 |
using sets_lebesgue_inner_closed assms |
|
824 |
by (metis sets_lebesgue_inner_closed zero_less_divide_1_iff zero_less_numeral zero_less_power) |
|
825 |
then obtain C where clo: "\<And>n. closed (C n)" and subS: "\<And>n. C n \<subseteq> S" |
|
826 |
and mea: "\<And>n. (S - C n) \<in> lmeasurable" |
|
827 |
and less: "\<And>n. measure lebesgue (S - C n) < (1/2)^n" |
|
828 |
by metis |
|
829 |
have "\<exists>F. (\<forall>n::nat. compact(F n)) \<and> (\<Union>n. F n) = C m" for m::nat |
|
830 |
by (metis clo closed_Union_compact_subsets) |
|
831 |
then obtain D :: "[nat,nat] \<Rightarrow> 'a set" where D: "\<And>m n. compact(D m n)" "\<And>m. (\<Union>n. D m n) = C m" |
|
832 |
by metis |
|
833 |
let ?C = "from_nat_into (\<Union>m. range (D m))" |
|
834 |
have "countable (\<Union>m. range (D m))" |
|
835 |
by blast |
|
836 |
have "range (from_nat_into (\<Union>m. range (D m))) = (\<Union>m. range (D m))" |
|
837 |
using range_from_nat_into by simp |
|
838 |
then have CD: "\<exists>m n. ?C k = D m n" for k |
|
839 |
by (metis (mono_tags, lifting) UN_iff rangeE range_eqI) |
|
840 |
show thesis |
|
841 |
proof |
|
842 |
show "negligible (S - (\<Union>n. C n))" |
|
843 |
proof (clarsimp simp: negligible_outer_le) |
|
844 |
fix e :: "real" |
|
845 |
assume "e > 0" |
|
846 |
then obtain n where n: "(1/2)^n < e" |
|
847 |
using real_arch_pow_inv [of e "1/2"] by auto |
|
848 |
show "\<exists>T. S - (\<Union>n. C n) \<subseteq> T \<and> T \<in> lmeasurable \<and> measure lebesgue T \<le> e" |
|
849 |
proof (intro exI conjI) |
|
850 |
show "S - (\<Union>n. C n) \<subseteq> S - C n" |
|
851 |
by blast |
|
852 |
show "S - C n \<in> lmeasurable" |
|
853 |
by (simp add: mea) |
|
854 |
show "measure lebesgue (S - C n) \<le> e" |
|
855 |
using less [of n] n by simp |
|
856 |
qed |
|
857 |
qed |
|
858 |
show "compact (?C n)" for n |
|
859 |
using CD D by metis |
|
860 |
show "S = (\<Union>n. ?C n) \<union> (S - (\<Union>n. C n))" (is "_ = ?rhs") |
|
861 |
proof |
|
862 |
show "S \<subseteq> ?rhs" |
|
863 |
using D by fastforce |
|
864 |
show "?rhs \<subseteq> S" |
|
865 |
using subS D CD by auto (metis Sup_upper range_eqI subsetCE) |
|
866 |
qed |
|
867 |
qed |
|
868 |
qed |
|
869 |
||
870 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
871 |
lemma sets_lebesgue_continuous_image: |
67998 | 872 |
assumes T: "T \<in> sets lebesgue" and contf: "continuous_on S f" |
873 |
and negim: "\<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible(f ` T)" and "T \<subseteq> S" |
|
874 |
shows "f ` T \<in> sets lebesgue" |
|
875 |
proof - |
|
876 |
obtain K C where "negligible K" and com: "\<And>n::nat. compact(C n)" and Teq: "T = (\<Union>n. C n) \<union> K" |
|
877 |
using lebesgue_regular_inner [OF T] by metis |
|
878 |
then have comf: "\<And>n::nat. compact(f ` C n)" |
|
879 |
by (metis Un_subset_iff Union_upper \<open>T \<subseteq> S\<close> compact_continuous_image contf continuous_on_subset rangeI) |
|
880 |
have "((\<Union>n. f ` C n) \<union> f ` K) \<in> sets lebesgue" |
|
881 |
proof (rule sets.Un) |
|
882 |
have "K \<subseteq> S" |
|
883 |
using Teq \<open>T \<subseteq> S\<close> by blast |
|
884 |
show "(\<Union>n. f ` C n) \<in> sets lebesgue" |
|
885 |
proof (rule sets.countable_Union) |
|
886 |
show "range (\<lambda>n. f ` C n) \<subseteq> sets lebesgue" |
|
887 |
using borel_compact comf by (auto simp: borel_compact) |
|
888 |
qed auto |
|
889 |
show "f ` K \<in> sets lebesgue" |
|
890 |
by (simp add: \<open>K \<subseteq> S\<close> \<open>negligible K\<close> negim negligible_imp_sets) |
|
891 |
qed |
|
892 |
then show ?thesis |
|
893 |
by (simp add: Teq image_Un image_Union) |
|
894 |
qed |
|
895 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
896 |
lemma differentiable_image_in_sets_lebesgue: |
67998 | 897 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
898 |
assumes S: "S \<in> sets lebesgue" and dim: "DIM('m) \<le> DIM('n)" and f: "f differentiable_on S" |
|
899 |
shows "f`S \<in> sets lebesgue" |
|
900 |
proof (rule sets_lebesgue_continuous_image [OF S]) |
|
901 |
show "continuous_on S f" |
|
902 |
by (meson differentiable_imp_continuous_on f) |
|
903 |
show "\<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)" |
|
904 |
using differentiable_on_subset f |
|
905 |
by (auto simp: intro!: negligible_differentiable_image_negligible [OF dim]) |
|
906 |
qed auto |
|
907 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
908 |
lemma sets_lebesgue_on_continuous_image: |
67998 | 909 |
assumes S: "S \<in> sets lebesgue" and X: "X \<in> sets (lebesgue_on S)" and contf: "continuous_on S f" |
910 |
and negim: "\<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible(f ` T)" |
|
911 |
shows "f ` X \<in> sets (lebesgue_on (f ` S))" |
|
912 |
proof - |
|
913 |
have "X \<subseteq> S" |
|
914 |
by (metis S X sets.Int_space_eq2 sets_restrict_space_iff) |
|
915 |
moreover have "f ` S \<in> sets lebesgue" |
|
916 |
using S contf negim sets_lebesgue_continuous_image by blast |
|
917 |
moreover have "f ` X \<in> sets lebesgue" |
|
918 |
by (metis S X contf negim sets_lebesgue_continuous_image sets_restrict_space_iff space_restrict_space space_restrict_space2) |
|
919 |
ultimately show ?thesis |
|
920 |
by (auto simp: sets_restrict_space_iff) |
|
921 |
qed |
|
922 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
923 |
lemma differentiable_image_in_sets_lebesgue_on: |
67998 | 924 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
925 |
assumes S: "S \<in> sets lebesgue" and X: "X \<in> sets (lebesgue_on S)" and dim: "DIM('m) \<le> DIM('n)" |
|
926 |
and f: "f differentiable_on S" |
|
927 |
shows "f ` X \<in> sets (lebesgue_on (f`S))" |
|
928 |
proof (rule sets_lebesgue_on_continuous_image [OF S X]) |
|
929 |
show "continuous_on S f" |
|
930 |
by (meson differentiable_imp_continuous_on f) |
|
931 |
show "\<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)" |
|
932 |
using differentiable_on_subset f |
|
933 |
by (auto simp: intro!: negligible_differentiable_image_negligible [OF dim]) |
|
934 |
qed |
|
935 |
||
936 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
937 |
proposition (*FIX needs name *) |
67998 | 938 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
939 |
assumes S: "S \<in> lmeasurable" |
|
940 |
and deriv: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
941 |
and int: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on S" |
|
942 |
and bounded: "\<And>x. x \<in> S \<Longrightarrow> \<bar>det (matrix (f' x))\<bar> \<le> B" |
|
943 |
shows measurable_bounded_differentiable_image: |
|
944 |
"f ` S \<in> lmeasurable" |
|
945 |
and measure_bounded_differentiable_image: |
|
946 |
"measure lebesgue (f ` S) \<le> B * measure lebesgue S" (is "?M") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
947 |
proof - |
67998 | 948 |
have "f ` S \<in> lmeasurable \<and> measure lebesgue (f ` S) \<le> B * measure lebesgue S" |
949 |
proof (cases "B < 0") |
|
950 |
case True |
|
951 |
then have "S = {}" |
|
952 |
by (meson abs_ge_zero bounded empty_iff equalityI less_le_trans linorder_not_less subsetI) |
|
953 |
then show ?thesis |
|
954 |
by auto |
|
955 |
next |
|
956 |
case False |
|
957 |
then have "B \<ge> 0" |
|
958 |
by arith |
|
959 |
let ?\<mu> = "measure lebesgue" |
|
960 |
have f_diff: "f differentiable_on S" |
|
961 |
using deriv by (auto simp: differentiable_on_def differentiable_def) |
|
962 |
have eps: "f ` S \<in> lmeasurable" "?\<mu> (f ` S) \<le> (B+e) * ?\<mu> S" (is "?ME") |
|
963 |
if "e > 0" for e |
|
964 |
proof - |
|
965 |
have eps_d: "f ` S \<in> lmeasurable" "?\<mu> (f ` S) \<le> (B+e) * (?\<mu> S + d)" (is "?MD") |
|
966 |
if "d > 0" for d |
|
967 |
proof - |
|
968 |
obtain T where "open T" "S \<subseteq> T" and TS: "(T-S) \<in> lmeasurable" and "?\<mu> (T-S) < d" |
|
969 |
using S \<open>d > 0\<close> lmeasurable_outer_open by blast |
|
970 |
with S have "T \<in> lmeasurable" and Tless: "?\<mu> T < ?\<mu> S + d" |
|
971 |
by (auto simp: measurable_measure_Diff dest!: fmeasurable_Diff_D) |
|
972 |
have "\<exists>r. 0 < r \<and> r < d \<and> ball x r \<subseteq> T \<and> f ` (S \<inter> ball x r) \<in> lmeasurable \<and> |
|
973 |
?\<mu> (f ` (S \<inter> ball x r)) \<le> (B + e) * ?\<mu> (ball x r)" |
|
974 |
if "x \<in> S" "d > 0" for x d |
|
975 |
proof - |
|
976 |
have lin: "linear (f' x)" |
|
977 |
and lim0: "((\<lambda>y. (f y - (f x + f' x (y - x))) /\<^sub>R norm(y - x)) \<longlongrightarrow> 0) (at x within S)" |
|
978 |
using deriv \<open>x \<in> S\<close> by (auto simp: has_derivative_within bounded_linear.linear field_simps) |
|
979 |
have bo: "bounded (f' x ` ball 0 1)" |
|
980 |
by (simp add: bounded_linear_image linear_linear lin) |
|
981 |
have neg: "negligible (frontier (f' x ` ball 0 1))" |
|
982 |
using deriv has_derivative_linear \<open>x \<in> S\<close> |
|
983 |
by (auto intro!: negligible_convex_frontier [OF convex_linear_image]) |
|
984 |
have 0: "0 < e * unit_ball_vol (real CARD('n))" |
|
985 |
using \<open>e > 0\<close> by simp |
|
986 |
obtain k where "k > 0" and k: |
|
987 |
"\<And>U. \<lbrakk>U \<in> lmeasurable; \<And>y. y \<in> U \<Longrightarrow> \<exists>z. z \<in> f' x ` ball 0 1 \<and> dist z y < k\<rbrakk> |
|
988 |
\<Longrightarrow> ?\<mu> U < ?\<mu> (f' x ` ball 0 1) + e * unit_ball_vol (CARD('n))" |
|
989 |
using measure_semicontinuous_with_hausdist_explicit [OF bo neg 0] by blast |
|
990 |
obtain l where "l > 0" and l: "ball x l \<subseteq> T" |
|
991 |
using \<open>x \<in> S\<close> \<open>open T\<close> \<open>S \<subseteq> T\<close> openE by blast |
|
992 |
obtain \<zeta> where "0 < \<zeta>" |
|
993 |
and \<zeta>: "\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < \<zeta>\<rbrakk> |
|
994 |
\<Longrightarrow> norm (f y - (f x + f' x (y - x))) / norm (y - x) < k" |
|
995 |
using lim0 \<open>k > 0\<close> by (force simp: Lim_within field_simps) |
|
996 |
define r where "r \<equiv> min (min l (\<zeta>/2)) (min 1 (d/2))" |
|
997 |
show ?thesis |
|
998 |
proof (intro exI conjI) |
|
999 |
show "r > 0" "r < d" |
|
1000 |
using \<open>l > 0\<close> \<open>\<zeta> > 0\<close> \<open>d > 0\<close> by (auto simp: r_def) |
|
1001 |
have "r \<le> l" |
|
1002 |
by (auto simp: r_def) |
|
1003 |
with l show "ball x r \<subseteq> T" |
|
1004 |
by auto |
|
1005 |
have ex_lessK: "\<exists>x' \<in> ball 0 1. dist (f' x x') ((f y - f x) /\<^sub>R r) < k" |
|
1006 |
if "y \<in> S" and "dist x y < r" for y |
|
1007 |
proof (cases "y = x") |
|
1008 |
case True |
|
1009 |
with lin linear_0 \<open>k > 0\<close> that show ?thesis |
|
1010 |
by (rule_tac x=0 in bexI) (auto simp: linear_0) |
|
1011 |
next |
|
1012 |
case False |
|
1013 |
then show ?thesis |
|
1014 |
proof (rule_tac x="(y - x) /\<^sub>R r" in bexI) |
|
1015 |
have "f' x ((y - x) /\<^sub>R r) = f' x (y - x) /\<^sub>R r" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1016 |
by (simp add: lin linear_scale) |
67998 | 1017 |
then have "dist (f' x ((y - x) /\<^sub>R r)) ((f y - f x) /\<^sub>R r) = norm (f' x (y - x) /\<^sub>R r - (f y - f x) /\<^sub>R r)" |
1018 |
by (simp add: dist_norm) |
|
1019 |
also have "\<dots> = norm (f' x (y - x) - (f y - f x)) / r" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1020 |
using \<open>r > 0\<close> by (simp add: scale_right_diff_distrib [symmetric] divide_simps) |
67998 | 1021 |
also have "\<dots> \<le> norm (f y - (f x + f' x (y - x))) / norm (y - x)" |
1022 |
using that \<open>r > 0\<close> False by (simp add: algebra_simps divide_simps dist_norm norm_minus_commute mult_right_mono) |
|
1023 |
also have "\<dots> < k" |
|
1024 |
using that \<open>0 < \<zeta>\<close> by (simp add: dist_commute r_def \<zeta> [OF \<open>y \<in> S\<close> False]) |
|
1025 |
finally show "dist (f' x ((y - x) /\<^sub>R r)) ((f y - f x) /\<^sub>R r) < k" . |
|
1026 |
show "(y - x) /\<^sub>R r \<in> ball 0 1" |
|
1027 |
using that \<open>r > 0\<close> by (simp add: dist_norm divide_simps norm_minus_commute) |
|
1028 |
qed |
|
1029 |
qed |
|
1030 |
let ?rfs = "(\<lambda>x. x /\<^sub>R r) ` (+) (- f x) ` f ` (S \<inter> ball x r)" |
|
1031 |
have rfs_mble: "?rfs \<in> lmeasurable" |
|
1032 |
proof (rule bounded_set_imp_lmeasurable) |
|
1033 |
have "f differentiable_on S \<inter> ball x r" |
|
1034 |
using f_diff by (auto simp: fmeasurableD differentiable_on_subset) |
|
1035 |
with S show "?rfs \<in> sets lebesgue" |
|
1036 |
by (auto simp: sets.Int intro!: lebesgue_sets_translation differentiable_image_in_sets_lebesgue) |
|
1037 |
let ?B = "(\<lambda>(x, y). x + y) ` (f' x ` ball 0 1 \<times> ball 0 k)" |
|
1038 |
have "bounded ?B" |
|
1039 |
by (simp add: bounded_plus [OF bo]) |
|
1040 |
moreover have "?rfs \<subseteq> ?B" |
|
1041 |
apply (auto simp: dist_norm image_iff dest!: ex_lessK) |
|
1042 |
by (metis (no_types, hide_lams) add.commute diff_add_cancel dist_0_norm dist_commute dist_norm mem_ball) |
|
1043 |
ultimately show "bounded (?rfs)" |
|
1044 |
by (rule bounded_subset) |
|
1045 |
qed |
|
1046 |
then have "(\<lambda>x. r *\<^sub>R x) ` ?rfs \<in> lmeasurable" |
|
1047 |
by (simp add: measurable_linear_image) |
|
1048 |
with \<open>r > 0\<close> have "(+) (- f x) ` f ` (S \<inter> ball x r) \<in> lmeasurable" |
|
1049 |
by (simp add: image_comp o_def) |
|
1050 |
then have "(+) (f x) ` (+) (- f x) ` f ` (S \<inter> ball x r) \<in> lmeasurable" |
|
1051 |
using measurable_translation by blast |
|
1052 |
then show fsb: "f ` (S \<inter> ball x r) \<in> lmeasurable" |
|
1053 |
by (simp add: image_comp o_def) |
|
1054 |
have "?\<mu> (f ` (S \<inter> ball x r)) = ?\<mu> (?rfs) * r ^ CARD('n)" |
|
69661 | 1055 |
using \<open>r > 0\<close> fsb |
1056 |
by (simp add: measure_linear_image measure_translation_subtract measurable_translation_subtract field_simps cong: image_cong_simp) |
|
67998 | 1057 |
also have "\<dots> \<le> (\<bar>det (matrix (f' x))\<bar> * unit_ball_vol (CARD('n)) + e * unit_ball_vol (CARD('n))) * r ^ CARD('n)" |
1058 |
proof - |
|
1059 |
have "?\<mu> (?rfs) < ?\<mu> (f' x ` ball 0 1) + e * unit_ball_vol (CARD('n))" |
|
1060 |
using rfs_mble by (force intro: k dest!: ex_lessK) |
|
1061 |
then have "?\<mu> (?rfs) < \<bar>det (matrix (f' x))\<bar> * unit_ball_vol (CARD('n)) + e * unit_ball_vol (CARD('n))" |
|
1062 |
by (simp add: lin measure_linear_image [of "f' x"] content_ball) |
|
1063 |
with \<open>r > 0\<close> show ?thesis |
|
1064 |
by auto |
|
1065 |
qed |
|
1066 |
also have "\<dots> \<le> (B + e) * ?\<mu> (ball x r)" |
|
1067 |
using bounded [OF \<open>x \<in> S\<close>] \<open>r > 0\<close> by (simp add: content_ball algebra_simps) |
|
1068 |
finally show "?\<mu> (f ` (S \<inter> ball x r)) \<le> (B + e) * ?\<mu> (ball x r)" . |
|
1069 |
qed |
|
1070 |
qed |
|
1071 |
then obtain r where |
|
1072 |
r0d: "\<And>x d. \<lbrakk>x \<in> S; d > 0\<rbrakk> \<Longrightarrow> 0 < r x d \<and> r x d < d" |
|
1073 |
and rT: "\<And>x d. \<lbrakk>x \<in> S; d > 0\<rbrakk> \<Longrightarrow> ball x (r x d) \<subseteq> T" |
|
1074 |
and r: "\<And>x d. \<lbrakk>x \<in> S; d > 0\<rbrakk> \<Longrightarrow> |
|
1075 |
(f ` (S \<inter> ball x (r x d))) \<in> lmeasurable \<and> |
|
1076 |
?\<mu> (f ` (S \<inter> ball x (r x d))) \<le> (B + e) * ?\<mu> (ball x (r x d))" |
|
1077 |
by metis |
|
1078 |
obtain C where "countable C" and Csub: "C \<subseteq> {(x,r x t) |x t. x \<in> S \<and> 0 < t}" |
|
1079 |
and pwC: "pairwise (\<lambda>i j. disjnt (ball (fst i) (snd i)) (ball (fst j) (snd j))) C" |
|
1080 |
and negC: "negligible(S - (\<Union>i \<in> C. ball (fst i) (snd i)))" |
|
1081 |
apply (rule Vitali_covering_theorem_balls [of S "{(x,r x t) |x t. x \<in> S \<and> 0 < t}" fst snd]) |
|
1082 |
apply auto |
|
1083 |
by (metis dist_eq_0_iff r0d) |
|
1084 |
let ?UB = "(\<Union>(x,s) \<in> C. ball x s)" |
|
1085 |
have eq: "f ` (S \<inter> ?UB) = (\<Union>(x,s) \<in> C. f ` (S \<inter> ball x s))" |
|
1086 |
by auto |
|
1087 |
have mle: "?\<mu> (\<Union>(x,s) \<in> K. f ` (S \<inter> ball x s)) \<le> (B + e) * (?\<mu> S + d)" (is "?l \<le> ?r") |
|
1088 |
if "K \<subseteq> C" and "finite K" for K |
|
1089 |
proof - |
|
1090 |
have gt0: "b > 0" if "(a, b) \<in> K" for a b |
|
1091 |
using Csub that \<open>K \<subseteq> C\<close> r0d by auto |
|
1092 |
have inj: "inj_on (\<lambda>(x, y). ball x y) K" |
|
1093 |
by (force simp: inj_on_def ball_eq_ball_iff dest: gt0) |
|
1094 |
have disjnt: "disjoint ((\<lambda>(x, y). ball x y) ` K)" |
|
1095 |
using pwC that |
|
1096 |
apply (clarsimp simp: pairwise_def case_prod_unfold ball_eq_ball_iff) |
|
1097 |
by (metis subsetD fst_conv snd_conv) |
|
1098 |
have "?l \<le> (\<Sum>i\<in>K. ?\<mu> (case i of (x, s) \<Rightarrow> f ` (S \<inter> ball x s)))" |
|
1099 |
proof (rule measure_UNION_le [OF \<open>finite K\<close>], clarify) |
|
1100 |
fix x r |
|
1101 |
assume "(x,r) \<in> K" |
|
1102 |
then have "x \<in> S" |
|
1103 |
using Csub \<open>K \<subseteq> C\<close> by auto |
|
1104 |
show "f ` (S \<inter> ball x r) \<in> sets lebesgue" |
|
1105 |
by (meson Int_lower1 S differentiable_on_subset f_diff fmeasurableD lmeasurable_ball order_refl sets.Int differentiable_image_in_sets_lebesgue) |
|
1106 |
qed |
|
1107 |
also have "\<dots> \<le> (\<Sum>(x,s) \<in> K. (B + e) * ?\<mu> (ball x s))" |
|
1108 |
apply (rule sum_mono) |
|
1109 |
using Csub r \<open>K \<subseteq> C\<close> by auto |
|
1110 |
also have "\<dots> = (B + e) * (\<Sum>(x,s) \<in> K. ?\<mu> (ball x s))" |
|
1111 |
by (simp add: prod.case_distrib sum_distrib_left) |
|
1112 |
also have "\<dots> = (B + e) * sum ?\<mu> ((\<lambda>(x, y). ball x y) ` K)" |
|
1113 |
using \<open>B \<ge> 0\<close> \<open>e > 0\<close> by (simp add: inj sum.reindex prod.case_distrib) |
|
1114 |
also have "\<dots> = (B + e) * ?\<mu> (\<Union>(x,s) \<in> K. ball x s)" |
|
1115 |
using \<open>B \<ge> 0\<close> \<open>e > 0\<close> that |
|
1116 |
by (subst measure_Union') (auto simp: disjnt measure_Union') |
|
1117 |
also have "\<dots> \<le> (B + e) * ?\<mu> T" |
|
1118 |
using \<open>B \<ge> 0\<close> \<open>e > 0\<close> that apply simp |
|
1119 |
apply (rule measure_mono_fmeasurable [OF _ _ \<open>T \<in> lmeasurable\<close>]) |
|
1120 |
using Csub rT by force+ |
|
1121 |
also have "\<dots> \<le> (B + e) * (?\<mu> S + d)" |
|
1122 |
using \<open>B \<ge> 0\<close> \<open>e > 0\<close> Tless by simp |
|
1123 |
finally show ?thesis . |
|
1124 |
qed |
|
1125 |
have fSUB_mble: "(f ` (S \<inter> ?UB)) \<in> lmeasurable" |
|
1126 |
unfolding eq using Csub r False \<open>e > 0\<close> that |
|
1127 |
by (auto simp: intro!: fmeasurable_UN_bound [OF \<open>countable C\<close> _ mle]) |
|
1128 |
have fSUB_meas: "?\<mu> (f ` (S \<inter> ?UB)) \<le> (B + e) * (?\<mu> S + d)" (is "?MUB") |
|
1129 |
unfolding eq using Csub r False \<open>e > 0\<close> that |
|
1130 |
by (auto simp: intro!: measure_UN_bound [OF \<open>countable C\<close> _ mle]) |
|
1131 |
have neg: "negligible ((f ` (S \<inter> ?UB) - f ` S) \<union> (f ` S - f ` (S \<inter> ?UB)))" |
|
1132 |
proof (rule negligible_subset [OF negligible_differentiable_image_negligible [OF order_refl negC, where f=f]]) |
|
1133 |
show "f differentiable_on S - (\<Union>i\<in>C. ball (fst i) (snd i))" |
|
1134 |
by (meson DiffE differentiable_on_subset subsetI f_diff) |
|
1135 |
qed force |
|
1136 |
show "f ` S \<in> lmeasurable" |
|
1137 |
by (rule lmeasurable_negligible_symdiff [OF fSUB_mble neg]) |
|
1138 |
show ?MD |
|
1139 |
using fSUB_meas measure_negligible_symdiff [OF fSUB_mble neg] by simp |
|
1140 |
qed |
|
1141 |
show "f ` S \<in> lmeasurable" |
|
1142 |
using eps_d [of 1] by simp |
|
1143 |
show ?ME |
|
1144 |
proof (rule field_le_epsilon) |
|
1145 |
fix \<delta> :: real |
|
1146 |
assume "0 < \<delta>" |
|
1147 |
then show "?\<mu> (f ` S) \<le> (B + e) * ?\<mu> S + \<delta>" |
|
1148 |
using eps_d [of "\<delta> / (B+e)"] \<open>e > 0\<close> \<open>B \<ge> 0\<close> by (auto simp: divide_simps mult_ac) |
|
1149 |
qed |
|
1150 |
qed |
|
1151 |
show ?thesis |
|
1152 |
proof (cases "?\<mu> S = 0") |
|
1153 |
case True |
|
1154 |
with eps have "?\<mu> (f ` S) = 0" |
|
1155 |
by (metis mult_zero_right not_le zero_less_measure_iff) |
|
1156 |
then show ?thesis |
|
1157 |
using eps [of 1] by (simp add: True) |
|
1158 |
next |
|
1159 |
case False |
|
1160 |
have "?\<mu> (f ` S) \<le> B * ?\<mu> S" |
|
1161 |
proof (rule field_le_epsilon) |
|
1162 |
fix e :: real |
|
1163 |
assume "e > 0" |
|
1164 |
then show "?\<mu> (f ` S) \<le> B * ?\<mu> S + e" |
|
1165 |
using eps [of "e / ?\<mu> S"] False by (auto simp: algebra_simps zero_less_measure_iff) |
|
1166 |
qed |
|
1167 |
with eps [of 1] show ?thesis by auto |
|
1168 |
qed |
|
1169 |
qed |
|
1170 |
then show "f ` S \<in> lmeasurable" ?M by blast+ |
|
1171 |
qed |
|
1172 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1173 |
proposition (*FIX needs name *) |
67998 | 1174 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
1175 |
assumes S: "S \<in> lmeasurable" |
|
1176 |
and deriv: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
1177 |
and int: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on S" |
|
1178 |
shows m_diff_image_weak: "f ` S \<in> lmeasurable \<and> measure lebesgue (f ` S) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1179 |
proof - |
67998 | 1180 |
let ?\<mu> = "measure lebesgue" |
1181 |
have aint_S: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on S" |
|
1182 |
using int unfolding absolutely_integrable_on_def by auto |
|
1183 |
define m where "m \<equiv> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1184 |
have *: "f ` S \<in> lmeasurable" "?\<mu> (f ` S) \<le> m + e * ?\<mu> S" |
|
1185 |
if "e > 0" for e |
|
1186 |
proof - |
|
1187 |
define T where "T \<equiv> \<lambda>n. {x \<in> S. n * e \<le> \<bar>det (matrix (f' x))\<bar> \<and> |
|
1188 |
\<bar>det (matrix (f' x))\<bar> < (Suc n) * e}" |
|
1189 |
have meas_t: "T n \<in> lmeasurable" for n |
|
1190 |
proof - |
|
1191 |
have *: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) \<in> borel_measurable (lebesgue_on S)" |
|
1192 |
using aint_S by (simp add: S borel_measurable_restrict_space_iff fmeasurableD set_integrable_def) |
|
1193 |
have [intro]: "x \<in> sets (lebesgue_on S) \<Longrightarrow> x \<in> sets lebesgue" for x |
|
1194 |
using S sets_restrict_space_subset by blast |
|
1195 |
have "{x \<in> S. real n * e \<le> \<bar>det (matrix (f' x))\<bar>} \<in> sets lebesgue" |
|
1196 |
using * by (auto simp: borel_measurable_iff_halfspace_ge space_restrict_space) |
|
1197 |
then have 1: "{x \<in> S. real n * e \<le> \<bar>det (matrix (f' x))\<bar>} \<in> lmeasurable" |
|
1198 |
using S by (simp add: fmeasurableI2) |
|
1199 |
have "{x \<in> S. \<bar>det (matrix (f' x))\<bar> < (1 + real n) * e} \<in> sets lebesgue" |
|
1200 |
using * by (auto simp: borel_measurable_iff_halfspace_less space_restrict_space) |
|
1201 |
then have 2: "{x \<in> S. \<bar>det (matrix (f' x))\<bar> < (1 + real n) * e} \<in> lmeasurable" |
|
1202 |
using S by (simp add: fmeasurableI2) |
|
1203 |
show ?thesis |
|
1204 |
using fmeasurable.Int [OF 1 2] by (simp add: T_def Int_def cong: conj_cong) |
|
1205 |
qed |
|
1206 |
have aint_T: "\<And>k. (\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on T k" |
|
1207 |
using set_integrable_subset [OF aint_S] meas_t T_def by blast |
|
1208 |
have Seq: "S = (\<Union>n. T n)" |
|
1209 |
apply (auto simp: T_def) |
|
1210 |
apply (rule_tac x="nat(floor(abs(det(matrix(f' x))) / e))" in exI) |
|
1211 |
using that apply auto |
|
1212 |
using of_int_floor_le pos_le_divide_eq apply blast |
|
1213 |
by (metis add.commute pos_divide_less_eq real_of_int_floor_add_one_gt) |
|
1214 |
have meas_ft: "f ` T n \<in> lmeasurable" for n |
|
1215 |
proof (rule measurable_bounded_differentiable_image) |
|
1216 |
show "T n \<in> lmeasurable" |
|
1217 |
by (simp add: meas_t) |
|
1218 |
next |
|
1219 |
fix x :: "(real,'n) vec" |
|
1220 |
assume "x \<in> T n" |
|
1221 |
show "(f has_derivative f' x) (at x within T n)" |
|
1222 |
by (metis (no_types, lifting) \<open>x \<in> T n\<close> deriv has_derivative_within_subset mem_Collect_eq subsetI T_def) |
|
1223 |
show "\<bar>det (matrix (f' x))\<bar> \<le> (Suc n) * e" |
|
1224 |
using \<open>x \<in> T n\<close> T_def by auto |
|
1225 |
next |
|
1226 |
show "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on T n" |
|
1227 |
using aint_T absolutely_integrable_on_def by blast |
|
1228 |
qed |
|
1229 |
have disT: "disjoint (range T)" |
|
1230 |
unfolding disjoint_def |
|
1231 |
proof clarsimp |
|
1232 |
show "T m \<inter> T n = {}" if "T m \<noteq> T n" for m n |
|
1233 |
using that |
|
1234 |
proof (induction m n rule: linorder_less_wlog) |
|
1235 |
case (less m n) |
|
1236 |
with \<open>e > 0\<close> show ?case |
|
1237 |
unfolding T_def |
|
1238 |
proof (clarsimp simp add: Collect_conj_eq [symmetric]) |
|
1239 |
fix x |
|
1240 |
assume "e > 0" "m < n" "n * e \<le> \<bar>det (matrix (f' x))\<bar>" "\<bar>det (matrix (f' x))\<bar> < (1 + real m) * e" |
|
1241 |
then have "n < 1 + real m" |
|
1242 |
by (metis (no_types, hide_lams) less_le_trans mult.commute not_le real_mult_le_cancel_iff2) |
|
1243 |
then show "False" |
|
1244 |
using less.hyps by linarith |
|
1245 |
qed |
|
1246 |
qed auto |
|
1247 |
qed |
|
1248 |
have injT: "inj_on T ({n. T n \<noteq> {}})" |
|
1249 |
unfolding inj_on_def |
|
1250 |
proof clarsimp |
|
1251 |
show "m = n" if "T m = T n" "T n \<noteq> {}" for m n |
|
1252 |
using that |
|
1253 |
proof (induction m n rule: linorder_less_wlog) |
|
1254 |
case (less m n) |
|
1255 |
have False if "T n \<subseteq> T m" "x \<in> T n" for x |
|
1256 |
using \<open>e > 0\<close> \<open>m < n\<close> that |
|
1257 |
apply (auto simp: T_def mult.commute intro: less_le_trans dest!: subsetD) |
|
1258 |
by (metis add.commute less_le_trans nat_less_real_le not_le real_mult_le_cancel_iff2) |
|
1259 |
then show ?case |
|
1260 |
using less.prems by blast |
|
1261 |
qed auto |
|
1262 |
qed |
|
1263 |
have sum_eq_Tim: "(\<Sum>k\<le>n. f (T k)) = sum f (T ` {..n})" if "f {} = 0" for f :: "_ \<Rightarrow> real" and n |
|
1264 |
proof (subst sum.reindex_nontrivial) |
|
1265 |
fix i j assume "i \<in> {..n}" "j \<in> {..n}" "i \<noteq> j" "T i = T j" |
|
1266 |
with that injT [unfolded inj_on_def] show "f (T i) = 0" |
|
1267 |
by simp metis |
|
1268 |
qed (use atMost_atLeast0 in auto) |
|
1269 |
let ?B = "m + e * ?\<mu> S" |
|
1270 |
have "(\<Sum>k\<le>n. ?\<mu> (f ` T k)) \<le> ?B" for n |
|
1271 |
proof - |
|
1272 |
have "(\<Sum>k\<le>n. ?\<mu> (f ` T k)) \<le> (\<Sum>k\<le>n. ((k+1) * e) * ?\<mu>(T k))" |
|
1273 |
proof (rule sum_mono [OF measure_bounded_differentiable_image]) |
|
1274 |
show "(f has_derivative f' x) (at x within T k)" if "x \<in> T k" for k x |
|
1275 |
using that unfolding T_def by (blast intro: deriv has_derivative_within_subset) |
|
1276 |
show "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on T k" for k |
|
1277 |
using absolutely_integrable_on_def aint_T by blast |
|
1278 |
show "\<bar>det (matrix (f' x))\<bar> \<le> real (k + 1) * e" if "x \<in> T k" for k x |
|
1279 |
using T_def that by auto |
|
1280 |
qed (use meas_t in auto) |
|
1281 |
also have "\<dots> \<le> (\<Sum>k\<le>n. (k * e) * ?\<mu>(T k)) + (\<Sum>k\<le>n. e * ?\<mu>(T k))" |
|
1282 |
by (simp add: algebra_simps sum.distrib) |
|
1283 |
also have "\<dots> \<le> ?B" |
|
1284 |
proof (rule add_mono) |
|
1285 |
have "(\<Sum>k\<le>n. real k * e * ?\<mu> (T k)) = (\<Sum>k\<le>n. integral (T k) (\<lambda>x. k * e))" |
|
1286 |
by (simp add: lmeasure_integral [OF meas_t] |
|
68403 | 1287 |
flip: integral_mult_right integral_mult_left) |
67998 | 1288 |
also have "\<dots> \<le> (\<Sum>k\<le>n. integral (T k) (\<lambda>x. (abs (det (matrix (f' x))))))" |
1289 |
proof (rule sum_mono) |
|
1290 |
fix k |
|
1291 |
assume "k \<in> {..n}" |
|
1292 |
show "integral (T k) (\<lambda>x. k * e) \<le> integral (T k) (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1293 |
proof (rule integral_le [OF integrable_on_const [OF meas_t]]) |
|
1294 |
show "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on T k" |
|
1295 |
using absolutely_integrable_on_def aint_T by blast |
|
1296 |
next |
|
1297 |
fix x assume "x \<in> T k" |
|
1298 |
show "k * e \<le> \<bar>det (matrix (f' x))\<bar>" |
|
1299 |
using \<open>x \<in> T k\<close> T_def by blast |
|
1300 |
qed |
|
1301 |
qed |
|
1302 |
also have "\<dots> = sum (\<lambda>T. integral T (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)) (T ` {..n})" |
|
1303 |
by (auto intro: sum_eq_Tim) |
|
1304 |
also have "\<dots> = integral (\<Union>k\<le>n. T k) (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1305 |
proof (rule integral_unique [OF has_integral_Union, symmetric]) |
|
1306 |
fix S assume "S \<in> T ` {..n}" |
|
1307 |
then show "((\<lambda>x. \<bar>det (matrix (f' x))\<bar>) has_integral integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)) S" |
|
1308 |
using absolutely_integrable_on_def aint_T by blast |
|
1309 |
next |
|
1310 |
show "pairwise (\<lambda>S S'. negligible (S \<inter> S')) (T ` {..n})" |
|
1311 |
using disT unfolding disjnt_iff by (auto simp: pairwise_def intro!: empty_imp_negligible) |
|
1312 |
qed auto |
|
1313 |
also have "\<dots> \<le> m" |
|
1314 |
unfolding m_def |
|
1315 |
proof (rule integral_subset_le) |
|
1316 |
have "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on (\<Union>k\<le>n. T k)" |
|
1317 |
apply (rule set_integrable_subset [OF aint_S]) |
|
1318 |
apply (intro measurable meas_t fmeasurableD) |
|
1319 |
apply (force simp: Seq) |
|
1320 |
done |
|
1321 |
then show "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on (\<Union>k\<le>n. T k)" |
|
1322 |
using absolutely_integrable_on_def by blast |
|
1323 |
qed (use Seq int in auto) |
|
1324 |
finally show "(\<Sum>k\<le>n. real k * e * ?\<mu> (T k)) \<le> m" . |
|
1325 |
next |
|
1326 |
have "(\<Sum>k\<le>n. ?\<mu> (T k)) = sum ?\<mu> (T ` {..n})" |
|
1327 |
by (auto intro: sum_eq_Tim) |
|
1328 |
also have "\<dots> = ?\<mu> (\<Union>k\<le>n. T k)" |
|
1329 |
using S disT by (auto simp: pairwise_def meas_t intro: measure_Union' [symmetric]) |
|
1330 |
also have "\<dots> \<le> ?\<mu> S" |
|
1331 |
using S by (auto simp: Seq intro: meas_t fmeasurableD measure_mono_fmeasurable) |
|
1332 |
finally have "(\<Sum>k\<le>n. ?\<mu> (T k)) \<le> ?\<mu> S" . |
|
1333 |
then show "(\<Sum>k\<le>n. e * ?\<mu> (T k)) \<le> e * ?\<mu> S" |
|
1334 |
by (metis less_eq_real_def ordered_comm_semiring_class.comm_mult_left_mono sum_distrib_left that) |
|
1335 |
qed |
|
1336 |
finally show "(\<Sum>k\<le>n. ?\<mu> (f ` T k)) \<le> ?B" . |
|
1337 |
qed |
|
1338 |
moreover have "measure lebesgue (\<Union>k\<le>n. f ` T k) \<le> (\<Sum>k\<le>n. ?\<mu> (f ` T k))" for n |
|
1339 |
by (simp add: fmeasurableD meas_ft measure_UNION_le) |
|
1340 |
ultimately have B_ge_m: "?\<mu> (\<Union>k\<le>n. (f ` T k)) \<le> ?B" for n |
|
1341 |
by (meson order_trans) |
|
1342 |
have "(\<Union>n. f ` T n) \<in> lmeasurable" |
|
1343 |
by (rule fmeasurable_countable_Union [OF meas_ft B_ge_m]) |
|
1344 |
moreover have "?\<mu> (\<Union>n. f ` T n) \<le> m + e * ?\<mu> S" |
|
1345 |
by (rule measure_countable_Union_le [OF meas_ft B_ge_m]) |
|
1346 |
ultimately show "f ` S \<in> lmeasurable" "?\<mu> (f ` S) \<le> m + e * ?\<mu> S" |
|
1347 |
by (auto simp: Seq image_Union) |
|
1348 |
qed |
|
1349 |
show ?thesis |
|
1350 |
proof |
|
1351 |
show "f ` S \<in> lmeasurable" |
|
1352 |
using * linordered_field_no_ub by blast |
|
1353 |
let ?x = "m - ?\<mu> (f ` S)" |
|
1354 |
have False if "?\<mu> (f ` S) > integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1355 |
proof - |
|
1356 |
have ml: "m < ?\<mu> (f ` S)" |
|
1357 |
using m_def that by blast |
|
1358 |
then have "?\<mu> S \<noteq> 0" |
|
1359 |
using "*"(2) bgauge_existence_lemma by fastforce |
|
1360 |
with ml have 0: "0 < - (m - ?\<mu> (f ` S))/2 / ?\<mu> S" |
|
1361 |
using that zero_less_measure_iff by force |
|
1362 |
then show ?thesis |
|
1363 |
using * [OF 0] that by (auto simp: divide_simps m_def split: if_split_asm) |
|
1364 |
qed |
|
1365 |
then show "?\<mu> (f ` S) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1366 |
by fastforce |
|
1367 |
qed |
|
1368 |
qed |
|
1369 |
||
1370 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1371 |
theorem (*FIX needs name *) |
67998 | 1372 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
1373 |
assumes S: "S \<in> sets lebesgue" |
|
1374 |
and deriv: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
1375 |
and int: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on S" |
|
1376 |
shows measurable_differentiable_image: "f ` S \<in> lmeasurable" |
|
1377 |
and measure_differentiable_image: |
|
1378 |
"measure lebesgue (f ` S) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" (is "?M") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1379 |
proof - |
67998 | 1380 |
let ?I = "\<lambda>n::nat. cbox (vec (-n)) (vec n) \<inter> S" |
1381 |
let ?\<mu> = "measure lebesgue" |
|
1382 |
have "x \<in> cbox (vec (- real (nat \<lceil>norm x\<rceil>))) (vec (real (nat \<lceil>norm x\<rceil>)))" for x :: "real^'n::_" |
|
1383 |
apply (auto simp: mem_box_cart) |
|
1384 |
apply (metis abs_le_iff component_le_norm_cart minus_le_iff of_nat_ceiling order.trans) |
|
1385 |
by (meson abs_le_D1 norm_bound_component_le_cart real_nat_ceiling_ge) |
|
1386 |
then have Seq: "S = (\<Union>n. ?I n)" |
|
1387 |
by auto |
|
1388 |
have fIn: "f ` ?I n \<in> lmeasurable" |
|
1389 |
and mfIn: "?\<mu> (f ` ?I n) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" (is ?MN) for n |
|
1390 |
proof - |
|
1391 |
have In: "?I n \<in> lmeasurable" |
|
1392 |
by (simp add: S bounded_Int bounded_set_imp_lmeasurable sets.Int) |
|
1393 |
moreover have "\<And>x. x \<in> ?I n \<Longrightarrow> (f has_derivative f' x) (at x within ?I n)" |
|
1394 |
by (meson Int_iff deriv has_derivative_within_subset subsetI) |
|
1395 |
moreover have int_In: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on ?I n" |
|
1396 |
proof - |
|
1397 |
have "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on S" |
|
1398 |
using int absolutely_integrable_integrable_bound by force |
|
1399 |
then have "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on ?I n" |
|
1400 |
by (metis (no_types) Int_lower1 In fmeasurableD inf_commute set_integrable_subset) |
|
1401 |
then show ?thesis |
|
1402 |
using absolutely_integrable_on_def by blast |
|
1403 |
qed |
|
1404 |
ultimately have "f ` ?I n \<in> lmeasurable" "?\<mu> (f ` ?I n) \<le> integral (?I n) (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1405 |
using m_diff_image_weak by metis+ |
|
1406 |
moreover have "integral (?I n) (\<lambda>x. \<bar>det (matrix (f' x))\<bar>) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1407 |
by (simp add: int_In int integral_subset_le) |
|
1408 |
ultimately show "f ` ?I n \<in> lmeasurable" ?MN |
|
1409 |
by auto |
|
1410 |
qed |
|
1411 |
have "?I k \<subseteq> ?I n" if "k \<le> n" for k n |
|
1412 |
by (rule Int_mono) (use that in \<open>auto simp: subset_interval_imp_cart\<close>) |
|
1413 |
then have "(\<Union>k\<le>n. f ` ?I k) = f ` ?I n" for n |
|
1414 |
by (fastforce simp add:) |
|
1415 |
with mfIn have "?\<mu> (\<Union>k\<le>n. f ` ?I k) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" for n |
|
1416 |
by simp |
|
1417 |
then have "(\<Union>n. f ` ?I n) \<in> lmeasurable" "?\<mu> (\<Union>n. f ` ?I n) \<le> integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
1418 |
by (rule fmeasurable_countable_Union [OF fIn] measure_countable_Union_le [OF fIn])+ |
|
1419 |
then show "f ` S \<in> lmeasurable" ?M |
|
1420 |
by (metis Seq image_UN)+ |
|
1421 |
qed |
|
1422 |
||
1423 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1424 |
lemma borel_measurable_simple_function_limit_increasing: |
67998 | 1425 |
fixes f :: "'a::euclidean_space \<Rightarrow> real" |
1426 |
shows "(f \<in> borel_measurable lebesgue \<and> (\<forall>x. 0 \<le> f x)) \<longleftrightarrow> |
|
1427 |
(\<exists>g. (\<forall>n x. 0 \<le> g n x \<and> g n x \<le> f x) \<and> (\<forall>n x. g n x \<le> (g(Suc n) x)) \<and> |
|
1428 |
(\<forall>n. g n \<in> borel_measurable lebesgue) \<and> (\<forall>n. finite(range (g n))) \<and> |
|
1429 |
(\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))" |
|
1430 |
(is "?lhs = ?rhs") |
|
1431 |
proof |
|
1432 |
assume f: ?lhs |
|
1433 |
have leb_f: "{x. a \<le> f x \<and> f x < b} \<in> sets lebesgue" for a b |
|
1434 |
proof - |
|
1435 |
have "{x. a \<le> f x \<and> f x < b} = {x. f x < b} - {x. f x < a}" |
|
1436 |
by auto |
|
1437 |
also have "\<dots> \<in> sets lebesgue" |
|
1438 |
using borel_measurable_vimage_halfspace_component_lt [of f UNIV] f by auto |
|
1439 |
finally show ?thesis . |
|
1440 |
qed |
|
1441 |
have "g n x \<le> f x" |
|
1442 |
if inc_g: "\<And>n x. 0 \<le> g n x \<and> g n x \<le> g (Suc n) x" |
|
1443 |
and meas_g: "\<And>n. g n \<in> borel_measurable lebesgue" |
|
1444 |
and fin: "\<And>n. finite(range (g n))" and lim: "\<And>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x" for g n x |
|
1445 |
proof - |
|
1446 |
have "\<exists>r>0. \<forall>N. \<exists>n\<ge>N. dist (g n x) (f x) \<ge> r" if "g n x > f x" |
|
1447 |
proof - |
|
1448 |
have g: "g n x \<le> g (N + n) x" for N |
|
1449 |
by (rule transitive_stepwise_le) (use inc_g in auto) |
|
1450 |
have "\<exists>na\<ge>N. g n x - f x \<le> dist (g na x) (f x)" for N |
|
1451 |
apply (rule_tac x="N+n" in exI) |
|
1452 |
using g [of N] by (auto simp: dist_norm) |
|
1453 |
with that show ?thesis |
|
1454 |
using diff_gt_0_iff_gt by blast |
|
1455 |
qed |
|
1456 |
with lim show ?thesis |
|
1457 |
apply (auto simp: lim_sequentially) |
|
1458 |
by (meson less_le_not_le not_le_imp_less) |
|
1459 |
qed |
|
1460 |
moreover |
|
1461 |
let ?\<Omega> = "\<lambda>n k. indicator {y. k/2^n \<le> f y \<and> f y < (k+1)/2^n}" |
|
1462 |
let ?g = "\<lambda>n x. (\<Sum>k::real | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * ?\<Omega> n k x)" |
|
1463 |
have "\<exists>g. (\<forall>n x. 0 \<le> g n x \<and> g n x \<le> (g(Suc n) x)) \<and> |
|
1464 |
(\<forall>n. g n \<in> borel_measurable lebesgue) \<and> (\<forall>n. finite(range (g n))) \<and>(\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)" |
|
1465 |
proof (intro exI allI conjI) |
|
1466 |
show "0 \<le> ?g n x" for n x |
|
1467 |
proof (clarify intro!: ordered_comm_monoid_add_class.sum_nonneg) |
|
1468 |
fix k::real |
|
1469 |
assume "k \<in> \<int>" and k: "\<bar>k\<bar> \<le> 2 ^ (2*n)" |
|
1470 |
show "0 \<le> k/2^n * ?\<Omega> n k x" |
|
1471 |
using f \<open>k \<in> \<int>\<close> apply (auto simp: indicator_def divide_simps Ints_def) |
|
1472 |
apply (drule spec [where x=x]) |
|
1473 |
using zero_le_power [of "2::real" n] mult_nonneg_nonneg [of "f x" "2^n"] |
|
1474 |
by linarith |
|
1475 |
qed |
|
1476 |
show "?g n x \<le> ?g (Suc n) x" for n x |
|
1477 |
proof - |
|
1478 |
have "?g n x = |
|
1479 |
(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). |
|
1480 |
k/2^n * (indicator {y. k/2^n \<le> f y \<and> f y < (k+1/2)/2^n} x + |
|
1481 |
indicator {y. (k+1/2)/2^n \<le> f y \<and> f y < (k+1)/2^n} x))" |
|
1482 |
by (rule sum.cong [OF refl]) (simp add: indicator_def divide_simps) |
|
1483 |
also have "\<dots> = (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * indicator {y. k/2^n \<le> f y \<and> f y < (k+1/2)/2^n} x) + |
|
1484 |
(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * indicator {y. (k+1/2)/2^n \<le> f y \<and> f y < (k+1)/2^n} x)" |
|
1485 |
by (simp add: comm_monoid_add_class.sum.distrib algebra_simps) |
|
1486 |
also have "\<dots> = (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). (2 * k)/2 ^ Suc n * indicator {y. (2 * k)/2 ^ Suc n \<le> f y \<and> f y < (2 * k+1)/2 ^ Suc n} x) + |
|
1487 |
(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). (2 * k)/2 ^ Suc n * indicator {y. (2 * k+1)/2 ^ Suc n \<le> f y \<and> f y < ((2 * k+1) + 1)/2 ^ Suc n} x)" |
|
1488 |
by (force simp: field_simps indicator_def intro: sum.cong) |
|
1489 |
also have "\<dots> \<le> (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2 * Suc n). k/2 ^ Suc n * (indicator {y. k/2 ^ Suc n \<le> f y \<and> f y < (k+1)/2 ^ Suc n} x))" |
|
1490 |
(is "?a + _ \<le> ?b") |
|
1491 |
proof - |
|
1492 |
have *: "\<lbrakk>sum f I \<le> sum h I; a + sum h I \<le> b\<rbrakk> \<Longrightarrow> a + sum f I \<le> b" for I a b f and h :: "real\<Rightarrow>real" |
|
1493 |
by linarith |
|
1494 |
let ?h = "\<lambda>k. (2*k+1)/2 ^ Suc n * |
|
1495 |
(indicator {y. (2 * k+1)/2 ^ Suc n \<le> f y \<and> f y < ((2*k+1) + 1)/2 ^ Suc n} x)" |
|
1496 |
show ?thesis |
|
1497 |
proof (rule *) |
|
1498 |
show "(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). |
|
1499 |
2 * k/2 ^ Suc n * indicator {y. (2 * k+1)/2 ^ Suc n \<le> f y \<and> f y < (2 * k+1 + 1)/2 ^ Suc n} x) |
|
1500 |
\<le> sum ?h {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)}" |
|
1501 |
by (rule sum_mono) (simp add: indicator_def divide_simps) |
|
1502 |
next |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
1503 |
have \<alpha>: "?a = (\<Sum>k \<in> (*)2 ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)}. |
67998 | 1504 |
k/2 ^ Suc n * indicator {y. k/2 ^ Suc n \<le> f y \<and> f y < (k+1)/2 ^ Suc n} x)" |
1505 |
by (auto simp: inj_on_def field_simps comm_monoid_add_class.sum.reindex) |
|
1506 |
have \<beta>: "sum ?h {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)} |
|
1507 |
= (\<Sum>k \<in> (\<lambda>x. 2*x + 1) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)}. |
|
1508 |
k/2 ^ Suc n * indicator {y. k/2 ^ Suc n \<le> f y \<and> f y < (k+1)/2 ^ Suc n} x)" |
|
1509 |
by (auto simp: inj_on_def field_simps comm_monoid_add_class.sum.reindex) |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
1510 |
have 0: "(*) 2 ` {k \<in> \<int>. P k} \<inter> (\<lambda>x. 2 * x + 1) ` {k \<in> \<int>. P k} = {}" for P :: "real \<Rightarrow> bool" |
67998 | 1511 |
proof - |
1512 |
have "2 * i \<noteq> 2 * j + 1" for i j :: int by arith |
|
1513 |
thus ?thesis |
|
1514 |
unfolding Ints_def by auto (use of_int_eq_iff in fastforce) |
|
1515 |
qed |
|
1516 |
have "?a + sum ?h {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)} |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
1517 |
= (\<Sum>k \<in> (*)2 ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)} \<union> (\<lambda>x. 2*x + 1) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)}. |
67998 | 1518 |
k/2 ^ Suc n * indicator {y. k/2 ^ Suc n \<le> f y \<and> f y < (k+1)/2 ^ Suc n} x)" |
1519 |
unfolding \<alpha> \<beta> |
|
1520 |
using finite_abs_int_segment [of "2 ^ (2*n)"] |
|
1521 |
by (subst sum_Un) (auto simp: 0) |
|
1522 |
also have "\<dots> \<le> ?b" |
|
1523 |
proof (rule sum_mono2) |
|
1524 |
show "finite {k::real. k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2 * Suc n)}" |
|
1525 |
by (rule finite_abs_int_segment) |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
1526 |
show "(*) 2 ` {k::real. k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2^(2*n)} \<union> (\<lambda>x. 2*x + 1) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2^(2*n)} \<subseteq> {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2 * Suc n)}" |
67998 | 1527 |
apply auto |
1528 |
using one_le_power [of "2::real" "2*n"] by linarith |
|
1529 |
have *: "\<lbrakk>x \<in> (S \<union> T) - U; \<And>x. x \<in> S \<Longrightarrow> x \<in> U; \<And>x. x \<in> T \<Longrightarrow> x \<in> U\<rbrakk> \<Longrightarrow> P x" for S T U P |
|
1530 |
by blast |
|
1531 |
have "0 \<le> b" if "b \<in> \<int>" "f x * (2 * 2^n) < b + 1" for b |
|
1532 |
proof - |
|
1533 |
have "0 \<le> f x * (2 * 2^n)" |
|
1534 |
by (simp add: f) |
|
1535 |
also have "\<dots> < b+1" |
|
1536 |
by (simp add: that) |
|
1537 |
finally show "0 \<le> b" |
|
1538 |
using \<open>b \<in> \<int>\<close> by (auto simp: elim!: Ints_cases) |
|
1539 |
qed |
|
1540 |
then show "0 \<le> b/2 ^ Suc n * indicator {y. b/2 ^ Suc n \<le> f y \<and> f y < (b + 1)/2 ^ Suc n} x" |
|
1541 |
if "b \<in> {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2 * Suc n)} - |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
1542 |
((*) 2 ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)} \<union> (\<lambda>x. 2*x + 1) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)})" for b |
67998 | 1543 |
using that by (simp add: indicator_def divide_simps) |
1544 |
qed |
|
1545 |
finally show "?a + sum ?h {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)} \<le> ?b" . |
|
1546 |
qed |
|
1547 |
qed |
|
1548 |
finally show ?thesis . |
|
1549 |
qed |
|
1550 |
show "?g n \<in> borel_measurable lebesgue" for n |
|
1551 |
apply (intro borel_measurable_indicator borel_measurable_times borel_measurable_sum) |
|
1552 |
using leb_f sets_restrict_UNIV by auto |
|
1553 |
show "finite (range (?g n))" for n |
|
1554 |
proof - |
|
1555 |
have "(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * ?\<Omega> n k x) |
|
1556 |
\<in> (\<lambda>k. k/2^n) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)}" for x |
|
1557 |
proof (cases "\<exists>k. k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n) \<and> k/2^n \<le> f x \<and> f x < (k+1)/2^n") |
|
1558 |
case True |
|
1559 |
then show ?thesis |
|
1560 |
by (blast intro: indicator_sum_eq) |
|
1561 |
next |
|
1562 |
case False |
|
1563 |
then have "(\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * ?\<Omega> n k x) = 0" |
|
1564 |
by auto |
|
1565 |
then show ?thesis by force |
|
1566 |
qed |
|
1567 |
then have "range (?g n) \<subseteq> ((\<lambda>k. (k/2^n)) ` {k. k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n)})" |
|
1568 |
by auto |
|
1569 |
moreover have "finite ((\<lambda>k::real. (k/2^n)) ` {k \<in> \<int>. \<bar>k\<bar> \<le> 2 ^ (2*n)})" |
|
1570 |
by (intro finite_imageI finite_abs_int_segment) |
|
1571 |
ultimately show ?thesis |
|
1572 |
by (rule finite_subset) |
|
1573 |
qed |
|
1574 |
show "(\<lambda>n. ?g n x) \<longlonglongrightarrow> f x" for x |
|
1575 |
proof (clarsimp simp add: lim_sequentially) |
|
1576 |
fix e::real |
|
1577 |
assume "e > 0" |
|
1578 |
obtain N1 where N1: "2 ^ N1 > abs(f x)" |
|
1579 |
using real_arch_pow by fastforce |
|
1580 |
obtain N2 where N2: "(1/2) ^ N2 < e" |
|
1581 |
using real_arch_pow_inv \<open>e > 0\<close> by fastforce |
|
1582 |
have "dist (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * ?\<Omega> n k x) (f x) < e" if "N1 + N2 \<le> n" for n |
|
1583 |
proof - |
|
1584 |
let ?m = "real_of_int \<lfloor>2^n * f x\<rfloor>" |
|
1585 |
have "\<bar>?m\<bar> \<le> 2^n * 2^N1" |
|
1586 |
using N1 apply (simp add: f) |
|
1587 |
by (meson floor_mono le_floor_iff less_le_not_le mult_le_cancel_left_pos zero_less_numeral zero_less_power) |
|
1588 |
also have "\<dots> \<le> 2 ^ (2*n)" |
|
1589 |
by (metis that add_leD1 add_le_cancel_left mult.commute mult_2_right one_less_numeral_iff |
|
1590 |
power_add power_increasing_iff semiring_norm(76)) |
|
1591 |
finally have m_le: "\<bar>?m\<bar> \<le> 2 ^ (2*n)" . |
|
1592 |
have "?m/2^n \<le> f x" "f x < (?m + 1)/2^n" |
|
1593 |
by (auto simp: mult.commute pos_divide_le_eq mult_imp_less_div_pos) |
|
1594 |
then have eq: "dist (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k/2^n * ?\<Omega> n k x) (f x) |
|
1595 |
= dist (?m/2^n) (f x)" |
|
1596 |
by (subst indicator_sum_eq [of ?m]) (auto simp: m_le) |
|
1597 |
have "\<bar>2^n\<bar> * \<bar>?m/2^n - f x\<bar> = \<bar>2^n * (?m/2^n - f x)\<bar>" |
|
1598 |
by (simp add: abs_mult) |
|
1599 |
also have "\<dots> < 2 ^ N2 * e" |
|
1600 |
using N2 by (simp add: divide_simps mult.commute) linarith |
|
1601 |
also have "\<dots> \<le> \<bar>2^n\<bar> * e" |
|
1602 |
using that \<open>e > 0\<close> by auto |
|
1603 |
finally have "dist (?m/2^n) (f x) < e" |
|
1604 |
by (simp add: dist_norm) |
|
1605 |
then show ?thesis |
|
1606 |
using eq by linarith |
|
1607 |
qed |
|
1608 |
then show "\<exists>no. \<forall>n\<ge>no. dist (\<Sum>k | k \<in> \<int> \<and> \<bar>k\<bar> \<le> 2 ^ (2*n). k * ?\<Omega> n k x/2^n) (f x) < e" |
|
1609 |
by force |
|
1610 |
qed |
|
1611 |
qed |
|
1612 |
ultimately show ?rhs |
|
1613 |
by metis |
|
1614 |
next |
|
1615 |
assume RHS: ?rhs |
|
1616 |
with borel_measurable_simple_function_limit [of f UNIV, unfolded borel_measurable_UNIV_eq] |
|
1617 |
show ?lhs |
|
1618 |
by (blast intro: order_trans) |
|
1619 |
qed |
|
1620 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
1621 |
subsection%important\<open>Borel measurable Jacobian determinant\<close> |
67998 | 1622 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1623 |
lemma lemma_partial_derivatives0: |
67998 | 1624 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
1625 |
assumes "linear f" and lim0: "((\<lambda>x. f x /\<^sub>R norm x) \<longlongrightarrow> 0) (at 0 within S)" |
|
1626 |
and lb: "\<And>v. v \<noteq> 0 \<Longrightarrow> (\<exists>k>0. \<forall>e>0. \<exists>x. x \<in> S - {0} \<and> norm x < e \<and> k * norm x \<le> \<bar>v \<bullet> x\<bar>)" |
|
1627 |
shows "f x = 0" |
|
1628 |
proof - |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1629 |
interpret linear f by fact |
67998 | 1630 |
have "dim {x. f x = 0} \<le> DIM('a)" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1631 |
by (rule dim_subset_UNIV) |
67998 | 1632 |
moreover have False if less: "dim {x. f x = 0} < DIM('a)" |
1633 |
proof - |
|
1634 |
obtain d where "d \<noteq> 0" and d: "\<And>y. f y = 0 \<Longrightarrow> d \<bullet> y = 0" |
|
1635 |
using orthogonal_to_subspace_exists [OF less] orthogonal_def |
|
68074 | 1636 |
by (metis (mono_tags, lifting) mem_Collect_eq span_base) |
67998 | 1637 |
then obtain k where "k > 0" |
1638 |
and k: "\<And>e. e > 0 \<Longrightarrow> \<exists>y. y \<in> S - {0} \<and> norm y < e \<and> k * norm y \<le> \<bar>d \<bullet> y\<bar>" |
|
1639 |
using lb by blast |
|
1640 |
have "\<exists>h. \<forall>n. ((h n \<in> S \<and> h n \<noteq> 0 \<and> k * norm (h n) \<le> \<bar>d \<bullet> h n\<bar>) \<and> norm (h n) < 1 / real (Suc n)) \<and> |
|
1641 |
norm (h (Suc n)) < norm (h n)" |
|
1642 |
proof (rule dependent_nat_choice) |
|
1643 |
show "\<exists>y. (y \<in> S \<and> y \<noteq> 0 \<and> k * norm y \<le> \<bar>d \<bullet> y\<bar>) \<and> norm y < 1 / real (Suc 0)" |
|
1644 |
by simp (metis DiffE insertCI k not_less not_one_le_zero) |
|
1645 |
qed (use k [of "min (norm x) (1/(Suc n + 1))" for x n] in auto) |
|
1646 |
then obtain \<alpha> where \<alpha>: "\<And>n. \<alpha> n \<in> S - {0}" and kd: "\<And>n. k * norm(\<alpha> n) \<le> \<bar>d \<bullet> \<alpha> n\<bar>" |
|
1647 |
and norm_lt: "\<And>n. norm(\<alpha> n) < 1/(Suc n)" |
|
1648 |
by force |
|
1649 |
let ?\<beta> = "\<lambda>n. \<alpha> n /\<^sub>R norm (\<alpha> n)" |
|
1650 |
have com: "\<And>g. (\<forall>n. g n \<in> sphere (0::'a) 1) |
|
1651 |
\<Longrightarrow> \<exists>l \<in> sphere 0 1. \<exists>\<rho>::nat\<Rightarrow>nat. strict_mono \<rho> \<and> (g \<circ> \<rho>) \<longlonglongrightarrow> l" |
|
1652 |
using compact_sphere compact_def by metis |
|
1653 |
moreover have "\<forall>n. ?\<beta> n \<in> sphere 0 1" |
|
1654 |
using \<alpha> by auto |
|
1655 |
ultimately obtain l::'a and \<rho>::"nat\<Rightarrow>nat" |
|
1656 |
where l: "l \<in> sphere 0 1" and "strict_mono \<rho>" and to_l: "(?\<beta> \<circ> \<rho>) \<longlonglongrightarrow> l" |
|
1657 |
by meson |
|
1658 |
moreover have "continuous (at l) (\<lambda>x. (\<bar>d \<bullet> x\<bar> - k))" |
|
1659 |
by (intro continuous_intros) |
|
1660 |
ultimately have lim_dl: "((\<lambda>x. (\<bar>d \<bullet> x\<bar> - k)) \<circ> (?\<beta> \<circ> \<rho>)) \<longlonglongrightarrow> (\<bar>d \<bullet> l\<bar> - k)" |
|
1661 |
by (meson continuous_imp_tendsto) |
|
1662 |
have "\<forall>\<^sub>F i in sequentially. 0 \<le> ((\<lambda>x. \<bar>d \<bullet> x\<bar> - k) \<circ> ((\<lambda>n. \<alpha> n /\<^sub>R norm (\<alpha> n)) \<circ> \<rho>)) i" |
|
1663 |
using \<alpha> kd by (auto simp: divide_simps) |
|
1664 |
then have "k \<le> \<bar>d \<bullet> l\<bar>" |
|
1665 |
using tendsto_lowerbound [OF lim_dl, of 0] by auto |
|
1666 |
moreover have "d \<bullet> l = 0" |
|
1667 |
proof (rule d) |
|
1668 |
show "f l = 0" |
|
1669 |
proof (rule LIMSEQ_unique [of "f \<circ> ?\<beta> \<circ> \<rho>"]) |
|
1670 |
have "isCont f l" |
|
1671 |
using \<open>linear f\<close> linear_continuous_at linear_conv_bounded_linear by blast |
|
1672 |
then show "(f \<circ> (\<lambda>n. \<alpha> n /\<^sub>R norm (\<alpha> n)) \<circ> \<rho>) \<longlonglongrightarrow> f l" |
|
1673 |
unfolding comp_assoc |
|
1674 |
using to_l continuous_imp_tendsto by blast |
|
1675 |
have "\<alpha> \<longlonglongrightarrow> 0" |
|
1676 |
using norm_lt LIMSEQ_norm_0 by metis |
|
1677 |
with \<open>strict_mono \<rho>\<close> have "(\<alpha> \<circ> \<rho>) \<longlonglongrightarrow> 0" |
|
1678 |
by (metis LIMSEQ_subseq_LIMSEQ) |
|
1679 |
with lim0 \<alpha> have "((\<lambda>x. f x /\<^sub>R norm x) \<circ> (\<alpha> \<circ> \<rho>)) \<longlonglongrightarrow> 0" |
|
1680 |
by (force simp: tendsto_at_iff_sequentially) |
|
1681 |
then show "(f \<circ> (\<lambda>n. \<alpha> n /\<^sub>R norm (\<alpha> n)) \<circ> \<rho>) \<longlonglongrightarrow> 0" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1682 |
by (simp add: o_def scale) |
67998 | 1683 |
qed |
1684 |
qed |
|
1685 |
ultimately show False |
|
1686 |
using \<open>k > 0\<close> by auto |
|
1687 |
qed |
|
1688 |
ultimately have dim: "dim {x. f x = 0} = DIM('a)" |
|
1689 |
by force |
|
1690 |
then show ?thesis |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1691 |
using dim_eq_full |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1692 |
by (metis (mono_tags, lifting) eq_0_on_span eucl.span_Basis linear_axioms linear_eq_stdbasis |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1693 |
mem_Collect_eq module_hom_zero span_base span_raw_def) |
67998 | 1694 |
qed |
1695 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1696 |
lemma lemma_partial_derivatives: |
67998 | 1697 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
1698 |
assumes "linear f" and lim: "((\<lambda>x. f (x - a) /\<^sub>R norm (x - a)) \<longlongrightarrow> 0) (at a within S)" |
|
1699 |
and lb: "\<And>v. v \<noteq> 0 \<Longrightarrow> (\<exists>k>0. \<forall>e>0. \<exists>x \<in> S - {a}. norm(a - x) < e \<and> k * norm(a - x) \<le> \<bar>v \<bullet> (x - a)\<bar>)" |
|
1700 |
shows "f x = 0" |
|
1701 |
proof - |
|
1702 |
have "((\<lambda>x. f x /\<^sub>R norm x) \<longlongrightarrow> 0) (at 0 within (\<lambda>x. x-a) ` S)" |
|
1703 |
using lim by (simp add: Lim_within dist_norm) |
|
1704 |
then show ?thesis |
|
1705 |
proof (rule lemma_partial_derivatives0 [OF \<open>linear f\<close>]) |
|
1706 |
fix v :: "'a" |
|
1707 |
assume v: "v \<noteq> 0" |
|
1708 |
show "\<exists>k>0. \<forall>e>0. \<exists>x. x \<in> (\<lambda>x. x - a) ` S - {0} \<and> norm x < e \<and> k * norm x \<le> \<bar>v \<bullet> x\<bar>" |
|
1709 |
using lb [OF v] by (force simp: norm_minus_commute) |
|
1710 |
qed |
|
1711 |
qed |
|
1712 |
||
1713 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1714 |
proposition borel_measurable_partial_derivatives: |
67998 | 1715 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" |
1716 |
assumes S: "S \<in> sets lebesgue" |
|
1717 |
and f: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
1718 |
shows "(\<lambda>x. (matrix(f' x)$m$n)) \<in> borel_measurable (lebesgue_on S)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
1719 |
proof - |
67998 | 1720 |
have contf: "continuous_on S f" |
1721 |
using continuous_on_eq_continuous_within f has_derivative_continuous by blast |
|
1722 |
have "{x \<in> S. (matrix (f' x)$m$n) \<le> b} \<in> sets lebesgue" for b |
|
1723 |
proof (rule sets_negligible_symdiff) |
|
1724 |
let ?T = "{x \<in> S. \<forall>e>0. \<exists>d>0. \<exists>A. A$m$n < b \<and> (\<forall>i j. A$i$j \<in> \<rat>) \<and> |
|
1725 |
(\<forall>y \<in> S. norm(y - x) < d \<longrightarrow> norm(f y - f x - A *v (y - x)) \<le> e * norm(y - x))}" |
|
1726 |
let ?U = "S \<inter> |
|
1727 |
(\<Inter>e \<in> {e \<in> \<rat>. e > 0}. |
|
1728 |
\<Union>A \<in> {A. A$m$n < b \<and> (\<forall>i j. A$i$j \<in> \<rat>)}. |
|
1729 |
\<Union>d \<in> {d \<in> \<rat>. 0 < d}. |
|
1730 |
S \<inter> (\<Inter>y \<in> S. {x \<in> S. norm(y - x) < d \<longrightarrow> norm(f y - f x - A *v (y - x)) \<le> e * norm(y - x)}))" |
|
1731 |
have "?T = ?U" |
|
1732 |
proof (intro set_eqI iffI) |
|
1733 |
fix x |
|
1734 |
assume xT: "x \<in> ?T" |
|
1735 |
then show "x \<in> ?U" |
|
1736 |
proof (clarsimp simp add:) |
|
1737 |
fix q :: real |
|
1738 |
assume "q \<in> \<rat>" "q > 0" |
|
1739 |
then obtain d A where "d > 0" and A: "A $ m $ n < b" "\<And>i j. A $ i $ j \<in> \<rat>" |
|
1740 |
"\<And>y. \<lbrakk>y\<in>S; norm (y - x) < d\<rbrakk> \<Longrightarrow> norm (f y - f x - A *v (y - x)) \<le> q * norm (y - x)" |
|
1741 |
using xT by auto |
|
1742 |
then obtain \<delta> where "d > \<delta>" "\<delta> > 0" "\<delta> \<in> \<rat>" |
|
1743 |
using Rats_dense_in_real by blast |
|
1744 |
with A show "\<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and> |
|
1745 |
(\<exists>s. s \<in> \<rat> \<and> 0 < s \<and> (\<forall>y\<in>S. norm (y - x) < s \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> q * norm (y - x)))" |
|
1746 |
by force |
|
1747 |
qed |
|
1748 |
next |
|
1749 |
fix x |
|
1750 |
assume xU: "x \<in> ?U" |
|
1751 |
then show "x \<in> ?T" |
|
1752 |
proof clarsimp |
|
1753 |
fix e :: "real" |
|
1754 |
assume "e > 0" |
|
1755 |
then obtain \<epsilon> where \<epsilon>: "e > \<epsilon>" "\<epsilon> > 0" "\<epsilon> \<in> \<rat>" |
|
1756 |
using Rats_dense_in_real by blast |
|
1757 |
with xU obtain A r where "x \<in> S" and Ar: "A $ m $ n < b" "\<forall>i j. A $ i $ j \<in> \<rat>" "r \<in> \<rat>" "r > 0" |
|
1758 |
and "\<forall>y\<in>S. norm (y - x) < r \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> \<epsilon> * norm (y - x)" |
|
1759 |
by (auto simp: split: if_split_asm) |
|
1760 |
then have "\<forall>y\<in>S. norm (y - x) < r \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x)" |
|
1761 |
by (meson \<open>e > \<epsilon>\<close> less_eq_real_def mult_right_mono norm_ge_zero order_trans) |
|
1762 |
then show "\<exists>d>0. \<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and> (\<forall>y\<in>S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x))" |
|
1763 |
using \<open>x \<in> S\<close> Ar by blast |
|
1764 |
qed |
|
1765 |
qed |
|
1766 |
moreover have "?U \<in> sets lebesgue" |
|
1767 |
proof - |
|
1768 |
have coQ: "countable {e \<in> \<rat>. 0 < e}" |
|
1769 |
using countable_Collect countable_rat by blast |
|
1770 |
have ne: "{e \<in> \<rat>. (0::real) < e} \<noteq> {}" |
|
1771 |
using zero_less_one Rats_1 by blast |
|
1772 |
have coA: "countable {A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>)}" |
|
1773 |
proof (rule countable_subset) |
|
1774 |
show "countable {A. \<forall>i j. A $ i $ j \<in> \<rat>}" |
|
1775 |
using countable_vector [OF countable_vector, of "\<lambda>i j. \<rat>"] by (simp add: countable_rat) |
|
1776 |
qed blast |
|
1777 |
have *: "\<lbrakk>U \<noteq> {} \<Longrightarrow> closedin (subtopology euclidean S) (S \<inter> \<Inter> U)\<rbrakk> |
|
1778 |
\<Longrightarrow> closedin (subtopology euclidean S) (S \<inter> \<Inter> U)" for U |
|
1779 |
by fastforce |
|
1780 |
have eq: "{x::(real,'m)vec. P x \<and> (Q x \<longrightarrow> R x)} = {x. P x \<and> \<not> Q x} \<union> {x. P x \<and> R x}" for P Q R |
|
1781 |
by auto |
|
1782 |
have sets: "S \<inter> (\<Inter>y\<in>S. {x \<in> S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x)}) |
|
1783 |
\<in> sets lebesgue" for e A d |
|
1784 |
proof - |
|
1785 |
have clo: "closedin (subtopology euclidean S) |
|
1786 |
{x \<in> S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x)}" |
|
1787 |
for y |
|
1788 |
proof - |
|
1789 |
have cont1: "continuous_on S (\<lambda>x. norm (y - x))" |
|
1790 |
and cont2: "continuous_on S (\<lambda>x. e * norm (y - x) - norm (f y - f x - (A *v y - A *v x)))" |
|
1791 |
by (force intro: contf continuous_intros)+ |
|
1792 |
have clo1: "closedin (subtopology euclidean S) {x \<in> S. d \<le> norm (y - x)}" |
|
1793 |
using continuous_closedin_preimage [OF cont1, of "{d..}"] by (simp add: vimage_def Int_def) |
|
1794 |
have clo2: "closedin (subtopology euclidean S) |
|
1795 |
{x \<in> S. norm (f y - f x - (A *v y - A *v x)) \<le> e * norm (y - x)}" |
|
1796 |
using continuous_closedin_preimage [OF cont2, of "{0..}"] by (simp add: vimage_def Int_def) |
|
1797 |
show ?thesis |
|
1798 |
by (auto simp: eq not_less matrix_vector_mult_diff_distrib intro: clo1 clo2) |
|
1799 |
qed |
|
1800 |
show ?thesis |
|
1801 |
by (rule lebesgue_closedin [of S]) (force intro: * S clo)+ |
|
1802 |
qed |
|
1803 |
show ?thesis |
|
1804 |
by (intro sets sets.Int S sets.countable_UN'' sets.countable_INT'' coQ coA) auto |
|
1805 |
qed |
|
1806 |
ultimately show "?T \<in> sets lebesgue" |
|
1807 |
by simp |
|
1808 |
let ?M = "(?T - {x \<in> S. matrix (f' x) $ m $ n \<le> b} \<union> ({x \<in> S. matrix (f' x) $ m $ n \<le> b} - ?T))" |
|
1809 |
let ?\<Theta> = "\<lambda>x v. \<forall>\<xi>>0. \<exists>e>0. \<forall>y \<in> S-{x}. norm (x - y) < e \<longrightarrow> \<bar>v \<bullet> (y - x)\<bar> < \<xi> * norm (x - y)" |
|
1810 |
have nN: "negligible {x \<in> S. \<exists>v\<noteq>0. ?\<Theta> x v}" |
|
1811 |
unfolding negligible_eq_zero_density |
|
1812 |
proof clarsimp |
|
1813 |
fix x v and r e :: "real" |
|
1814 |
assume "x \<in> S" "v \<noteq> 0" "r > 0" "e > 0" |
|
1815 |
and Theta [rule_format]: "?\<Theta> x v" |
|
1816 |
moreover have "(norm v * e / 2) / CARD('m) ^ CARD('m) > 0" |
|
1817 |
by (simp add: \<open>v \<noteq> 0\<close> \<open>e > 0\<close>) |
|
1818 |
ultimately obtain d where "d > 0" |
|
1819 |
and dless: "\<And>y. \<lbrakk>y \<in> S - {x}; norm (x - y) < d\<rbrakk> \<Longrightarrow> |
|
1820 |
\<bar>v \<bullet> (y - x)\<bar> < ((norm v * e / 2) / CARD('m) ^ CARD('m)) * norm (x - y)" |
|
1821 |
by metis |
|
1822 |
let ?W = "ball x (min d r) \<inter> {y. \<bar>v \<bullet> (y - x)\<bar> < (norm v * e/2 * min d r) / CARD('m) ^ CARD('m)}" |
|
1823 |
have "open {x. \<bar>v \<bullet> (x - a)\<bar> < b}" for a b |
|
1824 |
by (intro open_Collect_less continuous_intros) |
|
1825 |
show "\<exists>d>0. d \<le> r \<and> |
|
1826 |
(\<exists>U. {x' \<in> S. \<exists>v\<noteq>0. ?\<Theta> x' v} \<inter> ball x d \<subseteq> U \<and> |
|
1827 |
U \<in> lmeasurable \<and> measure lebesgue U < e * content (ball x d))" |
|
1828 |
proof (intro exI conjI) |
|
1829 |
show "0 < min d r" "min d r \<le> r" |
|
1830 |
using \<open>r > 0\<close> \<open>d > 0\<close> by auto |
|
1831 |
show "{x' \<in> S. \<exists>v. v \<noteq> 0 \<and> (\<forall>\<xi>>0. \<exists>e>0. \<forall>z\<in>S - {x'}. norm (x' - z) < e \<longrightarrow> \<bar>v \<bullet> (z - x')\<bar> < \<xi> * norm (x' - z))} \<inter> ball x (min d r) \<subseteq> ?W" |
|
1832 |
proof (clarsimp simp: dist_norm norm_minus_commute) |
|
68001
0a2a1b6507c1
correction of TeX errors and other oversights
paulson <lp15@cam.ac.uk>
parents:
67999
diff
changeset
|
1833 |
fix y w |
67998 | 1834 |
assume "y \<in> S" "w \<noteq> 0" |
1835 |
and less [rule_format]: |
|
1836 |
"\<forall>\<xi>>0. \<exists>e>0. \<forall>z\<in>S - {y}. norm (y - z) < e \<longrightarrow> \<bar>w \<bullet> (z - y)\<bar> < \<xi> * norm (y - z)" |
|
1837 |
and d: "norm (y - x) < d" and r: "norm (y - x) < r" |
|
1838 |
show "\<bar>v \<bullet> (y - x)\<bar> < norm v * e * min d r / (2 * real CARD('m) ^ CARD('m))" |
|
1839 |
proof (cases "y = x") |
|
1840 |
case True |
|
1841 |
with \<open>r > 0\<close> \<open>d > 0\<close> \<open>e > 0\<close> \<open>v \<noteq> 0\<close> show ?thesis |
|
1842 |
by simp |
|
1843 |
next |
|
1844 |
case False |
|
1845 |
have "\<bar>v \<bullet> (y - x)\<bar> < norm v * e / 2 / real (CARD('m) ^ CARD('m)) * norm (x - y)" |
|
1846 |
apply (rule dless) |
|
1847 |
using False \<open>y \<in> S\<close> d by (auto simp: norm_minus_commute) |
|
1848 |
also have "\<dots> \<le> norm v * e * min d r / (2 * real CARD('m) ^ CARD('m))" |
|
1849 |
using d r \<open>e > 0\<close> by (simp add: field_simps norm_minus_commute mult_left_mono) |
|
1850 |
finally show ?thesis . |
|
1851 |
qed |
|
1852 |
qed |
|
1853 |
show "?W \<in> lmeasurable" |
|
1854 |
by (simp add: fmeasurable_Int_fmeasurable borel_open) |
|
1855 |
obtain k::'m where True |
|
1856 |
by metis |
|
1857 |
obtain T where T: "orthogonal_transformation T" and v: "v = T(norm v *\<^sub>R axis k (1::real))" |
|
1858 |
using rotation_rightward_line by metis |
|
1859 |
define b where "b \<equiv> norm v" |
|
1860 |
have "b > 0" |
|
1861 |
using \<open>v \<noteq> 0\<close> by (auto simp: b_def) |
|
1862 |
obtain eqb: "inv T v = b *\<^sub>R axis k (1::real)" and "inj T" "bij T" and invT: "orthogonal_transformation (inv T)" |
|
1863 |
by (metis UNIV_I b_def T v bij_betw_inv_into_left orthogonal_transformation_inj orthogonal_transformation_bij orthogonal_transformation_inv) |
|
1864 |
let ?v = "\<chi> i. min d r / CARD('m)" |
|
1865 |
let ?v' = "\<chi> i. if i = k then (e/2 * min d r) / CARD('m) ^ CARD('m) else min d r" |
|
1866 |
let ?x' = "inv T x" |
|
1867 |
let ?W' = "(ball ?x' (min d r) \<inter> {y. \<bar>(y - ?x')$k\<bar> < e * min d r / (2 * CARD('m) ^ CARD('m))})" |
|
1868 |
have abs: "x - e \<le> y \<and> y \<le> x + e \<longleftrightarrow> abs(y - x) \<le> e" for x y e::real |
|
1869 |
by auto |
|
1870 |
have "?W = T ` ?W'" |
|
1871 |
proof - |
|
1872 |
have 1: "T ` (ball (inv T x) (min d r)) = ball x (min d r)" |
|
1873 |
by (simp add: T image_orthogonal_transformation_ball orthogonal_transformation_surj surj_f_inv_f) |
|
1874 |
have 2: "{y. \<bar>v \<bullet> (y - x)\<bar> < b * e * min d r / (2 * real CARD('m) ^ CARD('m))} = |
|
1875 |
T ` {y. \<bar>y $ k - ?x' $ k\<bar> < e * min d r / (2 * real CARD('m) ^ CARD('m))}" |
|
1876 |
proof - |
|
1877 |
have *: "\<bar>T (b *\<^sub>R axis k 1) \<bullet> (y - x)\<bar> = b * \<bar>inv T y $ k - ?x' $ k\<bar>" for y |
|
1878 |
proof - |
|
1879 |
have "\<bar>T (b *\<^sub>R axis k 1) \<bullet> (y - x)\<bar> = \<bar>(b *\<^sub>R axis k 1) \<bullet> inv T (y - x)\<bar>" |
|
1880 |
by (metis (no_types, hide_lams) b_def eqb invT orthogonal_transformation_def v) |
|
1881 |
also have "\<dots> = b * \<bar>(axis k 1) \<bullet> inv T (y - x)\<bar>" |
|
1882 |
using \<open>b > 0\<close> by (simp add: abs_mult) |
|
1883 |
also have "\<dots> = b * \<bar>inv T y $ k - ?x' $ k\<bar>" |
|
1884 |
using orthogonal_transformation_linear [OF invT] |
|
1885 |
by (simp add: inner_axis' linear_diff) |
|
1886 |
finally show ?thesis |
|
1887 |
by simp |
|
1888 |
qed |
|
1889 |
show ?thesis |
|
1890 |
using v b_def [symmetric] |
|
1891 |
using \<open>b > 0\<close> by (simp add: * bij_image_Collect_eq [OF \<open>bij T\<close>] mult_less_cancel_left_pos times_divide_eq_right [symmetric] del: times_divide_eq_right) |
|
1892 |
qed |
|
1893 |
show ?thesis |
|
1894 |
using \<open>b > 0\<close> by (simp add: image_Int \<open>inj T\<close> 1 2 b_def [symmetric]) |
|
1895 |
qed |
|
1896 |
moreover have "?W' \<in> lmeasurable" |
|
1897 |
by (auto intro: fmeasurable_Int_fmeasurable) |
|
1898 |
ultimately have "measure lebesgue ?W = measure lebesgue ?W'" |
|
1899 |
by (metis measure_orthogonal_image T) |
|
1900 |
also have "\<dots> \<le> measure lebesgue (cbox (?x' - ?v') (?x' + ?v'))" |
|
1901 |
proof (rule measure_mono_fmeasurable) |
|
1902 |
show "?W' \<subseteq> cbox (?x' - ?v') (?x' + ?v')" |
|
1903 |
apply (clarsimp simp add: mem_box_cart abs dist_norm norm_minus_commute simp del: min_less_iff_conj min.bounded_iff) |
|
1904 |
by (metis component_le_norm_cart less_eq_real_def le_less_trans vector_minus_component) |
|
1905 |
qed auto |
|
1906 |
also have "\<dots> \<le> e/2 * measure lebesgue (cbox (?x' - ?v) (?x' + ?v))" |
|
1907 |
proof - |
|
1908 |
have "cbox (?x' - ?v) (?x' + ?v) \<noteq> {}" |
|
1909 |
using \<open>r > 0\<close> \<open>d > 0\<close> by (auto simp: interval_eq_empty_cart divide_less_0_iff) |
|
1910 |
with \<open>r > 0\<close> \<open>d > 0\<close> \<open>e > 0\<close> show ?thesis |
|
1911 |
apply (simp add: content_cbox_if_cart mem_box_cart) |
|
1912 |
apply (auto simp: prod_nonneg) |
|
1913 |
apply (simp add: abs if_distrib prod.delta_remove prod_constant field_simps power_diff split: if_split_asm) |
|
1914 |
done |
|
1915 |
qed |
|
1916 |
also have "\<dots> \<le> e/2 * measure lebesgue (cball ?x' (min d r))" |
|
1917 |
proof (rule mult_left_mono [OF measure_mono_fmeasurable]) |
|
1918 |
have *: "norm (?x' - y) \<le> min d r" |
|
1919 |
if y: "\<And>i. \<bar>?x' $ i - y $ i\<bar> \<le> min d r / real CARD('m)" for y |
|
1920 |
proof - |
|
1921 |
have "norm (?x' - y) \<le> (\<Sum>i\<in>UNIV. \<bar>(?x' - y) $ i\<bar>)" |
|
1922 |
by (rule norm_le_l1_cart) |
|
1923 |
also have "\<dots> \<le> real CARD('m) * (min d r / real CARD('m))" |
|
1924 |
by (rule sum_bounded_above) (use y in auto) |
|
1925 |
finally show ?thesis |
|
1926 |
by simp |
|
1927 |
qed |
|
1928 |
show "cbox (?x' - ?v) (?x' + ?v) \<subseteq> cball ?x' (min d r)" |
|
1929 |
apply (clarsimp simp only: mem_box_cart dist_norm mem_cball intro!: *) |
|
1930 |
by (simp add: abs_diff_le_iff abs_minus_commute) |
|
1931 |
qed (use \<open>e > 0\<close> in auto) |
|
1932 |
also have "\<dots> < e * content (cball ?x' (min d r))" |
|
1933 |
using \<open>r > 0\<close> \<open>d > 0\<close> \<open>e > 0\<close> by auto |
|
1934 |
also have "\<dots> = e * content (ball x (min d r))" |
|
1935 |
using \<open>r > 0\<close> \<open>d > 0\<close> by (simp add: content_cball content_ball) |
|
1936 |
finally show "measure lebesgue ?W < e * content (ball x (min d r))" . |
|
1937 |
qed |
|
1938 |
qed |
|
1939 |
have *: "(\<And>x. (x \<notin> S) \<Longrightarrow> (x \<in> T \<longleftrightarrow> x \<in> U)) \<Longrightarrow> (T - U) \<union> (U - T) \<subseteq> S" for S T U :: "(real,'m) vec set" |
|
1940 |
by blast |
|
1941 |
have MN: "?M \<subseteq> {x \<in> S. \<exists>v\<noteq>0. ?\<Theta> x v}" |
|
1942 |
proof (rule *) |
|
1943 |
fix x |
|
1944 |
assume x: "x \<notin> {x \<in> S. \<exists>v\<noteq>0. ?\<Theta> x v}" |
|
1945 |
show "(x \<in> ?T) \<longleftrightarrow> (x \<in> {x \<in> S. matrix (f' x) $ m $ n \<le> b})" |
|
1946 |
proof (cases "x \<in> S") |
|
1947 |
case True |
|
1948 |
then have x: "\<not> ?\<Theta> x v" if "v \<noteq> 0" for v |
|
1949 |
using x that by force |
|
1950 |
show ?thesis |
|
1951 |
proof (rule iffI; clarsimp) |
|
1952 |
assume b: "\<forall>e>0. \<exists>d>0. \<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and> |
|
1953 |
(\<forall>y\<in>S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x))" |
|
1954 |
(is "\<forall>e>0. \<exists>d>0. \<exists>A. ?\<Phi> e d A") |
|
1955 |
then have "\<forall>k. \<exists>d>0. \<exists>A. ?\<Phi> (1 / Suc k) d A" |
|
1956 |
by (metis (no_types, hide_lams) less_Suc_eq_0_disj of_nat_0_less_iff zero_less_divide_1_iff) |
|
1957 |
then obtain \<delta> A where \<delta>: "\<And>k. \<delta> k > 0" |
|
1958 |
and Ab: "\<And>k. A k $ m $ n < b" |
|
1959 |
and A: "\<And>k y. \<lbrakk>y \<in> S; norm (y - x) < \<delta> k\<rbrakk> \<Longrightarrow> |
|
1960 |
norm (f y - f x - A k *v (y - x)) \<le> 1/(Suc k) * norm (y - x)" |
|
1961 |
by metis |
|
1962 |
have "\<forall>i j. \<exists>a. (\<lambda>n. A n $ i $ j) \<longlonglongrightarrow> a" |
|
1963 |
proof (intro allI) |
|
1964 |
fix i j |
|
1965 |
have vax: "(A n *v axis j 1) $ i = A n $ i $ j" for n |
|
1966 |
by (metis cart_eq_inner_axis matrix_vector_mul_component) |
|
1967 |
let ?CA = "{x. Cauchy (\<lambda>n. (A n) *v x)}" |
|
1968 |
have "subspace ?CA" |
|
1969 |
unfolding subspace_def convergent_eq_Cauchy [symmetric] |
|
1970 |
by (force simp: algebra_simps intro: tendsto_intros) |
|
1971 |
then have CA_eq: "?CA = span ?CA" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1972 |
by (metis span_eq_iff) |
67998 | 1973 |
also have "\<dots> = UNIV" |
1974 |
proof - |
|
1975 |
have "dim ?CA \<le> CARD('m)" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1976 |
using dim_subset_UNIV[of ?CA] |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
1977 |
by auto |
67998 | 1978 |
moreover have "False" if less: "dim ?CA < CARD('m)" |
1979 |
proof - |
|
1980 |
obtain d where "d \<noteq> 0" and d: "\<And>y. y \<in> span ?CA \<Longrightarrow> orthogonal d y" |
|
1981 |
using less by (force intro: orthogonal_to_subspace_exists [of ?CA]) |
|
1982 |
with x [OF \<open>d \<noteq> 0\<close>] obtain \<xi> where "\<xi> > 0" |
|
1983 |
and \<xi>: "\<And>e. e > 0 \<Longrightarrow> \<exists>y \<in> S - {x}. norm (x - y) < e \<and> \<xi> * norm (x - y) \<le> \<bar>d \<bullet> (y - x)\<bar>" |
|
1984 |
by (fastforce simp: not_le Bex_def) |
|
1985 |
obtain \<gamma> z where \<gamma>Sx: "\<And>i. \<gamma> i \<in> S - {x}" |
|
1986 |
and \<gamma>le: "\<And>i. \<xi> * norm(\<gamma> i - x) \<le> \<bar>d \<bullet> (\<gamma> i - x)\<bar>" |
|
1987 |
and \<gamma>x: "\<gamma> \<longlonglongrightarrow> x" |
|
1988 |
and z: "(\<lambda>n. (\<gamma> n - x) /\<^sub>R norm (\<gamma> n - x)) \<longlonglongrightarrow> z" |
|
1989 |
proof - |
|
1990 |
have "\<exists>\<gamma>. (\<forall>i. (\<gamma> i \<in> S - {x} \<and> |
|
1991 |
\<xi> * norm(\<gamma> i - x) \<le> \<bar>d \<bullet> (\<gamma> i - x)\<bar> \<and> norm(\<gamma> i - x) < 1/Suc i) \<and> |
|
1992 |
norm(\<gamma>(Suc i) - x) < norm(\<gamma> i - x))" |
|
1993 |
proof (rule dependent_nat_choice) |
|
1994 |
show "\<exists>y. y \<in> S - {x} \<and> \<xi> * norm (y - x) \<le> \<bar>d \<bullet> (y - x)\<bar> \<and> norm (y - x) < 1 / Suc 0" |
|
1995 |
using \<xi> [of 1] by (auto simp: dist_norm norm_minus_commute) |
|
1996 |
next |
|
1997 |
fix y i |
|
1998 |
assume "y \<in> S - {x} \<and> \<xi> * norm (y - x) \<le> \<bar>d \<bullet> (y - x)\<bar> \<and> norm (y - x) < 1/Suc i" |
|
1999 |
then have "min (norm(y - x)) (1/((Suc i) + 1)) > 0" |
|
2000 |
by auto |
|
2001 |
then obtain y' where "y' \<in> S - {x}" and y': "norm (x - y') < min (norm (y - x)) (1/((Suc i) + 1))" |
|
2002 |
"\<xi> * norm (x - y') \<le> \<bar>d \<bullet> (y' - x)\<bar>" |
|
2003 |
using \<xi> by metis |
|
2004 |
with \<xi> show "\<exists>y'. (y' \<in> S - {x} \<and> \<xi> * norm (y' - x) \<le> \<bar>d \<bullet> (y' - x)\<bar> \<and> |
|
2005 |
norm (y' - x) < 1/(Suc (Suc i))) \<and> norm (y' - x) < norm (y - x)" |
|
2006 |
by (auto simp: dist_norm norm_minus_commute) |
|
2007 |
qed |
|
2008 |
then obtain \<gamma> where |
|
2009 |
\<gamma>Sx: "\<And>i. \<gamma> i \<in> S - {x}" |
|
2010 |
and \<gamma>le: "\<And>i. \<xi> * norm(\<gamma> i - x) \<le> \<bar>d \<bullet> (\<gamma> i - x)\<bar>" |
|
2011 |
and \<gamma>conv: "\<And>i. norm(\<gamma> i - x) < 1/(Suc i)" |
|
2012 |
by blast |
|
2013 |
let ?f = "\<lambda>i. (\<gamma> i - x) /\<^sub>R norm (\<gamma> i - x)" |
|
2014 |
have "?f i \<in> sphere 0 1" for i |
|
2015 |
using \<gamma>Sx by auto |
|
2016 |
then obtain l \<rho> where "l \<in> sphere 0 1" "strict_mono \<rho>" and l: "(?f \<circ> \<rho>) \<longlonglongrightarrow> l" |
|
2017 |
using compact_sphere [of "0::(real,'m) vec" 1] unfolding compact_def by meson |
|
2018 |
show thesis |
|
2019 |
proof |
|
2020 |
show "(\<gamma> \<circ> \<rho>) i \<in> S - {x}" "\<xi> * norm ((\<gamma> \<circ> \<rho>) i - x) \<le> \<bar>d \<bullet> ((\<gamma> \<circ> \<rho>) i - x)\<bar>" for i |
|
2021 |
using \<gamma>Sx \<gamma>le by auto |
|
2022 |
have "\<gamma> \<longlonglongrightarrow> x" |
|
2023 |
proof (clarsimp simp add: LIMSEQ_def dist_norm) |
|
2024 |
fix r :: "real" |
|
2025 |
assume "r > 0" |
|
2026 |
with real_arch_invD obtain no where "no \<noteq> 0" "real no > 1/r" |
|
2027 |
by (metis divide_less_0_1_iff not_less_iff_gr_or_eq of_nat_0_eq_iff reals_Archimedean2) |
|
2028 |
with \<gamma>conv show "\<exists>no. \<forall>n\<ge>no. norm (\<gamma> n - x) < r" |
|
2029 |
by (metis \<open>r > 0\<close> add.commute divide_inverse inverse_inverse_eq inverse_less_imp_less less_trans mult.left_neutral nat_le_real_less of_nat_Suc) |
|
2030 |
qed |
|
2031 |
with \<open>strict_mono \<rho>\<close> show "(\<gamma> \<circ> \<rho>) \<longlonglongrightarrow> x" |
|
2032 |
by (metis LIMSEQ_subseq_LIMSEQ) |
|
2033 |
show "(\<lambda>n. ((\<gamma> \<circ> \<rho>) n - x) /\<^sub>R norm ((\<gamma> \<circ> \<rho>) n - x)) \<longlonglongrightarrow> l" |
|
2034 |
using l by (auto simp: o_def) |
|
2035 |
qed |
|
2036 |
qed |
|
2037 |
have "isCont (\<lambda>x. (\<bar>d \<bullet> x\<bar> - \<xi>)) z" |
|
2038 |
by (intro continuous_intros) |
|
2039 |
from isCont_tendsto_compose [OF this z] |
|
2040 |
have lim: "(\<lambda>y. \<bar>d \<bullet> ((\<gamma> y - x) /\<^sub>R norm (\<gamma> y - x))\<bar> - \<xi>) \<longlonglongrightarrow> \<bar>d \<bullet> z\<bar> - \<xi>" |
|
2041 |
by auto |
|
2042 |
moreover have "\<forall>\<^sub>F i in sequentially. 0 \<le> \<bar>d \<bullet> ((\<gamma> i - x) /\<^sub>R norm (\<gamma> i - x))\<bar> - \<xi>" |
|
2043 |
proof (rule eventuallyI) |
|
2044 |
fix n |
|
2045 |
show "0 \<le> \<bar>d \<bullet> ((\<gamma> n - x) /\<^sub>R norm (\<gamma> n - x))\<bar> - \<xi>" |
|
2046 |
using \<gamma>le [of n] \<gamma>Sx by (auto simp: abs_mult divide_simps) |
|
2047 |
qed |
|
2048 |
ultimately have "\<xi> \<le> \<bar>d \<bullet> z\<bar>" |
|
2049 |
using tendsto_lowerbound [where a=0] by fastforce |
|
2050 |
have "Cauchy (\<lambda>n. (A n) *v z)" |
|
2051 |
proof (clarsimp simp add: Cauchy_def) |
|
2052 |
fix \<epsilon> :: "real" |
|
2053 |
assume "0 < \<epsilon>" |
|
2054 |
then obtain N::nat where "N > 0" and N: "\<epsilon>/2 > 1/N" |
|
2055 |
by (metis half_gt_zero inverse_eq_divide neq0_conv real_arch_inverse) |
|
2056 |
show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (A m *v z) (A n *v z) < \<epsilon>" |
|
2057 |
proof (intro exI allI impI) |
|
2058 |
fix i j |
|
2059 |
assume ij: "N \<le> i" "N \<le> j" |
|
2060 |
let ?V = "\<lambda>i k. A i *v ((\<gamma> k - x) /\<^sub>R norm (\<gamma> k - x))" |
|
2061 |
have "\<forall>\<^sub>F k in sequentially. dist (\<gamma> k) x < min (\<delta> i) (\<delta> j)" |
|
2062 |
using \<gamma>x [unfolded tendsto_iff] by (meson min_less_iff_conj \<delta>) |
|
2063 |
then have even: "\<forall>\<^sub>F k in sequentially. norm (?V i k - ?V j k) - 2 / N \<le> 0" |
|
2064 |
proof (rule eventually_mono, clarsimp) |
|
2065 |
fix p |
|
2066 |
assume p: "dist (\<gamma> p) x < \<delta> i" "dist (\<gamma> p) x < \<delta> j" |
|
2067 |
let ?C = "\<lambda>k. f (\<gamma> p) - f x - A k *v (\<gamma> p - x)" |
|
2068 |
have "norm ((A i - A j) *v (\<gamma> p - x)) = norm (?C j - ?C i)" |
|
2069 |
by (simp add: algebra_simps) |
|
2070 |
also have "\<dots> \<le> norm (?C j) + norm (?C i)" |
|
2071 |
using norm_triangle_ineq4 by blast |
|
2072 |
also have "\<dots> \<le> 1/(Suc j) * norm (\<gamma> p - x) + 1/(Suc i) * norm (\<gamma> p - x)" |
|
2073 |
by (metis A Diff_iff \<gamma>Sx dist_norm p add_mono) |
|
2074 |
also have "\<dots> \<le> 1/N * norm (\<gamma> p - x) + 1/N * norm (\<gamma> p - x)" |
|
2075 |
apply (intro add_mono mult_right_mono) |
|
2076 |
using ij \<open>N > 0\<close> by (auto simp: field_simps) |
|
2077 |
also have "\<dots> = 2 / N * norm (\<gamma> p - x)" |
|
2078 |
by simp |
|
2079 |
finally have no_le: "norm ((A i - A j) *v (\<gamma> p - x)) \<le> 2 / N * norm (\<gamma> p - x)" . |
|
2080 |
have "norm (?V i p - ?V j p) = |
|
2081 |
norm ((A i - A j) *v ((\<gamma> p - x) /\<^sub>R norm (\<gamma> p - x)))" |
|
2082 |
by (simp add: algebra_simps) |
|
2083 |
also have "\<dots> = norm ((A i - A j) *v (\<gamma> p - x)) / norm (\<gamma> p - x)" |
|
2084 |
by (simp add: divide_inverse matrix_vector_mult_scaleR) |
|
2085 |
also have "\<dots> \<le> 2 / N" |
|
2086 |
using no_le by (auto simp: divide_simps) |
|
2087 |
finally show "norm (?V i p - ?V j p) \<le> 2 / N" . |
|
2088 |
qed |
|
2089 |
have "isCont (\<lambda>w. (norm(A i *v w - A j *v w) - 2 / N)) z" |
|
2090 |
by (intro continuous_intros) |
|
2091 |
from isCont_tendsto_compose [OF this z] |
|
2092 |
have lim: "(\<lambda>w. norm (A i *v ((\<gamma> w - x) /\<^sub>R norm (\<gamma> w - x)) - |
|
2093 |
A j *v ((\<gamma> w - x) /\<^sub>R norm (\<gamma> w - x))) - 2 / N) |
|
2094 |
\<longlonglongrightarrow> norm (A i *v z - A j *v z) - 2 / N" |
|
2095 |
by auto |
|
2096 |
have "dist (A i *v z) (A j *v z) \<le> 2 / N" |
|
2097 |
using tendsto_upperbound [OF lim even] by (auto simp: dist_norm) |
|
2098 |
with N show "dist (A i *v z) (A j *v z) < \<epsilon>" |
|
2099 |
by linarith |
|
2100 |
qed |
|
2101 |
qed |
|
2102 |
then have "d \<bullet> z = 0" |
|
2103 |
using CA_eq d orthogonal_def by auto |
|
2104 |
then show False |
|
2105 |
using \<open>0 < \<xi>\<close> \<open>\<xi> \<le> \<bar>d \<bullet> z\<bar>\<close> by auto |
|
2106 |
qed |
|
2107 |
ultimately show ?thesis |
|
2108 |
using dim_eq_full by fastforce |
|
2109 |
qed |
|
2110 |
finally have "?CA = UNIV" . |
|
2111 |
then have "Cauchy (\<lambda>n. (A n) *v axis j 1)" |
|
2112 |
by auto |
|
2113 |
then obtain L where "(\<lambda>n. A n *v axis j 1) \<longlonglongrightarrow> L" |
|
2114 |
by (auto simp: Cauchy_convergent_iff convergent_def) |
|
2115 |
then have "(\<lambda>x. (A x *v axis j 1) $ i) \<longlonglongrightarrow> L $ i" |
|
2116 |
by (rule tendsto_vec_nth) |
|
2117 |
then show "\<exists>a. (\<lambda>n. A n $ i $ j) \<longlonglongrightarrow> a" |
|
2118 |
by (force simp: vax) |
|
2119 |
qed |
|
2120 |
then obtain B where B: "\<And>i j. (\<lambda>n. A n $ i $ j) \<longlonglongrightarrow> B $ i $ j" |
|
2121 |
by (auto simp: lambda_skolem) |
|
2122 |
have lin_df: "linear (f' x)" |
|
2123 |
and lim_df: "((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' x (y - x)))) \<longlongrightarrow> 0) (at x within S)" |
|
2124 |
using \<open>x \<in> S\<close> assms by (auto simp: has_derivative_within linear_linear) |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2125 |
moreover |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2126 |
interpret linear "f' x" by fact |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2127 |
have "(matrix (f' x) - B) *v w = 0" for w |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2128 |
proof (rule lemma_partial_derivatives [of "(*v) (matrix (f' x) - B)"]) |
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2129 |
show "linear ((*v) (matrix (f' x) - B))" |
67998 | 2130 |
by (rule matrix_vector_mul_linear) |
2131 |
have "((\<lambda>y. ((f x + f' x (y - x)) - f y) /\<^sub>R norm (y - x)) \<longlongrightarrow> 0) (at x within S)" |
|
2132 |
using tendsto_minus [OF lim_df] by (simp add: algebra_simps divide_simps) |
|
2133 |
then show "((\<lambda>y. (matrix (f' x) - B) *v (y - x) /\<^sub>R norm (y - x)) \<longlongrightarrow> 0) (at x within S)" |
|
2134 |
proof (rule Lim_transform) |
|
2135 |
have "((\<lambda>y. ((f y + B *v x - (f x + B *v y)) /\<^sub>R norm (y - x))) \<longlongrightarrow> 0) (at x within S)" |
|
2136 |
proof (clarsimp simp add: Lim_within dist_norm) |
|
2137 |
fix e :: "real" |
|
2138 |
assume "e > 0" |
|
2139 |
then obtain q::nat where "q \<noteq> 0" and qe2: "1/q < e/2" |
|
2140 |
by (metis divide_pos_pos inverse_eq_divide real_arch_inverse zero_less_numeral) |
|
2141 |
let ?g = "\<lambda>p. sum (\<lambda>i. sum (\<lambda>j. abs((A p - B)$i$j)) UNIV) UNIV" |
|
2142 |
have "(\<lambda>k. onorm (\<lambda>y. (A k - B) *v y)) \<longlonglongrightarrow> 0" |
|
2143 |
proof (rule Lim_null_comparison) |
|
2144 |
show "\<forall>\<^sub>F k in sequentially. norm (onorm (\<lambda>y. (A k - B) *v y)) \<le> ?g k" |
|
2145 |
proof (rule eventually_sequentiallyI) |
|
2146 |
fix k :: "nat" |
|
2147 |
assume "0 \<le> k" |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2148 |
have "0 \<le> onorm ((*v) (A k - B))" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2149 |
using matrix_vector_mul_bounded_linear |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2150 |
by (rule onorm_pos_le) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2151 |
then show "norm (onorm ((*v) (A k - B))) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>(A k - B) $ i $ j\<bar>)" |
67998 | 2152 |
by (simp add: onorm_le_matrix_component_sum del: vector_minus_component) |
2153 |
qed |
|
2154 |
next |
|
2155 |
show "?g \<longlonglongrightarrow> 0" |
|
2156 |
using B Lim_null tendsto_rabs_zero_iff by (fastforce intro!: tendsto_null_sum) |
|
2157 |
qed |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2158 |
with \<open>e > 0\<close> obtain p where "\<And>n. n \<ge> p \<Longrightarrow> \<bar>onorm ((*v) (A n - B))\<bar> < e/2" |
67998 | 2159 |
unfolding lim_sequentially by (metis diff_zero dist_real_def divide_pos_pos zero_less_numeral) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2160 |
then have pqe2: "\<bar>onorm ((*v) (A (p + q) - B))\<bar> < e/2" (*17 [`abs (onorm (\y. A (p + q) ** y - B ** y)) < e / &2`]*) |
67998 | 2161 |
using le_add1 by blast |
2162 |
show "\<exists>d>0. \<forall>y\<in>S. y \<noteq> x \<and> norm (y - x) < d \<longrightarrow> |
|
2163 |
inverse (norm (y - x)) * norm (f y + B *v x - (f x + B *v y)) < e" |
|
2164 |
proof (intro exI, safe) |
|
2165 |
show "0 < \<delta>(p + q)" |
|
2166 |
by (simp add: \<delta>) |
|
2167 |
next |
|
2168 |
fix y |
|
2169 |
assume y: "y \<in> S" "norm (y - x) < \<delta>(p + q)" and "y \<noteq> x" |
|
2170 |
have *: "\<lbrakk>norm(b - c) < e - d; norm(y - x - b) \<le> d\<rbrakk> \<Longrightarrow> norm(y - x - c) < e" |
|
2171 |
for b c d e x and y:: "real^'n" |
|
2172 |
using norm_triangle_ineq2 [of "y - x - c" "y - x - b"] by simp |
|
2173 |
have "norm (f y - f x - B *v (y - x)) < e * norm (y - x)" |
|
2174 |
proof (rule *) |
|
2175 |
show "norm (f y - f x - A (p + q) *v (y - x)) \<le> norm (y - x) / (Suc (p + q))" |
|
2176 |
using A [OF y] by simp |
|
2177 |
have "norm (A (p + q) *v (y - x) - B *v (y - x)) \<le> onorm(\<lambda>x. (A(p + q) - B) *v x) * norm(y - x)" |
|
2178 |
by (metis linear_linear matrix_vector_mul_linear matrix_vector_mult_diff_rdistrib onorm) |
|
2179 |
also have "\<dots> < (e/2) * norm (y - x)" |
|
2180 |
using \<open>y \<noteq> x\<close> pqe2 by auto |
|
2181 |
also have "\<dots> \<le> (e - 1 / (Suc (p + q))) * norm (y - x)" |
|
2182 |
proof (rule mult_right_mono) |
|
2183 |
have "1 / Suc (p + q) \<le> 1 / q" |
|
2184 |
using \<open>q \<noteq> 0\<close> by (auto simp: divide_simps) |
|
2185 |
also have "\<dots> < e/2" |
|
2186 |
using qe2 by auto |
|
2187 |
finally show "e / 2 \<le> e - 1 / real (Suc (p + q))" |
|
2188 |
by linarith |
|
2189 |
qed auto |
|
2190 |
finally show "norm (A (p + q) *v (y - x) - B *v (y - x)) < e * norm (y - x) - norm (y - x) / real (Suc (p + q))" |
|
2191 |
by (simp add: algebra_simps) |
|
2192 |
qed |
|
2193 |
then show "inverse (norm (y - x)) * norm (f y + B *v x - (f x + B *v y)) < e" |
|
2194 |
using \<open>y \<noteq> x\<close> by (simp add: divide_simps algebra_simps) |
|
2195 |
qed |
|
2196 |
qed |
|
2197 |
then show "((\<lambda>y. (matrix (f' x) - B) *v (y - x) /\<^sub>R |
|
2198 |
norm (y - x) - (f x + f' x (y - x) - f y) /\<^sub>R norm (y - x)) \<longlongrightarrow> 0) |
|
2199 |
(at x within S)" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2200 |
by (simp add: algebra_simps diff lin_df matrix_vector_mul_linear scalar_mult_eq_scaleR) |
67998 | 2201 |
qed |
2202 |
qed (use x in \<open>simp; auto simp: not_less\<close>) |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2203 |
ultimately have "f' x = (*v) B" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2204 |
by (force simp: algebra_simps scalar_mult_eq_scaleR) |
67998 | 2205 |
show "matrix (f' x) $ m $ n \<le> b" |
2206 |
proof (rule tendsto_upperbound [of "\<lambda>i. (A i $ m $ n)" _ sequentially]) |
|
2207 |
show "(\<lambda>i. A i $ m $ n) \<longlonglongrightarrow> matrix (f' x) $ m $ n" |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2208 |
by (simp add: B \<open>f' x = (*v) B\<close>) |
67998 | 2209 |
show "\<forall>\<^sub>F i in sequentially. A i $ m $ n \<le> b" |
2210 |
by (simp add: Ab less_eq_real_def) |
|
2211 |
qed auto |
|
2212 |
next |
|
2213 |
fix e :: "real" |
|
2214 |
assume "x \<in> S" and b: "matrix (f' x) $ m $ n \<le> b" and "e > 0" |
|
2215 |
then obtain d where "d>0" |
|
2216 |
and d: "\<And>y. y\<in>S \<Longrightarrow> 0 < dist y x \<and> dist y x < d \<longrightarrow> norm (f y - f x - f' x (y - x)) / (norm (y - x)) |
|
2217 |
< e/2" |
|
2218 |
using f [OF \<open>x \<in> S\<close>] unfolding Deriv.has_derivative_at_within Lim_within |
|
2219 |
by (auto simp: field_simps dest: spec [of _ "e/2"]) |
|
2220 |
let ?A = "matrix(f' x) - (\<chi> i j. if i = m \<and> j = n then e / 4 else 0)" |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2221 |
obtain B where BRats: "\<And>i j. B$i$j \<in> \<rat>" and Bo_e6: "onorm((*v) (?A - B)) < e/6" |
67998 | 2222 |
using matrix_rational_approximation \<open>e > 0\<close> |
2223 |
by (metis zero_less_divide_iff zero_less_numeral) |
|
2224 |
show "\<exists>d>0. \<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and> |
|
2225 |
(\<forall>y\<in>S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x))" |
|
2226 |
proof (intro exI conjI ballI allI impI) |
|
2227 |
show "d>0" |
|
2228 |
by (rule \<open>d>0\<close>) |
|
2229 |
show "B $ m $ n < b" |
|
2230 |
proof - |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
2231 |
have "\<bar>matrix ((*v) (?A - B)) $ m $ n\<bar> \<le> onorm ((*v) (?A - B))" |
67998 | 2232 |
using component_le_onorm [OF matrix_vector_mul_linear, of _ m n] by metis |
2233 |
then show ?thesis |
|
2234 |
using b Bo_e6 by simp |
|
2235 |
qed |
|
2236 |
show "B $ i $ j \<in> \<rat>" for i j |
|
2237 |
using BRats by auto |
|
2238 |
show "norm (f y - f x - B *v (y - x)) \<le> e * norm (y - x)" |
|
2239 |
if "y \<in> S" and y: "norm (y - x) < d" for y |
|
2240 |
proof (cases "y = x") |
|
2241 |
case True then show ?thesis |
|
2242 |
by simp |
|
2243 |
next |
|
2244 |
case False |
|
2245 |
have *: "norm(d' - d) \<le> e/2 \<Longrightarrow> norm(y - (x + d')) < e/2 \<Longrightarrow> norm(y - x - d) \<le> e" for d d' e and x y::"real^'n" |
|
2246 |
using norm_triangle_le [of "d' - d" "y - (x + d')"] by simp |
|
2247 |
show ?thesis |
|
2248 |
proof (rule *) |
|
2249 |
have split246: "\<lbrakk>norm y \<le> e / 6; norm(x - y) \<le> e / 4\<rbrakk> \<Longrightarrow> norm x \<le> e/2" if "e > 0" for e and x y :: "real^'n" |
|
2250 |
using norm_triangle_le [of y "x-y" "e/2"] \<open>e > 0\<close> by simp |
|
2251 |
have "linear (f' x)" |
|
2252 |
using True f has_derivative_linear by blast |
|
2253 |
then have "norm (f' x (y - x) - B *v (y - x)) = norm ((matrix (f' x) - B) *v (y - x))" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2254 |
by (simp add: matrix_vector_mult_diff_rdistrib) |
67998 | 2255 |
also have "\<dots> \<le> (e * norm (y - x)) / 2" |
2256 |
proof (rule split246) |
|
2257 |
have "norm ((?A - B) *v (y - x)) / norm (y - x) \<le> onorm(\<lambda>x. (?A - B) *v x)" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2258 |
by (rule le_onorm) auto |
67998 | 2259 |
also have "\<dots> < e/6" |
2260 |
by (rule Bo_e6) |
|
2261 |
finally have "norm ((?A - B) *v (y - x)) / norm (y - x) < e / 6" . |
|
2262 |
then show "norm ((?A - B) *v (y - x)) \<le> e * norm (y - x) / 6" |
|
2263 |
by (simp add: divide_simps False) |
|
2264 |
have "norm ((matrix (f' x) - B) *v (y - x) - ((?A - B) *v (y - x))) = norm ((\<chi> i j. if i = m \<and> j = n then e / 4 else 0) *v (y - x))" |
|
2265 |
by (simp add: algebra_simps) |
|
2266 |
also have "\<dots> = norm((e/4) *\<^sub>R (y - x)$n *\<^sub>R axis m (1::real))" |
|
2267 |
proof - |
|
2268 |
have "(\<Sum>j\<in>UNIV. (if i = m \<and> j = n then e / 4 else 0) * (y $ j - x $ j)) * 4 = e * (y $ n - x $ n) * axis m 1 $ i" for i |
|
2269 |
proof (cases "i=m") |
|
2270 |
case True then show ?thesis |
|
2271 |
by (auto simp: if_distrib [of "\<lambda>z. z * _"] cong: if_cong) |
|
2272 |
next |
|
2273 |
case False then show ?thesis |
|
2274 |
by (simp add: axis_def) |
|
2275 |
qed |
|
2276 |
then have "(\<chi> i j. if i = m \<and> j = n then e / 4 else 0) *v (y - x) = (e/4) *\<^sub>R (y - x)$n *\<^sub>R axis m (1::real)" |
|
2277 |
by (auto simp: vec_eq_iff matrix_vector_mult_def) |
|
2278 |
then show ?thesis |
|
2279 |
by metis |
|
2280 |
qed |
|
2281 |
also have "\<dots> \<le> e * norm (y - x) / 4" |
|
2282 |
using \<open>e > 0\<close> apply (simp add: norm_mult abs_mult) |
|
2283 |
by (metis component_le_norm_cart vector_minus_component) |
|
2284 |
finally show "norm ((matrix (f' x) - B) *v (y - x) - ((?A - B) *v (y - x))) \<le> e * norm (y - x) / 4" . |
|
2285 |
show "0 < e * norm (y - x)" |
|
2286 |
by (simp add: False \<open>e > 0\<close>) |
|
2287 |
qed |
|
2288 |
finally show "norm (f' x (y - x) - B *v (y - x)) \<le> (e * norm (y - x)) / 2" . |
|
2289 |
show "norm (f y - (f x + f' x (y - x))) < (e * norm (y - x)) / 2" |
|
2290 |
using False d [OF \<open>y \<in> S\<close>] y by (simp add: dist_norm field_simps) |
|
2291 |
qed |
|
2292 |
qed |
|
2293 |
qed |
|
2294 |
qed |
|
2295 |
qed auto |
|
2296 |
qed |
|
2297 |
show "negligible ?M" |
|
2298 |
using negligible_subset [OF nN MN] . |
|
2299 |
qed |
|
2300 |
then show ?thesis |
|
2301 |
by (simp add: borel_measurable_vimage_halfspace_component_le sets_restrict_space_iff assms) |
|
2302 |
qed |
|
2303 |
||
2304 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2305 |
theorem borel_measurable_det_Jacobian: |
67998 | 2306 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
2307 |
assumes S: "S \<in> sets lebesgue" and f: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
2308 |
shows "(\<lambda>x. det(matrix(f' x))) \<in> borel_measurable (lebesgue_on S)" |
|
2309 |
unfolding det_def |
|
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
2310 |
by%unimportant (intro measurable) (auto intro: f borel_measurable_partial_derivatives [OF S]) |
67998 | 2311 |
|
68001
0a2a1b6507c1
correction of TeX errors and other oversights
paulson <lp15@cam.ac.uk>
parents:
67999
diff
changeset
|
2312 |
text\<open>The localisation wrt S uses the same argument for many similar results.\<close> |
0a2a1b6507c1
correction of TeX errors and other oversights
paulson <lp15@cam.ac.uk>
parents:
67999
diff
changeset
|
2313 |
(*See HOL Light's MEASURABLE_ON_LEBESGUE_MEASURABLE_PREIMAGE_BOREL, etc.*) |
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
2314 |
lemma%important borel_measurable_lebesgue_on_preimage_borel: |
67998 | 2315 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
2316 |
assumes "S \<in> sets lebesgue" |
|
2317 |
shows "f \<in> borel_measurable (lebesgue_on S) \<longleftrightarrow> |
|
2318 |
(\<forall>T. T \<in> sets borel \<longrightarrow> {x \<in> S. f x \<in> T} \<in> sets lebesgue)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2319 |
proof - |
67998 | 2320 |
have "{x. (if x \<in> S then f x else 0) \<in> T} \<in> sets lebesgue \<longleftrightarrow> {x \<in> S. f x \<in> T} \<in> sets lebesgue" |
2321 |
if "T \<in> sets borel" for T |
|
2322 |
proof (cases "0 \<in> T") |
|
2323 |
case True |
|
2324 |
then have "{x \<in> S. f x \<in> T} = {x. (if x \<in> S then f x else 0) \<in> T} \<inter> S" |
|
2325 |
"{x. (if x \<in> S then f x else 0) \<in> T} = {x \<in> S. f x \<in> T} \<union> -S" |
|
2326 |
by auto |
|
2327 |
then show ?thesis |
|
2328 |
by (metis (no_types, lifting) Compl_in_sets_lebesgue assms sets.Int sets.Un) |
|
2329 |
next |
|
2330 |
case False |
|
2331 |
then have "{x. (if x \<in> S then f x else 0) \<in> T} = {x \<in> S. f x \<in> T}" |
|
2332 |
by auto |
|
2333 |
then show ?thesis |
|
2334 |
by auto |
|
2335 |
qed |
|
2336 |
then show ?thesis |
|
2337 |
unfolding borel_measurable_lebesgue_preimage_borel borel_measurable_UNIV [OF assms, symmetric] |
|
2338 |
by blast |
|
2339 |
qed |
|
2340 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2341 |
lemma sets_lebesgue_almost_borel: |
67998 | 2342 |
assumes "S \<in> sets lebesgue" |
2343 |
obtains B N where "B \<in> sets borel" "negligible N" "B \<union> N = S" |
|
2344 |
proof - |
|
2345 |
obtain T N N' where "S = T \<union> N" "N \<subseteq> N'" "N' \<in> null_sets lborel" "T \<in> sets borel" |
|
2346 |
using sets_completionE [OF assms] by auto |
|
2347 |
then show thesis |
|
2348 |
by (metis negligible_iff_null_sets negligible_subset null_sets_completionI that) |
|
2349 |
qed |
|
2350 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2351 |
lemma double_lebesgue_sets: |
67998 | 2352 |
assumes S: "S \<in> sets lebesgue" and T: "T \<in> sets lebesgue" and fim: "f ` S \<subseteq> T" |
2353 |
shows "(\<forall>U. U \<in> sets lebesgue \<and> U \<subseteq> T \<longrightarrow> {x \<in> S. f x \<in> U} \<in> sets lebesgue) \<longleftrightarrow> |
|
2354 |
f \<in> borel_measurable (lebesgue_on S) \<and> |
|
2355 |
(\<forall>U. negligible U \<and> U \<subseteq> T \<longrightarrow> {x \<in> S. f x \<in> U} \<in> sets lebesgue)" |
|
2356 |
(is "?lhs \<longleftrightarrow> _ \<and> ?rhs") |
|
2357 |
unfolding borel_measurable_lebesgue_on_preimage_borel [OF S] |
|
2358 |
proof (intro iffI allI conjI impI, safe) |
|
2359 |
fix V :: "'b set" |
|
2360 |
assume *: "\<forall>U. U \<in> sets lebesgue \<and> U \<subseteq> T \<longrightarrow> {x \<in> S. f x \<in> U} \<in> sets lebesgue" |
|
2361 |
and "V \<in> sets borel" |
|
2362 |
then have V: "V \<in> sets lebesgue" |
|
2363 |
by simp |
|
2364 |
have "{x \<in> S. f x \<in> V} = {x \<in> S. f x \<in> T \<inter> V}" |
|
2365 |
using fim by blast |
|
2366 |
also have "{x \<in> S. f x \<in> T \<inter> V} \<in> sets lebesgue" |
|
2367 |
using T V * le_inf_iff by blast |
|
2368 |
finally show "{x \<in> S. f x \<in> V} \<in> sets lebesgue" . |
|
2369 |
next |
|
2370 |
fix U :: "'b set" |
|
2371 |
assume "\<forall>U. U \<in> sets lebesgue \<and> U \<subseteq> T \<longrightarrow> {x \<in> S. f x \<in> U} \<in> sets lebesgue" |
|
2372 |
"negligible U" "U \<subseteq> T" |
|
2373 |
then show "{x \<in> S. f x \<in> U} \<in> sets lebesgue" |
|
2374 |
using negligible_imp_sets by blast |
|
2375 |
next |
|
2376 |
fix U :: "'b set" |
|
2377 |
assume 1 [rule_format]: "(\<forall>T. T \<in> sets borel \<longrightarrow> {x \<in> S. f x \<in> T} \<in> sets lebesgue)" |
|
2378 |
and 2 [rule_format]: "\<forall>U. negligible U \<and> U \<subseteq> T \<longrightarrow> {x \<in> S. f x \<in> U} \<in> sets lebesgue" |
|
2379 |
and "U \<in> sets lebesgue" "U \<subseteq> T" |
|
2380 |
then obtain C N where C: "C \<in> sets borel \<and> negligible N \<and> C \<union> N = U" |
|
2381 |
using sets_lebesgue_almost_borel |
|
2382 |
by metis |
|
2383 |
then have "{x \<in> S. f x \<in> C} \<in> sets lebesgue" |
|
2384 |
by (blast intro: 1) |
|
2385 |
moreover have "{x \<in> S. f x \<in> N} \<in> sets lebesgue" |
|
2386 |
using C \<open>U \<subseteq> T\<close> by (blast intro: 2) |
|
2387 |
moreover have "{x \<in> S. f x \<in> C \<union> N} = {x \<in> S. f x \<in> C} \<union> {x \<in> S. f x \<in> N}" |
|
2388 |
by auto |
|
2389 |
ultimately show "{x \<in> S. f x \<in> U} \<in> sets lebesgue" |
|
2390 |
using C by auto |
|
2391 |
qed |
|
2392 |
||
2393 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
2394 |
subsection%important\<open>Simplest case of Sard's theorem (we don't need continuity of derivative)\<close> |
67998 | 2395 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2396 |
lemma Sard_lemma00: |
67998 | 2397 |
fixes P :: "'b::euclidean_space set" |
2398 |
assumes "a \<ge> 0" and a: "a *\<^sub>R i \<noteq> 0" and i: "i \<in> Basis" |
|
2399 |
and P: "P \<subseteq> {x. a *\<^sub>R i \<bullet> x = 0}" |
|
2400 |
and "0 \<le> m" "0 \<le> e" |
|
2401 |
obtains S where "S \<in> lmeasurable" |
|
2402 |
and "{z. norm z \<le> m \<and> (\<exists>t \<in> P. norm(z - t) \<le> e)} \<subseteq> S" |
|
2403 |
and "measure lebesgue S \<le> (2 * e) * (2 * m) ^ (DIM('b) - 1)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2404 |
proof - |
67998 | 2405 |
have "a > 0" |
2406 |
using assms by simp |
|
2407 |
let ?v = "(\<Sum>j\<in>Basis. (if j = i then e else m) *\<^sub>R j)" |
|
2408 |
show thesis |
|
2409 |
proof |
|
2410 |
have "- e \<le> x \<bullet> i" "x \<bullet> i \<le> e" |
|
2411 |
if "t \<in> P" "norm (x - t) \<le> e" for x t |
|
2412 |
using \<open>a > 0\<close> that Basis_le_norm [of i "x-t"] P i |
|
2413 |
by (auto simp: inner_commute algebra_simps) |
|
2414 |
moreover have "- m \<le> x \<bullet> j" "x \<bullet> j \<le> m" |
|
2415 |
if "norm x \<le> m" "t \<in> P" "norm (x - t) \<le> e" "j \<in> Basis" and "j \<noteq> i" |
|
2416 |
for x t j |
|
2417 |
using that Basis_le_norm [of j x] by auto |
|
2418 |
ultimately |
|
2419 |
show "{z. norm z \<le> m \<and> (\<exists>t\<in>P. norm (z - t) \<le> e)} \<subseteq> cbox (-?v) ?v" |
|
2420 |
by (auto simp: mem_box) |
|
2421 |
have *: "\<forall>k\<in>Basis. - ?v \<bullet> k \<le> ?v \<bullet> k" |
|
2422 |
using \<open>0 \<le> m\<close> \<open>0 \<le> e\<close> by (auto simp: inner_Basis) |
|
2423 |
have 2: "2 ^ DIM('b) = 2 * 2 ^ (DIM('b) - Suc 0)" |
|
2424 |
by (metis DIM_positive Suc_pred power_Suc) |
|
2425 |
show "measure lebesgue (cbox (-?v) ?v) \<le> 2 * e * (2 * m) ^ (DIM('b) - 1)" |
|
2426 |
using \<open>i \<in> Basis\<close> |
|
2427 |
by (simp add: content_cbox [OF *] prod.distrib prod.If_cases Diff_eq [symmetric] 2) |
|
2428 |
qed blast |
|
2429 |
qed |
|
2430 |
||
68001
0a2a1b6507c1
correction of TeX errors and other oversights
paulson <lp15@cam.ac.uk>
parents:
67999
diff
changeset
|
2431 |
text\<open>As above, but reorienting the vector (HOL Light's @text{GEOM\_BASIS\_MULTIPLE\_TAC})\<close> |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2432 |
lemma Sard_lemma0: |
67998 | 2433 |
fixes P :: "(real^'n::{finite,wellorder}) set" |
2434 |
assumes "a \<noteq> 0" |
|
2435 |
and P: "P \<subseteq> {x. a \<bullet> x = 0}" and "0 \<le> m" "0 \<le> e" |
|
2436 |
obtains S where "S \<in> lmeasurable" |
|
2437 |
and "{z. norm z \<le> m \<and> (\<exists>t \<in> P. norm(z - t) \<le> e)} \<subseteq> S" |
|
2438 |
and "measure lebesgue S \<le> (2 * e) * (2 * m) ^ (CARD('n) - 1)" |
|
2439 |
proof - |
|
2440 |
obtain T and k::'n where T: "orthogonal_transformation T" and a: "a = T (norm a *\<^sub>R axis k (1::real))" |
|
2441 |
using rotation_rightward_line by metis |
|
2442 |
have Tinv [simp]: "T (inv T x) = x" for x |
|
2443 |
by (simp add: T orthogonal_transformation_surj surj_f_inv_f) |
|
2444 |
obtain S where S: "S \<in> lmeasurable" |
|
2445 |
and subS: "{z. norm z \<le> m \<and> (\<exists>t \<in> T-`P. norm(z - t) \<le> e)} \<subseteq> S" |
|
2446 |
and mS: "measure lebesgue S \<le> (2 * e) * (2 * m) ^ (CARD('n) - 1)" |
|
2447 |
proof (rule Sard_lemma00 [of "norm a" "axis k (1::real)" "T-`P" m e]) |
|
2448 |
have "norm a *\<^sub>R axis k 1 \<bullet> x = 0" if "T x \<in> P" for x |
|
2449 |
proof - |
|
2450 |
have "a \<bullet> T x = 0" |
|
2451 |
using P that by blast |
|
2452 |
then show ?thesis |
|
2453 |
by (metis (no_types, lifting) T a orthogonal_orthogonal_transformation orthogonal_def) |
|
2454 |
qed |
|
2455 |
then show "T -` P \<subseteq> {x. norm a *\<^sub>R axis k 1 \<bullet> x = 0}" |
|
2456 |
by auto |
|
2457 |
qed (use assms T in auto) |
|
2458 |
show thesis |
|
2459 |
proof |
|
2460 |
show "T ` S \<in> lmeasurable" |
|
2461 |
using S measurable_orthogonal_image T by blast |
|
2462 |
have "{z. norm z \<le> m \<and> (\<exists>t\<in>P. norm (z - t) \<le> e)} \<subseteq> T ` {z. norm z \<le> m \<and> (\<exists>t\<in>T -` P. norm (z - t) \<le> e)}" |
|
2463 |
proof clarsimp |
|
2464 |
fix x t |
|
2465 |
assume "norm x \<le> m" "t \<in> P" "norm (x - t) \<le> e" |
|
2466 |
then have "norm (inv T x) \<le> m" |
|
2467 |
using orthogonal_transformation_inv [OF T] by (simp add: orthogonal_transformation_norm) |
|
2468 |
moreover have "\<exists>t\<in>T -` P. norm (inv T x - t) \<le> e" |
|
2469 |
proof |
|
2470 |
have "T (inv T x - inv T t) = x - t" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2471 |
using T linear_diff orthogonal_transformation_def |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2472 |
by (metis (no_types, hide_lams) Tinv) |
67998 | 2473 |
then have "norm (inv T x - inv T t) = norm (x - t)" |
2474 |
by (metis T orthogonal_transformation_norm) |
|
2475 |
then show "norm (inv T x - inv T t) \<le> e" |
|
2476 |
using \<open>norm (x - t) \<le> e\<close> by linarith |
|
2477 |
next |
|
2478 |
show "inv T t \<in> T -` P" |
|
2479 |
using \<open>t \<in> P\<close> by force |
|
2480 |
qed |
|
2481 |
ultimately show "x \<in> T ` {z. norm z \<le> m \<and> (\<exists>t\<in>T -` P. norm (z - t) \<le> e)}" |
|
2482 |
by force |
|
2483 |
qed |
|
2484 |
then show "{z. norm z \<le> m \<and> (\<exists>t\<in>P. norm (z - t) \<le> e)} \<subseteq> T ` S" |
|
2485 |
using image_mono [OF subS] by (rule order_trans) |
|
2486 |
show "measure lebesgue (T ` S) \<le> 2 * e * (2 * m) ^ (CARD('n) - 1)" |
|
2487 |
using mS T by (simp add: S measure_orthogonal_image) |
|
2488 |
qed |
|
2489 |
qed |
|
2490 |
||
68001
0a2a1b6507c1
correction of TeX errors and other oversights
paulson <lp15@cam.ac.uk>
parents:
67999
diff
changeset
|
2491 |
text\<open>As above, but translating the sets (HOL Light's @text{GEN\_GEOM\_ORIGIN\_TAC})\<close> |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2492 |
lemma Sard_lemma1: |
67998 | 2493 |
fixes P :: "(real^'n::{finite,wellorder}) set" |
2494 |
assumes P: "dim P < CARD('n)" and "0 \<le> m" "0 \<le> e" |
|
2495 |
obtains S where "S \<in> lmeasurable" |
|
2496 |
and "{z. norm(z - w) \<le> m \<and> (\<exists>t \<in> P. norm(z - w - t) \<le> e)} \<subseteq> S" |
|
2497 |
and "measure lebesgue S \<le> (2 * e) * (2 * m) ^ (CARD('n) - 1)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2498 |
proof - |
67998 | 2499 |
obtain a where "a \<noteq> 0" "P \<subseteq> {x. a \<bullet> x = 0}" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2500 |
using lowdim_subset_hyperplane [of P] P span_base by auto |
67998 | 2501 |
then obtain S where S: "S \<in> lmeasurable" |
2502 |
and subS: "{z. norm z \<le> m \<and> (\<exists>t \<in> P. norm(z - t) \<le> e)} \<subseteq> S" |
|
2503 |
and mS: "measure lebesgue S \<le> (2 * e) * (2 * m) ^ (CARD('n) - 1)" |
|
2504 |
by (rule Sard_lemma0 [OF _ _ \<open>0 \<le> m\<close> \<open>0 \<le> e\<close>]) |
|
2505 |
show thesis |
|
2506 |
proof |
|
2507 |
show "(+)w ` S \<in> lmeasurable" |
|
2508 |
by (metis measurable_translation S) |
|
2509 |
show "{z. norm (z - w) \<le> m \<and> (\<exists>t\<in>P. norm (z - w - t) \<le> e)} \<subseteq> (+)w ` S" |
|
2510 |
using subS by force |
|
2511 |
show "measure lebesgue ((+)w ` S) \<le> 2 * e * (2 * m) ^ (CARD('n) - 1)" |
|
2512 |
by (metis measure_translation mS) |
|
2513 |
qed |
|
2514 |
qed |
|
2515 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2516 |
lemma Sard_lemma2: |
67998 | 2517 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n::{finite,wellorder}" |
2518 |
assumes mlen: "CARD('m) \<le> CARD('n)" (is "?m \<le> ?n") |
|
2519 |
and "B > 0" "bounded S" |
|
2520 |
and derS: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
2521 |
and rank: "\<And>x. x \<in> S \<Longrightarrow> rank(matrix(f' x)) < CARD('n)" |
|
2522 |
and B: "\<And>x. x \<in> S \<Longrightarrow> onorm(f' x) \<le> B" |
|
2523 |
shows "negligible(f ` S)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2524 |
proof - |
67998 | 2525 |
have lin_f': "\<And>x. x \<in> S \<Longrightarrow> linear(f' x)" |
2526 |
using derS has_derivative_linear by blast |
|
2527 |
show ?thesis |
|
2528 |
proof (clarsimp simp add: negligible_outer_le) |
|
2529 |
fix e :: "real" |
|
2530 |
assume "e > 0" |
|
2531 |
obtain c where csub: "S \<subseteq> cbox (- (vec c)) (vec c)" and "c > 0" |
|
2532 |
proof - |
|
2533 |
obtain b where b: "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> b" |
|
2534 |
using \<open>bounded S\<close> by (auto simp: bounded_iff) |
|
2535 |
show thesis |
|
2536 |
proof |
|
2537 |
have "- \<bar>b\<bar> - 1 \<le> x $ i \<and> x $ i \<le> \<bar>b\<bar> + 1" if "x \<in> S" for x i |
|
2538 |
using component_le_norm_cart [of x i] b [OF that] by auto |
|
2539 |
then show "S \<subseteq> cbox (- vec (\<bar>b\<bar> + 1)) (vec (\<bar>b\<bar> + 1))" |
|
2540 |
by (auto simp: mem_box_cart) |
|
2541 |
qed auto |
|
2542 |
qed |
|
2543 |
then have box_cc: "box (- (vec c)) (vec c) \<noteq> {}" and cbox_cc: "cbox (- (vec c)) (vec c) \<noteq> {}" |
|
2544 |
by (auto simp: interval_eq_empty_cart) |
|
2545 |
obtain d where "d > 0" "d \<le> B" |
|
2546 |
and d: "(d * 2) * (4 * B) ^ (?n - 1) \<le> e / (2*c) ^ ?m / ?m ^ ?m" |
|
2547 |
apply (rule that [of "min B (e / (2*c) ^ ?m / ?m ^ ?m / (4 * B) ^ (?n - 1) / 2)"]) |
|
2548 |
using \<open>B > 0\<close> \<open>c > 0\<close> \<open>e > 0\<close> |
|
2549 |
by (simp_all add: divide_simps min_mult_distrib_right) |
|
2550 |
have "\<exists>r. 0 < r \<and> r \<le> 1/2 \<and> |
|
2551 |
(x \<in> S |
|
2552 |
\<longrightarrow> (\<forall>y. y \<in> S \<and> norm(y - x) < r |
|
2553 |
\<longrightarrow> norm(f y - f x - f' x (y - x)) \<le> d * norm(y - x)))" for x |
|
2554 |
proof (cases "x \<in> S") |
|
2555 |
case True |
|
2556 |
then obtain r where "r > 0" |
|
2557 |
and "\<And>y. \<lbrakk>y \<in> S; norm (y - x) < r\<rbrakk> |
|
2558 |
\<Longrightarrow> norm (f y - f x - f' x (y - x)) \<le> d * norm (y - x)" |
|
2559 |
using derS \<open>d > 0\<close> by (force simp: has_derivative_within_alt) |
|
2560 |
then show ?thesis |
|
2561 |
by (rule_tac x="min r (1/2)" in exI) simp |
|
2562 |
next |
|
2563 |
case False |
|
2564 |
then show ?thesis |
|
2565 |
by (rule_tac x="1/2" in exI) simp |
|
2566 |
qed |
|
2567 |
then obtain r where r12: "\<And>x. 0 < r x \<and> r x \<le> 1/2" |
|
2568 |
and r: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S; norm(y - x) < r x\<rbrakk> |
|
2569 |
\<Longrightarrow> norm(f y - f x - f' x (y - x)) \<le> d * norm(y - x)" |
|
2570 |
by metis |
|
2571 |
then have ga: "gauge (\<lambda>x. ball x (r x))" |
|
2572 |
by (auto simp: gauge_def) |
|
2573 |
obtain \<D> where \<D>: "countable \<D>" and sub_cc: "\<Union>\<D> \<subseteq> cbox (- vec c) (vec c)" |
|
2574 |
and cbox: "\<And>K. K \<in> \<D> \<Longrightarrow> interior K \<noteq> {} \<and> (\<exists>u v. K = cbox u v)" |
|
2575 |
and djointish: "pairwise (\<lambda>A B. interior A \<inter> interior B = {}) \<D>" |
|
2576 |
and covered: "\<And>K. K \<in> \<D> \<Longrightarrow> \<exists>x \<in> S \<inter> K. K \<subseteq> ball x (r x)" |
|
2577 |
and close: "\<And>u v. cbox u v \<in> \<D> \<Longrightarrow> \<exists>n. \<forall>i::'m. v $ i - u $ i = 2*c / 2^n" |
|
2578 |
and covers: "S \<subseteq> \<Union>\<D>" |
|
2579 |
apply (rule covering_lemma [OF csub box_cc ga]) |
|
2580 |
apply (auto simp: Basis_vec_def cart_eq_inner_axis [symmetric]) |
|
2581 |
done |
|
2582 |
let ?\<mu> = "measure lebesgue" |
|
2583 |
have "\<exists>T. T \<in> lmeasurable \<and> f ` (K \<inter> S) \<subseteq> T \<and> ?\<mu> T \<le> e / (2*c) ^ ?m * ?\<mu> K" |
|
2584 |
if "K \<in> \<D>" for K |
|
2585 |
proof - |
|
2586 |
obtain u v where uv: "K = cbox u v" |
|
2587 |
using cbox \<open>K \<in> \<D>\<close> by blast |
|
2588 |
then have uv_ne: "cbox u v \<noteq> {}" |
|
2589 |
using cbox that by fastforce |
|
2590 |
obtain x where x: "x \<in> S \<inter> cbox u v" "cbox u v \<subseteq> ball x (r x)" |
|
2591 |
using \<open>K \<in> \<D>\<close> covered uv by blast |
|
2592 |
then have "dim (range (f' x)) < ?n" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2593 |
using rank_dim_range [of "matrix (f' x)"] x rank[of x] |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2594 |
by (auto simp: matrix_works scalar_mult_eq_scaleR lin_f') |
67998 | 2595 |
then obtain T where T: "T \<in> lmeasurable" |
2596 |
and subT: "{z. norm(z - f x) \<le> (2 * B) * norm(v - u) \<and> (\<exists>t \<in> range (f' x). norm(z - f x - t) \<le> d * norm(v - u))} \<subseteq> T" |
|
2597 |
and measT: "?\<mu> T \<le> (2 * (d * norm(v - u))) * (2 * ((2 * B) * norm(v - u))) ^ (?n - 1)" |
|
2598 |
(is "_ \<le> ?DVU") |
|
2599 |
apply (rule Sard_lemma1 [of "range (f' x)" "(2 * B) * norm(v - u)" "d * norm(v - u)" "f x"]) |
|
2600 |
using \<open>B > 0\<close> \<open>d > 0\<close> by simp_all |
|
2601 |
show ?thesis |
|
2602 |
proof (intro exI conjI) |
|
2603 |
have "f ` (K \<inter> S) \<subseteq> {z. norm(z - f x) \<le> (2 * B) * norm(v - u) \<and> (\<exists>t \<in> range (f' x). norm(z - f x - t) \<le> d * norm(v - u))}" |
|
2604 |
unfolding uv |
|
2605 |
proof (clarsimp simp: mult.assoc, intro conjI) |
|
2606 |
fix y |
|
2607 |
assume y: "y \<in> cbox u v" and "y \<in> S" |
|
2608 |
then have "norm (y - x) < r x" |
|
2609 |
by (metis dist_norm mem_ball norm_minus_commute subsetCE x(2)) |
|
2610 |
then have le_dyx: "norm (f y - f x - f' x (y - x)) \<le> d * norm (y - x)" |
|
2611 |
using r [of x y] x \<open>y \<in> S\<close> by blast |
|
2612 |
have yx_le: "norm (y - x) \<le> norm (v - u)" |
|
2613 |
proof (rule norm_le_componentwise_cart) |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2614 |
show "norm ((y - x) $ i) \<le> norm ((v - u) $ i)" for i |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
2615 |
using x y by (force simp: mem_box_cart dest!: spec [where x=i]) |
67998 | 2616 |
qed |
2617 |
have *: "\<lbrakk>norm(y - x - z) \<le> d; norm z \<le> B; d \<le> B\<rbrakk> \<Longrightarrow> norm(y - x) \<le> 2 * B" |
|
2618 |
for x y z :: "real^'n::_" and d B |
|
2619 |
using norm_triangle_ineq2 [of "y - x" z] by auto |
|
2620 |
show "norm (f y - f x) \<le> 2 * (B * norm (v - u))" |
|
2621 |
proof (rule * [OF le_dyx]) |
|
2622 |
have "norm (f' x (y - x)) \<le> onorm (f' x) * norm (y - x)" |
|
2623 |
using onorm [of "f' x" "y-x"] by (meson IntE lin_f' linear_linear x(1)) |
|
2624 |
also have "\<dots> \<le> B * norm (v - u)" |
|
2625 |
proof (rule mult_mono) |
|
2626 |
show "onorm (f' x) \<le> B" |
|
2627 |
using B x by blast |
|
2628 |
qed (use \<open>B > 0\<close> yx_le in auto) |
|
2629 |
finally show "norm (f' x (y - x)) \<le> B * norm (v - u)" . |
|
2630 |
show "d * norm (y - x) \<le> B * norm (v - u)" |
|
2631 |
using \<open>B > 0\<close> by (auto intro: mult_mono [OF \<open>d \<le> B\<close> yx_le]) |
|
2632 |
qed |
|
2633 |
show "\<exists>t. norm (f y - f x - f' x t) \<le> d * norm (v - u)" |
|
2634 |
apply (rule_tac x="y-x" in exI) |
|
2635 |
using \<open>d > 0\<close> yx_le le_dyx mult_left_mono [where c=d] |
|
2636 |
by (meson order_trans real_mult_le_cancel_iff2) |
|
2637 |
qed |
|
2638 |
with subT show "f ` (K \<inter> S) \<subseteq> T" by blast |
|
2639 |
show "?\<mu> T \<le> e / (2*c) ^ ?m * ?\<mu> K" |
|
2640 |
proof (rule order_trans [OF measT]) |
|
2641 |
have "?DVU = (d * 2 * (4 * B) ^ (?n - 1)) * norm (v - u)^?n" |
|
2642 |
using \<open>c > 0\<close> |
|
2643 |
apply (simp add: algebra_simps power_mult_distrib) |
|
2644 |
by (metis Suc_pred power_Suc zero_less_card_finite) |
|
2645 |
also have "\<dots> \<le> (e / (2*c) ^ ?m / (?m ^ ?m)) * norm(v - u) ^ ?n" |
|
2646 |
by (rule mult_right_mono [OF d]) auto |
|
2647 |
also have "\<dots> \<le> e / (2*c) ^ ?m * ?\<mu> K" |
|
2648 |
proof - |
|
2649 |
have "u \<in> ball (x) (r x)" "v \<in> ball x (r x)" |
|
2650 |
using box_ne_empty(1) contra_subsetD [OF x(2)] mem_box(2) uv_ne by fastforce+ |
|
2651 |
moreover have "r x \<le> 1/2" |
|
2652 |
using r12 by auto |
|
2653 |
ultimately have "norm (v - u) \<le> 1" |
|
2654 |
using norm_triangle_half_r [of x u 1 v] |
|
2655 |
by (metis (no_types, hide_lams) dist_commute dist_norm less_eq_real_def less_le_trans mem_ball) |
|
2656 |
then have "norm (v - u) ^ ?n \<le> norm (v - u) ^ ?m" |
|
2657 |
by (simp add: power_decreasing [OF mlen]) |
|
2658 |
also have "\<dots> \<le> ?\<mu> K * real (?m ^ ?m)" |
|
2659 |
proof - |
|
2660 |
obtain n where n: "\<And>i. v$i - u$i = 2 * c / 2^n" |
|
2661 |
using close [of u v] \<open>K \<in> \<D>\<close> uv by blast |
|
2662 |
have "norm (v - u) ^ ?m \<le> (\<Sum>i\<in>UNIV. \<bar>(v - u) $ i\<bar>) ^ ?m" |
|
2663 |
by (intro norm_le_l1_cart power_mono) auto |
|
2664 |
also have "\<dots> \<le> (\<Prod>i\<in>UNIV. v $ i - u $ i) * real CARD('m) ^ CARD('m)" |
|
2665 |
by (simp add: n field_simps \<open>c > 0\<close> less_eq_real_def) |
|
2666 |
also have "\<dots> = ?\<mu> K * real (?m ^ ?m)" |
|
2667 |
by (simp add: uv uv_ne content_cbox_cart) |
|
2668 |
finally show ?thesis . |
|
2669 |
qed |
|
2670 |
finally have *: "1 / real (?m ^ ?m) * norm (v - u) ^ ?n \<le> ?\<mu> K" |
|
2671 |
by (simp add: divide_simps) |
|
2672 |
show ?thesis |
|
2673 |
using mult_left_mono [OF *, of "e / (2*c) ^ ?m"] \<open>c > 0\<close> \<open>e > 0\<close> by auto |
|
2674 |
qed |
|
2675 |
finally show "?DVU \<le> e / (2*c) ^ ?m * ?\<mu> K" . |
|
2676 |
qed |
|
2677 |
qed (use T in auto) |
|
2678 |
qed |
|
2679 |
then obtain g where meas_g: "\<And>K. K \<in> \<D> \<Longrightarrow> g K \<in> lmeasurable" |
|
2680 |
and sub_g: "\<And>K. K \<in> \<D> \<Longrightarrow> f ` (K \<inter> S) \<subseteq> g K" |
|
2681 |
and le_g: "\<And>K. K \<in> \<D> \<Longrightarrow> ?\<mu> (g K) \<le> e / (2*c)^?m * ?\<mu> K" |
|
2682 |
by metis |
|
2683 |
have le_e: "?\<mu> (\<Union>i\<in>\<F>. g i) \<le> e" |
|
2684 |
if "\<F> \<subseteq> \<D>" "finite \<F>" for \<F> |
|
2685 |
proof - |
|
2686 |
have "?\<mu> (\<Union>i\<in>\<F>. g i) \<le> (\<Sum>i\<in>\<F>. ?\<mu> (g i))" |
|
2687 |
using meas_g \<open>\<F> \<subseteq> \<D>\<close> by (auto intro: measure_UNION_le [OF \<open>finite \<F>\<close>]) |
|
2688 |
also have "\<dots> \<le> (\<Sum>K\<in>\<F>. e / (2*c) ^ ?m * ?\<mu> K)" |
|
2689 |
using \<open>\<F> \<subseteq> \<D>\<close> sum_mono [OF le_g] by (meson le_g subsetCE sum_mono) |
|
2690 |
also have "\<dots> = e / (2*c) ^ ?m * (\<Sum>K\<in>\<F>. ?\<mu> K)" |
|
2691 |
by (simp add: sum_distrib_left) |
|
2692 |
also have "\<dots> \<le> e" |
|
2693 |
proof - |
|
2694 |
have "\<F> division_of \<Union>\<F>" |
|
2695 |
proof (rule division_ofI) |
|
2696 |
show "K \<subseteq> \<Union>\<F>" "K \<noteq> {}" "\<exists>a b. K = cbox a b" if "K \<in> \<F>" for K |
|
2697 |
using \<open>K \<in> \<F>\<close> covered cbox \<open>\<F> \<subseteq> \<D>\<close> by (auto simp: Union_upper) |
|
2698 |
show "interior K \<inter> interior L = {}" if "K \<in> \<F>" and "L \<in> \<F>" and "K \<noteq> L" for K L |
|
2699 |
by (metis (mono_tags, lifting) \<open>\<F> \<subseteq> \<D>\<close> pairwiseD djointish pairwise_subset that) |
|
2700 |
qed (use that in auto) |
|
2701 |
then have "sum ?\<mu> \<F> \<le> ?\<mu> (\<Union>\<F>)" |
|
2702 |
by (simp add: content_division) |
|
2703 |
also have "\<dots> \<le> ?\<mu> (cbox (- vec c) (vec c) :: (real, 'm) vec set)" |
|
2704 |
proof (rule measure_mono_fmeasurable) |
|
2705 |
show "\<Union>\<F> \<subseteq> cbox (- vec c) (vec c)" |
|
2706 |
by (meson Sup_subset_mono sub_cc order_trans \<open>\<F> \<subseteq> \<D>\<close>) |
|
2707 |
qed (use \<open>\<F> division_of \<Union>\<F>\<close> lmeasurable_division in auto) |
|
2708 |
also have "\<dots> = content (cbox (- vec c) (vec c) :: (real, 'm) vec set)" |
|
2709 |
by simp |
|
2710 |
also have "\<dots> \<le> (2 ^ ?m * c ^ ?m)" |
|
2711 |
using \<open>c > 0\<close> by (simp add: content_cbox_if_cart) |
|
2712 |
finally have "sum ?\<mu> \<F> \<le> (2 ^ ?m * c ^ ?m)" . |
|
2713 |
then show ?thesis |
|
2714 |
using \<open>e > 0\<close> \<open>c > 0\<close> by (auto simp: divide_simps mult_less_0_iff) |
|
2715 |
qed |
|
2716 |
finally show ?thesis . |
|
2717 |
qed |
|
2718 |
show "\<exists>T. f ` S \<subseteq> T \<and> T \<in> lmeasurable \<and> ?\<mu> T \<le> e" |
|
2719 |
proof (intro exI conjI) |
|
69325 | 2720 |
show "f ` S \<subseteq> \<Union> (g ` \<D>)" |
67998 | 2721 |
using covers sub_g by force |
69325 | 2722 |
show "\<Union> (g ` \<D>) \<in> lmeasurable" |
67998 | 2723 |
by (rule fmeasurable_UN_bound [OF \<open>countable \<D>\<close> meas_g le_e]) |
69325 | 2724 |
show "?\<mu> (\<Union> (g ` \<D>)) \<le> e" |
67998 | 2725 |
by (rule measure_UN_bound [OF \<open>countable \<D>\<close> meas_g le_e]) |
2726 |
qed |
|
2727 |
qed |
|
2728 |
qed |
|
2729 |
||
2730 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2731 |
theorem baby_Sard: |
67998 | 2732 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n::{finite,wellorder}" |
2733 |
assumes mlen: "CARD('m) \<le> CARD('n)" |
|
2734 |
and der: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
2735 |
and rank: "\<And>x. x \<in> S \<Longrightarrow> rank(matrix(f' x)) < CARD('n)" |
|
2736 |
shows "negligible(f ` S)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2737 |
proof - |
67998 | 2738 |
let ?U = "\<lambda>n. {x \<in> S. norm(x) \<le> n \<and> onorm(f' x) \<le> real n}" |
2739 |
have "\<And>x. x \<in> S \<Longrightarrow> \<exists>n. norm x \<le> real n \<and> onorm (f' x) \<le> real n" |
|
2740 |
by (meson linear order_trans real_arch_simple) |
|
2741 |
then have eq: "S = (\<Union>n. ?U n)" |
|
2742 |
by auto |
|
2743 |
have "negligible (f ` ?U n)" for n |
|
2744 |
proof (rule Sard_lemma2 [OF mlen]) |
|
2745 |
show "0 < real n + 1" |
|
2746 |
by auto |
|
2747 |
show "bounded (?U n)" |
|
2748 |
using bounded_iff by blast |
|
2749 |
show "(f has_derivative f' x) (at x within ?U n)" if "x \<in> ?U n" for x |
|
2750 |
using der that by (force intro: has_derivative_subset) |
|
2751 |
qed (use rank in auto) |
|
2752 |
then show ?thesis |
|
2753 |
by (subst eq) (simp add: image_Union negligible_Union_nat) |
|
2754 |
qed |
|
2755 |
||
2756 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
2757 |
subsection%important\<open>A one-way version of change-of-variables not assuming injectivity. \<close> |
67998 | 2758 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2759 |
lemma integral_on_image_ubound_weak: |
67998 | 2760 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" |
2761 |
assumes S: "S \<in> sets lebesgue" |
|
2762 |
and f: "f \<in> borel_measurable (lebesgue_on (g ` S))" |
|
2763 |
and nonneg_fg: "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> f(g x)" |
|
2764 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
2765 |
and det_int_fg: "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) integrable_on S" |
|
2766 |
and meas_gim: "\<And>T. \<lbrakk>T \<subseteq> g ` S; T \<in> sets lebesgue\<rbrakk> \<Longrightarrow> {x \<in> S. g x \<in> T} \<in> sets lebesgue" |
|
2767 |
shows "f integrable_on (g ` S) \<and> |
|
2768 |
integral (g ` S) f \<le> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x))" |
|
2769 |
(is "_ \<and> _ \<le> ?b") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2770 |
proof - |
67998 | 2771 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar>" |
2772 |
have cont_g: "continuous_on S g" |
|
2773 |
using der_g has_derivative_continuous_on by blast |
|
2774 |
have [simp]: "space (lebesgue_on S) = S" |
|
2775 |
by (simp add: S) |
|
2776 |
have gS_in_sets_leb: "g ` S \<in> sets lebesgue" |
|
2777 |
apply (rule differentiable_image_in_sets_lebesgue) |
|
2778 |
using der_g by (auto simp: S differentiable_def differentiable_on_def) |
|
2779 |
obtain h where nonneg_h: "\<And>n x. 0 \<le> h n x" |
|
2780 |
and h_le_f: "\<And>n x. x \<in> S \<Longrightarrow> h n (g x) \<le> f (g x)" |
|
2781 |
and h_inc: "\<And>n x. h n x \<le> h (Suc n) x" |
|
2782 |
and h_meas: "\<And>n. h n \<in> borel_measurable lebesgue" |
|
2783 |
and fin_R: "\<And>n. finite(range (h n))" |
|
2784 |
and lim: "\<And>x. x \<in> g ` S \<Longrightarrow> (\<lambda>n. h n x) \<longlonglongrightarrow> f x" |
|
2785 |
proof - |
|
2786 |
let ?f = "\<lambda>x. if x \<in> g ` S then f x else 0" |
|
2787 |
have "?f \<in> borel_measurable lebesgue \<and> (\<forall>x. 0 \<le> ?f x)" |
|
2788 |
by (auto simp: gS_in_sets_leb f nonneg_fg measurable_restrict_space_iff [symmetric]) |
|
2789 |
then show ?thesis |
|
2790 |
apply (clarsimp simp add: borel_measurable_simple_function_limit_increasing) |
|
2791 |
apply (rename_tac h) |
|
2792 |
by (rule_tac h=h in that) (auto split: if_split_asm) |
|
2793 |
qed |
|
2794 |
have h_lmeas: "{t. h n (g t) = y} \<inter> S \<in> sets lebesgue" for y n |
|
2795 |
proof - |
|
2796 |
have "space (lebesgue_on (UNIV::(real,'n) vec set)) = UNIV" |
|
2797 |
by simp |
|
2798 |
then have "((h n) -`{y} \<inter> g ` S) \<in> sets (lebesgue_on (g ` S))" |
|
2799 |
by (metis Int_commute borel_measurable_vimage h_meas image_eqI inf_top.right_neutral sets_restrict_space space_borel space_completion space_lborel) |
|
2800 |
then have "({u. h n u = y} \<inter> g ` S) \<in> sets lebesgue" |
|
2801 |
using gS_in_sets_leb |
|
2802 |
by (simp add: integral_indicator fmeasurableI2 sets_restrict_space_iff vimage_def) |
|
2803 |
then have "{x \<in> S. g x \<in> ({u. h n u = y} \<inter> g ` S)} \<in> sets lebesgue" |
|
2804 |
using meas_gim[of "({u. h n u = y} \<inter> g ` S)"] by force |
|
2805 |
moreover have "{t. h n (g t) = y} \<inter> S = {x \<in> S. g x \<in> ({u. h n u = y} \<inter> g ` S)}" |
|
2806 |
by blast |
|
2807 |
ultimately show ?thesis |
|
2808 |
by auto |
|
2809 |
qed |
|
2810 |
have hint: "h n integrable_on g ` S \<and> integral (g ` S) (h n) \<le> integral S (\<lambda>x. ?D x * h n (g x))" |
|
2811 |
(is "?INT \<and> ?lhs \<le> ?rhs") for n |
|
2812 |
proof - |
|
2813 |
let ?R = "range (h n)" |
|
2814 |
have hn_eq: "h n = (\<lambda>x. \<Sum>y\<in>?R. y * indicat_real {x. h n x = y} x)" |
|
2815 |
by (simp add: indicator_def if_distrib fin_R cong: if_cong) |
|
2816 |
have yind: "(\<lambda>t. y * indicator{x. h n x = y} t) integrable_on (g ` S) \<and> |
|
2817 |
(integral (g ` S) (\<lambda>t. y * indicator {x. h n x = y} t)) |
|
2818 |
\<le> integral S (\<lambda>t. \<bar>det (matrix (g' t))\<bar> * y * indicator {x. h n x = y} (g t))" |
|
2819 |
if y: "y \<in> ?R" for y::real |
|
2820 |
proof (cases "y=0") |
|
2821 |
case True |
|
2822 |
then show ?thesis using gS_in_sets_leb integrable_0 by force |
|
2823 |
next |
|
2824 |
case False |
|
2825 |
with that have "y > 0" |
|
2826 |
using less_eq_real_def nonneg_h by fastforce |
|
2827 |
have "(\<lambda>x. if x \<in> {t. h n (g t) = y} then ?D x else 0) integrable_on S" |
|
2828 |
proof (rule measurable_bounded_by_integrable_imp_integrable) |
|
2829 |
have "(\<lambda>x. ?D x) \<in> borel_measurable (lebesgue_on ({t. h n (g t) = y} \<inter> S))" |
|
2830 |
apply (intro borel_measurable_abs borel_measurable_det_Jacobian [OF h_lmeas, where f=g]) |
|
2831 |
by (meson der_g IntD2 has_derivative_within_subset inf_le2) |
|
2832 |
then have "(\<lambda>x. if x \<in> {t. h n (g t) = y} \<inter> S then ?D x else 0) \<in> borel_measurable lebesgue" |
|
2833 |
by (rule borel_measurable_If_I [OF _ h_lmeas]) |
|
2834 |
then show "(\<lambda>x. if x \<in> {t. h n (g t) = y} then ?D x else 0) \<in> borel_measurable (lebesgue_on S)" |
|
2835 |
by (simp add: if_if_eq_conj Int_commute borel_measurable_UNIV [OF S, symmetric]) |
|
2836 |
show "(\<lambda>x. ?D x *\<^sub>R f (g x) /\<^sub>R y) integrable_on S" |
|
2837 |
by (rule integrable_cmul) (use det_int_fg in auto) |
|
2838 |
show "norm (if x \<in> {t. h n (g t) = y} then ?D x else 0) \<le> ?D x *\<^sub>R f (g x) /\<^sub>R y" |
|
2839 |
if "x \<in> S" for x |
|
2840 |
using nonneg_h [of n x] \<open>y > 0\<close> nonneg_fg [of x] h_le_f [of x n] that |
|
2841 |
by (auto simp: divide_simps ordered_semiring_class.mult_left_mono) |
|
2842 |
qed (use S in auto) |
|
2843 |
then have int_det: "(\<lambda>t. \<bar>det (matrix (g' t))\<bar>) integrable_on ({t. h n (g t) = y} \<inter> S)" |
|
2844 |
using integrable_restrict_Int by force |
|
2845 |
have "(g ` ({t. h n (g t) = y} \<inter> S)) \<in> lmeasurable" |
|
2846 |
apply (rule measurable_differentiable_image [OF h_lmeas]) |
|
2847 |
apply (blast intro: has_derivative_within_subset [OF der_g]) |
|
2848 |
apply (rule int_det) |
|
2849 |
done |
|
2850 |
moreover have "g ` ({t. h n (g t) = y} \<inter> S) = {x. h n x = y} \<inter> g ` S" |
|
2851 |
by blast |
|
2852 |
moreover have "measure lebesgue (g ` ({t. h n (g t) = y} \<inter> S)) |
|
2853 |
\<le> integral ({t. h n (g t) = y} \<inter> S) (\<lambda>t. \<bar>det (matrix (g' t))\<bar>)" |
|
2854 |
apply (rule measure_differentiable_image [OF h_lmeas _ int_det]) |
|
2855 |
apply (blast intro: has_derivative_within_subset [OF der_g]) |
|
2856 |
done |
|
2857 |
ultimately show ?thesis |
|
2858 |
using \<open>y > 0\<close> integral_restrict_Int [of S "{t. h n (g t) = y}" "\<lambda>t. \<bar>det (matrix (g' t))\<bar> * y"] |
|
2859 |
apply (simp add: integrable_on_indicator integrable_on_cmult_iff integral_indicator) |
|
2860 |
apply (simp add: indicator_def if_distrib cong: if_cong) |
|
2861 |
done |
|
2862 |
qed |
|
2863 |
have hn_int: "h n integrable_on g ` S" |
|
2864 |
apply (subst hn_eq) |
|
2865 |
using yind by (force intro: integrable_sum [OF fin_R]) |
|
2866 |
then show ?thesis |
|
2867 |
proof |
|
2868 |
have "?lhs = integral (g ` S) (\<lambda>x. \<Sum>y\<in>range (h n). y * indicat_real {x. h n x = y} x)" |
|
2869 |
by (metis hn_eq) |
|
2870 |
also have "\<dots> = (\<Sum>y\<in>range (h n). integral (g ` S) (\<lambda>x. y * indicat_real {x. h n x = y} x))" |
|
2871 |
by (rule integral_sum [OF fin_R]) (use yind in blast) |
|
2872 |
also have "\<dots> \<le> (\<Sum>y\<in>range (h n). integral S (\<lambda>u. \<bar>det (matrix (g' u))\<bar> * y * indicat_real {x. h n x = y} (g u)))" |
|
2873 |
using yind by (force intro: sum_mono) |
|
2874 |
also have "\<dots> = integral S (\<lambda>u. \<Sum>y\<in>range (h n). \<bar>det (matrix (g' u))\<bar> * y * indicat_real {x. h n x = y} (g u))" |
|
2875 |
proof (rule integral_sum [OF fin_R, symmetric]) |
|
2876 |
fix y assume y: "y \<in> ?R" |
|
2877 |
with nonneg_h have "y \<ge> 0" |
|
2878 |
by auto |
|
2879 |
show "(\<lambda>u. \<bar>det (matrix (g' u))\<bar> * y * indicat_real {x. h n x = y} (g u)) integrable_on S" |
|
2880 |
proof (rule measurable_bounded_by_integrable_imp_integrable) |
|
2881 |
have "(\<lambda>x. indicat_real {x. h n x = y} (g x)) \<in> borel_measurable (lebesgue_on S)" |
|
2882 |
using h_lmeas S |
|
2883 |
by (auto simp: indicator_vimage [symmetric] borel_measurable_indicator_iff sets_restrict_space_iff) |
|
2884 |
then show "(\<lambda>u. \<bar>det (matrix (g' u))\<bar> * y * indicat_real {x. h n x = y} (g u)) \<in> borel_measurable (lebesgue_on S)" |
|
2885 |
by (intro borel_measurable_times borel_measurable_abs borel_measurable_const borel_measurable_det_Jacobian [OF S der_g]) |
|
2886 |
next |
|
2887 |
fix x |
|
2888 |
assume "x \<in> S" |
|
2889 |
have "y * indicat_real {x. h n x = y} (g x) \<le> f (g x)" |
|
2890 |
by (metis (full_types) \<open>x \<in> S\<close> h_le_f indicator_def mem_Collect_eq mult.right_neutral mult_zero_right nonneg_fg) |
|
2891 |
with \<open>y \<ge> 0\<close> show "norm (?D x * y * indicat_real {x. h n x = y} (g x)) \<le> ?D x * f(g x)" |
|
2892 |
by (simp add: abs_mult mult.assoc mult_left_mono) |
|
2893 |
qed (use S det_int_fg in auto) |
|
2894 |
qed |
|
2895 |
also have "\<dots> = integral S (\<lambda>T. \<bar>det (matrix (g' T))\<bar> * |
|
2896 |
(\<Sum>y\<in>range (h n). y * indicat_real {x. h n x = y} (g T)))" |
|
2897 |
by (simp add: sum_distrib_left mult.assoc) |
|
2898 |
also have "\<dots> = ?rhs" |
|
2899 |
by (metis hn_eq) |
|
2900 |
finally show "integral (g ` S) (h n) \<le> ?rhs" . |
|
2901 |
qed |
|
2902 |
qed |
|
2903 |
have le: "integral S (\<lambda>T. \<bar>det (matrix (g' T))\<bar> * h n (g T)) \<le> ?b" for n |
|
2904 |
proof (rule integral_le) |
|
2905 |
show "(\<lambda>T. \<bar>det (matrix (g' T))\<bar> * h n (g T)) integrable_on S" |
|
2906 |
proof (rule measurable_bounded_by_integrable_imp_integrable) |
|
2907 |
have "(\<lambda>T. \<bar>det (matrix (g' T))\<bar> *\<^sub>R h n (g T)) \<in> borel_measurable (lebesgue_on S)" |
|
2908 |
proof (intro borel_measurable_scaleR borel_measurable_abs borel_measurable_det_Jacobian \<open>S \<in> sets lebesgue\<close>) |
|
2909 |
have eq: "{x \<in> S. f x \<le> a} = (\<Union>b \<in> (f ` S) \<inter> atMost a. {x. f x = b} \<inter> S)" for f and a::real |
|
2910 |
by auto |
|
2911 |
have "finite ((\<lambda>x. h n (g x)) ` S \<inter> {..a})" for a |
|
2912 |
by (force intro: finite_subset [OF _ fin_R]) |
|
2913 |
with h_lmeas [of n] show "(\<lambda>x. h n (g x)) \<in> borel_measurable (lebesgue_on S)" |
|
2914 |
apply (simp add: borel_measurable_vimage_halfspace_component_le \<open>S \<in> sets lebesgue\<close> sets_restrict_space_iff eq) |
|
2915 |
by (metis (mono_tags) SUP_inf sets.finite_UN) |
|
2916 |
qed (use der_g in blast) |
|
2917 |
then show "(\<lambda>T. \<bar>det (matrix (g' T))\<bar> * h n (g T)) \<in> borel_measurable (lebesgue_on S)" |
|
2918 |
by simp |
|
2919 |
show "norm (?D x * h n (g x)) \<le> ?D x *\<^sub>R f (g x)" |
|
2920 |
if "x \<in> S" for x |
|
2921 |
by (simp add: h_le_f mult_left_mono nonneg_h that) |
|
2922 |
qed (use S det_int_fg in auto) |
|
2923 |
show "?D x * h n (g x) \<le> ?D x * f (g x)" if "x \<in> S" for x |
|
2924 |
by (simp add: \<open>x \<in> S\<close> h_le_f mult_left_mono) |
|
2925 |
show "(\<lambda>x. ?D x * f (g x)) integrable_on S" |
|
2926 |
using det_int_fg by blast |
|
2927 |
qed |
|
2928 |
have "f integrable_on g ` S \<and> (\<lambda>k. integral (g ` S) (h k)) \<longlonglongrightarrow> integral (g ` S) f" |
|
2929 |
proof (rule monotone_convergence_increasing) |
|
2930 |
have "\<bar>integral (g ` S) (h n)\<bar> \<le> integral S (\<lambda>x. ?D x * f (g x))" for n |
|
2931 |
proof - |
|
2932 |
have "\<bar>integral (g ` S) (h n)\<bar> = integral (g ` S) (h n)" |
|
2933 |
using hint by (simp add: integral_nonneg nonneg_h) |
|
2934 |
also have "\<dots> \<le> integral S (\<lambda>x. ?D x * f (g x))" |
|
2935 |
using hint le by (meson order_trans) |
|
2936 |
finally show ?thesis . |
|
2937 |
qed |
|
2938 |
then show "bounded (range (\<lambda>k. integral (g ` S) (h k)))" |
|
2939 |
by (force simp: bounded_iff) |
|
2940 |
qed (use h_inc lim hint in auto) |
|
2941 |
moreover have "integral (g ` S) (h n) \<le> integral S (\<lambda>x. ?D x * f (g x))" for n |
|
2942 |
using hint by (blast intro: le order_trans) |
|
2943 |
ultimately show ?thesis |
|
68532
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
paulson <lp15@cam.ac.uk>
parents:
68403
diff
changeset
|
2944 |
by (auto intro: Lim_bounded) |
67998 | 2945 |
qed |
2946 |
||
2947 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2948 |
lemma integral_on_image_ubound_nonneg: |
67998 | 2949 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" |
2950 |
assumes nonneg_fg: "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> f(g x)" |
|
2951 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
2952 |
and intS: "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) integrable_on S" |
|
2953 |
shows "f integrable_on (g ` S) \<and> integral (g ` S) f \<le> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x))" |
|
2954 |
(is "_ \<and> _ \<le> ?b") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
2955 |
proof - |
67998 | 2956 |
let ?D = "\<lambda>x. det (matrix (g' x))" |
2957 |
define S' where "S' \<equiv> {x \<in> S. ?D x * f(g x) \<noteq> 0}" |
|
2958 |
then have der_gS': "\<And>x. x \<in> S' \<Longrightarrow> (g has_derivative g' x) (at x within S')" |
|
2959 |
by (metis (mono_tags, lifting) der_g has_derivative_within_subset mem_Collect_eq subset_iff) |
|
2960 |
have "(\<lambda>x. if x \<in> S then \<bar>?D x\<bar> * f (g x) else 0) integrable_on UNIV" |
|
2961 |
by (simp add: integrable_restrict_UNIV intS) |
|
2962 |
then have Df_borel: "(\<lambda>x. if x \<in> S then \<bar>?D x\<bar> * f (g x) else 0) \<in> borel_measurable lebesgue" |
|
2963 |
using integrable_imp_measurable borel_measurable_UNIV_eq by blast |
|
2964 |
have S': "S' \<in> sets lebesgue" |
|
2965 |
proof - |
|
2966 |
from Df_borel borel_measurable_vimage_open [of _ UNIV] |
|
2967 |
have "{x. (if x \<in> S then \<bar>?D x\<bar> * f (g x) else 0) \<in> T} \<in> sets lebesgue" |
|
2968 |
if "open T" for T |
|
2969 |
using that unfolding borel_measurable_UNIV_eq |
|
2970 |
by (fastforce simp add: dest!: spec) |
|
2971 |
then have "{x. (if x \<in> S then \<bar>?D x\<bar> * f (g x) else 0) \<in> -{0}} \<in> sets lebesgue" |
|
2972 |
using open_Compl by blast |
|
2973 |
then show ?thesis |
|
2974 |
by (simp add: S'_def conj_ac split: if_split_asm cong: conj_cong) |
|
2975 |
qed |
|
2976 |
then have gS': "g ` S' \<in> sets lebesgue" |
|
2977 |
proof (rule differentiable_image_in_sets_lebesgue) |
|
2978 |
show "g differentiable_on S'" |
|
2979 |
using der_g unfolding S'_def differentiable_def differentiable_on_def |
|
2980 |
by (blast intro: has_derivative_within_subset) |
|
2981 |
qed auto |
|
2982 |
have f: "f \<in> borel_measurable (lebesgue_on (g ` S'))" |
|
2983 |
proof (clarsimp simp add: borel_measurable_vimage_open) |
|
2984 |
fix T :: "real set" |
|
2985 |
assume "open T" |
|
2986 |
have "{x \<in> g ` S'. f x \<in> T} = g ` {x \<in> S'. f(g x) \<in> T}" |
|
2987 |
by blast |
|
2988 |
moreover have "g ` {x \<in> S'. f(g x) \<in> T} \<in> sets lebesgue" |
|
2989 |
proof (rule differentiable_image_in_sets_lebesgue) |
|
2990 |
let ?h = "\<lambda>x. \<bar>?D x\<bar> * f (g x) /\<^sub>R \<bar>?D x\<bar>" |
|
2991 |
have "(\<lambda>x. if x \<in> S' then \<bar>?D x\<bar> * f (g x) else 0) = (\<lambda>x. if x \<in> S then \<bar>?D x\<bar> * f (g x) else 0)" |
|
2992 |
by (auto simp: S'_def) |
|
2993 |
also have "\<dots> \<in> borel_measurable lebesgue" |
|
2994 |
by (rule Df_borel) |
|
2995 |
finally have *: "(\<lambda>x. \<bar>?D x\<bar> * f (g x)) \<in> borel_measurable (lebesgue_on S')" |
|
2996 |
by (simp add: borel_measurable_If_D) |
|
2997 |
have "?h \<in> borel_measurable (lebesgue_on S')" |
|
2998 |
by (intro * S' der_gS' borel_measurable_det_Jacobian measurable) (blast intro: der_gS') |
|
2999 |
moreover have "?h x = f(g x)" if "x \<in> S'" for x |
|
3000 |
using that by (auto simp: S'_def) |
|
3001 |
ultimately have "(\<lambda>x. f(g x)) \<in> borel_measurable (lebesgue_on S')" |
|
3002 |
by (metis (no_types, lifting) measurable_lebesgue_cong) |
|
3003 |
then show "{x \<in> S'. f (g x) \<in> T} \<in> sets lebesgue" |
|
3004 |
by (simp add: \<open>S' \<in> sets lebesgue\<close> \<open>open T\<close> borel_measurable_vimage_open sets_restrict_space_iff) |
|
3005 |
show "g differentiable_on {x \<in> S'. f (g x) \<in> T}" |
|
3006 |
using der_g unfolding S'_def differentiable_def differentiable_on_def |
|
3007 |
by (blast intro: has_derivative_within_subset) |
|
3008 |
qed auto |
|
3009 |
ultimately have "{x \<in> g ` S'. f x \<in> T} \<in> sets lebesgue" |
|
3010 |
by metis |
|
3011 |
then show "{x \<in> g ` S'. f x \<in> T} \<in> sets (lebesgue_on (g ` S'))" |
|
3012 |
by (simp add: \<open>g ` S' \<in> sets lebesgue\<close> sets_restrict_space_iff) |
|
3013 |
qed |
|
3014 |
have intS': "(\<lambda>x. \<bar>?D x\<bar> * f (g x)) integrable_on S'" |
|
3015 |
using intS |
|
3016 |
by (rule integrable_spike_set) (auto simp: S'_def intro: empty_imp_negligible) |
|
3017 |
have lebS': "{x \<in> S'. g x \<in> T} \<in> sets lebesgue" if "T \<subseteq> g ` S'" "T \<in> sets lebesgue" for T |
|
3018 |
proof - |
|
3019 |
have "g \<in> borel_measurable (lebesgue_on S')" |
|
3020 |
using der_gS' has_derivative_continuous_on S' |
|
3021 |
by (blast intro: continuous_imp_measurable_on_sets_lebesgue) |
|
3022 |
moreover have "{x \<in> S'. g x \<in> U} \<in> sets lebesgue" if "negligible U" "U \<subseteq> g ` S'" for U |
|
3023 |
proof (intro negligible_imp_sets negligible_differentiable_vimage that) |
|
3024 |
fix x |
|
3025 |
assume x: "x \<in> S'" |
|
3026 |
then have "linear (g' x)" |
|
3027 |
using der_gS' has_derivative_linear by blast |
|
3028 |
with x show "inj (g' x)" |
|
3029 |
by (auto simp: S'_def det_nz_iff_inj) |
|
3030 |
qed (use der_gS' in auto) |
|
3031 |
ultimately show ?thesis |
|
3032 |
using double_lebesgue_sets [OF S' gS' order_refl] that by blast |
|
3033 |
qed |
|
3034 |
have int_gS': "f integrable_on g ` S' \<and> integral (g ` S') f \<le> integral S' (\<lambda>x. \<bar>?D x\<bar> * f(g x))" |
|
3035 |
using integral_on_image_ubound_weak [OF S' f nonneg_fg der_gS' intS' lebS'] S'_def by blast |
|
3036 |
have "negligible (g ` {x \<in> S. det(matrix(g' x)) = 0})" |
|
3037 |
proof (rule baby_Sard, simp_all) |
|
3038 |
fix x |
|
3039 |
assume x: "x \<in> S \<and> det (matrix (g' x)) = 0" |
|
3040 |
then show "(g has_derivative g' x) (at x within {x \<in> S. det (matrix (g' x)) = 0})" |
|
3041 |
by (metis (no_types, lifting) der_g has_derivative_within_subset mem_Collect_eq subsetI) |
|
3042 |
then show "rank (matrix (g' x)) < CARD('n)" |
|
3043 |
using det_nz_iff_inj matrix_vector_mul_linear x |
|
3044 |
by (fastforce simp add: less_rank_noninjective) |
|
3045 |
qed |
|
3046 |
then have negg: "negligible (g ` S - g ` {x \<in> S. ?D x \<noteq> 0})" |
|
3047 |
by (rule negligible_subset) (auto simp: S'_def) |
|
3048 |
have null: "g ` {x \<in> S. ?D x \<noteq> 0} - g ` S = {}" |
|
3049 |
by (auto simp: S'_def) |
|
3050 |
let ?F = "{x \<in> S. f (g x) \<noteq> 0}" |
|
3051 |
have eq: "g ` S' = g ` ?F \<inter> g ` {x \<in> S. ?D x \<noteq> 0}" |
|
3052 |
by (auto simp: S'_def image_iff) |
|
3053 |
show ?thesis |
|
3054 |
proof |
|
3055 |
have "((\<lambda>x. if x \<in> g ` ?F then f x else 0) integrable_on g ` {x \<in> S. ?D x \<noteq> 0})" |
|
3056 |
using int_gS' eq integrable_restrict_Int [where f=f] |
|
3057 |
by simp |
|
3058 |
then have "f integrable_on g ` {x \<in> S. ?D x \<noteq> 0}" |
|
3059 |
by (auto simp: image_iff elim!: integrable_eq) |
|
3060 |
then show "f integrable_on g ` S" |
|
3061 |
apply (rule integrable_spike_set [OF _ empty_imp_negligible negligible_subset]) |
|
3062 |
using negg null by auto |
|
3063 |
have "integral (g ` S) f = integral (g ` {x \<in> S. ?D x \<noteq> 0}) f" |
|
3064 |
using negg by (auto intro: negligible_subset integral_spike_set) |
|
3065 |
also have "\<dots> = integral (g ` {x \<in> S. ?D x \<noteq> 0}) (\<lambda>x. if x \<in> g ` ?F then f x else 0)" |
|
3066 |
by (auto simp: image_iff intro!: integral_cong) |
|
3067 |
also have "\<dots> = integral (g ` S') f" |
|
3068 |
using eq integral_restrict_Int by simp |
|
3069 |
also have "\<dots> \<le> integral S' (\<lambda>x. \<bar>?D x\<bar> * f(g x))" |
|
3070 |
by (metis int_gS') |
|
3071 |
also have "\<dots> \<le> ?b" |
|
3072 |
by (rule integral_subset_le [OF _ intS' intS]) (use nonneg_fg S'_def in auto) |
|
3073 |
finally show "integral (g ` S) f \<le> ?b" . |
|
3074 |
qed |
|
3075 |
qed |
|
3076 |
||
3077 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3078 |
proposition absolutely_integrable_on_image_real: |
67998 | 3079 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_" |
3080 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3081 |
and intS: "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) absolutely_integrable_on S" |
|
3082 |
shows "f absolutely_integrable_on (g ` S)" |
|
3083 |
proof - |
|
3084 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x)" |
|
3085 |
let ?N = "{x \<in> S. f (g x) < 0}" and ?P = "{x \<in> S. f (g x) > 0}" |
|
3086 |
have eq: "{x. (if x \<in> S then ?D x else 0) > 0} = {x \<in> S. ?D x > 0}" |
|
3087 |
"{x. (if x \<in> S then ?D x else 0) < 0} = {x \<in> S. ?D x < 0}" |
|
3088 |
by auto |
|
3089 |
have "?D integrable_on S" |
|
3090 |
using intS absolutely_integrable_on_def by blast |
|
3091 |
then have "(\<lambda>x. if x \<in> S then ?D x else 0) integrable_on UNIV" |
|
3092 |
by (simp add: integrable_restrict_UNIV) |
|
3093 |
then have D_borel: "(\<lambda>x. if x \<in> S then ?D x else 0) \<in> borel_measurable (lebesgue_on UNIV)" |
|
3094 |
using integrable_imp_measurable borel_measurable_UNIV_eq by blast |
|
3095 |
then have Dlt: "{x \<in> S. ?D x < 0} \<in> sets lebesgue" |
|
3096 |
unfolding borel_measurable_vimage_halfspace_component_lt |
|
3097 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3098 |
from D_borel have Dgt: "{x \<in> S. ?D x > 0} \<in> sets lebesgue" |
|
3099 |
unfolding borel_measurable_vimage_halfspace_component_gt |
|
3100 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3101 |
||
3102 |
have dfgbm: "?D \<in> borel_measurable (lebesgue_on S)" |
|
3103 |
using intS absolutely_integrable_on_def integrable_imp_measurable by blast |
|
3104 |
have der_gN: "(g has_derivative g' x) (at x within ?N)" if "x \<in> ?N" for x |
|
3105 |
using der_g has_derivative_within_subset that by force |
|
3106 |
have "(\<lambda>x. - f x) integrable_on g ` ?N \<and> |
|
3107 |
integral (g ` ?N) (\<lambda>x. - f x) \<le> integral ?N (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * - f (g x))" |
|
3108 |
proof (rule integral_on_image_ubound_nonneg [OF _ der_gN]) |
|
3109 |
have 1: "?D integrable_on {x \<in> S. ?D x < 0}" |
|
3110 |
using Dlt |
|
3111 |
by (auto intro: set_lebesgue_integral_eq_integral [OF set_integrable_subset] intS) |
|
3112 |
have "uminus \<circ> (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * - f (g x)) integrable_on ?N" |
|
3113 |
by (simp add: o_def mult_less_0_iff empty_imp_negligible integrable_spike_set [OF 1]) |
|
3114 |
then show "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * - f (g x)) integrable_on ?N" |
|
3115 |
by (simp add: integrable_neg_iff o_def) |
|
3116 |
qed auto |
|
3117 |
then have "f integrable_on g ` ?N" |
|
3118 |
by (simp add: integrable_neg_iff) |
|
3119 |
moreover have "g ` ?N = {y \<in> g ` S. f y < 0}" |
|
3120 |
by auto |
|
3121 |
ultimately have "f integrable_on {y \<in> g ` S. f y < 0}" |
|
3122 |
by simp |
|
3123 |
then have N: "f absolutely_integrable_on {y \<in> g ` S. f y < 0}" |
|
3124 |
by (rule absolutely_integrable_absolutely_integrable_ubound) auto |
|
3125 |
||
3126 |
have der_gP: "(g has_derivative g' x) (at x within ?P)" if "x \<in> ?P" for x |
|
3127 |
using der_g has_derivative_within_subset that by force |
|
3128 |
have "f integrable_on g ` ?P \<and> integral (g ` ?P) f \<le> integral ?P ?D" |
|
3129 |
proof (rule integral_on_image_ubound_nonneg [OF _ der_gP]) |
|
3130 |
have "?D integrable_on {x \<in> S. 0 < ?D x}" |
|
3131 |
using Dgt |
|
3132 |
by (auto intro: set_lebesgue_integral_eq_integral [OF set_integrable_subset] intS) |
|
3133 |
then show "?D integrable_on ?P" |
|
3134 |
apply (rule integrable_spike_set) |
|
3135 |
by (auto simp: zero_less_mult_iff empty_imp_negligible) |
|
3136 |
qed auto |
|
3137 |
then have "f integrable_on g ` ?P" |
|
3138 |
by metis |
|
3139 |
moreover have "g ` ?P = {y \<in> g ` S. f y > 0}" |
|
3140 |
by auto |
|
3141 |
ultimately have "f integrable_on {y \<in> g ` S. f y > 0}" |
|
3142 |
by simp |
|
3143 |
then have P: "f absolutely_integrable_on {y \<in> g ` S. f y > 0}" |
|
3144 |
by (rule absolutely_integrable_absolutely_integrable_lbound) auto |
|
3145 |
have "(\<lambda>x. if x \<in> g ` S \<and> f x < 0 \<or> x \<in> g ` S \<and> 0 < f x then f x else 0) = (\<lambda>x. if x \<in> g ` S then f x else 0)" |
|
3146 |
by auto |
|
3147 |
then show ?thesis |
|
3148 |
using absolutely_integrable_Un [OF N P] absolutely_integrable_restrict_UNIV [symmetric, where f=f] |
|
3149 |
by simp |
|
3150 |
qed |
|
3151 |
||
3152 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3153 |
proposition absolutely_integrable_on_image: |
67998 | 3154 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3155 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3156 |
and intS: "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S" |
|
3157 |
shows "f absolutely_integrable_on (g ` S)" |
|
3158 |
apply (rule absolutely_integrable_componentwise [OF absolutely_integrable_on_image_real [OF der_g]]) |
|
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3159 |
using%unimportant absolutely_integrable_component [OF intS] by%unimportant auto |
67998 | 3160 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3161 |
proposition integral_on_image_ubound: |
67998 | 3162 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_" |
3163 |
assumes"\<And>x. x \<in> S \<Longrightarrow> 0 \<le> f(g x)" |
|
3164 |
and "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3165 |
and "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) integrable_on S" |
|
3166 |
shows "integral (g ` S) f \<le> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x))" |
|
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3167 |
using%unimportant integral_on_image_ubound_nonneg [OF assms] by%unimportant simp |
67998 | 3168 |
|
3169 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3170 |
subsection%important\<open>Change-of-variables theorem\<close> |
67998 | 3171 |
|
3172 |
text\<open>The classic change-of-variables theorem. We have two versions with quite general hypotheses, |
|
3173 |
the first that the transforming function has a continuous inverse, the second that the base set is |
|
3174 |
Lebesgue measurable.\<close> |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3175 |
lemma cov_invertible_nonneg_le: |
67998 | 3176 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_" |
3177 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3178 |
and der_h: "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)" |
|
3179 |
and f0: "\<And>y. y \<in> T \<Longrightarrow> 0 \<le> f y" |
|
3180 |
and hg: "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x" |
|
3181 |
and gh: "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y" |
|
3182 |
and id: "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id" |
|
3183 |
shows "f integrable_on T \<and> (integral T f) \<le> b \<longleftrightarrow> |
|
3184 |
(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) integrable_on S \<and> |
|
3185 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) \<le> b" |
|
3186 |
(is "?lhs = ?rhs") |
|
3187 |
proof - |
|
3188 |
have Teq: "T = g`S" and Seq: "S = h`T" |
|
3189 |
using hg gh image_iff by fastforce+ |
|
3190 |
have gS: "g differentiable_on S" |
|
3191 |
by (meson der_g differentiable_def differentiable_on_def) |
|
3192 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x)" |
|
3193 |
show ?thesis |
|
3194 |
proof |
|
3195 |
assume ?lhs |
|
3196 |
then have fT: "f integrable_on T" and intf: "integral T f \<le> b" |
|
3197 |
by blast+ |
|
3198 |
show ?rhs |
|
3199 |
proof |
|
3200 |
let ?fgh = "\<lambda>x. \<bar>det (matrix (h' x))\<bar> * (\<bar>det (matrix (g' (h x)))\<bar> * f (g (h x)))" |
|
3201 |
have ddf: "?fgh x = f x" |
|
3202 |
if "x \<in> T" for x |
|
3203 |
proof - |
|
3204 |
have "matrix (h' x) ** matrix (g' (h x)) = mat 1" |
|
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
3205 |
using that id[OF that] der_g[of "h x"] gh[OF that] left_inverse_linear has_derivative_linear |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
68001
diff
changeset
|
3206 |
by (subst matrix_compose[symmetric]) (force simp: matrix_id_mat_1 has_derivative_linear)+ |
67998 | 3207 |
then have "\<bar>det (matrix (h' x))\<bar> * \<bar>det (matrix (g' (h x)))\<bar> = 1" |
3208 |
by (metis abs_1 abs_mult det_I det_mul) |
|
3209 |
then show ?thesis |
|
3210 |
by (simp add: gh that) |
|
3211 |
qed |
|
3212 |
have "?D integrable_on (h ` T)" |
|
3213 |
proof (intro set_lebesgue_integral_eq_integral absolutely_integrable_on_image_real) |
|
3214 |
show "(\<lambda>x. ?fgh x) absolutely_integrable_on T" |
|
3215 |
proof (subst absolutely_integrable_on_iff_nonneg) |
|
3216 |
show "(\<lambda>x. ?fgh x) integrable_on T" |
|
3217 |
using ddf fT integrable_eq by force |
|
3218 |
qed (simp add: zero_le_mult_iff f0 gh) |
|
3219 |
qed (use der_h in auto) |
|
3220 |
with Seq show "(\<lambda>x. ?D x) integrable_on S" |
|
3221 |
by simp |
|
3222 |
have "integral S (\<lambda>x. ?D x) \<le> integral T (\<lambda>x. ?fgh x)" |
|
3223 |
unfolding Seq |
|
3224 |
proof (rule integral_on_image_ubound) |
|
3225 |
show "(\<lambda>x. ?fgh x) integrable_on T" |
|
3226 |
using ddf fT integrable_eq by force |
|
3227 |
qed (use f0 gh der_h in auto) |
|
3228 |
also have "\<dots> = integral T f" |
|
3229 |
by (force simp: ddf intro: integral_cong) |
|
3230 |
also have "\<dots> \<le> b" |
|
3231 |
by (rule intf) |
|
3232 |
finally show "integral S (\<lambda>x. ?D x) \<le> b" . |
|
3233 |
qed |
|
3234 |
next |
|
3235 |
assume R: ?rhs |
|
3236 |
then have "f integrable_on g ` S" |
|
3237 |
using der_g f0 hg integral_on_image_ubound_nonneg by blast |
|
3238 |
moreover have "integral (g ` S) f \<le> integral S (\<lambda>x. ?D x)" |
|
3239 |
by (rule integral_on_image_ubound [OF f0 der_g]) (use R Teq in auto) |
|
3240 |
ultimately show ?lhs |
|
3241 |
using R by (simp add: Teq) |
|
3242 |
qed |
|
3243 |
qed |
|
3244 |
||
3245 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3246 |
lemma cov_invertible_nonneg_eq: |
67998 | 3247 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_" |
3248 |
assumes "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3249 |
and "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)" |
|
3250 |
and "\<And>y. y \<in> T \<Longrightarrow> 0 \<le> f y" |
|
3251 |
and "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x" |
|
3252 |
and "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y" |
|
3253 |
and "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id" |
|
3254 |
shows "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) has_integral b) S \<longleftrightarrow> (f has_integral b) T" |
|
3255 |
using cov_invertible_nonneg_le [OF assms] |
|
3256 |
by (simp add: has_integral_iff) (meson eq_iff) |
|
3257 |
||
3258 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3259 |
lemma cov_invertible_real: |
67998 | 3260 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_" |
3261 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3262 |
and der_h: "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)" |
|
3263 |
and hg: "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x" |
|
3264 |
and gh: "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y" |
|
3265 |
and id: "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id" |
|
3266 |
shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) absolutely_integrable_on S \<and> |
|
3267 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) = b \<longleftrightarrow> |
|
3268 |
f absolutely_integrable_on T \<and> integral T f = b" |
|
3269 |
(is "?lhs = ?rhs") |
|
3270 |
proof - |
|
3271 |
have Teq: "T = g`S" and Seq: "S = h`T" |
|
3272 |
using hg gh image_iff by fastforce+ |
|
3273 |
let ?DP = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)" and ?DN = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> * -f(g x)" |
|
3274 |
have "+": "(?DP has_integral b) {x \<in> S. f (g x) > 0} \<longleftrightarrow> (f has_integral b) {y \<in> T. f y > 0}" for b |
|
3275 |
proof (rule cov_invertible_nonneg_eq) |
|
3276 |
have *: "(\<lambda>x. f (g x)) -` Y \<inter> {x \<in> S. f (g x) > 0} |
|
3277 |
= ((\<lambda>x. f (g x)) -` Y \<inter> S) \<inter> {x \<in> S. f (g x) > 0}" for Y |
|
3278 |
by auto |
|
3279 |
show "(g has_derivative g' x) (at x within {x \<in> S. f (g x) > 0})" if "x \<in> {x \<in> S. f (g x) > 0}" for x |
|
3280 |
using that der_g has_derivative_within_subset by fastforce |
|
3281 |
show "(h has_derivative h' y) (at y within {y \<in> T. f y > 0})" if "y \<in> {y \<in> T. f y > 0}" for y |
|
3282 |
using that der_h has_derivative_within_subset by fastforce |
|
3283 |
qed (use gh hg id in auto) |
|
3284 |
have "-": "(?DN has_integral b) {x \<in> S. f (g x) < 0} \<longleftrightarrow> ((\<lambda>x. - f x) has_integral b) {y \<in> T. f y < 0}" for b |
|
3285 |
proof (rule cov_invertible_nonneg_eq) |
|
3286 |
have *: "(\<lambda>x. - f (g x)) -` y \<inter> {x \<in> S. f (g x) < 0} |
|
3287 |
= ((\<lambda>x. f (g x)) -` uminus ` y \<inter> S) \<inter> {x \<in> S. f (g x) < 0}" for y |
|
3288 |
using image_iff by fastforce |
|
3289 |
show "(g has_derivative g' x) (at x within {x \<in> S. f (g x) < 0})" if "x \<in> {x \<in> S. f (g x) < 0}" for x |
|
3290 |
using that der_g has_derivative_within_subset by fastforce |
|
3291 |
show "(h has_derivative h' y) (at y within {y \<in> T. f y < 0})" if "y \<in> {y \<in> T. f y < 0}" for y |
|
3292 |
using that der_h has_derivative_within_subset by fastforce |
|
3293 |
qed (use gh hg id in auto) |
|
3294 |
show ?thesis |
|
3295 |
proof |
|
3296 |
assume LHS: ?lhs |
|
3297 |
have eq: "{x. (if x \<in> S then ?DP x else 0) > 0} = {x \<in> S. ?DP x > 0}" |
|
3298 |
"{x. (if x \<in> S then ?DP x else 0) < 0} = {x \<in> S. ?DP x < 0}" |
|
3299 |
by auto |
|
3300 |
have "?DP integrable_on S" |
|
3301 |
using LHS absolutely_integrable_on_def by blast |
|
3302 |
then have "(\<lambda>x. if x \<in> S then ?DP x else 0) integrable_on UNIV" |
|
3303 |
by (simp add: integrable_restrict_UNIV) |
|
3304 |
then have D_borel: "(\<lambda>x. if x \<in> S then ?DP x else 0) \<in> borel_measurable (lebesgue_on UNIV)" |
|
3305 |
using integrable_imp_measurable borel_measurable_UNIV_eq by blast |
|
3306 |
then have SN: "{x \<in> S. ?DP x < 0} \<in> sets lebesgue" |
|
3307 |
unfolding borel_measurable_vimage_halfspace_component_lt |
|
3308 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3309 |
from D_borel have SP: "{x \<in> S. ?DP x > 0} \<in> sets lebesgue" |
|
3310 |
unfolding borel_measurable_vimage_halfspace_component_gt |
|
3311 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3312 |
have "?DP absolutely_integrable_on {x \<in> S. ?DP x > 0}" |
|
3313 |
using LHS by (fast intro!: set_integrable_subset [OF _, of _ S] SP) |
|
3314 |
then have aP: "?DP absolutely_integrable_on {x \<in> S. f (g x) > 0}" |
|
3315 |
by (rule absolutely_integrable_spike_set) (auto simp: zero_less_mult_iff empty_imp_negligible) |
|
3316 |
have "?DP absolutely_integrable_on {x \<in> S. ?DP x < 0}" |
|
3317 |
using LHS by (fast intro!: set_integrable_subset [OF _, of _ S] SN) |
|
3318 |
then have aN: "?DP absolutely_integrable_on {x \<in> S. f (g x) < 0}" |
|
3319 |
by (rule absolutely_integrable_spike_set) (auto simp: mult_less_0_iff empty_imp_negligible) |
|
3320 |
have fN: "f integrable_on {y \<in> T. f y < 0}" |
|
3321 |
"integral {y \<in> T. f y < 0} f = integral {x \<in> S. f (g x) < 0} ?DP" |
|
3322 |
using "-" [of "integral {x \<in> S. f(g x) < 0} ?DN"] aN |
|
3323 |
by (auto simp: set_lebesgue_integral_eq_integral has_integral_iff integrable_neg_iff) |
|
3324 |
have faN: "f absolutely_integrable_on {y \<in> T. f y < 0}" |
|
3325 |
apply (rule absolutely_integrable_integrable_bound [where g = "\<lambda>x. - f x"]) |
|
3326 |
using fN by (auto simp: integrable_neg_iff) |
|
3327 |
have fP: "f integrable_on {y \<in> T. f y > 0}" |
|
3328 |
"integral {y \<in> T. f y > 0} f = integral {x \<in> S. f (g x) > 0} ?DP" |
|
3329 |
using "+" [of "integral {x \<in> S. f(g x) > 0} ?DP"] aP |
|
3330 |
by (auto simp: set_lebesgue_integral_eq_integral has_integral_iff integrable_neg_iff) |
|
3331 |
have faP: "f absolutely_integrable_on {y \<in> T. f y > 0}" |
|
3332 |
apply (rule absolutely_integrable_integrable_bound [where g = f]) |
|
3333 |
using fP by auto |
|
3334 |
have fa: "f absolutely_integrable_on ({y \<in> T. f y < 0} \<union> {y \<in> T. f y > 0})" |
|
3335 |
by (rule absolutely_integrable_Un [OF faN faP]) |
|
3336 |
show ?rhs |
|
3337 |
proof |
|
3338 |
have eq: "((if x \<in> T \<and> f x < 0 \<or> x \<in> T \<and> 0 < f x then 1 else 0) * f x) |
|
3339 |
= (if x \<in> T then 1 else 0) * f x" for x |
|
3340 |
by auto |
|
3341 |
show "f absolutely_integrable_on T" |
|
3342 |
using fa by (simp add: indicator_def set_integrable_def eq) |
|
3343 |
have [simp]: "{y \<in> T. f y < 0} \<inter> {y \<in> T. 0 < f y} = {}" for T and f :: "(real^'n::_) \<Rightarrow> real" |
|
3344 |
by auto |
|
3345 |
have "integral T f = integral ({y \<in> T. f y < 0} \<union> {y \<in> T. f y > 0}) f" |
|
3346 |
by (intro empty_imp_negligible integral_spike_set) (auto simp: eq) |
|
3347 |
also have "\<dots> = integral {y \<in> T. f y < 0} f + integral {y \<in> T. f y > 0} f" |
|
3348 |
using fN fP by simp |
|
3349 |
also have "\<dots> = integral {x \<in> S. f (g x) < 0} ?DP + integral {x \<in> S. 0 < f (g x)} ?DP" |
|
3350 |
by (simp add: fN fP) |
|
3351 |
also have "\<dots> = integral ({x \<in> S. f (g x) < 0} \<union> {x \<in> S. 0 < f (g x)}) ?DP" |
|
3352 |
using aP aN by (simp add: set_lebesgue_integral_eq_integral) |
|
3353 |
also have "\<dots> = integral S ?DP" |
|
3354 |
by (intro empty_imp_negligible integral_spike_set) auto |
|
3355 |
also have "\<dots> = b" |
|
3356 |
using LHS by simp |
|
3357 |
finally show "integral T f = b" . |
|
3358 |
qed |
|
3359 |
next |
|
3360 |
assume RHS: ?rhs |
|
3361 |
have eq: "{x. (if x \<in> T then f x else 0) > 0} = {x \<in> T. f x > 0}" |
|
3362 |
"{x. (if x \<in> T then f x else 0) < 0} = {x \<in> T. f x < 0}" |
|
3363 |
by auto |
|
3364 |
have "f integrable_on T" |
|
3365 |
using RHS absolutely_integrable_on_def by blast |
|
3366 |
then have "(\<lambda>x. if x \<in> T then f x else 0) integrable_on UNIV" |
|
3367 |
by (simp add: integrable_restrict_UNIV) |
|
3368 |
then have D_borel: "(\<lambda>x. if x \<in> T then f x else 0) \<in> borel_measurable (lebesgue_on UNIV)" |
|
3369 |
using integrable_imp_measurable borel_measurable_UNIV_eq by blast |
|
3370 |
then have TN: "{x \<in> T. f x < 0} \<in> sets lebesgue" |
|
3371 |
unfolding borel_measurable_vimage_halfspace_component_lt |
|
3372 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3373 |
from D_borel have TP: "{x \<in> T. f x > 0} \<in> sets lebesgue" |
|
3374 |
unfolding borel_measurable_vimage_halfspace_component_gt |
|
3375 |
by (drule_tac x=0 in spec) (auto simp: eq) |
|
3376 |
have aint: "f absolutely_integrable_on {y. y \<in> T \<and> 0 < (f y)}" |
|
3377 |
"f absolutely_integrable_on {y. y \<in> T \<and> (f y) < 0}" |
|
3378 |
and intT: "integral T f = b" |
|
3379 |
using set_integrable_subset [of _ T] TP TN RHS |
|
3380 |
by blast+ |
|
3381 |
show ?lhs |
|
3382 |
proof |
|
3383 |
have fN: "f integrable_on {v \<in> T. f v < 0}" |
|
3384 |
using absolutely_integrable_on_def aint by blast |
|
3385 |
then have DN: "(?DN has_integral integral {y \<in> T. f y < 0} (\<lambda>x. - f x)) {x \<in> S. f (g x) < 0}" |
|
3386 |
using "-" [of "integral {y \<in> T. f y < 0} (\<lambda>x. - f x)"] |
|
3387 |
by (simp add: has_integral_neg_iff integrable_integral) |
|
3388 |
have aDN: "?DP absolutely_integrable_on {x \<in> S. f (g x) < 0}" |
|
3389 |
apply (rule absolutely_integrable_integrable_bound [where g = ?DN]) |
|
3390 |
using DN hg by (fastforce simp: abs_mult integrable_neg_iff)+ |
|
3391 |
have fP: "f integrable_on {v \<in> T. f v > 0}" |
|
3392 |
using absolutely_integrable_on_def aint by blast |
|
3393 |
then have DP: "(?DP has_integral integral {y \<in> T. f y > 0} f) {x \<in> S. f (g x) > 0}" |
|
3394 |
using "+" [of "integral {y \<in> T. f y > 0} f"] |
|
3395 |
by (simp add: has_integral_neg_iff integrable_integral) |
|
3396 |
have aDP: "?DP absolutely_integrable_on {x \<in> S. f (g x) > 0}" |
|
3397 |
apply (rule absolutely_integrable_integrable_bound [where g = ?DP]) |
|
3398 |
using DP hg by (fastforce simp: integrable_neg_iff)+ |
|
3399 |
have eq: "(if x \<in> S then 1 else 0) * ?DP x = (if x \<in> S \<and> f (g x) < 0 \<or> x \<in> S \<and> f (g x) > 0 then 1 else 0) * ?DP x" for x |
|
3400 |
by force |
|
3401 |
have "?DP absolutely_integrable_on ({x \<in> S. f (g x) < 0} \<union> {x \<in> S. f (g x) > 0})" |
|
3402 |
by (rule absolutely_integrable_Un [OF aDN aDP]) |
|
3403 |
then show I: "?DP absolutely_integrable_on S" |
|
3404 |
by (simp add: indicator_def eq set_integrable_def) |
|
3405 |
have [simp]: "{y \<in> S. f y < 0} \<inter> {y \<in> S. 0 < f y} = {}" for S and f :: "(real^'n::_) \<Rightarrow> real" |
|
3406 |
by auto |
|
3407 |
have "integral S ?DP = integral ({x \<in> S. f (g x) < 0} \<union> {x \<in> S. f (g x) > 0}) ?DP" |
|
3408 |
by (intro empty_imp_negligible integral_spike_set) auto |
|
3409 |
also have "\<dots> = integral {x \<in> S. f (g x) < 0} ?DP + integral {x \<in> S. 0 < f (g x)} ?DP" |
|
3410 |
using aDN aDP by (simp add: set_lebesgue_integral_eq_integral) |
|
3411 |
also have "\<dots> = - integral {y \<in> T. f y < 0} (\<lambda>x. - f x) + integral {y \<in> T. f y > 0} f" |
|
3412 |
using DN DP by (auto simp: has_integral_iff) |
|
3413 |
also have "\<dots> = integral ({x \<in> T. f x < 0} \<union> {x \<in> T. 0 < f x}) f" |
|
3414 |
by (simp add: fN fP) |
|
3415 |
also have "\<dots> = integral T f" |
|
3416 |
by (intro empty_imp_negligible integral_spike_set) auto |
|
3417 |
also have "\<dots> = b" |
|
3418 |
using intT by simp |
|
3419 |
finally show "integral S ?DP = b" . |
|
3420 |
qed |
|
3421 |
qed |
|
3422 |
qed |
|
3423 |
||
3424 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3425 |
lemma cv_inv_version3: |
67998 | 3426 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3427 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3428 |
and der_h: "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)" |
|
3429 |
and hg: "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x" |
|
3430 |
and gh: "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y" |
|
3431 |
and id: "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id" |
|
3432 |
shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3433 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b |
|
3434 |
\<longleftrightarrow> f absolutely_integrable_on T \<and> integral T f = b" |
|
3435 |
proof - |
|
3436 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)" |
|
3437 |
have "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x) $ i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * (f(g x) $ i)) = b $ i) \<longleftrightarrow> |
|
3438 |
((\<lambda>x. f x $ i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ i) = b $ i)" for i |
|
3439 |
by (rule cov_invertible_real [OF der_g der_h hg gh id]) |
|
3440 |
then have "?D absolutely_integrable_on S \<and> (?D has_integral b) S \<longleftrightarrow> |
|
3441 |
f absolutely_integrable_on T \<and> (f has_integral b) T" |
|
3442 |
unfolding absolutely_integrable_componentwise_iff [where f=f] has_integral_componentwise_iff [of f] |
|
3443 |
absolutely_integrable_componentwise_iff [where f="?D"] has_integral_componentwise_iff [of ?D] |
|
3444 |
by (auto simp: all_conj_distrib Basis_vec_def cart_eq_inner_axis [symmetric] |
|
3445 |
has_integral_iff set_lebesgue_integral_eq_integral) |
|
3446 |
then show ?thesis |
|
3447 |
using absolutely_integrable_on_def by blast |
|
3448 |
qed |
|
3449 |
||
3450 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3451 |
lemma cv_inv_version4: |
67998 | 3452 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3453 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S) \<and> invertible(matrix(g' x))" |
|
3454 |
and hg: "\<And>x. x \<in> S \<Longrightarrow> continuous_on (g ` S) h \<and> h(g x) = x" |
|
3455 |
shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3456 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b |
|
3457 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3458 |
proof - |
|
3459 |
have "\<forall>x. \<exists>h'. x \<in> S |
|
3460 |
\<longrightarrow> (g has_derivative g' x) (at x within S) \<and> linear h' \<and> g' x \<circ> h' = id \<and> h' \<circ> g' x = id" |
|
3461 |
using der_g matrix_invertible has_derivative_linear by blast |
|
3462 |
then obtain h' where h': |
|
3463 |
"\<And>x. x \<in> S |
|
3464 |
\<Longrightarrow> (g has_derivative g' x) (at x within S) \<and> |
|
3465 |
linear (h' x) \<and> g' x \<circ> (h' x) = id \<and> (h' x) \<circ> g' x = id" |
|
3466 |
by metis |
|
3467 |
show ?thesis |
|
3468 |
proof (rule cv_inv_version3) |
|
3469 |
show "\<And>y. y \<in> g ` S \<Longrightarrow> (h has_derivative h' (h y)) (at y within g ` S)" |
|
3470 |
using h' hg |
|
3471 |
by (force simp: continuous_on_eq_continuous_within intro!: has_derivative_inverse_within) |
|
3472 |
qed (use h' hg in auto) |
|
3473 |
qed |
|
3474 |
||
3475 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3476 |
proposition has_absolute_integral_change_of_variables_invertible: |
67998 | 3477 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3478 |
assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3479 |
and hg: "\<And>x. x \<in> S \<Longrightarrow> h(g x) = x" |
|
3480 |
and conth: "continuous_on (g ` S) h" |
|
3481 |
shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b \<longleftrightarrow> |
|
3482 |
f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3483 |
(is "?lhs = ?rhs") |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3484 |
proof - |
67998 | 3485 |
let ?S = "{x \<in> S. invertible (matrix (g' x))}" and ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)" |
3486 |
have *: "?D absolutely_integrable_on ?S \<and> integral ?S ?D = b |
|
3487 |
\<longleftrightarrow> f absolutely_integrable_on (g ` ?S) \<and> integral (g ` ?S) f = b" |
|
3488 |
proof (rule cv_inv_version4) |
|
3489 |
show "(g has_derivative g' x) (at x within ?S) \<and> invertible (matrix (g' x))" |
|
3490 |
if "x \<in> ?S" for x |
|
3491 |
using der_g that has_derivative_within_subset that by fastforce |
|
3492 |
show "continuous_on (g ` ?S) h \<and> h (g x) = x" |
|
3493 |
if "x \<in> ?S" for x |
|
3494 |
using that continuous_on_subset [OF conth] by (simp add: hg image_mono) |
|
3495 |
qed |
|
3496 |
have "(g has_derivative g' x) (at x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})" if "x \<in> S" for x |
|
3497 |
by (metis (no_types, lifting) der_g has_derivative_within_subset mem_Collect_eq subsetI that) |
|
3498 |
then have "negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})" |
|
3499 |
by (auto simp: invertible_det_nz det_eq_0_rank intro: baby_Sard) |
|
3500 |
then have neg: "negligible {x \<in> g ` S. x \<notin> g ` ?S \<and> f x \<noteq> 0}" |
|
3501 |
by (auto intro: negligible_subset) |
|
3502 |
have [simp]: "{x \<in> g ` ?S. x \<notin> g ` S \<and> f x \<noteq> 0} = {}" |
|
3503 |
by auto |
|
3504 |
have "?D absolutely_integrable_on ?S \<and> integral ?S ?D = b |
|
3505 |
\<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b" |
|
3506 |
apply (intro conj_cong absolutely_integrable_spike_set_eq) |
|
3507 |
apply(auto simp: integral_spike_set invertible_det_nz empty_imp_negligible neg) |
|
3508 |
done |
|
3509 |
moreover |
|
3510 |
have "f absolutely_integrable_on (g ` ?S) \<and> integral (g ` ?S) f = b |
|
3511 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3512 |
by (auto intro!: conj_cong absolutely_integrable_spike_set_eq integral_spike_set neg) |
|
3513 |
ultimately |
|
3514 |
show ?thesis |
|
3515 |
using "*" by blast |
|
3516 |
qed |
|
3517 |
||
3518 |
||
3519 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3520 |
proposition has_absolute_integral_change_of_variables_compact: |
67998 | 3521 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3522 |
assumes "compact S" |
|
3523 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3524 |
and inj: "inj_on g S" |
|
3525 |
shows "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3526 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b |
|
3527 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b)" |
|
3528 |
proof - |
|
3529 |
obtain h where hg: "\<And>x. x \<in> S \<Longrightarrow> h(g x) = x" |
|
3530 |
using inj by (metis the_inv_into_f_f) |
|
3531 |
have conth: "continuous_on (g ` S) h" |
|
3532 |
by (metis \<open>compact S\<close> continuous_on_inv der_g has_derivative_continuous_on hg) |
|
3533 |
show ?thesis |
|
3534 |
by (rule has_absolute_integral_change_of_variables_invertible [OF der_g hg conth]) |
|
3535 |
qed |
|
3536 |
||
3537 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3538 |
lemma has_absolute_integral_change_of_variables_compact_family: |
67998 | 3539 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3540 |
assumes compact: "\<And>n::nat. compact (F n)" |
|
3541 |
and der_g: "\<And>x. x \<in> (\<Union>n. F n) \<Longrightarrow> (g has_derivative g' x) (at x within (\<Union>n. F n))" |
|
3542 |
and inj: "inj_on g (\<Union>n. F n)" |
|
3543 |
shows "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on (\<Union>n. F n) \<and> |
|
3544 |
integral (\<Union>n. F n) (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b |
|
3545 |
\<longleftrightarrow> f absolutely_integrable_on (g ` (\<Union>n. F n)) \<and> integral (g ` (\<Union>n. F n)) f = b)" |
|
3546 |
proof - |
|
3547 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)" |
|
3548 |
let ?U = "\<lambda>n. \<Union>m\<le>n. F m" |
|
3549 |
let ?lift = "vec::real\<Rightarrow>real^1" |
|
3550 |
have F_leb: "F m \<in> sets lebesgue" for m |
|
3551 |
by (simp add: compact borel_compact) |
|
3552 |
have iff: "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on (?U n) \<and> |
|
3553 |
integral (?U n) (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b |
|
3554 |
\<longleftrightarrow> f absolutely_integrable_on (g ` (?U n)) \<and> integral (g ` (?U n)) f = b" for n b and f :: "real^'m::_ \<Rightarrow> real^'k" |
|
3555 |
proof (rule has_absolute_integral_change_of_variables_compact) |
|
3556 |
show "compact (?U n)" |
|
3557 |
by (simp add: compact compact_UN) |
|
3558 |
show "(g has_derivative g' x) (at x within (?U n))" |
|
3559 |
if "x \<in> ?U n" for x |
|
3560 |
using that by (blast intro!: has_derivative_within_subset [OF der_g]) |
|
3561 |
show "inj_on g (?U n)" |
|
3562 |
using inj by (auto simp: inj_on_def) |
|
3563 |
qed |
|
3564 |
show ?thesis |
|
3565 |
unfolding image_UN |
|
3566 |
proof safe |
|
3567 |
assume DS: "?D absolutely_integrable_on (\<Union>n. F n)" |
|
3568 |
and b: "b = integral (\<Union>n. F n) ?D" |
|
3569 |
have DU: "\<And>n. ?D absolutely_integrable_on (?U n)" |
|
3570 |
"(\<lambda>n. integral (?U n) ?D) \<longlonglongrightarrow> integral (\<Union>n. F n) ?D" |
|
3571 |
using integral_countable_UN [OF DS F_leb] by auto |
|
3572 |
with iff have fag: "f absolutely_integrable_on g ` (?U n)" |
|
3573 |
and fg_int: "integral (\<Union>m\<le>n. g ` F m) f = integral (?U n) ?D" for n |
|
3574 |
by (auto simp: image_UN) |
|
3575 |
let ?h = "\<lambda>x. if x \<in> (\<Union>m. g ` F m) then norm(f x) else 0" |
|
3576 |
have "(\<lambda>x. if x \<in> (\<Union>m. g ` F m) then f x else 0) absolutely_integrable_on UNIV" |
|
3577 |
proof (rule dominated_convergence_absolutely_integrable) |
|
3578 |
show "(\<lambda>x. if x \<in> (\<Union>m\<le>k. g ` F m) then f x else 0) absolutely_integrable_on UNIV" for k |
|
3579 |
unfolding absolutely_integrable_restrict_UNIV |
|
3580 |
using fag by (simp add: image_UN) |
|
3581 |
let ?nf = "\<lambda>n x. if x \<in> (\<Union>m\<le>n. g ` F m) then norm(f x) else 0" |
|
3582 |
show "?h integrable_on UNIV" |
|
3583 |
proof (rule monotone_convergence_increasing [THEN conjunct1]) |
|
3584 |
show "?nf k integrable_on UNIV" for k |
|
3585 |
using fag |
|
3586 |
unfolding integrable_restrict_UNIV absolutely_integrable_on_def by (simp add: image_UN) |
|
3587 |
{ fix n |
|
3588 |
have "(norm \<circ> ?D) absolutely_integrable_on ?U n" |
|
3589 |
by (intro absolutely_integrable_norm DU) |
|
3590 |
then have "integral (g ` ?U n) (norm \<circ> f) = integral (?U n) (norm \<circ> ?D)" |
|
3591 |
using iff [of n "vec \<circ> norm \<circ> f" "integral (?U n) (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R (?lift \<circ> norm \<circ> f) (g x))"] |
|
3592 |
unfolding absolutely_integrable_on_1_iff integral_on_1_eq by (auto simp: o_def) |
|
3593 |
} |
|
3594 |
moreover have "bounded (range (\<lambda>k. integral (?U k) (norm \<circ> ?D)))" |
|
3595 |
unfolding bounded_iff |
|
3596 |
proof (rule exI, clarify) |
|
3597 |
fix k |
|
3598 |
show "norm (integral (?U k) (norm \<circ> ?D)) \<le> integral (\<Union>n. F n) (norm \<circ> ?D)" |
|
3599 |
unfolding integral_restrict_UNIV [of _ "norm \<circ> ?D", symmetric] |
|
3600 |
proof (rule integral_norm_bound_integral) |
|
69325 | 3601 |
show "(\<lambda>x. if x \<in> \<Union> (F ` {..k}) then (norm \<circ> ?D) x else 0) integrable_on UNIV" |
67998 | 3602 |
"(\<lambda>x. if x \<in> (\<Union>n. F n) then (norm \<circ> ?D) x else 0) integrable_on UNIV" |
3603 |
using DU(1) DS |
|
3604 |
unfolding absolutely_integrable_on_def o_def integrable_restrict_UNIV by auto |
|
3605 |
qed auto |
|
3606 |
qed |
|
3607 |
ultimately show "bounded (range (\<lambda>k. integral UNIV (?nf k)))" |
|
3608 |
by (simp add: integral_restrict_UNIV image_UN [symmetric] o_def) |
|
3609 |
next |
|
3610 |
show "(\<lambda>k. if x \<in> (\<Union>m\<le>k. g ` F m) then norm (f x) else 0) |
|
3611 |
\<longlonglongrightarrow> (if x \<in> (\<Union>m. g ` F m) then norm (f x) else 0)" for x |
|
3612 |
by (force intro: Lim_eventually eventually_sequentiallyI) |
|
3613 |
qed auto |
|
3614 |
next |
|
3615 |
show "(\<lambda>k. if x \<in> (\<Union>m\<le>k. g ` F m) then f x else 0) |
|
3616 |
\<longlonglongrightarrow> (if x \<in> (\<Union>m. g ` F m) then f x else 0)" for x |
|
3617 |
proof clarsimp |
|
3618 |
fix m y |
|
3619 |
assume "y \<in> F m" |
|
3620 |
show "(\<lambda>k. if \<exists>x\<in>{..k}. g y \<in> g ` F x then f (g y) else 0) \<longlonglongrightarrow> f (g y)" |
|
3621 |
using \<open>y \<in> F m\<close> by (force intro: Lim_eventually eventually_sequentiallyI [of m]) |
|
3622 |
qed |
|
3623 |
qed auto |
|
3624 |
then show fai: "f absolutely_integrable_on (\<Union>m. g ` F m)" |
|
3625 |
using absolutely_integrable_restrict_UNIV by blast |
|
3626 |
show "integral ((\<Union>x. g ` F x)) f = integral (\<Union>n. F n) ?D" |
|
3627 |
proof (rule LIMSEQ_unique) |
|
3628 |
show "(\<lambda>n. integral (?U n) ?D) \<longlonglongrightarrow> integral (\<Union>x. g ` F x) f" |
|
3629 |
unfolding fg_int [symmetric] |
|
3630 |
proof (rule integral_countable_UN [OF fai]) |
|
3631 |
show "g ` F m \<in> sets lebesgue" for m |
|
3632 |
proof (rule differentiable_image_in_sets_lebesgue [OF F_leb]) |
|
3633 |
show "g differentiable_on F m" |
|
3634 |
by (meson der_g differentiableI UnionI differentiable_on_def differentiable_on_subset rangeI subsetI) |
|
3635 |
qed auto |
|
3636 |
qed |
|
3637 |
next |
|
3638 |
show "(\<lambda>n. integral (?U n) ?D) \<longlonglongrightarrow> integral (\<Union>n. F n) ?D" |
|
3639 |
by (rule DU) |
|
3640 |
qed |
|
3641 |
next |
|
3642 |
assume fs: "f absolutely_integrable_on (\<Union>x. g ` F x)" |
|
3643 |
and b: "b = integral ((\<Union>x. g ` F x)) f" |
|
3644 |
have gF_leb: "g ` F m \<in> sets lebesgue" for m |
|
3645 |
proof (rule differentiable_image_in_sets_lebesgue [OF F_leb]) |
|
3646 |
show "g differentiable_on F m" |
|
3647 |
using der_g unfolding differentiable_def differentiable_on_def |
|
3648 |
by (meson Sup_upper UNIV_I UnionI has_derivative_within_subset image_eqI) |
|
3649 |
qed auto |
|
3650 |
have fgU: "\<And>n. f absolutely_integrable_on (\<Union>m\<le>n. g ` F m)" |
|
3651 |
"(\<lambda>n. integral (\<Union>m\<le>n. g ` F m) f) \<longlonglongrightarrow> integral (\<Union>m. g ` F m) f" |
|
3652 |
using integral_countable_UN [OF fs gF_leb] by auto |
|
3653 |
with iff have DUn: "?D absolutely_integrable_on ?U n" |
|
3654 |
and D_int: "integral (?U n) ?D = integral (\<Union>m\<le>n. g ` F m) f" for n |
|
3655 |
by (auto simp: image_UN) |
|
3656 |
let ?h = "\<lambda>x. if x \<in> (\<Union>n. F n) then norm(?D x) else 0" |
|
3657 |
have "(\<lambda>x. if x \<in> (\<Union>n. F n) then ?D x else 0) absolutely_integrable_on UNIV" |
|
3658 |
proof (rule dominated_convergence_absolutely_integrable) |
|
3659 |
show "(\<lambda>x. if x \<in> ?U k then ?D x else 0) absolutely_integrable_on UNIV" for k |
|
3660 |
unfolding absolutely_integrable_restrict_UNIV using DUn by simp |
|
3661 |
let ?nD = "\<lambda>n x. if x \<in> ?U n then norm(?D x) else 0" |
|
3662 |
show "?h integrable_on UNIV" |
|
3663 |
proof (rule monotone_convergence_increasing [THEN conjunct1]) |
|
3664 |
show "?nD k integrable_on UNIV" for k |
|
3665 |
using DUn |
|
3666 |
unfolding integrable_restrict_UNIV absolutely_integrable_on_def by (simp add: image_UN) |
|
3667 |
{ fix n::nat |
|
3668 |
have "(norm \<circ> f) absolutely_integrable_on (\<Union>m\<le>n. g ` F m)" |
|
3669 |
apply (rule absolutely_integrable_norm) |
|
3670 |
using fgU by blast |
|
3671 |
then have "integral (?U n) (norm \<circ> ?D) = integral (g ` ?U n) (norm \<circ> f)" |
|
3672 |
using iff [of n "?lift \<circ> norm \<circ> f" "integral (g ` ?U n) (?lift \<circ> norm \<circ> f)"] |
|
3673 |
unfolding absolutely_integrable_on_1_iff integral_on_1_eq image_UN by (auto simp: o_def) |
|
3674 |
} |
|
3675 |
moreover have "bounded (range (\<lambda>k. integral (g ` ?U k) (norm \<circ> f)))" |
|
3676 |
unfolding bounded_iff |
|
3677 |
proof (rule exI, clarify) |
|
3678 |
fix k |
|
3679 |
show "norm (integral (g ` ?U k) (norm \<circ> f)) \<le> integral (g ` (\<Union>n. F n)) (norm \<circ> f)" |
|
3680 |
unfolding integral_restrict_UNIV [of _ "norm \<circ> f", symmetric] |
|
3681 |
proof (rule integral_norm_bound_integral) |
|
3682 |
show "(\<lambda>x. if x \<in> g ` ?U k then (norm \<circ> f) x else 0) integrable_on UNIV" |
|
3683 |
"(\<lambda>x. if x \<in> g ` (\<Union>n. F n) then (norm \<circ> f) x else 0) integrable_on UNIV" |
|
3684 |
using fgU fs |
|
3685 |
unfolding absolutely_integrable_on_def o_def integrable_restrict_UNIV |
|
3686 |
by (auto simp: image_UN) |
|
3687 |
qed auto |
|
3688 |
qed |
|
3689 |
ultimately show "bounded (range (\<lambda>k. integral UNIV (?nD k)))" |
|
3690 |
unfolding integral_restrict_UNIV image_UN [symmetric] o_def by simp |
|
3691 |
next |
|
3692 |
show "(\<lambda>k. if x \<in> ?U k then norm (?D x) else 0) \<longlonglongrightarrow> (if x \<in> (\<Union>n. F n) then norm (?D x) else 0)" for x |
|
3693 |
by (force intro: Lim_eventually eventually_sequentiallyI) |
|
3694 |
qed auto |
|
3695 |
next |
|
3696 |
show "(\<lambda>k. if x \<in> ?U k then ?D x else 0) \<longlonglongrightarrow> (if x \<in> (\<Union>n. F n) then ?D x else 0)" for x |
|
3697 |
proof clarsimp |
|
3698 |
fix n |
|
3699 |
assume "x \<in> F n" |
|
3700 |
show "(\<lambda>m. if \<exists>j\<in>{..m}. x \<in> F j then ?D x else 0) \<longlonglongrightarrow> ?D x" |
|
3701 |
using \<open>x \<in> F n\<close> by (auto intro!: Lim_eventually eventually_sequentiallyI [of n]) |
|
3702 |
qed |
|
3703 |
qed auto |
|
3704 |
then show Dai: "?D absolutely_integrable_on (\<Union>n. F n)" |
|
3705 |
unfolding absolutely_integrable_restrict_UNIV by simp |
|
3706 |
show "integral (\<Union>n. F n) ?D = integral ((\<Union>x. g ` F x)) f" |
|
3707 |
proof (rule LIMSEQ_unique) |
|
3708 |
show "(\<lambda>n. integral (\<Union>m\<le>n. g ` F m) f) \<longlonglongrightarrow> integral (\<Union>x. g ` F x) f" |
|
3709 |
by (rule fgU) |
|
3710 |
show "(\<lambda>n. integral (\<Union>m\<le>n. g ` F m) f) \<longlonglongrightarrow> integral (\<Union>n. F n) ?D" |
|
3711 |
unfolding D_int [symmetric] by (rule integral_countable_UN [OF Dai F_leb]) |
|
3712 |
qed |
|
3713 |
qed |
|
3714 |
qed |
|
3715 |
||
3716 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3717 |
proposition has_absolute_integral_change_of_variables: |
67998 | 3718 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3719 |
assumes S: "S \<in> sets lebesgue" |
|
3720 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3721 |
and inj: "inj_on g S" |
|
3722 |
shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3723 |
integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b |
|
3724 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3725 |
proof - |
67998 | 3726 |
obtain C N where "fsigma C" "negligible N" and CNS: "C \<union> N = S" and "disjnt C N" |
3727 |
using lebesgue_set_almost_fsigma [OF S] . |
|
3728 |
then obtain F :: "nat \<Rightarrow> (real^'m::_) set" |
|
3729 |
where F: "range F \<subseteq> Collect compact" and Ceq: "C = Union(range F)" |
|
3730 |
using fsigma_Union_compact by metis |
|
3731 |
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)" |
|
3732 |
have "?D absolutely_integrable_on C \<and> integral C ?D = b |
|
3733 |
\<longleftrightarrow> f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b" |
|
3734 |
unfolding Ceq |
|
3735 |
proof (rule has_absolute_integral_change_of_variables_compact_family) |
|
3736 |
fix n x |
|
69313 | 3737 |
assume "x \<in> \<Union>(F ` UNIV)" |
3738 |
then show "(g has_derivative g' x) (at x within \<Union>(F ` UNIV))" |
|
67998 | 3739 |
using Ceq \<open>C \<union> N = S\<close> der_g has_derivative_within_subset by blast |
3740 |
next |
|
69313 | 3741 |
have "\<Union>(F ` UNIV) \<subseteq> S" |
67998 | 3742 |
using Ceq \<open>C \<union> N = S\<close> by blast |
69313 | 3743 |
then show "inj_on g (\<Union>(F ` UNIV))" |
67998 | 3744 |
using inj by (meson inj_on_subset) |
3745 |
qed (use F in auto) |
|
3746 |
moreover |
|
3747 |
have "?D absolutely_integrable_on C \<and> integral C ?D = b |
|
3748 |
\<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b" |
|
3749 |
proof (rule conj_cong) |
|
3750 |
have neg: "negligible {x \<in> C - S. ?D x \<noteq> 0}" "negligible {x \<in> S - C. ?D x \<noteq> 0}" |
|
3751 |
using CNS by (blast intro: negligible_subset [OF \<open>negligible N\<close>])+ |
|
3752 |
then show "(?D absolutely_integrable_on C) = (?D absolutely_integrable_on S)" |
|
3753 |
by (rule absolutely_integrable_spike_set_eq) |
|
3754 |
show "(integral C ?D = b) \<longleftrightarrow> (integral S ?D = b)" |
|
3755 |
using integral_spike_set [OF neg] by simp |
|
3756 |
qed |
|
3757 |
moreover |
|
3758 |
have "f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b |
|
3759 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3760 |
proof (rule conj_cong) |
|
3761 |
have "g differentiable_on N" |
|
3762 |
by (metis CNS der_g differentiable_def differentiable_on_def differentiable_on_subset sup.cobounded2) |
|
3763 |
with \<open>negligible N\<close> |
|
3764 |
have neg_gN: "negligible (g ` N)" |
|
3765 |
by (blast intro: negligible_differentiable_image_negligible) |
|
3766 |
have neg: "negligible {x \<in> g ` C - g ` S. f x \<noteq> 0}" |
|
3767 |
"negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}" |
|
3768 |
using CNS by (blast intro: negligible_subset [OF neg_gN])+ |
|
3769 |
then show "(f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)" |
|
3770 |
by (rule absolutely_integrable_spike_set_eq) |
|
3771 |
show "(integral (g ` C) f = b) \<longleftrightarrow> (integral (g ` S) f = b)" |
|
3772 |
using integral_spike_set [OF neg] by simp |
|
3773 |
qed |
|
3774 |
ultimately show ?thesis |
|
3775 |
by simp |
|
3776 |
qed |
|
3777 |
||
3778 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3779 |
corollary absolutely_integrable_change_of_variables: |
67998 | 3780 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3781 |
assumes "S \<in> sets lebesgue" |
|
3782 |
and "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3783 |
and "inj_on g S" |
|
3784 |
shows "f absolutely_integrable_on (g ` S) |
|
3785 |
\<longleftrightarrow> (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3786 |
using assms has_absolute_integral_change_of_variables by blast |
67998 | 3787 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3788 |
corollary integral_change_of_variables: |
67998 | 3789 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3790 |
assumes S: "S \<in> sets lebesgue" |
|
3791 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)" |
|
3792 |
and inj: "inj_on g S" |
|
3793 |
and disj: "(f absolutely_integrable_on (g ` S) \<or> |
|
3794 |
(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S)" |
|
3795 |
shows "integral (g ` S) f = integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x))" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3796 |
using has_absolute_integral_change_of_variables [OF S der_g inj] disj |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3797 |
by blast |
67998 | 3798 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3799 |
lemma has_absolute_integral_change_of_variables_1: |
67998 | 3800 |
fixes f :: "real \<Rightarrow> real^'n::{finite,wellorder}" and g :: "real \<Rightarrow> real" |
3801 |
assumes S: "S \<in> sets lebesgue" |
|
3802 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_vector_derivative g' x) (at x within S)" |
|
3803 |
and inj: "inj_on g S" |
|
3804 |
shows "(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3805 |
integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)) = b |
|
3806 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3807 |
proof - |
|
3808 |
let ?lift = "vec :: real \<Rightarrow> real^1" |
|
3809 |
let ?drop = "(\<lambda>x::real^1. x $ 1)" |
|
3810 |
have S': "?lift ` S \<in> sets lebesgue" |
|
3811 |
by (auto intro: differentiable_image_in_sets_lebesgue [OF S] differentiable_vec) |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
3812 |
have "((\<lambda>x. vec (g (x $ 1))) has_derivative (*\<^sub>R) (g' z)) (at (vec z) within ?lift ` S)" |
67998 | 3813 |
if "z \<in> S" for z |
3814 |
using der_g [OF that] |
|
3815 |
by (simp add: has_vector_derivative_def has_derivative_vector_1) |
|
3816 |
then have der': "\<And>x. x \<in> ?lift ` S \<Longrightarrow> |
|
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
3817 |
(?lift \<circ> g \<circ> ?drop has_derivative (*\<^sub>R) (g' (?drop x))) (at x within ?lift ` S)" |
67998 | 3818 |
by (auto simp: o_def) |
3819 |
have inj': "inj_on (vec \<circ> g \<circ> ?drop) (vec ` S)" |
|
3820 |
using inj by (simp add: inj_on_def) |
|
3821 |
let ?fg = "\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)" |
|
3822 |
have "((\<lambda>x. ?fg x $ i) absolutely_integrable_on S \<and> ((\<lambda>x. ?fg x $ i) has_integral b $ i) S |
|
3823 |
\<longleftrightarrow> (\<lambda>x. f x $ i) absolutely_integrable_on g ` S \<and> ((\<lambda>x. f x $ i) has_integral b $ i) (g ` S))" for i |
|
3824 |
using has_absolute_integral_change_of_variables [OF S' der' inj', of "\<lambda>x. ?lift(f (?drop x) $ i)" "?lift (b$i)"] |
|
3825 |
unfolding integrable_on_1_iff integral_on_1_eq absolutely_integrable_on_1_iff absolutely_integrable_drop absolutely_integrable_on_def |
|
3826 |
by (auto simp: image_comp o_def integral_vec1_eq has_integral_iff) |
|
3827 |
then have "?fg absolutely_integrable_on S \<and> (?fg has_integral b) S |
|
3828 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> (f has_integral b) (g ` S)" |
|
3829 |
unfolding has_integral_componentwise_iff [where y=b] |
|
3830 |
absolutely_integrable_componentwise_iff [where f=f] |
|
3831 |
absolutely_integrable_componentwise_iff [where f = ?fg] |
|
3832 |
by (force simp: Basis_vec_def cart_eq_inner_axis) |
|
3833 |
then show ?thesis |
|
3834 |
using absolutely_integrable_on_def by blast |
|
3835 |
qed |
|
3836 |
||
3837 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3838 |
corollary absolutely_integrable_change_of_variables_1: |
67998 | 3839 |
fixes f :: "real \<Rightarrow> real^'n::{finite,wellorder}" and g :: "real \<Rightarrow> real" |
3840 |
assumes S: "S \<in> sets lebesgue" |
|
3841 |
and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_vector_derivative g' x) (at x within S)" |
|
3842 |
and inj: "inj_on g S" |
|
3843 |
shows "(f absolutely_integrable_on g ` S \<longleftrightarrow> |
|
3844 |
(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3845 |
using has_absolute_integral_change_of_variables_1 [OF assms] by auto |
67998 | 3846 |
|
3847 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3848 |
subsection%important\<open>Change of variables for integrals: special case of linear function\<close> |
67998 | 3849 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3850 |
lemma has_absolute_integral_change_of_variables_linear: |
67998 | 3851 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3852 |
assumes "linear g" |
|
3853 |
shows "(\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> |
|
3854 |
integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f(g x)) = b |
|
3855 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b" |
|
3856 |
proof (cases "det(matrix g) = 0") |
|
3857 |
case True |
|
3858 |
then have "negligible(g ` S)" |
|
3859 |
using assms det_nz_iff_inj negligible_linear_singular_image by blast |
|
3860 |
with True show ?thesis |
|
3861 |
by (auto simp: absolutely_integrable_on_def integrable_negligible integral_negligible) |
|
3862 |
next |
|
3863 |
case False |
|
3864 |
then obtain h where h: "\<And>x. x \<in> S \<Longrightarrow> h (g x) = x" "linear h" |
|
3865 |
using assms det_nz_iff_inj linear_injective_isomorphism by blast |
|
3866 |
show ?thesis |
|
3867 |
proof (rule has_absolute_integral_change_of_variables_invertible) |
|
3868 |
show "(g has_derivative g) (at x within S)" for x |
|
3869 |
by (simp add: assms linear_imp_has_derivative) |
|
3870 |
show "continuous_on (g ` S) h" |
|
3871 |
using continuous_on_eq_continuous_within has_derivative_continuous linear_imp_has_derivative h by blast |
|
3872 |
qed (use h in auto) |
|
3873 |
qed |
|
3874 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3875 |
lemma absolutely_integrable_change_of_variables_linear: |
67998 | 3876 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3877 |
assumes "linear g" |
|
3878 |
shows "(\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S |
|
3879 |
\<longleftrightarrow> f absolutely_integrable_on (g ` S)" |
|
3880 |
using assms has_absolute_integral_change_of_variables_linear by blast |
|
3881 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3882 |
lemma absolutely_integrable_on_linear_image: |
67998 | 3883 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3884 |
assumes "linear g" |
|
3885 |
shows "f absolutely_integrable_on (g ` S) |
|
3886 |
\<longleftrightarrow> (f \<circ> g) absolutely_integrable_on S \<or> det(matrix g) = 0" |
|
3887 |
unfolding assms absolutely_integrable_change_of_variables_linear [OF assms, symmetric] absolutely_integrable_on_scaleR_iff |
|
3888 |
by (auto simp: set_integrable_def) |
|
3889 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3890 |
lemma integral_change_of_variables_linear: |
67998 | 3891 |
fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_" |
3892 |
assumes "linear g" |
|
3893 |
and "f absolutely_integrable_on (g ` S) \<or> (f \<circ> g) absolutely_integrable_on S" |
|
3894 |
shows "integral (g ` S) f = \<bar>det (matrix g)\<bar> *\<^sub>R integral S (f \<circ> g)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3895 |
proof - |
67998 | 3896 |
have "((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S) \<or> (f absolutely_integrable_on g ` S)" |
3897 |
using absolutely_integrable_on_linear_image assms by blast |
|
3898 |
moreover |
|
3899 |
have ?thesis if "((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S)" "(f absolutely_integrable_on g ` S)" |
|
3900 |
using has_absolute_integral_change_of_variables_linear [OF \<open>linear g\<close>] that |
|
3901 |
by (auto simp: o_def) |
|
3902 |
ultimately show ?thesis |
|
3903 |
using absolutely_integrable_change_of_variables_linear [OF \<open>linear g\<close>] |
|
3904 |
by blast |
|
3905 |
qed |
|
3906 |
||
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3907 |
subsection%important\<open>Change of variable for measure\<close> |
67998 | 3908 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3909 |
lemma has_measure_differentiable_image: |
67998 | 3910 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
3911 |
assumes "S \<in> sets lebesgue" |
|
3912 |
and "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
3913 |
and "inj_on f S" |
|
3914 |
shows "f ` S \<in> lmeasurable \<and> measure lebesgue (f ` S) = m |
|
3915 |
\<longleftrightarrow> ((\<lambda>x. \<bar>det (matrix (f' x))\<bar>) has_integral m) S" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3916 |
using has_absolute_integral_change_of_variables [OF assms, of "\<lambda>x. (1::real^1)" "vec m"] |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3917 |
unfolding absolutely_integrable_on_1_iff integral_on_1_eq integrable_on_1_iff absolutely_integrable_on_def |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3918 |
by (auto simp: has_integral_iff lmeasurable_iff_integrable_on lmeasure_integral) |
67998 | 3919 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3920 |
lemma measurable_differentiable_image_eq: |
67998 | 3921 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
3922 |
assumes "S \<in> sets lebesgue" |
|
3923 |
and "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
3924 |
and "inj_on f S" |
|
3925 |
shows "f ` S \<in> lmeasurable \<longleftrightarrow> (\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on S" |
|
3926 |
using has_measure_differentiable_image [OF assms] |
|
3927 |
by blast |
|
3928 |
||
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3929 |
lemma measurable_differentiable_image_alt: |
67998 | 3930 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
3931 |
assumes "S \<in> sets lebesgue" |
|
3932 |
and "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
3933 |
and "inj_on f S" |
|
3934 |
shows "f ` S \<in> lmeasurable \<longleftrightarrow> (\<lambda>x. \<bar>det (matrix (f' x))\<bar>) absolutely_integrable_on S" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3935 |
using measurable_differentiable_image_eq [OF assms] |
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3936 |
by (simp only: absolutely_integrable_on_iff_nonneg) |
67998 | 3937 |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3938 |
lemma measure_differentiable_image_eq: |
67998 | 3939 |
fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real^'n::_" |
3940 |
assumes S: "S \<in> sets lebesgue" |
|
3941 |
and der_f: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
3942 |
and inj: "inj_on f S" |
|
3943 |
and intS: "(\<lambda>x. \<bar>det (matrix (f' x))\<bar>) integrable_on S" |
|
3944 |
shows "measure lebesgue (f ` S) = integral S (\<lambda>x. \<bar>det (matrix (f' x))\<bar>)" |
|
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69661
diff
changeset
|
3945 |
using measurable_differentiable_image_eq [OF S der_f inj] |
68833
fde093888c16
tagged 21 theories in the Analysis library for the manual
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
68532
diff
changeset
|
3946 |
assms has_measure_differentiable_image by%unimportant blast |
67998 | 3947 |
|
3948 |
end |