diff -r 2a03ae772c60 -r 8020249565fb src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Sun Sep 13 14:44:03 2015 +0200 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Sun Sep 13 16:50:12 2015 +0200 @@ -1191,8 +1191,9 @@ have lem1: "\e>0. \d>0. \z. norm (z - y) < d \ norm (g z - g y - g'(z - y)) \ e * norm (g z - g y)" proof (rule, rule) - case goal1 - have *: "e / C > 0" using \e > 0\ C(1) by auto + fix e :: real + assume "e > 0" + with C(1) have *: "e / C > 0" by auto obtain d0 where d0: "0 < d0" "\ya. norm (ya - g y) < d0 \ norm (f ya - f (g y) - f' (ya - g y)) \ e / C * norm (ya - g y)" @@ -1213,7 +1214,7 @@ using assms(6) by blast obtain d where d: "0 < d" "d < d1" "d < d2" using real_lbound_gt_zero[OF d1(1) d2(1)] by blast - then show ?case + then show "\d>0. \z. norm (z - y) < d \ norm (g z - g y - g' (z - y)) \ e * norm (g z - g y)" apply (rule_tac x=d in exI) apply rule defer @@ -1257,14 +1258,13 @@ def B \ "C * 2" have "B > 0" unfolding B_def using C by auto - have lem2: "\z. norm(z - y) < d \ norm (g z - g y) \ B * norm (z - y)" - proof (rule, rule) - case goal1 + have lem2: "norm (g z - g y) \ B * norm (z - y)" if z: "norm(z - y) < d" for z + proof - have "norm (g z - g y) \ norm(g' (z - y)) + norm ((g z - g y) - g'(z - y))" by (rule norm_triangle_sub) also have "\ \ norm (g' (z - y)) + 1 / 2 * norm (g z - g y)" apply (rule add_left_mono) - using d and goal1 + using d and z apply auto done also have "\ \ norm (z - y) * C + 1 / 2 * norm (g z - g y)" @@ -1272,7 +1272,7 @@ using C apply auto done - finally show ?case + finally show "norm (g z - g y) \ B * norm (z - y)" unfolding B_def by (auto simp add: field_simps) qed @@ -1283,15 +1283,16 @@ apply rule apply rule proof - - case goal1 - hence *: "e / B >0" by (metis \0 < B\ divide_pos_pos) + fix e :: real + assume "e > 0" + then have *: "e / B > 0" by (metis \B > 0\ divide_pos_pos) obtain d' where d': "0 < d'" "\z. norm (z - y) < d' \ norm (g z - g y - g' (z - y)) \ e / B * norm (g z - g y)" using lem1 * by blast obtain k where k: "0 < k" "k < d" "k < d'" using real_lbound_gt_zero[OF d(1) d'(1)] by blast - show ?case + show "\d>0. \ya. norm (ya - y) < d \ norm (g ya - g y - g' (ya - y)) \ e * norm (ya - y)" apply (rule_tac x=k in exI) apply auto proof - @@ -1301,7 +1302,7 @@ using d' k by auto also have "\ \ e * norm (z - y)" unfolding times_divide_eq_left pos_divide_le_eq[OF \B>0\] - using lem2[THEN spec[where x=z]] + using lem2[of z] using k as using \e > 0\ by (auto simp add: field_simps) finally show "norm (g z - g y - g' (z - y)) \ e * norm (z - y)" @@ -1650,7 +1651,8 @@ apply rule apply rule proof - - case goal1 + fix y + assume "0 < dist y (f x) \ dist y (f x) < d" then have "g y \ g ` f ` (ball x e \ s)" using d(2)[unfolded subset_eq,THEN bspec[where x=y]] by (auto simp add: dist_commute) @@ -1667,13 +1669,12 @@ using interior_open[OF assms(1)] and \x \ s\ apply auto done - moreover have "\y. y \ interior (f ` s) \ f (g y) = y" + moreover have "f (g y) = y" if "y \ interior (f ` s)" for y proof - - case goal1 - then have "y \ f ` s" + from that have "y \ f ` s" using interior_subset by auto then obtain z where "z \ s" "y = f z" unfolding image_iff .. - then show ?case + then show ?thesis using assms(4) by auto qed ultimately show ?thesis using assms @@ -1882,11 +1883,13 @@ shows "\e>0. \N. \m\N. \n\N. \x\s. \y\s. norm ((f m x - f n x) - (f m y - f n y)) \ e * norm (x - y)" proof (rule, rule) - case goal1 have *: "2 * (1/2* e) = e" "1/2 * e >0" - using \e > 0\ by auto + fix e :: real + assume "e > 0" + then have *: "2 * (1/2* e) = e" "1/2 * e >0" + by auto obtain N where "\n\N. \x\s. \h. norm (f' n x h - g' x h) \ 1 / 2 * e * norm h" using assms(3) *(2) by blast - then show ?case + then show "\N. \m\N. \n\N. \x\s. \y\s. norm (f m x - f n x - (f m y - f n y)) \ e * norm (x - y)" apply (rule_tac x=N in exI) apply (rule has_derivative_sequence_lipschitz_lemma[where e="1/2 *e", unfolded *]) using assms \e > 0\ @@ -2060,9 +2063,10 @@ qed show "\e>0. eventually (\y. norm (g y - g x - g' x (y - x)) \ e * norm (y - x)) (at x within s)" proof (rule, rule) - case goal1 - have *: "e / 3 > 0" - using goal1 by auto + fix e :: real + assume "e > 0" + then have *: "e / 3 > 0" + by auto obtain N1 where N1: "\n\N1. \x\s. \h. norm (f' n x h - g' x h) \ e / 3 * norm h" using assms(3) * by blast obtain N2 where @@ -2073,7 +2077,7 @@ using assms(2)[unfolded has_derivative_within_alt2] and \x \ s\ and * by fast moreover have "eventually (\y. y \ s) (at x within s)" unfolding eventually_at by (fast intro: zero_less_one) - ultimately show ?case + ultimately show "\\<^sub>F y in at x within s. norm (g y - g x - g' x (y - x)) \ e * norm (y - x)" proof (rule eventually_elim2) fix y assume "y \ s" @@ -2150,15 +2154,20 @@ using reals_Archimedean[OF \e>0\] .. show "\N. \n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" apply (rule_tac x=N in exI) - proof rule+ - case goal1 + apply rule + apply rule + apply rule + apply rule + proof - + fix n x h + assume n: "N \ n" and x: "x \ s" have *: "inverse (real (Suc n)) \ e" apply (rule order_trans[OF _ N[THEN less_imp_le]]) - using goal1(1) + using n apply (auto simp add: field_simps) done - show ?case - using f[rule_format,THEN conjunct2,OF goal1(2), of n, THEN spec[where x=h]] + show "norm (f' n x h - g' x h) \ e * norm h" + using f[rule_format,THEN conjunct2, OF x, of n, THEN spec[where x=h]] apply (rule order_trans) using N * apply (cases "h = 0")