# HG changeset patch # User paulson # Date 1475150335 -3600 # Node ID 51a3d38d2281af1d54adcc0eabeebeac2eb208f3 # Parent fb03766658f41b2b554623d0e38ac23ea3d5fa04 more new material diff -r fb03766658f4 -r 51a3d38d2281 src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu Sep 29 11:24:36 2016 +0100 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu Sep 29 12:58:55 2016 +0100 @@ -129,24 +129,28 @@ have "(\x. if x \ c then f x else g x) differentiable at x within {a..b}" (is "?diff_fg") proof (cases x c rule: le_cases) case le show ?diff_fg - apply (rule differentiable_transform_within [where d = "dist x c" and f = f]) - using x le st - apply (simp_all add: dist_real_def) - apply (rule differentiable_at_withinI) - apply (rule differentiable_within_open [where s = "{a<..finite s\ finite_imp_closed) + ultimately show "f differentiable at x within {a..b}" + using x le by (auto simp add: at_within_open_NO_MATCH differentiable_at_withinI) + qed (use x le st dist_real_def in auto) next case ge show ?diff_fg - apply (rule differentiable_transform_within [where d = "dist x c" and f = g]) - using x ge st - apply (simp_all add: dist_real_def) - apply (rule differentiable_at_withinI) - apply (rule differentiable_within_open [where s = "{c<..finite t\ finite_imp_closed) + ultimately show "g differentiable at x within {a..b}" + using x ge by (auto simp add: at_within_open_NO_MATCH differentiable_at_withinI) + qed (use x ge st dist_real_def in auto) qed } then have "\s. finite s \ @@ -3801,7 +3805,7 @@ moreover have "{a<.. {a..b} - k" by force ultimately have g_diff_at: "\x. \x \ k; x \ {a<.. \ \ differentiable at x" - by (metis Diff_iff differentiable_on_subset C1_diff_imp_diff [OF g_C1_diff] differentiable_on_def differentiable_within_open) + by (metis Diff_iff differentiable_on_subset C1_diff_imp_diff [OF g_C1_diff] differentiable_on_def at_within_open) { fix w assume "w \ z" have "continuous_on (ball w (cmod (w - z))) (\w. 1 / (w - z))" @@ -7527,4 +7531,32 @@ by (metis Cauchy_theorem_global assms winding_number_zero_in_outside valid_path_imp_path) +lemma simply_connected_imp_winding_number_zero: + assumes "simply_connected s" "path g" + "path_image g \ s" "pathfinish g = pathstart g" "z \ s" + shows "winding_number g z = 0" +proof - + have "winding_number g z = winding_number(linepath (pathstart g) (pathstart g)) z" + apply (rule winding_number_homotopic_paths) + apply (rule homotopic_loops_imp_homotopic_paths_null [where a = "pathstart g"]) + apply (rule homotopic_loops_subset [of s]) + using assms + apply (auto simp: homotopic_paths_imp_homotopic_loops path_defs simply_connected_eq_contractible_path) + done + also have "... = 0" + using assms by (force intro: winding_number_trivial) + finally show ?thesis . +qed + +lemma Cauchy_theorem_simply_connected: + assumes "open s" "simply_connected s" "f holomorphic_on s" "valid_path g" + "path_image g \ s" "pathfinish g = pathstart g" + shows "(f has_contour_integral 0) g" +using assms +apply (simp add: simply_connected_eq_contractible_path) +apply (auto intro!: Cauchy_theorem_null_homotopic [where a = "pathstart g"] + homotopic_paths_imp_homotopic_loops) +using valid_path_imp_path by blast + + end diff -r fb03766658f4 -r 51a3d38d2281 src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Thu Sep 29 11:24:36 2016 +0100 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Thu Sep 29 12:58:55 2016 +0100 @@ -8697,6 +8697,59 @@ apply (simp add: rel_frontier_def convex_affine_closure_Int frontier_def) by (metis Diff_Int_distrib2 Int_emptyI convex_affine_closure_Int convex_affine_rel_interior_Int empty_iff interior_rel_interior_gen) +lemma rel_interior_convex_Int_affine: + fixes S :: "'a::euclidean_space set" + assumes "convex S" "affine T" "interior S \ T \ {}" + shows "rel_interior(S \ T) = interior S \ T" +proof - + obtain a where aS: "a \ interior S" and aT:"a \ T" + using assms by force + have "rel_interior S = interior S" + by (metis (no_types) aS affine_hull_nonempty_interior equals0D rel_interior_interior) + then show ?thesis + by (metis (no_types) affine_imp_convex assms convex_rel_interior_inter_two hull_same rel_interior_affine_hull) +qed + +lemma closure_convex_Int_affine: + fixes S :: "'a::euclidean_space set" + assumes "convex S" "affine T" "rel_interior S \ T \ {}" + shows "closure(S \ T) = closure S \ T" +proof + have "closure (S \ T) \ closure T" + by (simp add: closure_mono) + also have "... \ T" + by (simp add: affine_closed assms) + finally show "closure(S \ T) \ closure S \ T" + by (simp add: closure_mono) +next + obtain a where "a \ rel_interior S" "a \ T" + using assms by auto + then have ssT: "subspace ((\x. (-a)+x) ` T)" and "a \ S" + using affine_diffs_subspace rel_interior_subset assms by blast+ + show "closure S \ T \ closure (S \ T)" + proof + fix x assume "x \ closure S \ T" + show "x \ closure (S \ T)" + proof (cases "x = a") + case True + then show ?thesis + using \a \ S\ \a \ T\ closure_subset by fastforce + next + case False + then have "x \ closure(open_segment a x)" + by auto + then show ?thesis + using \x \ closure S \ T\ assms convex_affine_closure_Int by blast + qed + qed +qed + +lemma rel_frontier_convex_Int_affine: + fixes S :: "'a::euclidean_space set" + assumes "convex S" "affine T" "interior S \ T \ {}" + shows "rel_frontier(S \ T) = frontier S \ T" +by (simp add: assms convex_affine_rel_frontier_Int) + lemma subset_rel_interior_convex: fixes S T :: "'n::euclidean_space set" assumes "convex S" diff -r fb03766658f4 -r 51a3d38d2281 src/HOL/Analysis/Derivative.thy --- a/src/HOL/Analysis/Derivative.thy Thu Sep 29 11:24:36 2016 +0100 +++ b/src/HOL/Analysis/Derivative.thy Thu Sep 29 12:58:55 2016 +0100 @@ -180,13 +180,6 @@ shows "f differentiable F \ (\d. (f has_derivative (\x. x *\<^sub>R d)) F)" by (auto simp: differentiable_def dest: has_derivative_linear linear_imp_scaleR) -lemma differentiable_within_open: (* TODO: delete *) - assumes "a \ s" - and "open s" - shows "f differentiable (at a within s) \ f differentiable (at a)" - using assms - by (simp only: at_within_interior interior_open) - lemma differentiable_on_eq_differentiable_at: "open s \ f differentiable_on s \ (\x\s. f differentiable at x)" unfolding differentiable_on_def @@ -207,6 +200,15 @@ lemma differentiable_on_id [simp, derivative_intros]: "id differentiable_on S" by (simp add: id_def) +lemma differentiable_on_const [simp, derivative_intros]: "(\z. c) differentiable_on S" + by (simp add: differentiable_on_def) + +lemma differentiable_on_mult [simp, derivative_intros]: + fixes f :: "'M::real_normed_vector \ 'a::real_normed_algebra" + shows "\f differentiable_on S; g differentiable_on S\ \ (\z. f z * g z) differentiable_on S" + apply (simp add: differentiable_on_def differentiable_def) + using differentiable_def differentiable_mult by blast + lemma differentiable_on_compose: "\g differentiable_on S; f differentiable_on (g ` S)\ \ (\x. f (g x)) differentiable_on S" by (simp add: differentiable_in_compose differentiable_on_def) diff -r fb03766658f4 -r 51a3d38d2281 src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Thu Sep 29 11:24:36 2016 +0100 +++ b/src/HOL/Analysis/Path_Connected.thy Thu Sep 29 12:58:55 2016 +0100 @@ -2315,10 +2315,10 @@ "outside s \ s = {}" by (auto simp: outside_def) -lemma inside_inter_outside [simp]: "inside s \ outside s = {}" +lemma inside_Int_outside [simp]: "inside s \ outside s = {}" by (auto simp: inside_def outside_def) -lemma inside_union_outside [simp]: "inside s \ outside s = (- s)" +lemma inside_Un_outside [simp]: "inside s \ outside s = (- s)" by (auto simp: inside_def outside_def) lemma inside_eq_outside: @@ -2606,7 +2606,7 @@ by (simp add: inside_def connected_component_UNIV) lemma outside_empty [simp]: "outside {} = (UNIV :: 'a :: {real_normed_vector, perfect_space} set)" -using inside_empty inside_union_outside by blast +using inside_empty inside_Un_outside by blast lemma inside_same_component: "\connected_component (- s) x y; x \ inside s\ \ y \ inside s" @@ -2666,7 +2666,7 @@ fixes s :: "'a :: {real_normed_vector, perfect_space} set" assumes "convex s" shows "outside s = - s" - by (metis ComplD assms convex_in_outside equalityI inside_union_outside subsetI sup.cobounded2) + by (metis ComplD assms convex_in_outside equalityI inside_Un_outside subsetI sup.cobounded2) lemma inside_convex: fixes s :: "'a :: {real_normed_vector, perfect_space} set" @@ -2761,7 +2761,7 @@ have "closure (inside s) \ - inside s = closure (inside s) - interior (inside s)" by (metis (no_types) Diff_Compl assms closure_closed interior_closure open_closed open_inside) moreover have "- inside s \ - outside s = s" - by (metis (no_types) compl_sup double_compl inside_union_outside) + by (metis (no_types) compl_sup double_compl inside_Un_outside) moreover have "closure (inside s) \ - outside s" by (metis (no_types) assms closure_inside_subset union_with_inside) ultimately have "closure (inside s) - interior (inside s) \ s" @@ -5460,21 +5460,6 @@ subsection\Components, continuity, openin, closedin\ -lemma continuous_openin_preimage_eq: - "continuous_on S f \ - (\t. open t \ openin (subtopology euclidean S) {x. x \ S \ f x \ t})" -apply (auto simp: continuous_openin_preimage_gen) -apply (fastforce simp add: continuous_on_open openin_open) -done - -lemma continuous_closedin_preimage_eq: - "continuous_on S f \ - (\t. closed t \ closedin (subtopology euclidean S) {x. x \ S \ f x \ t})" -apply safe -apply (simp add: continuous_closedin_preimage) -apply (fastforce simp add: continuous_on_closed closedin_closed) -done - lemma continuous_on_components_gen: fixes f :: "'a::topological_space \ 'b::topological_space" assumes "\c. c \ components S \ @@ -6108,7 +6093,6 @@ apply (metis assms homotopy_eqv_homotopic_triviality_imp) by (metis (no_types) assms homotopy_eqv_homotopic_triviality_imp homotopy_eqv_sym) - lemma homotopy_eqv_cohomotopic_triviality_null_imp: fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set" @@ -6156,7 +6140,6 @@ apply (metis assms homotopy_eqv_cohomotopic_triviality_null_imp) by (metis assms homotopy_eqv_cohomotopic_triviality_null_imp homotopy_eqv_sym) - lemma homotopy_eqv_contractible_sets: fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set" @@ -6215,6 +6198,50 @@ lemma homeomorphic_contractible: fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set" shows "\contractible S; S homeomorphic T\ \ contractible T" -by (metis homeomorphic_contractible_eq) + by (metis homeomorphic_contractible_eq) + +subsection\Misc other results\ + +lemma bounded_connected_Compl_real: + fixes S :: "real set" + assumes "bounded S" and conn: "connected(- S)" + shows "S = {}" +proof - + obtain a b where "S \ box a b" + by (meson assms bounded_subset_open_interval) + then have "a \ S" "b \ S" + by auto + then have "\x. a \ x \ x \ b \ x \ - S" + by (meson Compl_iff conn connected_iff_interval) + then show ?thesis + using \S \ box a b\ by auto +qed + +lemma bounded_connected_Compl_1: + fixes S :: "'a::{euclidean_space} set" + assumes "bounded S" and conn: "connected(- S)" and 1: "DIM('a) = 1" + shows "S = {}" +proof - + have "DIM('a) = DIM(real)" + by (simp add: "1") + then obtain f::"'a \ real" and g + where "linear f" "\x. norm(f x) = norm x" "\x. g(f x) = x" "\y. f(g y) = y" + by (rule isomorphisms_UNIV_UNIV) blast + with \bounded S\ have "bounded (f ` S)" + using bounded_linear_image linear_linear by blast + have "connected (f ` (-S))" + using connected_linear_image assms \linear f\ by blast + moreover have "f ` (-S) = - (f ` S)" + apply (rule bij_image_Compl_eq) + apply (auto simp: bij_def) + apply (metis \\x. g (f x) = x\ injI) + by (metis UNIV_I \\y. f (g y) = y\ image_iff) + finally have "connected (- (f ` S))" + by simp + then have "f ` S = {}" + using \bounded (f ` S)\ bounded_connected_Compl_real by blast + then show ?thesis + by blast +qed end diff -r fb03766658f4 -r 51a3d38d2281 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Sep 29 11:24:36 2016 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Sep 29 12:58:55 2016 +0100 @@ -550,6 +550,11 @@ lemma Diff_Inter[intro]: "A - \S = \{A - s|s. s\S}" by auto +lemma closedin_Union: + assumes "finite S" "\T. T \ S \ closedin U T" + shows "closedin U (\S)" + using assms by induction auto + lemma closedin_Inter[intro]: assumes Ke: "K \ {}" and Kc: "\S. S \K \ closedin U S" @@ -6164,6 +6169,22 @@ using * by auto qed +lemma continuous_openin_preimage_eq: + "continuous_on S f \ + (\t. open t \ openin (subtopology euclidean S) {x. x \ S \ f x \ t})" +apply safe +apply (simp add: continuous_openin_preimage_gen) +apply (fastforce simp add: continuous_on_open openin_open) +done + +lemma continuous_closedin_preimage_eq: + "continuous_on S f \ + (\t. closed t \ closedin (subtopology euclidean S) {x. x \ S \ f x \ t})" +apply safe +apply (simp add: continuous_closedin_preimage) +apply (fastforce simp add: continuous_on_closed closedin_closed) +done + lemma continuous_open_preimage: assumes "continuous_on s f" and "open s" @@ -9893,6 +9914,101 @@ by (force simp: bounded_linear_def bounded_linear_axioms_def \linear f'\) qed +subsection\Pasting functions together\ + +subsubsection\on open sets\ + +lemma pasting_lemma: + fixes f :: "'i \ 'a::topological_space \ 'b::topological_space" + assumes clo: "\i. i \ I \ openin (subtopology euclidean S) (T i)" + and cont: "\i. i \ I \ continuous_on (T i) (f i)" + and f: "\i j x. \i \ I; j \ I; x \ S \ T i \ T j\ \ f i x = f j x" + and g: "\x. x \ S \ \j. j \ I \ x \ T j \ g x = f j x" + shows "continuous_on S g" +proof (clarsimp simp: continuous_openin_preimage_eq) + fix U :: "'b set" + assume "open U" + have S: "\i. i \ I \ (T i) \ S" + using clo openin_imp_subset by blast + have *: "{x \ S. g x \ U} = \{{x. x \ (T i) \ (f i x) \ U} |i. i \ I}" + apply (auto simp: dest: S) + apply (metis (no_types, lifting) g mem_Collect_eq) + using clo f g openin_imp_subset by fastforce + show "openin (subtopology euclidean S) {x \ S. g x \ U}" + apply (subst *) + apply (rule openin_Union, clarify) + apply (metis (full_types) \open U\ cont clo openin_trans continuous_openin_preimage_gen) + done +qed + +lemma pasting_lemma_exists: + fixes f :: "'i \ 'a::topological_space \ 'b::topological_space" + assumes S: "S \ (\i \ I. T i)" + and clo: "\i. i \ I \ openin (subtopology euclidean S) (T i)" + and cont: "\i. i \ I \ continuous_on (T i) (f i)" + and f: "\i j x. \i \ I; j \ I; x \ S \ T i \ T j\ \ f i x = f j x" + obtains g where "continuous_on S g" "\x i. \i \ I; x \ S \ T i\ \ g x = f i x" +proof + show "continuous_on S (\x. f (SOME i. i \ I \ x \ T i) x)" + apply (rule pasting_lemma [OF clo cont]) + apply (blast intro: f)+ + apply (metis (mono_tags, lifting) S UN_iff subsetCE someI) + done +next + fix x i + assume "i \ I" "x \ S \ T i" + then show "f (SOME i. i \ I \ x \ T i) x = f i x" + by (metis (no_types, lifting) IntD2 IntI f someI_ex) +qed + +subsubsection\Likewise on closed sets, with a finiteness assumption\ + +lemma pasting_lemma_closed: + fixes f :: "'i \ 'a::topological_space \ 'b::topological_space" + assumes "finite I" + and clo: "\i. i \ I \ closedin (subtopology euclidean S) (T i)" + and cont: "\i. i \ I \ continuous_on (T i) (f i)" + and f: "\i j x. \i \ I; j \ I; x \ S \ T i \ T j\ \ f i x = f j x" + and g: "\x. x \ S \ \j. j \ I \ x \ T j \ g x = f j x" + shows "continuous_on S g" +proof (clarsimp simp: continuous_closedin_preimage_eq) + fix U :: "'b set" + assume "closed U" + have *: "{x \ S. g x \ U} = \{{x. x \ (T i) \ (f i x) \ U} |i. i \ I}" + apply auto + apply (metis (no_types, lifting) g mem_Collect_eq) + using clo closedin_closed apply blast + apply (metis Int_iff f g clo closedin_limpt inf.absorb_iff2) + done + show "closedin (subtopology euclidean S) {x \ S. g x \ U}" + apply (subst *) + apply (rule closedin_Union) + using \finite I\ apply simp + apply (blast intro: \closed U\ continuous_closedin_preimage cont clo closedin_trans) + done +qed + +lemma pasting_lemma_exists_closed: + fixes f :: "'i \ 'a::topological_space \ 'b::topological_space" + assumes "finite I" + and S: "S \ (\i \ I. T i)" + and clo: "\i. i \ I \ closedin (subtopology euclidean S) (T i)" + and cont: "\i. i \ I \ continuous_on (T i) (f i)" + and f: "\i j x. \i \ I; j \ I; x \ S \ T i \ T j\ \ f i x = f j x" + obtains g where "continuous_on S g" "\x i. \i \ I; x \ S \ T i\ \ g x = f i x" +proof + show "continuous_on S (\x. f (SOME i. i \ I \ x \ T i) x)" + apply (rule pasting_lemma_closed [OF \finite I\ clo cont]) + apply (blast intro: f)+ + apply (metis (mono_tags, lifting) S UN_iff subsetCE someI) + done +next + fix x i + assume "i \ I" "x \ S \ T i" + then show "f (SOME i. i \ I \ x \ T i) x = f i x" + by (metis (no_types, lifting) IntD2 IntI f someI_ex) +qed + no_notation eucl_less (infix "