# HG changeset patch # User paulson # Date 1746461054 -3600 # Node ID 5540532087fa9372066d79b883e34942ae2210d2 # Parent 700f9b01c9d9996fb0434fae6ed689f135d095ca# Parent 5648293625a501bb3c4d524d721d91693a6aa97f merged diff -r 700f9b01c9d9 -r 5540532087fa src/HOL/Analysis/Elementary_Normed_Spaces.thy --- a/src/HOL/Analysis/Elementary_Normed_Spaces.thy Mon May 05 12:42:40 2025 +0200 +++ b/src/HOL/Analysis/Elementary_Normed_Spaces.thy Mon May 05 17:04:14 2025 +0100 @@ -1150,37 +1150,50 @@ subsection\<^marker>\tag unimportant\ \Arithmetic Preserves Topological Properties\ lemma open_scaling[intro]: - fixes s :: "'a::real_normed_vector set" + fixes S :: "'a::real_normed_vector set" assumes "c \ 0" - and "open s" - shows "open((\x. c *\<^sub>R x) ` s)" + and "open S" + shows "open((\x. c *\<^sub>R x) ` S)" proof - { fix x - assume "x \ s" - then obtain e where "e>0" - and e:"\x'. dist x' x < e \ x' \ s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]] + assume "x \ S" + then obtain \ where "\>0" + and \: "\x'. dist x' x < \ \ x' \ S" using assms(2)[unfolded open_dist, THEN bspec[where x=x]] by auto - have "e * \c\ > 0" - using assms(1)[unfolded zero_less_abs_iff[symmetric]] \e>0\ by auto + have "\ * \c\ > 0" + using assms(1)[unfolded zero_less_abs_iff[symmetric]] \\>0\ by auto moreover { fix y - assume "dist y (c *\<^sub>R x) < e * \c\" - then have "norm (c *\<^sub>R ((1 / c) *\<^sub>R y - x)) < e * norm c" + assume "dist y (c *\<^sub>R x) < \ * \c\" + then have "norm (c *\<^sub>R ((1 / c) *\<^sub>R y - x)) < \ * norm c" by (simp add: \c \ 0\ dist_norm scale_right_diff_distrib) - then have "norm ((1 / c) *\<^sub>R y - x) < e" + then have "norm ((1 / c) *\<^sub>R y - x) < \" by (simp add: \c \ 0\) - then have "y \ (*\<^sub>R) c ` s" - using rev_image_eqI[of "(1 / c) *\<^sub>R y" s y "(*\<^sub>R) c"] - by (simp add: \c \ 0\ dist_norm e) + then have "y \ (*\<^sub>R) c ` S" + using rev_image_eqI[of "(1 / c) *\<^sub>R y" S y "(*\<^sub>R) c"] + by (simp add: \c \ 0\ dist_norm \) } - ultimately have "\e>0. \x'. dist x' (c *\<^sub>R x) < e \ x' \ (*\<^sub>R) c ` s" - by (rule_tac x="e * \c\" in exI, auto) + ultimately have "\e>0. \x'. dist x' (c *\<^sub>R x) < e \ x' \ (*\<^sub>R) c ` S" + by (rule_tac x="\ * \c\" in exI, auto) } then show ?thesis unfolding open_dist by auto qed +lemma open_times_image: + fixes S::"'a::real_normed_field set" + assumes "c\0" "open S" + shows "open (((*) c) ` S)" +proof - + let ?f = "\x. x/c" and ?g="((*) c)" + have "continuous_on UNIV ?f" using \c\0\ by (auto intro:continuous_intros) + then have "open (?f -` S)" using \open S\ by (auto elim:open_vimage) + moreover have "?g ` S = ?f -` S" using \c\0\ + using image_iff by fastforce + ultimately show ?thesis by auto +qed + lemma minus_image_eq_vimage: fixes A :: "'a::ab_group_add set" shows "(\x. - x) ` A = (\x. - x) -` A" diff -r 700f9b01c9d9 -r 5540532087fa src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Mon May 05 12:42:40 2025 +0200 +++ b/src/HOL/Analysis/Elementary_Topology.thy Mon May 05 17:04:14 2025 +0100 @@ -40,7 +40,27 @@ lemma real_eq_affinity: "m \ 0 \ y = m * x + c \ inverse m * y + - (c / m) = x" for m :: "'a::linordered_field" - by (simp add: field_simps) + by (metis real_affinity_eq) + +lemma image_linear_greaterThan: + fixes x::"'a::linordered_field" + assumes "c\0" + shows "((\x. c*x+b) ` {x<..}) = (if c>0 then {c*x+b <..} else {..< c*x+b})" +using \c\0\ + apply (auto simp add:image_iff field_simps) + subgoal for y by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps) + subgoal for y by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps) +done + +lemma image_linear_lessThan: + fixes x::"'a::linordered_field" + assumes "c\0" + shows "((\x. c*x+b) ` {..0 then {..c\0\ + apply (auto simp add:image_iff field_simps) + subgoal for y by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps) + subgoal for y by (rule bexI[where x="(y-b)/c"],auto simp add:field_simps) +done subsection \Topological Basis\ @@ -2113,26 +2133,6 @@ \ ((f \ x) \ f a) sequentially)" by (meson continuous_on_eq_continuous_within continuous_within_sequentially) -text \Continuity in terms of open preimages.\ - -lemma continuous_at_open: - "continuous (at x) f \ (\t. open t \ f x \ t \ (\S. open S \ x \ S \ (\x' \ S. (f x') \ t)))" - by (metis UNIV_I continuous_within_topological) - -lemma continuous_imp_tendsto: - assumes "continuous (at x0) f" and "x \ x0" - shows "(f \ x) \ (f x0)" -proof (rule topological_tendstoI) - fix S - assume "open S" "f x0 \ S" - then obtain T where T_def: "open T" "x0 \ T" "\x\T. f x \ S" - using assms continuous_at_open by metis - then have "eventually (\n. x n \ T) sequentially" - using assms T_def by (auto simp: tendsto_def) - then show "eventually (\n. (f \ x) n \ S) sequentially" - using T_def by (auto elim!: eventually_mono) -qed - subsection \Homeomorphisms\ definition\<^marker>\tag important\ "homeomorphism S T f g \ diff -r 700f9b01c9d9 -r 5540532087fa src/HOL/Filter.thy --- a/src/HOL/Filter.thy Mon May 05 12:42:40 2025 +0200 +++ b/src/HOL/Filter.thy Mon May 05 17:04:14 2025 +0100 @@ -884,6 +884,12 @@ unfolding at_bot_def by (subst eventually_INF_base) (auto simp: eventually_principal intro: min.cobounded1 min.cobounded2) +lemma eventually_at_bot_linorderI: + fixes c::"'a::linorder" + assumes "\x. x \ c \ P x" + shows "eventually P at_bot" + using assms by (auto simp: eventually_at_bot_linorder) + lemma eventually_filtercomap_at_bot_linorder: "eventually P (filtercomap f at_bot) \ (\N::'a::linorder. \x. f x \ N \ P x)" by (auto simp: eventually_filtercomap eventually_at_bot_linorder) diff -r 700f9b01c9d9 -r 5540532087fa src/HOL/Limits.thy --- a/src/HOL/Limits.thy Mon May 05 12:42:40 2025 +0200 +++ b/src/HOL/Limits.thy Mon May 05 17:04:14 2025 +0100 @@ -26,6 +26,12 @@ by (subst eventually_INF_base) (auto simp: subset_eq eventually_principal intro!: exI[of _ "max a b" for a b]) +lemma eventually_at_infinityI: + fixes P::"'a::real_normed_vector \ bool" + assumes "\x. c \ norm x \ P x" + shows "eventually P at_infinity" +unfolding eventually_at_infinity using assms by auto + corollary eventually_at_infinity_pos: "eventually p at_infinity \ (\b. 0 < b \ (\x. norm x \ b \ p x))" unfolding eventually_at_infinity @@ -1550,7 +1556,34 @@ for a :: real by (simp add: filter_eq_iff eventually_filtermap eventually_at_filter filtermap_nhds_minus[symmetric]) - +lemma filtermap_linear_at_within: + assumes "bij f" and cont: "isCont f a" and open_map: "\S. open S \ open (f`S)" + shows "filtermap f (at a within S) = at (f a) within f`S" + unfolding filter_eq_iff +proof safe + fix P + assume "eventually P (filtermap f (at a within S))" + then obtain T where "open T" "a \ T" and impP:"\x\T. x\a \ x\S\ P (f x)" + by (auto simp: eventually_filtermap eventually_at_topological) + then show "eventually P (at (f a) within f ` S)" + unfolding eventually_at_topological + apply (intro exI[of _ "f`T"]) + using \bij f\ open_map by (metis bij_pointE image_iff) +next + fix P + assume "eventually P (at (f a) within f ` S)" + then obtain T1 where "open T1" "f a \ T1" and impP:"\x\T1. x\f a \ x\f`S\ P (x)" + unfolding eventually_at_topological by auto + then obtain T2 where "open T2" "a \ T2" "(\x'\T2. f x' \ T1)" + using cont[unfolded continuous_at_open,rule_format,of T1] by blast + then have "\x\T2. x\a \ x\S\ P (f x)" + using impP by (metis assms(1) bij_pointE imageI) + then show "eventually P (filtermap f (at a within S))" + unfolding eventually_filtermap eventually_at_topological + apply (intro exI[of _ T2]) + using \open T2\ \a \ T2\ by auto +qed + lemma filterlim_at_left_to_right: "filterlim f F (at_left a) \ filterlim (\x. f (- x)) F (at_right (-a))" for a :: real @@ -2015,6 +2048,32 @@ by eventually_elim simp qed +lemma filterlim_tendsto_add_at_top_iff: + assumes f: "(f \ c) F" + shows "(LIM x F. (f x + g x :: real) :> at_top) \ (LIM x F. g x :> at_top)" +proof + assume "LIM x F. f x + g x :> at_top" + moreover have "((\x. - f x) \ - c) F" + by (simp add: f tendsto_minus) + ultimately show "filterlim g at_top F" + using filterlim_tendsto_add_at_top by fastforce +qed (auto simp: filterlim_tendsto_add_at_top[OF f]) + +lemma filterlim_tendsto_add_at_bot_iff: + fixes c::real + assumes f: "(f \ c) F" + shows "(LIM x F. f x + g x :> at_bot) \ (LIM x F. g x :> at_bot)" +proof - + have "(LIM x F. f x + g x :> at_bot) + \ (LIM x F. - f x + (- g x) :> at_top)" + by (simp add: filterlim_uminus_at_bot) + also have "... = (LIM x F. - g x :> at_top)" + by (metis f filterlim_tendsto_add_at_top_iff tendsto_minus) + also have "... = (LIM x F. g x :> at_bot)" + by (simp add: filterlim_uminus_at_bot) + finally show ?thesis . +qed + lemma LIM_at_top_divide: fixes f g :: "'a \ real" assumes f: "(f \ a) F" "0 < a" diff -r 700f9b01c9d9 -r 5540532087fa src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Mon May 05 12:42:40 2025 +0200 +++ b/src/HOL/Topological_Spaces.thy Mon May 05 17:04:14 2025 +0100 @@ -2319,6 +2319,26 @@ "continuous (at x within A) (f :: 'a :: discrete_topology \ _)" by (auto simp: continuous_def at_discrete) +text \Continuity in terms of open preimages.\ + +lemma continuous_at_open: + "continuous (at x) f \ (\t. open t \ f x \ t \ (\S. open S \ x \ S \ (\x' \ S. (f x') \ t)))" + by (metis UNIV_I continuous_within_topological) + +lemma continuous_imp_tendsto: + assumes "continuous (at x0) f" and "x \ x0" + shows "(f \ x) \ (f x0)" +proof (rule topological_tendstoI) + fix S + assume "open S" "f x0 \ S" + then obtain T where T_def: "open T" "x0 \ T" "\x\T. f x \ S" + using assms continuous_at_open by metis + then have "eventually (\n. x n \ T) sequentially" + using assms T_def by (auto simp: tendsto_def) + then show "eventually (\n. (f \ x) n \ S) sequentially" + using T_def by (auto elim!: eventually_mono) +qed + abbreviation isCont :: "('a::t2_space \ 'b::topological_space) \ 'a \ bool" where "isCont f a \ continuous (at a) f"