src/HOL/Analysis/Change_Of_Vars.thy
changeset 73932 fd21b4a93043
parent 73648 1bd3463e30b8
child 73933 fa92bc604c59
equal deleted inserted replaced
73866:66bff50bc5f1 73932:fd21b4a93043
   196               by (simp add: field_simps image_comp o_def)
   196               by (simp add: field_simps image_comp o_def)
   197             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)"
   197             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)"
   198               by simp
   198               by simp
   199             have "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar>
   199             have "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar>
   200                  = \<bar>prod m UNIV\<bar> * \<bar>z - measure lebesgue S\<bar>"
   200                  = \<bar>prod m UNIV\<bar> * \<bar>z - measure lebesgue S\<bar>"
   201               by (metis (no_types, hide_lams) abs_abs abs_scaleR mult.commute real_scaleR_def right_diff_distrib')
   201               by (metis (no_types, opaque_lifting) abs_abs abs_scaleR mult.commute real_scaleR_def right_diff_distrib')
   202             also have "\<dots> < e"
   202             also have "\<dots> < e"
   203               using zless True by (simp add: field_simps)
   203               using zless True by (simp add: field_simps)
   204             finally show "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e" .
   204             finally show "\<bar>z *\<^sub>R \<bar>prod m UNIV\<bar> - \<bar>prod m UNIV\<bar> * measure lebesgue S\<bar> < e" .
   205           qed
   205           qed
   206         qed
   206         qed
   561               let ?B = "(\<lambda>(x, y). x + y) ` (f' x ` ball 0 1 \<times> ball 0 k)"
   561               let ?B = "(\<lambda>(x, y). x + y) ` (f' x ` ball 0 1 \<times> ball 0 k)"
   562               have "bounded ?B"
   562               have "bounded ?B"
   563                 by (simp add: bounded_plus [OF bo])
   563                 by (simp add: bounded_plus [OF bo])
   564               moreover have "?rfs \<subseteq> ?B"
   564               moreover have "?rfs \<subseteq> ?B"
   565                 apply (auto simp: dist_norm image_iff dest!: ex_lessK)
   565                 apply (auto simp: dist_norm image_iff dest!: ex_lessK)
   566                 by (metis (no_types, hide_lams) add.commute diff_add_cancel dist_0_norm dist_commute dist_norm mem_ball)
   566                 by (metis (no_types, opaque_lifting) add.commute diff_add_cancel dist_0_norm dist_commute dist_norm mem_ball)
   567               ultimately show "bounded (?rfs)"
   567               ultimately show "bounded (?rfs)"
   568                 by (rule bounded_subset)
   568                 by (rule bounded_subset)
   569             qed
   569             qed
   570             then have "(\<lambda>x. r *\<^sub>R x) ` ?rfs \<in> lmeasurable"
   570             then have "(\<lambda>x. r *\<^sub>R x) ` ?rfs \<in> lmeasurable"
   571               by (simp add: measurable_linear_image)
   571               by (simp add: measurable_linear_image)
   762           unfolding T_def
   762           unfolding T_def
   763           proof (clarsimp simp add: Collect_conj_eq [symmetric])
   763           proof (clarsimp simp add: Collect_conj_eq [symmetric])
   764             fix x
   764             fix x
   765             assume "e > 0"  "m < n"  "n * e \<le> \<bar>det (matrix (f' x))\<bar>"  "\<bar>det (matrix (f' x))\<bar> < (1 + real m) * e"
   765             assume "e > 0"  "m < n"  "n * e \<le> \<bar>det (matrix (f' x))\<bar>"  "\<bar>det (matrix (f' x))\<bar> < (1 + real m) * e"
   766             then have "n < 1 + real m"
   766             then have "n < 1 + real m"
   767               by (metis (no_types, hide_lams) less_le_trans mult.commute not_le mult_le_cancel_iff2)
   767               by (metis (no_types, opaque_lifting) less_le_trans mult.commute not_le mult_le_cancel_iff2)
   768             then show "False"
   768             then show "False"
   769               using less.hyps by linarith
   769               using less.hyps by linarith
   770           qed
   770           qed
   771       qed auto
   771       qed auto
   772     qed
   772     qed
  1400                       T ` {y. \<bar>y $ k - ?x' $ k\<bar> < e * min d r / (2 * real CARD('m) ^ CARD('m))}"
  1400                       T ` {y. \<bar>y $ k - ?x' $ k\<bar> < e * min d r / (2 * real CARD('m) ^ CARD('m))}"
  1401             proof -
  1401             proof -
  1402               have *: "\<bar>T (b *\<^sub>R axis k 1) \<bullet> (y - x)\<bar> = b * \<bar>inv T y $ k - ?x' $ k\<bar>" for y
  1402               have *: "\<bar>T (b *\<^sub>R axis k 1) \<bullet> (y - x)\<bar> = b * \<bar>inv T y $ k - ?x' $ k\<bar>" for y
  1403               proof -
  1403               proof -
  1404                 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>"
  1404                 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>"
  1405                   by (metis (no_types, hide_lams) b_def eqb invT orthogonal_transformation_def v)
  1405                   by (metis (no_types, opaque_lifting) b_def eqb invT orthogonal_transformation_def v)
  1406                 also have "\<dots> = b * \<bar>(axis k 1) \<bullet> inv T (y - x)\<bar>"
  1406                 also have "\<dots> = b * \<bar>(axis k 1) \<bullet> inv T (y - x)\<bar>"
  1407                   using \<open>b > 0\<close> by (simp add: abs_mult)
  1407                   using \<open>b > 0\<close> by (simp add: abs_mult)
  1408                 also have "\<dots> = b * \<bar>inv T y $ k - ?x' $ k\<bar>"
  1408                 also have "\<dots> = b * \<bar>inv T y $ k - ?x' $ k\<bar>"
  1409                   using orthogonal_transformation_linear [OF invT]
  1409                   using orthogonal_transformation_linear [OF invT]
  1410                   by (simp add: inner_axis' linear_diff)
  1410                   by (simp add: inner_axis' linear_diff)
  1478         proof (rule iffI; clarsimp)
  1478         proof (rule iffI; clarsimp)
  1479           assume b: "\<forall>e>0. \<exists>d>0. \<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and>
  1479           assume b: "\<forall>e>0. \<exists>d>0. \<exists>A. A $ m $ n < b \<and> (\<forall>i j. A $ i $ j \<in> \<rat>) \<and>
  1480                                     (\<forall>y\<in>S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x))"
  1480                                     (\<forall>y\<in>S. norm (y - x) < d \<longrightarrow> norm (f y - f x - A *v (y - x)) \<le> e * norm (y - x))"
  1481                      (is "\<forall>e>0. \<exists>d>0. \<exists>A. ?\<Phi> e d A")
  1481                      (is "\<forall>e>0. \<exists>d>0. \<exists>A. ?\<Phi> e d A")
  1482           then have "\<forall>k. \<exists>d>0. \<exists>A. ?\<Phi> (1 / Suc k) d A"
  1482           then have "\<forall>k. \<exists>d>0. \<exists>A. ?\<Phi> (1 / Suc k) d A"
  1483             by (metis (no_types, hide_lams) less_Suc_eq_0_disj of_nat_0_less_iff zero_less_divide_1_iff)
  1483             by (metis (no_types, opaque_lifting) less_Suc_eq_0_disj of_nat_0_less_iff zero_less_divide_1_iff)
  1484           then obtain \<delta> A where \<delta>: "\<And>k. \<delta> k > 0"
  1484           then obtain \<delta> A where \<delta>: "\<And>k. \<delta> k > 0"
  1485                            and Ab: "\<And>k. A k $ m $ n < b"
  1485                            and Ab: "\<And>k. A k $ m $ n < b"
  1486                            and A: "\<And>k y. \<lbrakk>y \<in> S; norm (y - x) < \<delta> k\<rbrakk> \<Longrightarrow>
  1486                            and A: "\<And>k y. \<lbrakk>y \<in> S; norm (y - x) < \<delta> k\<rbrakk> \<Longrightarrow>
  1487                                           norm (f y - f x - A k *v (y - x)) \<le> 1/(Suc k) * norm (y - x)"
  1487                                           norm (f y - f x - A k *v (y - x)) \<le> 1/(Suc k) * norm (y - x)"
  1488             by metis
  1488             by metis
  1995         using orthogonal_transformation_inv [OF T] by (simp add: orthogonal_transformation_norm)
  1995         using orthogonal_transformation_inv [OF T] by (simp add: orthogonal_transformation_norm)
  1996       moreover have "\<exists>t\<in>T -` P. norm (inv T x - t) \<le> e"
  1996       moreover have "\<exists>t\<in>T -` P. norm (inv T x - t) \<le> e"
  1997       proof
  1997       proof
  1998         have "T (inv T x - inv T t) = x - t"
  1998         have "T (inv T x - inv T t) = x - t"
  1999           using T linear_diff orthogonal_transformation_def
  1999           using T linear_diff orthogonal_transformation_def
  2000           by (metis (no_types, hide_lams) Tinv)
  2000           by (metis (no_types, opaque_lifting) Tinv)
  2001         then have "norm (inv T x - inv T t) = norm (x - t)"
  2001         then have "norm (inv T x - inv T t) = norm (x - t)"
  2002           by (metis T orthogonal_transformation_norm)
  2002           by (metis T orthogonal_transformation_norm)
  2003         then show "norm (inv T x - inv T t) \<le> e"
  2003         then show "norm (inv T x - inv T t) \<le> e"
  2004           using \<open>norm (x - t) \<le> e\<close> by linarith
  2004           using \<open>norm (x - t) \<le> e\<close> by linarith
  2005        next
  2005        next
  2178               using box_ne_empty(1) contra_subsetD [OF x(2)] mem_box(2) uv_ne by fastforce+
  2178               using box_ne_empty(1) contra_subsetD [OF x(2)] mem_box(2) uv_ne by fastforce+
  2179             moreover have "r x \<le> 1/2"
  2179             moreover have "r x \<le> 1/2"
  2180               using r12 by auto
  2180               using r12 by auto
  2181             ultimately have "norm (v - u) \<le> 1"
  2181             ultimately have "norm (v - u) \<le> 1"
  2182               using norm_triangle_half_r [of x u 1 v]
  2182               using norm_triangle_half_r [of x u 1 v]
  2183               by (metis (no_types, hide_lams) dist_commute dist_norm less_eq_real_def less_le_trans mem_ball)
  2183               by (metis (no_types, opaque_lifting) dist_commute dist_norm less_eq_real_def less_le_trans mem_ball)
  2184             then have "norm (v - u) ^ ?n \<le> norm (v - u) ^ ?m"
  2184             then have "norm (v - u) ^ ?n \<le> norm (v - u) ^ ?m"
  2185               by (simp add: power_decreasing [OF mlen])
  2185               by (simp add: power_decreasing [OF mlen])
  2186             also have "\<dots> \<le> ?\<mu> K * real (?m ^ ?m)"
  2186             also have "\<dots> \<le> ?\<mu> K * real (?m ^ ?m)"
  2187             proof -
  2187             proof -
  2188               obtain n where n: "\<And>i. v$i - u$i = 2 * c / 2^n"
  2188               obtain n where n: "\<And>i. v$i - u$i = 2 * c / 2^n"