3202 "uniformly_continuous_on s f \<longleftrightarrow> |
3202 "uniformly_continuous_on s f \<longleftrightarrow> |
3203 (\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall> x'\<in>s. dist x' x < d |
3203 (\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall> x'\<in>s. dist x' x < d |
3204 --> dist (f x') (f x) < e)" |
3204 --> dist (f x') (f x) < e)" |
3205 |
3205 |
3206 |
3206 |
3207 text{* Lifting and dropping *} |
|
3208 |
|
3209 lemma continuous_on_o_dest_vec1: fixes f::"real \<Rightarrow> 'a::real_normed_vector" |
|
3210 assumes "continuous_on {a..b::real} f" shows "continuous_on {vec1 a..vec1 b} (f o dest_vec1)" |
|
3211 using assms unfolding continuous_on_iff apply safe |
|
3212 apply(erule_tac x="x$1" in ballE,erule_tac x=e in allE) apply safe |
|
3213 apply(rule_tac x=d in exI) apply safe unfolding o_def dist_real_def dist_real |
|
3214 apply(erule_tac x="dest_vec1 x'" in ballE) by(auto simp add:vector_le_def) |
|
3215 |
|
3216 lemma continuous_on_o_vec1: fixes f::"real^1 \<Rightarrow> 'a::real_normed_vector" |
|
3217 assumes "continuous_on {a..b} f" shows "continuous_on {dest_vec1 a..dest_vec1 b} (f o vec1)" |
|
3218 using assms unfolding continuous_on_iff apply safe |
|
3219 apply(erule_tac x="vec x" in ballE,erule_tac x=e in allE) apply safe |
|
3220 apply(rule_tac x=d in exI) apply safe unfolding o_def dist_real_def dist_real |
|
3221 apply(erule_tac x="vec1 x'" in ballE) by(auto simp add:vector_le_def) |
|
3222 |
|
3223 text{* Some simple consequential lemmas. *} |
3207 text{* Some simple consequential lemmas. *} |
3224 |
3208 |
3225 lemma uniformly_continuous_imp_continuous: |
3209 lemma uniformly_continuous_imp_continuous: |
3226 " uniformly_continuous_on s f ==> continuous_on s f" |
3210 " uniformly_continuous_on s f ==> continuous_on s f" |
3227 unfolding uniformly_continuous_on_def continuous_on_iff by blast |
3211 unfolding uniformly_continuous_on_def continuous_on_iff by blast |
4096 |
4080 |
4097 lemma linear_continuous_on: |
4081 lemma linear_continuous_on: |
4098 shows "bounded_linear f ==> continuous_on s f" |
4082 shows "bounded_linear f ==> continuous_on s f" |
4099 using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto |
4083 using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto |
4100 |
4084 |
4101 lemma continuous_on_vec1:"continuous_on A (vec1::real\<Rightarrow>real^1)" |
|
4102 by(rule linear_continuous_on[OF bounded_linear_vec1]) |
|
4103 |
|
4104 text{* Also bilinear functions, in composition form. *} |
4085 text{* Also bilinear functions, in composition form. *} |
4105 |
4086 |
4106 lemma bilinear_continuous_at_compose: |
4087 lemma bilinear_continuous_at_compose: |
4107 shows "continuous (at x) f \<Longrightarrow> continuous (at x) g \<Longrightarrow> bounded_bilinear h |
4088 shows "continuous (at x) f \<Longrightarrow> continuous (at x) g \<Longrightarrow> bounded_bilinear h |
4108 ==> continuous (at x) (\<lambda>x. h (f x) (g x))" |
4089 ==> continuous (at x) (\<lambda>x. h (f x) (g x))" |
4719 |
4700 |
4720 lemma mem_interval: fixes a :: "'a::ord^'n" shows |
4701 lemma mem_interval: fixes a :: "'a::ord^'n" shows |
4721 "x \<in> {a<..<b} \<longleftrightarrow> (\<forall>i. a$i < x$i \<and> x$i < b$i)" |
4702 "x \<in> {a<..<b} \<longleftrightarrow> (\<forall>i. a$i < x$i \<and> x$i < b$i)" |
4722 "x \<in> {a .. b} \<longleftrightarrow> (\<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i)" |
4703 "x \<in> {a .. b} \<longleftrightarrow> (\<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i)" |
4723 using interval[of a b] by(auto simp add: expand_set_eq vector_less_def vector_le_def) |
4704 using interval[of a b] by(auto simp add: expand_set_eq vector_less_def vector_le_def) |
4724 |
|
4725 lemma mem_interval_1: fixes x :: "real^1" shows |
|
4726 "(x \<in> {a .. b} \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b)" |
|
4727 "(x \<in> {a<..<b} \<longleftrightarrow> dest_vec1 a < dest_vec1 x \<and> dest_vec1 x < dest_vec1 b)" |
|
4728 by(simp_all add: Cart_eq vector_less_def vector_le_def) |
|
4729 |
|
4730 lemma vec1_interval:fixes a::"real" shows |
|
4731 "vec1 ` {a .. b} = {vec1 a .. vec1 b}" |
|
4732 "vec1 ` {a<..<b} = {vec1 a<..<vec1 b}" |
|
4733 apply(rule_tac[!] set_ext) unfolding image_iff vector_less_def unfolding mem_interval |
|
4734 unfolding forall_1 unfolding vec1_dest_vec1_simps |
|
4735 apply rule defer apply(rule_tac x="dest_vec1 x" in bexI) prefer 3 apply rule defer |
|
4736 apply(rule_tac x="dest_vec1 x" in bexI) by auto |
|
4737 |
|
4738 |
4705 |
4739 lemma interval_eq_empty: fixes a :: "real^'n" shows |
4706 lemma interval_eq_empty: fixes a :: "real^'n" shows |
4740 "({a <..< b} = {} \<longleftrightarrow> (\<exists>i. b$i \<le> a$i))" (is ?th1) and |
4707 "({a <..< b} = {} \<longleftrightarrow> (\<exists>i. b$i \<le> a$i))" (is ?th1) and |
4741 "({a .. b} = {} \<longleftrightarrow> (\<exists>i. b$i < a$i))" (is ?th2) |
4708 "({a .. b} = {} \<longleftrightarrow> (\<exists>i. b$i < a$i))" (is ?th2) |
4742 proof- |
4709 proof- |
4916 } |
4883 } |
4917 thus ?thesis unfolding open_dist using open_interval_lemma by auto |
4884 thus ?thesis unfolding open_dist using open_interval_lemma by auto |
4918 qed |
4885 qed |
4919 |
4886 |
4920 lemma open_interval_real[intro]: fixes a :: "real" shows "open {a<..<b}" |
4887 lemma open_interval_real[intro]: fixes a :: "real" shows "open {a<..<b}" |
4921 using open_interval[of "vec1 a" "vec1 b"] unfolding open_contains_ball |
4888 by (rule open_real_greaterThanLessThan) |
4922 apply-apply(rule,erule_tac x="vec1 x" in ballE) apply(erule exE,rule_tac x=e in exI) |
|
4923 unfolding subset_eq mem_ball apply(rule) defer apply(rule,erule conjE,erule_tac x="vec1 xa" in ballE) |
|
4924 by(auto simp add: dist_vec1 dist_real_def vector_less_def) |
|
4925 |
4889 |
4926 lemma closed_interval[intro]: fixes a :: "real^'n" shows "closed {a .. b}" |
4890 lemma closed_interval[intro]: fixes a :: "real^'n" shows "closed {a .. b}" |
4927 proof- |
4891 proof- |
4928 { fix x i assume as:"\<forall>e>0. \<exists>x'\<in>{a..b}. x' \<noteq> x \<and> dist x' x < e"(* and xab:"a$i > x$i \<or> b$i < x$i"*) |
4892 { fix x i assume as:"\<forall>e>0. \<exists>x'\<in>{a..b}. x' \<noteq> x \<and> dist x' x < e"(* and xab:"a$i > x$i \<or> b$i < x$i"*) |
4929 { assume xa:"a$i > x$i" |
4893 { assume xa:"a$i > x$i" |
5110 lemma inter_interval_mixed_eq_empty: fixes a :: "real^'n" |
5074 lemma inter_interval_mixed_eq_empty: fixes a :: "real^'n" |
5111 assumes "{c<..<d} \<noteq> {}" shows "{a<..<b} \<inter> {c .. d} = {} \<longleftrightarrow> {a<..<b} \<inter> {c<..<d} = {}" |
5075 assumes "{c<..<d} \<noteq> {}" shows "{a<..<b} \<inter> {c .. d} = {} \<longleftrightarrow> {a<..<b} \<inter> {c<..<d} = {}" |
5112 unfolding closure_open_interval[OF assms, THEN sym] unfolding open_inter_closure_eq_empty[OF open_interval] .. |
5076 unfolding closure_open_interval[OF assms, THEN sym] unfolding open_inter_closure_eq_empty[OF open_interval] .. |
5113 |
5077 |
5114 |
5078 |
5115 (* Some special cases for intervals in R^1. *) |
|
5116 |
|
5117 lemma interval_cases_1: fixes x :: "real^1" shows |
|
5118 "x \<in> {a .. b} ==> x \<in> {a<..<b} \<or> (x = a) \<or> (x = b)" |
|
5119 unfolding Cart_eq vector_less_def vector_le_def mem_interval by(auto simp del:dest_vec1_eq) |
|
5120 |
|
5121 lemma in_interval_1: fixes x :: "real^1" shows |
|
5122 "(x \<in> {a .. b} \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b) \<and> |
|
5123 (x \<in> {a<..<b} \<longleftrightarrow> dest_vec1 a < dest_vec1 x \<and> dest_vec1 x < dest_vec1 b)" |
|
5124 unfolding Cart_eq vector_less_def vector_le_def mem_interval by(auto simp del:dest_vec1_eq) |
|
5125 |
|
5126 lemma interval_eq_empty_1: fixes a :: "real^1" shows |
|
5127 "{a .. b} = {} \<longleftrightarrow> dest_vec1 b < dest_vec1 a" |
|
5128 "{a<..<b} = {} \<longleftrightarrow> dest_vec1 b \<le> dest_vec1 a" |
|
5129 unfolding interval_eq_empty and ex_1 by auto |
|
5130 |
|
5131 lemma subset_interval_1: fixes a :: "real^1" shows |
|
5132 "({a .. b} \<subseteq> {c .. d} \<longleftrightarrow> dest_vec1 b < dest_vec1 a \<or> |
|
5133 dest_vec1 c \<le> dest_vec1 a \<and> dest_vec1 a \<le> dest_vec1 b \<and> dest_vec1 b \<le> dest_vec1 d)" |
|
5134 "({a .. b} \<subseteq> {c<..<d} \<longleftrightarrow> dest_vec1 b < dest_vec1 a \<or> |
|
5135 dest_vec1 c < dest_vec1 a \<and> dest_vec1 a \<le> dest_vec1 b \<and> dest_vec1 b < dest_vec1 d)" |
|
5136 "({a<..<b} \<subseteq> {c .. d} \<longleftrightarrow> dest_vec1 b \<le> dest_vec1 a \<or> |
|
5137 dest_vec1 c \<le> dest_vec1 a \<and> dest_vec1 a < dest_vec1 b \<and> dest_vec1 b \<le> dest_vec1 d)" |
|
5138 "({a<..<b} \<subseteq> {c<..<d} \<longleftrightarrow> dest_vec1 b \<le> dest_vec1 a \<or> |
|
5139 dest_vec1 c \<le> dest_vec1 a \<and> dest_vec1 a < dest_vec1 b \<and> dest_vec1 b \<le> dest_vec1 d)" |
|
5140 unfolding subset_interval[of a b c d] unfolding forall_1 by auto |
|
5141 |
|
5142 lemma eq_interval_1: fixes a :: "real^1" shows |
|
5143 "{a .. b} = {c .. d} \<longleftrightarrow> |
|
5144 dest_vec1 b < dest_vec1 a \<and> dest_vec1 d < dest_vec1 c \<or> |
|
5145 dest_vec1 a = dest_vec1 c \<and> dest_vec1 b = dest_vec1 d" |
|
5146 unfolding set_eq_subset[of "{a .. b}" "{c .. d}"] |
|
5147 unfolding subset_interval_1(1)[of a b c d] |
|
5148 unfolding subset_interval_1(1)[of c d a b] |
|
5149 by auto |
|
5150 |
|
5151 lemma disjoint_interval_1: fixes a :: "real^1" shows |
|
5152 "{a .. b} \<inter> {c .. d} = {} \<longleftrightarrow> dest_vec1 b < dest_vec1 a \<or> dest_vec1 d < dest_vec1 c \<or> dest_vec1 b < dest_vec1 c \<or> dest_vec1 d < dest_vec1 a" |
|
5153 "{a .. b} \<inter> {c<..<d} = {} \<longleftrightarrow> dest_vec1 b < dest_vec1 a \<or> dest_vec1 d \<le> dest_vec1 c \<or> dest_vec1 b \<le> dest_vec1 c \<or> dest_vec1 d \<le> dest_vec1 a" |
|
5154 "{a<..<b} \<inter> {c .. d} = {} \<longleftrightarrow> dest_vec1 b \<le> dest_vec1 a \<or> dest_vec1 d < dest_vec1 c \<or> dest_vec1 b \<le> dest_vec1 c \<or> dest_vec1 d \<le> dest_vec1 a" |
|
5155 "{a<..<b} \<inter> {c<..<d} = {} \<longleftrightarrow> dest_vec1 b \<le> dest_vec1 a \<or> dest_vec1 d \<le> dest_vec1 c \<or> dest_vec1 b \<le> dest_vec1 c \<or> dest_vec1 d \<le> dest_vec1 a" |
|
5156 unfolding disjoint_interval and ex_1 by auto |
|
5157 |
|
5158 lemma open_closed_interval_1: fixes a :: "real^1" shows |
|
5159 "{a<..<b} = {a .. b} - {a, b}" |
|
5160 unfolding expand_set_eq apply simp unfolding vector_less_def and vector_le_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq) |
|
5161 |
|
5162 lemma closed_open_interval_1: "dest_vec1 (a::real^1) \<le> dest_vec1 b ==> {a .. b} = {a<..<b} \<union> {a,b}" |
|
5163 unfolding expand_set_eq apply simp unfolding vector_less_def and vector_le_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq) |
|
5164 |
|
5165 (* Some stuff for half-infinite intervals too; FIXME: notation? *) |
5079 (* Some stuff for half-infinite intervals too; FIXME: notation? *) |
5166 |
5080 |
5167 lemma closed_interval_left: fixes b::"real^'n" |
5081 lemma closed_interval_left: fixes b::"real^'n" |
5168 shows "closed {x::real^'n. \<forall>i. x$i \<le> b$i}" |
5082 shows "closed {x::real^'n. \<forall>i. x$i \<le> b$i}" |
5169 proof- |
5083 proof- |
5292 |
5206 |
5293 lemma Lim_component_eq: fixes f :: "'a \<Rightarrow> real^'n" |
5207 lemma Lim_component_eq: fixes f :: "'a \<Rightarrow> real^'n" |
5294 assumes net:"(f ---> l) net" "~(trivial_limit net)" and ev:"eventually (\<lambda>x. f(x)$i = b) net" |
5208 assumes net:"(f ---> l) net" "~(trivial_limit net)" and ev:"eventually (\<lambda>x. f(x)$i = b) net" |
5295 shows "l$i = b" |
5209 shows "l$i = b" |
5296 using ev[unfolded order_eq_iff eventually_and] using Lim_component_ge[OF net, of b i] and Lim_component_le[OF net, of i b] by auto |
5210 using ev[unfolded order_eq_iff eventually_and] using Lim_component_ge[OF net, of b i] and Lim_component_le[OF net, of i b] by auto |
5297 |
|
5298 lemma Lim_drop_le: fixes f :: "'a \<Rightarrow> real^1" shows |
|
5299 "(f ---> l) net \<Longrightarrow> ~(trivial_limit net) \<Longrightarrow> eventually (\<lambda>x. dest_vec1 (f x) \<le> b) net ==> dest_vec1 l \<le> b" |
|
5300 using Lim_component_le[of f l net 1 b] by auto |
|
5301 |
|
5302 lemma Lim_drop_ge: fixes f :: "'a \<Rightarrow> real^1" shows |
|
5303 "(f ---> l) net \<Longrightarrow> ~(trivial_limit net) \<Longrightarrow> eventually (\<lambda>x. b \<le> dest_vec1 (f x)) net ==> b \<le> dest_vec1 l" |
|
5304 using Lim_component_ge[of f l net b 1] by auto |
|
5305 |
5211 |
5306 text{* Limits relative to a union. *} |
5212 text{* Limits relative to a union. *} |
5307 |
5213 |
5308 lemma eventually_within_Un: |
5214 lemma eventually_within_Un: |
5309 "eventually P (net within (s \<union> t)) \<longleftrightarrow> |
5215 "eventually P (net within (s \<union> t)) \<longleftrightarrow> |
5356 qed |
5262 qed |
5357 |
5263 |
5358 lemma connected_ivt_component: fixes x::"real^'n" shows |
5264 lemma connected_ivt_component: fixes x::"real^'n" shows |
5359 "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x$k \<le> a \<Longrightarrow> a \<le> y$k \<Longrightarrow> (\<exists>z\<in>s. z$k = a)" |
5265 "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x$k \<le> a \<Longrightarrow> a \<le> y$k \<Longrightarrow> (\<exists>z\<in>s. z$k = a)" |
5360 using connected_ivt_hyperplane[of s x y "(basis k)::real^'n" a] by (auto simp add: inner_basis) |
5266 using connected_ivt_hyperplane[of s x y "(basis k)::real^'n" a] by (auto simp add: inner_basis) |
5361 |
|
5362 text{* Also more convenient formulations of monotone convergence. *} |
|
5363 |
|
5364 lemma bounded_increasing_convergent: fixes s::"nat \<Rightarrow> real^1" |
|
5365 assumes "bounded {s n| n::nat. True}" "\<forall>n. dest_vec1(s n) \<le> dest_vec1(s(Suc n))" |
|
5366 shows "\<exists>l. (s ---> l) sequentially" |
|
5367 proof- |
|
5368 obtain a where a:"\<forall>n. \<bar>dest_vec1 (s n)\<bar> \<le> a" using assms(1)[unfolded bounded_iff abs_dest_vec1] by auto |
|
5369 { fix m::nat |
|
5370 have "\<And> n. n\<ge>m \<longrightarrow> dest_vec1 (s m) \<le> dest_vec1 (s n)" |
|
5371 apply(induct_tac n) apply simp using assms(2) apply(erule_tac x="na" in allE) by(auto simp add: not_less_eq_eq) } |
|
5372 hence "\<forall>m n. m \<le> n \<longrightarrow> dest_vec1 (s m) \<le> dest_vec1 (s n)" by auto |
|
5373 then obtain l where "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<bar>dest_vec1 (s n) - l\<bar> < e" using convergent_bounded_monotone[OF a] unfolding monoseq_def by auto |
|
5374 thus ?thesis unfolding Lim_sequentially apply(rule_tac x="vec1 l" in exI) |
|
5375 unfolding dist_norm unfolding abs_dest_vec1 by auto |
|
5376 qed |
|
5377 |
5267 |
5378 subsection{* Basic homeomorphism definitions. *} |
5268 subsection{* Basic homeomorphism definitions. *} |
5379 |
5269 |
5380 definition "homeomorphism s t f g \<equiv> |
5270 definition "homeomorphism s t f g \<equiv> |
5381 (\<forall>x\<in>s. (g(f x) = x)) \<and> (f ` s = t) \<and> continuous_on s f \<and> |
5271 (\<forall>x\<in>s. (g(f x) = x)) \<and> (f ` s = t) \<and> continuous_on s f \<and> |