# HG changeset patch # User paulson # Date 1531333140 -3600 # Node ID 3ed4ff0b7ac4b1a3618b3b2f07a50555f8dafbde # Parent 3cb44b0abc5c22582e8e5c32be1d4dc224acc338 de-applying diff -r 3cb44b0abc5c -r 3ed4ff0b7ac4 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Wed Jul 11 15:36:12 2018 +0100 +++ b/src/HOL/Limits.thy Wed Jul 11 19:19:00 2018 +0100 @@ -36,7 +36,7 @@ have 3: "\x. u \ \x\ \ A x \ \N. \n\N. A n" for A and u::real by (metis (full_types) abs_ge_self abs_minus_cancel le_minus_iff order_trans) show ?thesis - by (auto simp add: filter_eq_iff eventually_sup eventually_at_infinity + by (auto simp: filter_eq_iff eventually_sup eventually_at_infinity eventually_at_top_linorder eventually_at_bot_linorder intro: 1 2 3) qed @@ -136,7 +136,7 @@ by (simp add: Bseq_def) lemma BseqI: "0 < K \ \n. norm (X n) \ K \ Bseq X" - by (auto simp add: Bseq_def) + by (auto simp: Bseq_def) lemma Bseq_bdd_above: "Bseq X \ bdd_above (range X)" for X :: "nat \ real" @@ -222,7 +222,7 @@ proof assume ?P then obtain K where *: "0 < K" and **: "\n. norm (X n) \ K" - by (auto simp add: Bseq_def) + by (auto simp: Bseq_def) from * have "0 < K + norm (X 0)" by (rule order_less_le_trans) simp from ** have "\n. norm (X n - X 0) \ K + norm (X 0)" by (auto intro: order_trans norm_triangle_ineq4) @@ -231,7 +231,7 @@ with \0 < K + norm (X 0)\ show ?Q by blast next assume ?Q - then show ?P by (auto simp add: Bseq_iff2) + then show ?P by (auto simp: Bseq_iff2) qed @@ -688,7 +688,7 @@ unfolding tendsto_Zfun_iff add_diff_add using tendsto_fst[OF filterlim_ident, of "(a,b)"] tendsto_snd[OF filterlim_ident, of "(a,b)"] by (intro Zfun_add) - (auto simp add: tendsto_Zfun_iff[symmetric] nhds_prod[symmetric] intro!: tendsto_fst) + (auto simp: tendsto_Zfun_iff[symmetric] nhds_prod[symmetric] intro!: tendsto_fst) show "(uminus \ - a) (nhds a)" unfolding tendsto_Zfun_iff minus_diff_minus using filterlim_ident[of "nhds a"] @@ -826,7 +826,7 @@ lemma continuous_on_mult_const [simp]: fixes c::"'a::real_normed_algebra" - shows "continuous_on s (( * ) c)" + shows "continuous_on s (( *) c)" by (intro continuous_on_mult_left continuous_on_id) lemma tendsto_divide_zero: @@ -910,14 +910,6 @@ shows "Zfun (\x. f x ** g x) F" using flip g f by (rule bounded_bilinear.Zfun_prod_Bfun) -lemma Bfun_inverse_lemma: - fixes x :: "'a::real_normed_div_algebra" - shows "r \ norm x \ 0 < r \ norm (inverse x) \ inverse r" - apply (subst nonzero_norm_inverse) - apply clarsimp - apply (erule (1) le_imp_inverse_le) - done - lemma Bfun_inverse: fixes a :: "'a::real_normed_div_algebra" assumes f: "(f \ a) F" @@ -1304,14 +1296,14 @@ lemma at_bot_mirror : shows "(at_bot::('a::{ordered_ab_group_add,linorder} filter)) = filtermap uminus at_top" apply (rule filtermap_fun_inverse[of uminus, symmetric]) - subgoal unfolding filterlim_at_top eventually_at_bot_linorder using le_minus_iff by auto + subgoal unfolding filterlim_at_top filterlim_at_bot eventually_at_bot_linorder using le_minus_iff by auto subgoal unfolding filterlim_at_bot eventually_at_top_linorder using minus_le_iff by auto by auto lemma at_top_mirror : shows "(at_top::('a::{ordered_ab_group_add,linorder} filter)) = filtermap uminus at_bot" apply (subst at_bot_mirror) - by (auto simp add: filtermap_filtermap) + by (auto simp: filtermap_filtermap) lemma filterlim_at_top_mirror: "(LIM x at_top. f x :> F) \ (LIM x at_bot. f (-x::real) :> F)" unfolding filterlim_def at_top_mirror filtermap_filtermap .. @@ -1355,7 +1347,7 @@ fix Z :: real assume [arith]: "0 < Z" then have "eventually (\x. x < inverse Z) (nhds 0)" - by (auto simp add: eventually_nhds_metric dist_real_def intro!: exI[of _ "\inverse Z\"]) + by (auto simp: eventually_nhds_metric dist_real_def intro!: exI[of _ "\inverse Z\"]) then show "eventually (\x. x \ 0 \ x \ {0<..} \ Z \ inverse x) (nhds 0)" by (auto elim!: eventually_mono simp: inverse_eq_divide field_simps) qed @@ -1563,10 +1555,7 @@ have "(inverse \ (0::'a)) at_infinity" by (fact tendsto_inverse_0) then show "filtermap inverse at_infinity \ at (0::'a)" - apply (simp add: le_principal eventually_filtermap eventually_at_infinity filterlim_def at_within_def) - apply (rule_tac x="1" in exI) - apply auto - done + using filterlim_def filterlim_ident filterlim_inverse_at_iff by fastforce next have "filtermap inverse (filtermap inverse (at (0::'a))) \ filtermap inverse at_infinity" using filterlim_inverse_at_infinity unfolding filterlim_def @@ -1873,16 +1862,6 @@ unfolding tendsto_def eventually_sequentially by (metis div_le_dividend div_mult_self1_is_m le_trans mult.commute) -lemma norm_inverse_le_norm: "r \ norm x \ 0 < r \ norm (inverse x) \ inverse r" - for x :: "'a::real_normed_div_algebra" - apply (subst nonzero_norm_inverse, clarsimp) - apply (erule (1) le_imp_inverse_le) - done - -lemma Bseq_inverse: "X \ a \ a \ 0 \ Bseq (\n. inverse (X n))" - for a :: "'a::real_normed_div_algebra" - by (rule Bfun_inverse) - text \Transformation of limit.\ @@ -1900,11 +1879,7 @@ lemma Lim_transform_eventually: "eventually (\x. f x = g x) net \ (f \ l) net \ (g \ l) net" - apply (rule topological_tendstoI) - apply (drule (2) topological_tendstoD) - apply (erule (1) eventually_elim2) - apply simp - done + using eventually_elim2 by (fastforce simp add: tendsto_def) lemma Lim_transform_within: assumes "(f \ l) (at x within S)" @@ -1988,9 +1963,7 @@ assumes "\r::real. \N. \n\N. r < X n" shows "(\n. inverse (X n)) \ 0" apply (rule filterlim_compose[OF tendsto_inverse_0]) - apply (simp add: filterlim_at_infinity[OF order_refl] eventually_sequentially) - apply (metis assms abs_le_D1 linorder_le_cases linorder_not_le) - done + by (metis assms eventually_at_top_linorderI filterlim_at_top_dense filterlim_at_top_imp_at_infinity) text \The sequence @{term "1/n"} tends to 0 as @{term n} tends to infinity.\ lemma LIMSEQ_inverse_real_of_nat: "(\n. inverse (real (Suc n))) \ 0" @@ -2261,18 +2234,11 @@ lemma Bseq_realpow: "0 \ x \ x \ 1 \ Bseq (\n. x ^ n)" for x :: real - apply (simp add: Bseq_def) - apply (rule_tac x = 1 in exI) - apply (simp add: power_abs) - apply (auto dest: power_mono) - done + by (metis decseq_bounded decseq_def power_decreasing zero_le_power) lemma monoseq_realpow: "0 \ x \ x \ 1 \ monoseq (\n. x ^ n)" for x :: real - apply (clarify intro!: mono_SucI2) - apply (cut_tac n = n and N = "Suc n" and a = x in power_decreasing) - apply auto - done + using monoseq_def power_decreasing by blast lemma convergent_realpow: "0 \ x \ x \ 1 \ convergent (\n. x ^ n)" for x :: real @@ -2303,9 +2269,7 @@ lemma LIMSEQ_power_zero: "norm x < 1 \ (\n. x ^ n) \ 0" for x :: "'a::real_normed_algebra_1" apply (drule LIMSEQ_realpow_zero [OF norm_ge_zero]) - apply (simp only: tendsto_Zfun_iff, erule Zfun_le) - apply (simp add: power_abs norm_power_ineq) - done + by (simp add: Zfun_le norm_power_ineq tendsto_Zfun_iff) lemma LIMSEQ_divide_realpow_zero: "1 < x \ (\n. a / (x ^ n) :: real) \ 0" by (rule tendsto_divide_0 [OF tendsto_const filterlim_realpow_sequentially_gt1]) simp @@ -2327,7 +2291,7 @@ using \filterlim f sequentially F\ by (simp add: filterlim_at_top) then show "\\<^sub>F i in F. dist (x ^ f i) 0 < e" - by (eventually_elim) (auto simp: N) + by eventually_elim (auto simp: N) qed text \Limit of @{term "c^n"} for @{term"\c\ < 1"}.\ @@ -2717,14 +2681,14 @@ shows "a \ b \ \x::real. a \ x \ x \ b \ isCont f x \ \M. (\x. a \ x \ x \ b \ f x \ M) \ (\x. a \ x \ x \ b \ f x = M)" using continuous_attains_sup[of "{a..b}" f] - by (auto simp add: continuous_at_imp_continuous_on Ball_def Bex_def) + by (auto simp: continuous_at_imp_continuous_on Ball_def Bex_def) lemma isCont_eq_Lb: fixes f :: "real \ 'a::linorder_topology" shows "a \ b \ \x. a \ x \ x \ b \ isCont f x \ \M. (\x. a \ x \ x \ b \ M \ f x) \ (\x. a \ x \ x \ b \ f x = M)" using continuous_attains_inf[of "{a..b}" f] - by (auto simp add: continuous_at_imp_continuous_on Ball_def Bex_def) + by (auto simp: continuous_at_imp_continuous_on Ball_def Bex_def) lemma isCont_bounded: fixes f :: "real \ 'a::linorder_topology" @@ -2760,16 +2724,20 @@ using isCont_eq_Ub[OF assms] by auto obtain L where L: "a \ L" "L \ b" "\x. a \ x \ x \ b \ f L \ f x" using isCont_eq_Lb[OF assms] by auto - show ?thesis - using IVT[of f L _ M] IVT2[of f L _ M] M L assms - apply (rule_tac x="f L" in exI) - apply (rule_tac x="f M" in exI) - apply (cases "L \ M") - apply simp - apply (metis order_trans) - apply simp - apply (metis order_trans) - done + have "(\x. a \ x \ x \ b \ f L \ f x \ f x \ f M)" + using M L by simp + moreover + have "(\y. f L \ y \ y \ f M \ (\x\a. x \ b \ f x = y))" + proof (cases "L \ M") + case True then show ?thesis + using IVT[of f L _ M] M L assms by (metis order.trans) + next + case False then show ?thesis + using IVT2[of f L _ M] + by (metis L(2) M(1) assms(2) le_cases order.trans) +qed + ultimately show ?thesis + by blast qed @@ -2800,8 +2768,7 @@ using d inj by (intro continuous_inj_imp_mono[OF _ _ f] inj_on_imageI2[of g, OF inj_onI]) auto then have "f x \ {min ?A ?B <..< max ?A ?B}" by auto - ultimately - show ?thesis + ultimately show ?thesis by (simp add: continuous_on_eq_continuous_at) qed @@ -2818,23 +2785,14 @@ text \Bartle/Sherbert: Introduction to Real Analysis, Theorem 4.2.9, p. 110.\ lemma LIM_fun_gt_zero: "f \c\ l \ 0 < l \ \r. 0 < r \ (\x. x \ c \ \c - x\ < r \ 0 < f x)" for f :: "real \ real" - apply (drule (1) LIM_D) - apply clarify - apply (rule_tac x = s in exI) - apply (simp add: abs_less_iff) - done + by (force simp: dest: LIM_D) lemma LIM_fun_less_zero: "f \c\ l \ l < 0 \ \r. 0 < r \ (\x. x \ c \ \c - x\ < r \ f x < 0)" for f :: "real \ real" - apply (drule LIM_D [where r="-l"]) - apply simp - apply clarify - apply (rule_tac x = s in exI) - apply (simp add: abs_less_iff) - done + by (drule LIM_D [where r="-l"]) force+ lemma LIM_fun_not_zero: "f \c\ l \ l \ 0 \ \r. 0 < r \ (\x. x \ c \ \c - x\ < r \ f x \ 0)" for f :: "real \ real" - using LIM_fun_gt_zero[of f l c] LIM_fun_less_zero[of f l c] by (auto simp add: neq_iff) + using LIM_fun_gt_zero[of f l c] LIM_fun_less_zero[of f l c] by (auto simp: neq_iff) end diff -r 3cb44b0abc5c -r 3ed4ff0b7ac4 src/HOL/Quotient.thy --- a/src/HOL/Quotient.thy Wed Jul 11 15:36:12 2018 +0100 +++ b/src/HOL/Quotient.thy Wed Jul 11 19:19:00 2018 +0100 @@ -349,11 +349,8 @@ apply(rule iffI) apply(simp_all only: babs_rsp[OF q]) apply(auto simp add: Babs_def rel_fun_def) - apply (subgoal_tac "x \ Respects R1 \ y \ Respects R1") - apply(metis Babs_def) - apply (simp add: in_respects) - using Quotient3_rel[OF q] - by metis + apply(metis Babs_def in_respects Quotient3_rel[OF q]) + done (* If a user proves that a particular functional relation is an equivalence this may be useful in regularising *) @@ -401,51 +398,17 @@ lemma bex1_rel_aux: "\\xa ya. R xa ya \ x xa = y ya; Bex1_rel R x\ \ Bex1_rel R y" unfolding Bex1_rel_def - apply (erule conjE)+ - apply (erule bexE) - apply rule - apply (rule_tac x="xa" in bexI) - apply metis - apply metis - apply rule+ - apply (erule_tac x="xaa" in ballE) - prefer 2 - apply (metis) - apply (erule_tac x="ya" in ballE) - prefer 2 - apply (metis) - apply (metis in_respects) - done + by (metis in_respects) lemma bex1_rel_aux2: "\\xa ya. R xa ya \ x xa = y ya; Bex1_rel R y\ \ Bex1_rel R x" unfolding Bex1_rel_def - apply (erule conjE)+ - apply (erule bexE) - apply rule - apply (rule_tac x="xa" in bexI) - apply metis - apply metis - apply rule+ - apply (erule_tac x="xaa" in ballE) - prefer 2 - apply (metis) - apply (erule_tac x="ya" in ballE) - prefer 2 - apply (metis) - apply (metis in_respects) - done + by (metis in_respects) lemma bex1_rel_rsp: assumes a: "Quotient3 R absf repf" shows "((R ===> (=)) ===> (=)) (Bex1_rel R) (Bex1_rel R)" - apply (simp add: rel_fun_def) - apply clarify - apply rule - apply (simp_all add: bex1_rel_aux bex1_rel_aux2) - apply (erule bex1_rel_aux2) - apply assumption - done + unfolding rel_fun_def by (metis bex1_rel_aux bex1_rel_aux2) lemma ex1_prs: diff -r 3cb44b0abc5c -r 3ed4ff0b7ac4 src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Wed Jul 11 15:36:12 2018 +0100 +++ b/src/HOL/Real_Vector_Spaces.thy Wed Jul 11 19:19:00 2018 +0100 @@ -830,6 +830,11 @@ for a b :: "'a::{real_normed_field,field}" by (simp add: divide_inverse norm_mult norm_inverse) +lemma norm_inverse_le_norm: + fixes x :: "'a::real_normed_div_algebra" + shows "r \ norm x \ 0 < r \ norm (inverse x) \ inverse r" + by (simp add: le_imp_inverse_le norm_inverse) + lemma norm_power_ineq: "norm (x ^ n) \ norm x ^ n" for x :: "'a::real_normed_algebra_1" proof (induct n)