# HG changeset patch # User paulson # Date 1507559663 -3600 # Node ID deabce3ccf1f8c4de092893ff90d59c271585883 # Parent 6b76a5d1b7a569b6fc7578afbe6250cabf9e3d61 new material about connectedness, etc. diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Mon Oct 09 15:34:23 2017 +0100 @@ -180,7 +180,7 @@ have "f differentiable at x within ({a<..finite s\ finite_imp_closed) ultimately show "f differentiable at x within {a..b}" @@ -192,7 +192,7 @@ have "g differentiable at x within ({c<..finite t\ finite_imp_closed) ultimately show "g differentiable at x within {a..b}" @@ -1446,7 +1446,7 @@ show ?thesis apply (rule fundamental_theorem_of_calculus_interior_strong) using k assms cfg * - apply (auto simp: at_within_closed_interval) + apply (auto simp: at_within_Icc_at) done qed @@ -4158,7 +4158,7 @@ subsection\Winding number is zero "outside" a curve, in various senses\ -lemma winding_number_zero_in_outside: +proposition winding_number_zero_in_outside: assumes \: "path \" and loop: "pathfinish \ = pathstart \" and z: "z \ outside (path_image \)" shows "winding_number \ z = 0" proof - @@ -4210,7 +4210,11 @@ finally show ?thesis . qed -lemma winding_number_zero_outside: +corollary winding_number_zero_const: "a \ z \ winding_number (\t. a) z = 0" + by (rule winding_number_zero_in_outside) + (auto simp: pathfinish_def pathstart_def path_polynomial_function) + +corollary winding_number_zero_outside: "\path \; convex s; pathfinish \ = pathstart \; z \ s; path_image \ \ s\ \ winding_number \ z = 0" by (meson convex_in_outside outside_mono subsetCE winding_number_zero_in_outside) diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Mon Oct 09 15:34:23 2017 +0100 @@ -1233,7 +1233,7 @@ lemma continuous_on_Ln [continuous_intros]: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ continuous_on s Ln" by (simp add: continuous_at_imp_continuous_on continuous_within_Ln) -lemma holomorphic_on_Ln: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ Ln holomorphic_on s" +lemma holomorphic_on_Ln [holomorphic_intros]: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ Ln holomorphic_on s" by (simp add: field_differentiable_within_Ln holomorphic_on_def) lemma divide_ln_mono: diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Conformal_Mappings.thy --- a/src/HOL/Analysis/Conformal_Mappings.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Conformal_Mappings.thy Mon Oct 09 15:34:23 2017 +0100 @@ -1454,6 +1454,15 @@ qed qed +corollary Schwarz_Lemma': + assumes holf: "f holomorphic_on (ball 0 1)" and [simp]: "f 0 = 0" + and no: "\z. norm z < 1 \ norm (f z) < 1" + shows "((\\. norm \ < 1 \ norm (f \) \ norm \) \ norm(deriv f 0) \ 1) \ + (((\z. norm z < 1 \ z \ 0 \ norm(f z) = norm z) \ norm(deriv f 0) = 1) + \ (\\. (\z. norm z < 1 \ f z = \ * z) \ norm \ = 1))" + using Schwarz_Lemma [OF assms] + by (metis (no_types) norm_eq_zero zero_less_one) + subsection\The Schwarz reflection principle\ lemma hol_pal_lem0: diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Mon Oct 09 15:34:23 2017 +0100 @@ -4696,6 +4696,15 @@ finally show ?thesis . qed +lemma interior_atLeastLessThan [simp]: + fixes a::real shows "interior {a..R f (g x)) (at x)" if "x \ {a..b} - (s \ {a,b})" for x - using deriv[of x] that by (simp add: at_within_closed_interval o_def) + using deriv[of x] that by (simp add: at_within_Icc_at o_def) have "((\x. g' x *\<^sub>R f (g x)) has_integral (?F b - ?F a)) {a..b}" using le cont_int s deriv cont_int by (intro fundamental_theorem_of_calculus_interior_strong[of "s \ {a,b}"]) simp_all diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Path_Connected.thy Mon Oct 09 15:34:23 2017 +0100 @@ -166,6 +166,9 @@ lemma simple_path_eq_arc: "pathfinish g \ pathstart g \ (simple_path g = arc g)" by (simp add: arc_simple_path) +lemma path_image_const [simp]: "path_image (\t. a) = {a}" + by (force simp: path_image_def) + lemma path_image_nonempty [simp]: "path_image g \ {}" unfolding path_image_def image_is_empty box_eq_empty by auto @@ -1511,13 +1514,7 @@ assumes "convex s" shows "path_connected s" unfolding path_connected_def - apply rule - apply rule - apply (rule_tac x = "linepath x y" in exI) - unfolding path_image_linepath - using assms [unfolded convex_contains_segment] - apply auto - done + using assms convex_contains_segment by fastforce lemma path_connected_UNIV [iff]: "path_connected (UNIV :: 'a::real_normed_vector set)" by (simp add: convex_imp_path_connected) @@ -1528,13 +1525,7 @@ lemma path_connected_imp_connected: assumes "path_connected S" shows "connected S" - unfolding connected_def not_ex - apply rule - apply rule - apply (rule ccontr) - unfolding not_not - apply (elim conjE) -proof - +proof (rule connectedI) fix e1 e2 assume as: "open e1" "open e2" "S \ e1 \ e2" "e1 \ e2 \ S = {}" "e1 \ S \ {}" "e2 \ S \ {}" then obtain x1 x2 where obt:"x1 \ e1 \ S" "x2 \ e2 \ S" @@ -1570,31 +1561,14 @@ fix y assume as: "y \ path_component_set S x" then have "y \ S" - apply - - apply (rule path_component_mem(2)) - unfolding mem_Collect_eq - apply auto - done + by (simp add: path_component_mem(2)) then obtain e where e: "e > 0" "ball y e \ S" using assms[unfolded open_contains_ball] by auto - show "\e > 0. ball y e \ path_component_set S x" - apply (rule_tac x=e in exI) - apply (rule,rule \e>0\) - apply rule - unfolding mem_ball mem_Collect_eq - proof - - fix z - assume "dist y z < e" - then show "path_component S x z" - apply (rule_tac path_component_trans[of _ _ y]) - defer - apply (rule path_component_of_subset[OF e(2)]) - apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format]) - using \e > 0\ as - apply auto - done - qed +have "\u. dist y u < e \ path_component S x u" + by (metis (full_types) as centre_in_ball convex_ball convex_imp_path_connected e mem_Collect_eq mem_ball path_component_eq path_component_of_subset path_connected_component) + then show "\e > 0. ball y e \ path_component_set S x" + using \e>0\ by auto qed lemma open_non_path_component: @@ -1904,6 +1878,8 @@ using is_interval_connected_1 is_interval_path_connected path_connected_imp_connected by blast +subsection\Path components\ + lemma Union_path_component [simp]: "Union {path_component_set S x |x. x \ S} = S" apply (rule subset_antisym) @@ -2151,7 +2127,6 @@ by (auto simp: path_connected_component) qed - lemma connected_complement_bounded_convex: fixes s :: "'a :: euclidean_space set" assumes "bounded s" "convex s" "2 \ DIM('a)" @@ -2300,6 +2275,65 @@ qed +subsection\Every annulus is a connected set\ + +lemma path_connected_2DIM_I: + fixes a :: "'N::euclidean_space" + assumes 2: "2 \ DIM('N)" and pc: "path_connected {r. 0 \ r \ P r}" + shows "path_connected {x. P(norm(x - a))}" +proof - + have "{x. P(norm(x - a))} = op+a ` {x. P(norm x)}" + by force + moreover have "path_connected {x::'N. P(norm x)}" + proof - + let ?D = "{x. 0 \ x \ P x} \ sphere (0::'N) 1" + have "x \ (\z. fst z *\<^sub>R snd z) ` ?D" + if "P (norm x)" for x::'N + proof (cases "x=0") + case True + with that show ?thesis + apply (simp add: image_iff) + apply (rule_tac x=0 in exI, simp) + using vector_choose_size zero_le_one by blast + next + case False + with that show ?thesis + by (rule_tac x="(norm x, x /\<^sub>R norm x)" in image_eqI) auto + qed + then have *: "{x::'N. P(norm x)} = (\z. fst z *\<^sub>R snd z) ` ?D" + by auto + have "continuous_on ?D (\z:: real\'N. fst z *\<^sub>R snd z)" + by (intro continuous_intros) + moreover have "path_connected ?D" + by (metis path_connected_Times [OF pc] path_connected_sphere 2) + ultimately show ?thesis + apply (subst *) + apply (rule path_connected_continuous_image, auto) + done + qed + ultimately show ?thesis + using path_connected_translation by metis +qed + +lemma path_connected_annulus: + fixes a :: "'N::euclidean_space" + assumes "2 \ DIM('N)" + shows "path_connected {x. r1 < norm(x - a) \ norm(x - a) < r2}" + "path_connected {x. r1 < norm(x - a) \ norm(x - a) \ r2}" + "path_connected {x. r1 \ norm(x - a) \ norm(x - a) < r2}" + "path_connected {x. r1 \ norm(x - a) \ norm(x - a) \ r2}" + by (auto simp: is_interval_def intro!: is_interval_convex convex_imp_path_connected path_connected_2DIM_I [OF assms]) + +lemma connected_annulus: + fixes a :: "'N::euclidean_space" + assumes "2 \ DIM('N::euclidean_space)" + shows "connected {x. r1 < norm(x - a) \ norm(x - a) < r2}" + "connected {x. r1 < norm(x - a) \ norm(x - a) \ r2}" + "connected {x. r1 \ norm(x - a) \ norm(x - a) < r2}" + "connected {x. r1 \ norm(x - a) \ norm(x - a) \ r2}" + by (auto simp: path_connected_annulus [OF assms] path_connected_imp_connected) + + subsection\Relations between components and path components\ lemma open_connected_component: @@ -2894,11 +2928,21 @@ shows "outside s = - s" by (metis ComplD assms convex_in_outside equalityI inside_Un_outside subsetI sup.cobounded2) +lemma outside_singleton [simp]: + fixes x :: "'a :: {real_normed_vector, perfect_space}" + shows "outside {x} = -{x}" + by (auto simp: outside_convex) + lemma inside_convex: fixes s :: "'a :: {real_normed_vector, perfect_space} set" shows "convex s \ inside s = {}" by (simp add: inside_outside outside_convex) +lemma inside_singleton [simp]: + fixes x :: "'a :: {real_normed_vector, perfect_space}" + shows "inside {x} = {}" + by (auto simp: inside_convex) + lemma outside_subset_convex: fixes s :: "'a :: {real_normed_vector, perfect_space} set" shows "\convex t; s \ t\ \ - t \ outside s" @@ -4119,6 +4163,39 @@ by (blast intro: homotopic_loops_trans) qed +lemma homotopic_paths_loop_parts: + assumes loops: "homotopic_loops S (p +++ reversepath q) (linepath a a)" and "path q" + shows "homotopic_paths S p q" +proof - + have paths: "homotopic_paths S (p +++ reversepath q) (linepath (pathstart p) (pathstart p))" + using homotopic_loops_imp_homotopic_paths_null [OF loops] by simp + then have "path p" + using \path q\ homotopic_loops_imp_path loops path_join path_join_path_ends path_reversepath by blast + show ?thesis + proof (cases "pathfinish p = pathfinish q") + case True + have pipq: "path_image p \ S" "path_image q \ S" + by (metis Un_subset_iff paths \path p\ \path q\ homotopic_loops_imp_subset homotopic_paths_imp_path loops + path_image_join path_image_reversepath path_imp_reversepath path_join_eq)+ + have "homotopic_paths S p (p +++ (linepath (pathfinish p) (pathfinish p)))" + using \path p\ \path_image p \ S\ homotopic_paths_rid homotopic_paths_sym by blast + moreover have "homotopic_paths S (p +++ (linepath (pathfinish p) (pathfinish p))) (p +++ (reversepath q +++ q))" + by (simp add: True \path p\ \path q\ pipq homotopic_paths_join homotopic_paths_linv homotopic_paths_sym) + moreover have "homotopic_paths S (p +++ (reversepath q +++ q)) ((p +++ reversepath q) +++ q)" + by (simp add: True \path p\ \path q\ homotopic_paths_assoc pipq) + moreover have "homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart p) (pathstart p) +++ q)" + by (simp add: \path q\ homotopic_paths_join paths pipq) + moreover then have "homotopic_paths S (linepath (pathstart p) (pathstart p) +++ q) q" + by (metis \path q\ homotopic_paths_imp_path homotopic_paths_lid linepath_trivial path_join_path_ends pathfinish_def pipq(2)) + ultimately show ?thesis + using homotopic_paths_trans by metis + next + case False + then show ?thesis + using \path q\ homotopic_loops_imp_path loops path_join_path_ends by fastforce + qed +qed + subsection\ Homotopy of "nearby" function, paths and loops.\ diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Starlike.thy --- a/src/HOL/Analysis/Starlike.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Starlike.thy Mon Oct 09 15:34:23 2017 +0100 @@ -3776,24 +3776,6 @@ subsection\Explicit formulas for interior and relative interior of convex hull\ -lemma interior_atLeastAtMost [simp]: - fixes a::real shows "interior {a..b} = {a<.. x < b \ (at x within {a..b}) = at x" - by (metis at_within_interior greaterThanLessThan_iff interior_atLeastAtMost) - lemma at_within_cbox_finite: assumes "x \ box a b" "x \ S" "finite S" shows "(at x within cbox a b - S) = at x" @@ -5087,7 +5069,6 @@ using separation_closures [of S T] by (metis assms closure_closed disjnt_def inf_commute) - lemma separation_normal_local: fixes S :: "'a::euclidean_space set" assumes US: "closedin (subtopology euclidean U) S" @@ -5147,6 +5128,139 @@ by auto (meson bounded_ball bounded_subset compl_le_swap2 disjoint_eq_subset_Compl) qed +subsection\Connectedness of the intersection of a chain\ + +proposition connected_chain: + fixes \ :: "'a :: euclidean_space set set" + assumes cc: "\S. S \ \ \ compact S \ connected S" + and linear: "\S T. S \ \ \ T \ \ \ S \ T \ T \ S" + shows "connected(\\)" +proof (cases "\ = {}") + case True then show ?thesis + by auto +next + case False + then have cf: "compact(\\)" + by (simp add: cc compact_Inter) + have False if AB: "closed A" "closed B" "A \ B = {}" + and ABeq: "A \ B = \\" and "A \ {}" "B \ {}" for A B + proof - + obtain U V where "open U" "open V" "A \ U" "B \ V" "U \ V = {}" + using separation_normal [OF AB] by metis + obtain K where "K \ \" "compact K" + using cc False by blast + then obtain N where "open N" and "K \ N" + by blast + let ?\ = "insert (U \ V) ((\S. N - S) ` \)" + obtain \ where "\ \ ?\" "finite \" "K \ \\" + proof (rule compactE [OF \compact K\]) + show "K \ \insert (U \ V) (op - N ` \)" + using \K \ N\ ABeq \A \ U\ \B \ V\ by auto + show "\B. B \ insert (U \ V) (op - N ` \) \ open B" + by (auto simp: \open U\ \open V\ open_Un \open N\ cc compact_imp_closed open_Diff) + qed + then have "finite(\ - {U \ V})" + by blast + moreover have "\ - {U \ V} \ (\S. N - S) ` \" + using \\ \ ?\\ by blast + ultimately obtain \ where "\ \ \" "finite \" and Deq: "\ - {U \ V} = (\S. N-S) ` \" + using finite_subset_image by metis + obtain J where "J \ \" and J: "(\S\\. N - S) \ N - J" + proof (cases "\ = {}") + case True + with \\ \ {}\ that show ?thesis + by auto + next + case False + have "\S T. \S \ \; T \ \\ \ S \ T \ T \ S" + by (meson \\ \ \\ in_mono local.linear) + with \finite \\ \\ \ {}\ + have "\J \ \. (\S\\. N - S) \ N - J" + proof induction + case (insert X \) + show ?case + proof (cases "\ = {}") + case True then show ?thesis by auto + next + case False + then have "\S T. \S \ \; T \ \\ \ S \ T \ T \ S" + by (simp add: insert.prems) + with insert.IH False obtain J where "J \ \" and J: "(\Y\\. N - Y) \ N - J" + by metis + have "N - J \ N - X \ N - X \ N - J" + by (meson Diff_mono \J \ \\ insert.prems(2) insert_iff order_refl) + then show ?thesis + proof + assume "N - J \ N - X" with J show ?thesis + by auto + next + assume "N - X \ N - J" + with J have "N - X \ UNION \ (op - N) \ N - J" + by auto + with \J \ \\ show ?thesis + by blast + qed + qed + qed simp + with \\ \ \\ show ?thesis by (blast intro: that) + qed + have "K \ \(insert (U \ V) (\ - {U \ V}))" + using \K \ \\\ by auto + also have "... \ (U \ V) \ (N - J)" + by (metis (no_types, hide_lams) Deq Un_subset_iff Un_upper2 J Union_insert order_trans sup_ge1) + finally have "J \ K \ U \ V" + by blast + moreover have "connected(J \ K)" + by (metis Int_absorb1 \J \ \\ \K \ \\ cc inf.orderE local.linear) + moreover have "U \ (J \ K) \ {}" + using ABeq \J \ \\ \K \ \\ \A \ {}\ \A \ U\ by blast + moreover have "V \ (J \ K) \ {}" + using ABeq \J \ \\ \K \ \\ \B \ {}\ \B \ V\ by blast + ultimately show False + using connectedD [of "J \ K" U V] \open U\ \open V\ \U \ V = {}\ by auto + qed + with cf show ?thesis + by (auto simp: connected_closed_set compact_imp_closed) +qed + +lemma connected_chain_gen: + fixes \ :: "'a :: euclidean_space set set" + assumes X: "X \ \" "compact X" + and cc: "\T. T \ \ \ closed T \ connected T" + and linear: "\S T. S \ \ \ T \ \ \ S \ T \ T \ S" + shows "connected(\\)" +proof - + have "\\ = (\T\\. X \ T)" + using X by blast + moreover have "connected (\T\\. X \ T)" + proof (rule connected_chain) + show "\T. T \ op \ X ` \ \ compact T \ connected T" + using cc X by auto (metis inf.absorb2 inf.orderE local.linear) + show "\S T. S \ op \ X ` \ \ T \ op \ X ` \ \ S \ T \ T \ S" + using local.linear by blast + qed + ultimately show ?thesis + by metis +qed + +lemma connected_nest: + fixes S :: "'a::linorder \ 'b::euclidean_space set" + assumes S: "\n. compact(S n)" "\n. connected(S n)" + and nest: "\m n. m \ n \ S n \ S m" + shows "connected(\ (range S))" + apply (rule connected_chain) + using S apply blast + by (metis image_iff le_cases nest) + +lemma connected_nest_gen: + fixes S :: "'a::linorder \ 'b::euclidean_space set" + assumes S: "\n. closed(S n)" "\n. connected(S n)" "compact(S k)" + and nest: "\m n. m \ n \ S n \ S m" + shows "connected(\ (range S))" + apply (rule connected_chain_gen [of "S k"]) + using S apply auto + by (meson le_cases nest subsetCE) + subsection\Proper maps, including projections out of compact sets\ lemma finite_indexed_bound: diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Oct 09 15:34:23 2017 +0100 @@ -676,6 +676,10 @@ using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute) qed +lemma openin_Inter [intro]: + assumes "finite \" "\ \ {}" "\X. X \ \ \ openin T X" shows "openin T (\\)" + by (metis (full_types) assms openin_INT2 image_ident) + subsubsection \Closed sets\ @@ -2404,6 +2408,11 @@ lemma closedin_closed_eq: "closed S \ closedin (subtopology euclidean S) T \ closed T \ T \ S" by (meson closedin_limpt closed_subset closedin_closed_trans) +lemma connected_closed_set: + "closed S + \ connected S \ (\A B. closed A \ closed B \ A \ {} \ B \ {} \ A \ B = S \ A \ B = {})" + unfolding connected_closedin_eq closedin_closed_eq connected_closedin_eq by blast + lemma closedin_subset_trans: "closedin (subtopology euclidean U) S \ S \ T \ T \ U \ closedin (subtopology euclidean T) S" @@ -5407,6 +5416,13 @@ by auto qed +lemma compact_Inter: + fixes \ :: "'a :: heine_borel set set" + assumes com: "\S. S \ \ \ compact S" and "\ \ {}" + shows "compact(\ \)" + using assms + by (meson Inf_lower all_not_in_conv bounded_subset closed_Inter compact_eq_bounded_closed) + lemma compact_closure [simp]: fixes S :: "'a::heine_borel set" shows "compact(closure S) \ bounded S" @@ -5819,19 +5835,6 @@ then show ?thesis unfolding complete_def by auto qed -lemma nat_approx_posE: - fixes e::real - assumes "0 < e" - obtains n :: nat where "1 / (Suc n) < e" -proof atomize_elim - have "1 / real (Suc (nat \1/e\)) < 1 / \1/e\" - by (rule divide_strict_left_mono) (auto simp: \0 < e\) - also have "1 / \1/e\ \ 1 / (1/e)" - by (rule divide_left_mono) (auto simp: \0 < e\ ceiling_correct) - also have "\ = e" by simp - finally show "\n. 1 / real (Suc n) < e" .. -qed - lemma compact_eq_totally_bounded: "compact s \ complete s \ (\e>0. \k. finite k \ s \ (\x\k. ball x e))" (is "_ \ ?rhs") @@ -9679,6 +9682,43 @@ simp: dist_commute dist_norm pos_divide_less_eq mult_strict_left_mono) done +lemma homeomorphic_ball01_UNIV: + "ball (0::'a::real_normed_vector) 1 homeomorphic (UNIV:: 'a set)" + (is "?B homeomorphic ?U") +proof + have "x \ (\z. z /\<^sub>R (1 - norm z)) ` ball 0 1" for x::'a + apply (rule_tac x="x /\<^sub>R (1 + norm x)" in image_eqI) + apply (auto simp: divide_simps) + using norm_ge_zero [of x] apply linarith+ + done + then show "(\z::'a. z /\<^sub>R (1 - norm z)) ` ?B = ?U" + by blast + have "x \ range (\z. (1 / (1 + norm z)) *\<^sub>R z)" if "norm x < 1" for x::'a + apply (rule_tac x="x /\<^sub>R (1 - norm x)" in image_eqI) + using that apply (auto simp: divide_simps) + done + then show "(\z::'a. z /\<^sub>R (1 + norm z)) ` ?U = ?B" + by (force simp: divide_simps dest: add_less_zeroD) + show "continuous_on (ball 0 1) (\z. z /\<^sub>R (1 - norm z))" + by (rule continuous_intros | force)+ + show "continuous_on UNIV (\z. z /\<^sub>R (1 + norm z))" + apply (intro continuous_intros) + apply (metis le_add_same_cancel1 norm_ge_zero not_le zero_less_one) + done + show "\x. x \ ball 0 1 \ + x /\<^sub>R (1 - norm x) /\<^sub>R (1 + norm (x /\<^sub>R (1 - norm x))) = x" + by (auto simp: divide_simps) + show "\y. y /\<^sub>R (1 + norm y) /\<^sub>R (1 - norm (y /\<^sub>R (1 + norm y))) = y" + apply (auto simp: divide_simps) + apply (metis le_add_same_cancel1 norm_ge_zero not_le zero_less_one) + done +qed + +proposition homeomorphic_ball_UNIV: + fixes a ::"'a::real_normed_vector" + assumes "0 < r" shows "ball a r homeomorphic (UNIV:: 'a set)" + using assms homeomorphic_ball01_UNIV homeomorphic_balls(1) homeomorphic_trans zero_less_one by blast + subsection\Inverse function property for open/closed maps\ lemma continuous_on_inverse_open_map: @@ -10711,7 +10751,7 @@ then show ?thesis by blast qed -lemma closed_imp_fip_compact: +lemma clconnected_closedin_eqosed_imp_fip_compact: fixes S :: "'a::heine_borel set" shows "\closed S; \T. T \ \ \ compact T; @@ -11043,38 +11083,38 @@ text\Still missing: versions for a set that is smaller than R, or countable.\ lemma continuous_disconnected_range_constant: - assumes s: "connected s" - and conf: "continuous_on s f" - and fim: "f ` s \ t" + assumes S: "connected S" + and conf: "continuous_on S f" + and fim: "f ` S \ t" and cct: "\y. y \ t \ connected_component_set t y = {y}" - shows "\a. \x \ s. f x = a" -proof (cases "s = {}") + shows "\a. \x \ S. f x = a" +proof (cases "S = {}") case True then show ?thesis by force next case False - { fix x assume "x \ s" - then have "f ` s \ {f x}" - by (metis connected_continuous_image conf connected_component_maximal fim image_subset_iff rev_image_eqI s cct) + { fix x assume "x \ S" + then have "f ` S \ {f x}" + by (metis connected_continuous_image conf connected_component_maximal fim image_subset_iff rev_image_eqI S cct) } with False show ?thesis by blast qed lemma discrete_subset_disconnected: - fixes s :: "'a::topological_space set" + fixes S :: "'a::topological_space set" fixes t :: "'b::real_normed_vector set" - assumes conf: "continuous_on s f" - and no: "\x. x \ s \ \e>0. \y. y \ s \ f y \ f x \ e \ norm (f y - f x)" - shows "f ` s \ {y. connected_component_set (f ` s) y = {y}}" -proof - - { fix x assume x: "x \ s" - then obtain e where "e>0" and ele: "\y. \y \ s; f y \ f x\ \ e \ norm (f y - f x)" + assumes conf: "continuous_on S f" + and no: "\x. x \ S \ \e>0. \y. y \ S \ f y \ f x \ e \ norm (f y - f x)" + shows "f ` S \ {y. connected_component_set (f ` S) y = {y}}" +proof - + { fix x assume x: "x \ S" + then obtain e where "e>0" and ele: "\y. \y \ S; f y \ f x\ \ e \ norm (f y - f x)" using conf no [OF x] by auto then have e2: "0 \ e / 2" by simp - have "f y = f x" if "y \ s" and ccs: "f y \ connected_component_set (f ` s) (f x)" for y + have "f y = f x" if "y \ S" and ccs: "f y \ connected_component_set (f ` S) (f x)" for y apply (rule ccontr) - using connected_closed [of "connected_component_set (f ` s) (f x)"] \e>0\ + using connected_closed [of "connected_component_set (f ` S) (f x)"] \e>0\ apply (simp add: del: ex_simps) apply (drule spec [where x="cball (f x) (e / 2)"]) apply (drule spec [where x="- ball(f x) e"]) @@ -11082,11 +11122,11 @@ apply (metis diff_self e2 ele norm_minus_commute norm_zero not_less) using centre_in_cball connected_component_refl_eq e2 x apply blast using ccs - apply (force simp: cball_def dist_norm norm_minus_commute dest: ele [OF \y \ s\]) + apply (force simp: cball_def dist_norm norm_minus_commute dest: ele [OF \y \ S\]) done - moreover have "connected_component_set (f ` s) (f x) \ f ` s" + moreover have "connected_component_set (f ` S) (f x) \ f ` S" by (auto simp: connected_component_in) - ultimately have "connected_component_set (f ` s) (f x) = {f x}" + ultimately have "connected_component_set (f ` S) (f x) = {f x}" by (auto simp: x) } with assms show ?thesis @@ -11094,22 +11134,22 @@ qed lemma finite_implies_discrete: - fixes s :: "'a::topological_space set" - assumes "finite (f ` s)" - shows "(\x \ s. \e>0. \y. y \ s \ f y \ f x \ e \ norm (f y - f x))" -proof - - have "\e>0. \y. y \ s \ f y \ f x \ e \ norm (f y - f x)" if "x \ s" for x - proof (cases "f ` s - {f x} = {}") + fixes S :: "'a::topological_space set" + assumes "finite (f ` S)" + shows "(\x \ S. \e>0. \y. y \ S \ f y \ f x \ e \ norm (f y - f x))" +proof - + have "\e>0. \y. y \ S \ f y \ f x \ e \ norm (f y - f x)" if "x \ S" for x + proof (cases "f ` S - {f x} = {}") case True with zero_less_numeral show ?thesis by (fastforce simp add: Set.image_subset_iff cong: conj_cong) next case False - then obtain z where z: "z \ s" "f z \ f x" + then obtain z where z: "z \ S" "f z \ f x" by blast - have finn: "finite {norm (z - f x) |z. z \ f ` s - {f x}}" + have finn: "finite {norm (z - f x) |z. z \ f ` S - {f x}}" using assms by simp - then have *: "0 < Inf{norm(z - f x) | z. z \ f ` s - {f x}}" + then have *: "0 < Inf{norm(z - f x) | z. z \ f ` S - {f x}}" apply (rule finite_imp_less_Inf) using z apply force+ done @@ -11123,20 +11163,20 @@ text\This proof requires the existence of two separate values of the range type.\ lemma finite_range_constant_imp_connected: assumes "\f::'a::topological_space \ 'b::real_normed_algebra_1. - \continuous_on s f; finite(f ` s)\ \ \a. \x \ s. f x = a" - shows "connected s" + \continuous_on S f; finite(f ` S)\ \ \a. \x \ S. f x = a" + shows "connected S" proof - { fix t u - assume clt: "closedin (subtopology euclidean s) t" - and clu: "closedin (subtopology euclidean s) u" - and tue: "t \ u = {}" and tus: "t \ u = s" - have conif: "continuous_on s (\x. if x \ t then 0 else 1)" + assume clt: "closedin (subtopology euclidean S) t" + and clu: "closedin (subtopology euclidean S) u" + and tue: "t \ u = {}" and tus: "t \ u = S" + have conif: "continuous_on S (\x. if x \ t then 0 else 1)" apply (subst tus [symmetric]) apply (rule continuous_on_cases_local) using clt clu tue apply (auto simp: tus continuous_on_const) done - have fi: "finite ((\x. if x \ t then 0 else 1) ` s)" + have fi: "finite ((\x. if x \ t then 0 else 1) ` S)" by (rule finite_subset [of _ "{0,1}"]) auto have "t = {} \ u = {}" using assms [OF conif fi] tus [symmetric] diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Archimedean_Field.thy --- a/src/HOL/Archimedean_Field.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Archimedean_Field.thy Mon Oct 09 15:34:23 2017 +0100 @@ -526,7 +526,8 @@ shows "finite {k \ \. \k\ \ a}" using finite_int_segment [of "-a" a] by (auto simp add: abs_le_iff conj_commute minus_le_iff) -text \Ceiling with numerals.\ + +subsubsection \Ceiling with numerals.\ lemma ceiling_zero [simp]: "\0\ = 0" using ceiling_of_int [of 0] by simp @@ -595,7 +596,7 @@ by (simp add: ceiling_altdef) -text \Addition and subtraction of integers.\ +subsubsection \Addition and subtraction of integers.\ lemma ceiling_add_of_int [simp]: "\x + of_int z\ = \x\ + z" using ceiling_correct [of x] by (simp add: ceiling_def) @@ -630,6 +631,24 @@ unfolding of_int_less_iff by simp qed +lemma nat_approx_posE: + fixes e:: "'a::{archimedean_field,floor_ceiling}" + assumes "0 < e" + obtains n :: nat where "1 / of_nat(Suc n) < e" +proof + have "(1::'a) / of_nat (Suc (nat \1/e\)) < 1 / of_int (\1/e\)" + proof (rule divide_strict_left_mono) + show "(of_int \1 / e\::'a) < of_nat (Suc (nat \1 / e\))" + using assms by (simp add: field_simps) + show "(0::'a) < of_nat (Suc (nat \1 / e\)) * of_int \1 / e\" + using assms by (auto simp: zero_less_mult_iff pos_add_strict) + qed auto + also have "1 / of_int (\1/e\) \ 1 / (1/e)" + by (rule divide_left_mono) (auto simp: \0 < e\ ceiling_correct) + also have "\ = e" by simp + finally show "1 / of_nat (Suc (nat \1 / e\)) < e" + by metis +qed subsection \Negation\ diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Complex.thy --- a/src/HOL/Complex.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Complex.thy Mon Oct 09 15:34:23 2017 +0100 @@ -1077,7 +1077,7 @@ and Complex_mult_complex_of_real: "Complex x y * complex_of_real r = Complex (x*r) (y*r)" and complex_of_real_mult_Complex: "complex_of_real r * Complex x y = Complex (r*x) (r*y)" and complex_eq_cancel_iff2: "(Complex x y = complex_of_real xa) = (x = xa \ y = 0)" - and complex_cn: "cnj (Complex a b) = Complex a (- b)" + and complex_cnj: "cnj (Complex a b) = Complex a (- b)" and Complex_sum': "sum (\x. Complex (f x) 0) s = Complex (sum f s) 0" and Complex_sum: "Complex (sum f s) 0 = sum (\x. Complex (f x) 0) s" and complex_of_real_def: "complex_of_real r = Complex r 0" diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Limits.thy --- a/src/HOL/Limits.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Limits.thy Mon Oct 09 15:34:23 2017 +0100 @@ -820,6 +820,11 @@ lemmas tendsto_mult_right_zero = bounded_bilinear.tendsto_right_zero [OF bounded_bilinear_mult] +lemma tendsto_divide_zero: + fixes c :: "'a::real_normed_field" + shows "(f \ 0) F \ ((\x. f x / c) \ 0) F" + by (cases "c=0") (simp_all add: divide_inverse tendsto_mult_left_zero) + lemma tendsto_power [tendsto_intros]: "(f \ a) F \ ((\x. f x ^ n) \ a ^ n) F" for f :: "'a \ 'b::{power,real_normed_algebra}" by (induct n) (simp_all add: tendsto_mult) diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Real.thy --- a/src/HOL/Real.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Real.thy Mon Oct 09 15:34:23 2017 +0100 @@ -23,6 +23,11 @@ subsection \Preliminary lemmas\ +text{*Useful in convergence arguments*} +lemma inverse_of_nat_le: + fixes n::nat shows "\n \ m; n\0\ \ 1 / of_nat m \ (1::'a::linordered_field) / of_nat n" + by (simp add: frac_le) + lemma inj_add_left [simp]: "inj (op + x)" for x :: "'a::cancel_semigroup_add" by (meson add_left_imp_eq injI) diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Real_Vector_Spaces.thy Mon Oct 09 15:34:23 2017 +0100 @@ -1469,17 +1469,14 @@ begin lemma pos_bounded: "\K>0. \a b. norm (a ** b) \ norm a * norm b * K" - apply (insert bounded) - apply (erule exE) - apply (rule_tac x="max 1 K" in exI) - apply safe - apply (rule order_less_le_trans [OF zero_less_one max.cobounded1]) - apply (drule spec) - apply (drule spec) - apply (erule order_trans) - apply (rule mult_left_mono [OF max.cobounded2]) - apply (intro mult_nonneg_nonneg norm_ge_zero) - done +proof - + obtain K where "\a b. norm (a ** b) \ norm a * norm b * K" + using bounded by blast + then have "norm (a ** b) \ norm a * norm b * (max 1 K)" for a b + by (rule order.trans) (simp add: mult_left_mono) + then show ?thesis + by force +qed lemma nonneg_bounded: "\K\0. \a b. norm (a ** b) \ norm a * norm b * K" using pos_bounded by (auto intro: order_less_imp_le) diff -r 6b76a5d1b7a5 -r deabce3ccf1f src/HOL/Rings.thy --- a/src/HOL/Rings.thy Sun Oct 08 16:50:37 2017 +0200 +++ b/src/HOL/Rings.thy Mon Oct 09 15:34:23 2017 +0100 @@ -2241,6 +2241,10 @@ lemma minus_less_iff_1 [simp, no_atp]: "- a < 1 \ - 1 < a" by (fact minus_less_iff) +lemma add_less_zeroD: + shows "x+y < 0 \ x<0 \ y<0" + by (auto simp: not_less intro: le_less_trans [of _ "x+y"]) + end text \Simprules for comparisons where common factors can be cancelled.\