# HG changeset patch # User wenzelm # Date 1434232639 -7200 # Node ID 7c5e22e6b89fb06811e900604d573d00041a3926 # Parent 22995ec9fefd7360d1b578282c30b7cb1fea3f0b tuned proofs; diff -r 22995ec9fefd -r 7c5e22e6b89f src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Sat Jun 13 23:36:21 2015 +0200 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Sat Jun 13 23:57:19 2015 +0200 @@ -921,8 +921,8 @@ defines "I \ {f\Basis \\<^sub>E \ \ \. box (a' f) (b' f) \ M}" shows "M = (\f\I. box (a' f) (b' f))" proof - - { - fix x assume "x \ M" + have "x \ (\f\I. box (a' f) (b' f))" if "x \ M" for x + proof - obtain e where e: "e > 0" "ball x e \ M" using openE[OF \open M\ \x \ M\] by auto moreover obtain a b where ab: @@ -931,10 +931,10 @@ "\i\Basis. b \ i \ \" "box a b \ ball x e" using rational_boxes[OF e(1)] by metis - ultimately have "x \ (\f\I. box (a' f) (b' f))" + ultimately show ?thesis by (intro UN_I[of "\i\Basis. (a \ i, b \ i)"]) (auto simp: euclidean_representation I_def a'_def b'_def) - } + qed then show ?thesis by (auto simp: I_def) qed @@ -1153,17 +1153,18 @@ lemma UN_box_eq_UNIV: "(\i::nat. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) = UNIV" proof - - { - fix x b :: 'a - assume [simp]: "b \ Basis" + have "\x \ b\ < real (ceiling (Max ((\b. \x \ b\)`Basis)) + 1)" + if [simp]: "b \ Basis" for x b :: 'a + proof - have "\x \ b\ \ real (ceiling \x \ b\)" by (rule real_of_int_ceiling_ge) also have "\ \ real (ceiling (Max ((\b. \x \ b\)`Basis)))" by (auto intro!: ceiling_mono) also have "\ < real (ceiling (Max ((\b. \x \ b\)`Basis)) + 1)" by simp - finally have "\x \ b\ < real (ceiling (Max ((\b. \x \ b\)`Basis)) + 1)" . } - then have "\x::'a. \n::nat. \b\Basis. \x \ b\ < real n" + finally show ?thesis . + qed + then have "\n::nat. \b\Basis. \x \ b\ < real n" for x :: 'a by (metis order.strict_trans reals_Archimedean2) moreover have "\x b::'a. \n::nat. \x \ b\ < real n \ - real n < x \ b \ x \ b < real n" by auto @@ -1254,7 +1255,7 @@ lemma exists_diff: fixes P :: "'a set \ bool" - shows "(\S. P(- S)) \ (\S. P S)" (is "?lhs \ ?rhs") + shows "(\S. P (- S)) \ (\S. P S)" (is "?lhs \ ?rhs") proof - { assume "?lhs" @@ -1374,7 +1375,7 @@ then show ?case by (auto intro: zero_less_one) next case (2 x F) - from 2 obtain d where d: "d >0" "\x\F. x\a \ d \ dist a x" + from 2 obtain d where d: "d > 0" "\x\F. x \ a \ d \ dist a x" by blast show ?case proof (cases "x = a") @@ -1385,7 +1386,7 @@ let ?d = "min d (dist a x)" have dp: "?d > 0" using False d(1) using dist_nz by auto - from d have d': "\x\F. x\a \ ?d \ dist a x" + from d have d': "\x\F. x \ a \ ?d \ dist a x" by auto with dp False show ?thesis by (auto intro!: exI[where x="?d"]) @@ -2116,10 +2117,10 @@ lemma not_trivial_limit_within_ball: "\ trivial_limit (at x within S) \ (\e>0. S \ ball x e - {x} \ {})" - (is "?lhs = ?rhs") -proof - - { - assume "?lhs" + (is "?lhs \ ?rhs") +proof + show ?rhs if ?lhs + proof - { fix e :: real assume "e > 0" @@ -2130,11 +2131,10 @@ unfolding ball_def by (simp add: dist_commute) then have "S \ ball x e - {x} \ {}" by blast } - then have "?rhs" by auto - } - moreover - { - assume "?rhs" + then show ?thesis by auto + qed + show ?lhs if ?rhs + proof - { fix e :: real assume "e > 0" @@ -2145,11 +2145,10 @@ then have "\y \ S - {x}. dist y x < e" by auto } - then have "?lhs" + then show ?thesis using not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"] by auto - } - ultimately show ?thesis by auto + qed qed @@ -2347,102 +2346,103 @@ lemma islimpt_ball: fixes x y :: "'a::{real_normed_vector,perfect_space}" shows "y islimpt ball x e \ 0 < e \ y \ cball x e" - (is "?lhs = ?rhs") + (is "?lhs \ ?rhs") proof - assume "?lhs" - { - assume "e \ 0" - then have *:"ball x e = {}" - using ball_eq_empty[of x e] by auto - have False using \?lhs\ - unfolding * using islimpt_EMPTY[of y] by auto - } - then have "e > 0" by (metis not_less) - moreover - have "y \ cball x e" - using closed_cball[of x e] islimpt_subset[of y "ball x e" "cball x e"] - ball_subset_cball[of x e] \?lhs\ - unfolding closed_limpt by auto - ultimately show "?rhs" by auto -next - assume "?rhs" - then have "e > 0" by auto - { - fix d :: real - assume "d > 0" - have "\x'\ball x e. x' \ y \ dist x' y < d" - proof (cases "d \ dist x y") - case True - then show "\x'\ball x e. x' \ y \ dist x' y < d" - proof (cases "x = y") + show ?rhs if ?lhs + proof + { + assume "e \ 0" + then have *: "ball x e = {}" + using ball_eq_empty[of x e] by auto + have False using \?lhs\ + unfolding * using islimpt_EMPTY[of y] by auto + } + then show "e > 0" by (metis not_less) + show "y \ cball x e" + using closed_cball[of x e] islimpt_subset[of y "ball x e" "cball x e"] + ball_subset_cball[of x e] \?lhs\ + unfolding closed_limpt by auto + qed + show ?lhs if ?rhs + proof - + from that have "e > 0" by auto + { + fix d :: real + assume "d > 0" + have "\x'\ball x e. x' \ y \ dist x' y < d" + proof (cases "d \ dist x y") case True - then have False - using \d \ dist x y\ \d>0\ by auto then show "\x'\ball x e. x' \ y \ dist x' y < d" - by auto + proof (cases "x = y") + case True + then have False + using \d \ dist x y\ \d>0\ by auto + then show "\x'\ball x e. x' \ y \ dist x' y < d" + by auto + next + case False + have "dist x (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) = + norm (x - y + (d / (2 * norm (y - x))) *\<^sub>R (y - x))" + unfolding mem_cball mem_ball dist_norm diff_diff_eq2 diff_add_eq[symmetric] + by auto + also have "\ = \- 1 + d / (2 * norm (x - y))\ * norm (x - y)" + using scaleR_left_distrib[of "- 1" "d / (2 * norm (y - x))", symmetric, of "y - x"] + unfolding scaleR_minus_left scaleR_one + by (auto simp add: norm_minus_commute) + also have "\ = \- norm (x - y) + d / 2\" + unfolding abs_mult_pos[of "norm (x - y)", OF norm_ge_zero[of "x - y"]] + unfolding distrib_right using \x\y\[unfolded dist_nz, unfolded dist_norm] + by auto + also have "\ \ e - d/2" using \d \ dist x y\ and \d>0\ and \?rhs\ + by (auto simp add: dist_norm) + finally have "y - (d / (2 * dist y x)) *\<^sub>R (y - x) \ ball x e" using \d>0\ + by auto + moreover + have "(d / (2*dist y x)) *\<^sub>R (y - x) \ 0" + using \x\y\[unfolded dist_nz] \d>0\ unfolding scaleR_eq_0_iff + by (auto simp add: dist_commute) + moreover + have "dist (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) y < d" + unfolding dist_norm + apply simp + unfolding norm_minus_cancel + using \d > 0\ \x\y\[unfolded dist_nz] dist_commute[of x y] + unfolding dist_norm + apply auto + done + ultimately show "\x'\ball x e. x' \ y \ dist x' y < d" + apply (rule_tac x = "y - (d / (2*dist y x)) *\<^sub>R (y - x)" in bexI) + apply auto + done + qed next case False - have "dist x (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) = - norm (x - y + (d / (2 * norm (y - x))) *\<^sub>R (y - x))" - unfolding mem_cball mem_ball dist_norm diff_diff_eq2 diff_add_eq[symmetric] - by auto - also have "\ = \- 1 + d / (2 * norm (x - y))\ * norm (x - y)" - using scaleR_left_distrib[of "- 1" "d / (2 * norm (y - x))", symmetric, of "y - x"] - unfolding scaleR_minus_left scaleR_one - by (auto simp add: norm_minus_commute) - also have "\ = \- norm (x - y) + d / 2\" - unfolding abs_mult_pos[of "norm (x - y)", OF norm_ge_zero[of "x - y"]] - unfolding distrib_right using \x\y\[unfolded dist_nz, unfolded dist_norm] - by auto - also have "\ \ e - d/2" using \d \ dist x y\ and \d>0\ and \?rhs\ - by (auto simp add: dist_norm) - finally have "y - (d / (2 * dist y x)) *\<^sub>R (y - x) \ ball x e" using \d>0\ - by auto - moreover - have "(d / (2*dist y x)) *\<^sub>R (y - x) \ 0" - using \x\y\[unfolded dist_nz] \d>0\ unfolding scaleR_eq_0_iff - by (auto simp add: dist_commute) - moreover - have "dist (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) y < d" - unfolding dist_norm - apply simp - unfolding norm_minus_cancel - using \d > 0\ \x\y\[unfolded dist_nz] dist_commute[of x y] - unfolding dist_norm - apply auto - done - ultimately show "\x'\ball x e. x' \ y \ dist x' y < d" - apply (rule_tac x = "y - (d / (2*dist y x)) *\<^sub>R (y - x)" in bexI) - apply auto - done + then have "d > dist x y" by auto + show "\x' \ ball x e. x' \ y \ dist x' y < d" + proof (cases "x = y") + case True + obtain z where **: "z \ y" "dist z y < min e d" + using perfect_choose_dist[of "min e d" y] + using \d > 0\ \e>0\ by auto + show "\x'\ball x e. x' \ y \ dist x' y < d" + unfolding \x = y\ + using \z \ y\ ** + apply (rule_tac x=z in bexI) + apply (auto simp add: dist_commute) + done + next + case False + then show "\x'\ball x e. x' \ y \ dist x' y < d" + using \d>0\ \d > dist x y\ \?rhs\ + apply (rule_tac x=x in bexI) + apply auto + done + qed qed - next - case False - then have "d > dist x y" by auto - show "\x' \ ball x e. x' \ y \ dist x' y < d" - proof (cases "x = y") - case True - obtain z where **: "z \ y" "dist z y < min e d" - using perfect_choose_dist[of "min e d" y] - using \d > 0\ \e>0\ by auto - show "\x'\ball x e. x' \ y \ dist x' y < d" - unfolding \x = y\ - using \z \ y\ ** - apply (rule_tac x=z in bexI) - apply (auto simp add: dist_commute) - done - next - case False - then show "\x'\ball x e. x' \ y \ dist x' y < d" - using \d>0\ \d > dist x y\ \?rhs\ - apply (rule_tac x=x in bexI) - apply auto - done - qed - qed - } - then show "?lhs" - unfolding mem_cball islimpt_approachable mem_ball by auto + } + then show ?thesis + unfolding mem_cball islimpt_approachable mem_ball by auto + qed qed lemma closure_ball_lemma: