502 have bo: "bounded (f' x ` ball 0 1)" |
502 have bo: "bounded (f' x ` ball 0 1)" |
503 by (simp add: bounded_linear_image linear_linear lin) |
503 by (simp add: bounded_linear_image linear_linear lin) |
504 have neg: "negligible (frontier (f' x ` ball 0 1))" |
504 have neg: "negligible (frontier (f' x ` ball 0 1))" |
505 using deriv has_derivative_linear \<open>x \<in> S\<close> |
505 using deriv has_derivative_linear \<open>x \<in> S\<close> |
506 by (auto intro!: negligible_convex_frontier [OF convex_linear_image]) |
506 by (auto intro!: negligible_convex_frontier [OF convex_linear_image]) |
507 have 0: "0 < e * unit_ball_vol (real CARD('n))" |
507 let ?unit_vol = "content (ball (0 :: real ^ 'n :: {finite, wellorder}) 1)" |
508 using \<open>e > 0\<close> by simp |
508 have 0: "0 < e * ?unit_vol" |
|
509 using \<open>e > 0\<close> by (simp add: content_ball_pos) |
509 obtain k where "k > 0" and k: |
510 obtain k where "k > 0" and k: |
510 "\<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> |
511 "\<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> |
511 \<Longrightarrow> ?\<mu> U < ?\<mu> (f' x ` ball 0 1) + e * unit_ball_vol (CARD('n))" |
512 \<Longrightarrow> ?\<mu> U < ?\<mu> (f' x ` ball 0 1) + e * ?unit_vol" |
512 using measure_semicontinuous_with_hausdist_explicit [OF bo neg 0] by blast |
513 using measure_semicontinuous_with_hausdist_explicit [OF bo neg 0] by blast |
513 obtain l where "l > 0" and l: "ball x l \<subseteq> T" |
514 obtain l where "l > 0" and l: "ball x l \<subseteq> T" |
514 using \<open>x \<in> S\<close> \<open>open T\<close> \<open>S \<subseteq> T\<close> openE by blast |
515 using \<open>x \<in> S\<close> \<open>open T\<close> \<open>S \<subseteq> T\<close> openE by blast |
515 obtain \<zeta> where "0 < \<zeta>" |
516 obtain \<zeta> where "0 < \<zeta>" |
516 and \<zeta>: "\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < \<zeta>\<rbrakk> |
517 and \<zeta>: "\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < \<zeta>\<rbrakk> |
575 then show fsb: "f ` (S \<inter> ball x r) \<in> lmeasurable" |
576 then show fsb: "f ` (S \<inter> ball x r) \<in> lmeasurable" |
576 by (simp add: image_comp o_def) |
577 by (simp add: image_comp o_def) |
577 have "?\<mu> (f ` (S \<inter> ball x r)) = ?\<mu> (?rfs) * r ^ CARD('n)" |
578 have "?\<mu> (f ` (S \<inter> ball x r)) = ?\<mu> (?rfs) * r ^ CARD('n)" |
578 using \<open>r > 0\<close> fsb |
579 using \<open>r > 0\<close> fsb |
579 by (simp add: measure_linear_image measure_translation_subtract measurable_translation_subtract field_simps cong: image_cong_simp) |
580 by (simp add: measure_linear_image measure_translation_subtract measurable_translation_subtract field_simps cong: image_cong_simp) |
580 also have "\<dots> \<le> (\<bar>det (matrix (f' x))\<bar> * unit_ball_vol (CARD('n)) + e * unit_ball_vol (CARD('n))) * r ^ CARD('n)" |
581 also have "\<dots> \<le> (\<bar>det (matrix (f' x))\<bar> * ?unit_vol + e * ?unit_vol) * r ^ CARD('n)" |
581 proof - |
582 proof - |
582 have "?\<mu> (?rfs) < ?\<mu> (f' x ` ball 0 1) + e * unit_ball_vol (CARD('n))" |
583 have "?\<mu> (?rfs) < ?\<mu> (f' x ` ball 0 1) + e * ?unit_vol" |
583 using rfs_mble by (force intro: k dest!: ex_lessK) |
584 using rfs_mble by (force intro: k dest!: ex_lessK) |
584 then have "?\<mu> (?rfs) < \<bar>det (matrix (f' x))\<bar> * unit_ball_vol (CARD('n)) + e * unit_ball_vol (CARD('n))" |
585 then have "?\<mu> (?rfs) < \<bar>det (matrix (f' x))\<bar> * ?unit_vol + e * ?unit_vol" |
585 by (simp add: lin measure_linear_image [of "f' x"] content_ball) |
586 by (simp add: lin measure_linear_image [of "f' x"]) |
586 with \<open>r > 0\<close> show ?thesis |
587 with \<open>r > 0\<close> show ?thesis |
587 by auto |
588 by auto |
588 qed |
589 qed |
589 also have "\<dots> \<le> (B + e) * ?\<mu> (ball x r)" |
590 also have "\<dots> \<le> (B + e) * ?\<mu> (ball x r)" |
590 using bounded [OF \<open>x \<in> S\<close>] \<open>r > 0\<close> by (simp add: content_ball algebra_simps) |
591 using bounded [OF \<open>x \<in> S\<close>] \<open>r > 0\<close> |
|
592 by (simp add: algebra_simps content_ball_conv_unit_ball[of r] content_ball_pos) |
591 finally show "?\<mu> (f ` (S \<inter> ball x r)) \<le> (B + e) * ?\<mu> (ball x r)" . |
593 finally show "?\<mu> (f ` (S \<inter> ball x r)) \<le> (B + e) * ?\<mu> (ball x r)" . |
592 qed |
594 qed |
593 qed |
595 qed |
594 then obtain r where |
596 then obtain r where |
595 r0d: "\<And>x d. \<lbrakk>x \<in> S; d > 0\<rbrakk> \<Longrightarrow> 0 < r x d \<and> r x d < d" |
597 r0d: "\<And>x d. \<lbrakk>x \<in> S; d > 0\<rbrakk> \<Longrightarrow> 0 < r x d \<and> r x d < d" |
1451 show "cbox (?x' - ?v) (?x' + ?v) \<subseteq> cball ?x' (min d r)" |
1453 show "cbox (?x' - ?v) (?x' + ?v) \<subseteq> cball ?x' (min d r)" |
1452 apply (clarsimp simp only: mem_box_cart dist_norm mem_cball intro!: *) |
1454 apply (clarsimp simp only: mem_box_cart dist_norm mem_cball intro!: *) |
1453 by (simp add: abs_diff_le_iff abs_minus_commute) |
1455 by (simp add: abs_diff_le_iff abs_minus_commute) |
1454 qed (use \<open>e > 0\<close> in auto) |
1456 qed (use \<open>e > 0\<close> in auto) |
1455 also have "\<dots> < e * content (cball ?x' (min d r))" |
1457 also have "\<dots> < e * content (cball ?x' (min d r))" |
1456 using \<open>r > 0\<close> \<open>d > 0\<close> \<open>e > 0\<close> by auto |
1458 using \<open>r > 0\<close> \<open>d > 0\<close> \<open>e > 0\<close> by (auto intro: content_cball_pos) |
1457 also have "\<dots> = e * content (ball x (min d r))" |
1459 also have "\<dots> = e * content (ball x (min d r))" |
1458 using \<open>r > 0\<close> \<open>d > 0\<close> by (simp add: content_cball content_ball) |
1460 using \<open>r > 0\<close> \<open>d > 0\<close> content_ball_conv_unit_ball[of "min d r" "inv T x"] |
|
1461 content_ball_conv_unit_ball[of "min d r" x] |
|
1462 by (simp add: content_cball_conv_ball) |
1459 finally show "measure lebesgue ?W < e * content (ball x (min d r))" . |
1463 finally show "measure lebesgue ?W < e * content (ball x (min d r))" . |
1460 qed |
1464 qed |
1461 qed |
1465 qed |
1462 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" |
1466 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" |
1463 by blast |
1467 by blast |