# HG changeset patch # User immler # Date 1546883441 -3600 # Node ID 00347595559372a7f5dfd8998b234c0b9f608f83 # Parent 9c22ff18125bc063fbe016da9bf542e746d5fddf moved generalized lemmas diff -r 9c22ff18125b -r 003475955593 src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Mon Jan 07 18:42:49 2019 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Mon Jan 07 18:50:41 2019 +0100 @@ -3556,4 +3556,166 @@ lemma continuous_closed_vimage: "closed S \ (\x. continuous (at x) f) \ closed (f -` S)" by (simp add: closed_vimage continuous_on_eq_continuous_within) +lemma Times_in_interior_subtopology: + assumes "(x, y) \ U" "openin (subtopology euclidean (S \ T)) U" + obtains V W where "openin (subtopology euclidean S) V" "x \ V" + "openin (subtopology euclidean T) W" "y \ W" "(V \ W) \ U" +proof - + from assms obtain E where "open E" "U = S \ T \ E" "(x, y) \ E" "x \ S" "y \ T" + by (auto simp: openin_open) + from open_prod_elim[OF \open E\ \(x, y) \ E\] + obtain E1 E2 where "open E1" "open E2" "(x, y) \ E1 \ E2" "E1 \ E2 \ E" + by blast + show ?thesis + proof + show "openin (subtopology euclidean S) (E1 \ S)" + "openin (subtopology euclidean T) (E2 \ T)" + using \open E1\ \open E2\ + by (auto simp: openin_open) + show "x \ E1 \ S" "y \ E2 \ T" + using \(x, y) \ E1 \ E2\ \x \ S\ \y \ T\ by auto + show "(E1 \ S) \ (E2 \ T) \ U" + using \E1 \ E2 \ E\ \U = _\ + by (auto simp: ) + qed +qed + +lemma closedin_Times: + "closedin (subtopology euclidean S) S' \ closedin (subtopology euclidean T) T' \ + closedin (subtopology euclidean (S \ T)) (S' \ T')" + unfolding closedin_closed using closed_Times by blast + +lemma openin_Times: + "openin (subtopology euclidean S) S' \ openin (subtopology euclidean T) T' \ + openin (subtopology euclidean (S \ T)) (S' \ T')" + unfolding openin_open using open_Times by blast + +lemma openin_Times_eq: + fixes S :: "'a::topological_space set" and T :: "'b::topological_space set" + shows + "openin (subtopology euclidean (S \ T)) (S' \ T') \ + S' = {} \ T' = {} \ openin (subtopology euclidean S) S' \ openin (subtopology euclidean T) T'" + (is "?lhs = ?rhs") +proof (cases "S' = {} \ T' = {}") + case True + then show ?thesis by auto +next + case False + then obtain x y where "x \ S'" "y \ T'" + by blast + show ?thesis + proof + assume ?lhs + have "openin (subtopology euclidean S) S'" + apply (subst openin_subopen, clarify) + apply (rule Times_in_interior_subtopology [OF _ \?lhs\]) + using \y \ T'\ + apply auto + done + moreover have "openin (subtopology euclidean T) T'" + apply (subst openin_subopen, clarify) + apply (rule Times_in_interior_subtopology [OF _ \?lhs\]) + using \x \ S'\ + apply auto + done + ultimately show ?rhs + by simp + next + assume ?rhs + with False show ?lhs + by (simp add: openin_Times) + qed +qed + +lemma Lim_transform_within_openin: + assumes f: "(f \ l) (at a within T)" + and "openin (subtopology euclidean T) S" "a \ S" + and eq: "\x. \x \ S; x \ a\ \ f x = g x" + shows "(g \ l) (at a within T)" +proof - + have "\\<^sub>F x in at a within T. x \ T \ x \ a" + by (simp add: eventually_at_filter) + moreover + from \openin _ _\ obtain U where "open U" "S = T \ U" + by (auto simp: openin_open) + then have "a \ U" using \a \ S\ by auto + from topological_tendstoD[OF tendsto_ident_at \open U\ \a \ U\] + have "\\<^sub>F x in at a within T. x \ U" by auto + ultimately + have "\\<^sub>F x in at a within T. f x = g x" + by eventually_elim (auto simp: \S = _\ eq) + then show ?thesis using f + by (rule Lim_transform_eventually) +qed + +lemma continuous_on_open_gen: + assumes "f ` S \ T" + shows "continuous_on S f \ + (\U. openin (subtopology euclidean T) U + \ openin (subtopology euclidean S) (S \ f -` U))" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + by (clarsimp simp add: continuous_openin_preimage_eq openin_open) + (metis Int_assoc assms image_subset_iff_subset_vimage inf.absorb_iff1) +next + assume R [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp add: continuous_openin_preimage_eq) + fix U::"'a set" + assume "open U" + then have "openin (subtopology euclidean S) (S \ f -` (U \ T))" + by (metis R inf_commute openin_open) + then show "openin (subtopology euclidean S) (S \ f -` U)" + by (metis Int_assoc Int_commute assms image_subset_iff_subset_vimage inf.absorb_iff2 vimage_Int) + qed +qed + +lemma continuous_openin_preimage: + "\continuous_on S f; f ` S \ T; openin (subtopology euclidean T) U\ + \ openin (subtopology euclidean S) (S \ f -` U)" + by (simp add: continuous_on_open_gen) + +lemma continuous_on_closed_gen: + assumes "f ` S \ T" + shows "continuous_on S f \ + (\U. closedin (subtopology euclidean T) U + \ closedin (subtopology euclidean S) (S \ f -` U))" + (is "?lhs = ?rhs") +proof - + have *: "U \ T \ S \ f -` (T - U) = S - (S \ f -` U)" for U + using assms by blast + show ?thesis + proof + assume L: ?lhs + show ?rhs + proof clarify + fix U + assume "closedin (subtopology euclidean T) U" + then show "closedin (subtopology euclidean S) (S \ f -` U)" + using L unfolding continuous_on_open_gen [OF assms] + by (metis * closedin_def inf_le1 topspace_euclidean_subtopology) + qed + next + assume R [rule_format]: ?rhs + show ?lhs + unfolding continuous_on_open_gen [OF assms] + by (metis * R inf_le1 openin_closedin_eq topspace_euclidean_subtopology) + qed +qed + +lemma continuous_closedin_preimage_gen: + assumes "continuous_on S f" "f ` S \ T" "closedin (subtopology euclidean T) U" + shows "closedin (subtopology euclidean S) (S \ f -` U)" +using assms continuous_on_closed_gen by blast + +lemma continuous_transform_within_openin: + assumes "continuous (at a within T) f" + and "openin (subtopology euclidean T) S" "a \ S" + and eq: "\x. x \ S \ f x = g x" + shows "continuous (at a within T) g" + using assms by (simp add: Lim_transform_within_openin continuous_within) + + end diff -r 9c22ff18125b -r 003475955593 src/HOL/Analysis/Abstract_Topology_2.thy --- a/src/HOL/Analysis/Abstract_Topology_2.thy Mon Jan 07 18:42:49 2019 +0100 +++ b/src/HOL/Analysis/Abstract_Topology_2.thy Mon Jan 07 18:50:41 2019 +0100 @@ -132,11 +132,6 @@ openin (subtopology euclidean T) S" by (auto simp: openin_open) -lemma openin_Times: - "openin (subtopology euclidean S) S' \ openin (subtopology euclidean T) T' \ - openin (subtopology euclidean (S \ T)) (S' \ T')" - unfolding openin_open using open_Times by blast - lemma closedin_compact: "\compact S; closedin (subtopology euclidean S) T\ \ compact T" by (metis closedin_closed compact_Int_closed) @@ -179,6 +174,22 @@ shows "\openin (subtopology euclidean U) S; x \ S; x islimpt U\ \ infinite S" by (clarsimp simp add: openin_open islimpt_eq_acc_point inf_commute) +lemma closure_Int_ballI: + assumes "\U. \openin (subtopology euclidean S) U; U \ {}\ \ T \ U \ {}" + shows "S \ closure T" +proof (clarsimp simp: closure_iff_nhds_not_empty) + fix x and A and V + assume "x \ S" "V \ A" "open V" "x \ V" "T \ A = {}" + then have "openin (subtopology euclidean S) (A \ V \ S)" + by (auto simp: openin_open intro!: exI[where x="V"]) + moreover have "A \ V \ S \ {}" using \x \ V\ \V \ A\ \x \ S\ + by auto + ultimately have "T \ (A \ V \ S) \ {}" + by (rule assms) + with \T \ A = {}\ show False by auto +qed + + subsection \Frontier\ lemma connected_Int_frontier: diff -r 9c22ff18125b -r 003475955593 src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Mon Jan 07 18:42:49 2019 +0100 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Mon Jan 07 18:50:41 2019 +0100 @@ -2736,183 +2736,12 @@ "openin (subtopology euclidean t) s \ s \ t \ (\x \ s. \e. 0 < e \ cball x e \ t \ s)" -apply (simp add: openin_contains_ball) -apply (rule iffI) -apply (auto dest!: bspec) -apply (rule_tac x="e/2" in exI, force+) + apply (simp add: openin_contains_ball) + apply (rule iffI) + apply (auto dest!: bspec) + apply (rule_tac x="e/2" in exI, force+) done -lemma Times_in_interior_subtopology: - assumes "(x, y) \ U" "openin (subtopology euclidean (S \ T)) U" - obtains V W where "openin (subtopology euclidean S) V" "x \ V" - "openin (subtopology euclidean T) W" "y \ W" "(V \ W) \ U" -proof - - from assms obtain E where "open E" "U = S \ T \ E" "(x, y) \ E" "x \ S" "y \ T" - by (auto simp: openin_open) - from open_prod_elim[OF \open E\ \(x, y) \ E\] - obtain E1 E2 where "open E1" "open E2" "(x, y) \ E1 \ E2" "E1 \ E2 \ E" - by blast - show ?thesis - proof - show "openin (subtopology euclidean S) (E1 \ S)" - "openin (subtopology euclidean T) (E2 \ T)" - using \open E1\ \open E2\ - by (auto simp: openin_open) - show "x \ E1 \ S" "y \ E2 \ T" - using \(x, y) \ E1 \ E2\ \x \ S\ \y \ T\ by auto - show "(E1 \ S) \ (E2 \ T) \ U" - using \E1 \ E2 \ E\ \U = _\ - by (auto simp: ) - qed -qed - -lemma openin_Times_eq: - fixes S :: "'a::topological_space set" and T :: "'b::topological_space set" - shows - "openin (subtopology euclidean (S \ T)) (S' \ T') \ - S' = {} \ T' = {} \ openin (subtopology euclidean S) S' \ openin (subtopology euclidean T) T'" - (is "?lhs = ?rhs") -proof (cases "S' = {} \ T' = {}") - case True - then show ?thesis by auto -next - case False - then obtain x y where "x \ S'" "y \ T'" - by blast - show ?thesis - proof - assume ?lhs - have "openin (subtopology euclidean S) S'" - apply (subst openin_subopen, clarify) - apply (rule Times_in_interior_subtopology [OF _ \?lhs\]) - using \y \ T'\ - apply auto - done - moreover have "openin (subtopology euclidean T) T'" - apply (subst openin_subopen, clarify) - apply (rule Times_in_interior_subtopology [OF _ \?lhs\]) - using \x \ S'\ - apply auto - done - ultimately show ?rhs - by simp - next - assume ?rhs - with False show ?lhs - by (simp add: openin_Times) - qed -qed - -lemma closedin_Times: - "closedin (subtopology euclidean S) S' \ closedin (subtopology euclidean T) T' \ - closedin (subtopology euclidean (S \ T)) (S' \ T')" - unfolding closedin_closed using closed_Times by blast - -lemma Lim_transform_within_openin: - assumes f: "(f \ l) (at a within T)" - and "openin (subtopology euclidean T) S" "a \ S" - and eq: "\x. \x \ S; x \ a\ \ f x = g x" - shows "(g \ l) (at a within T)" -proof - - have "\\<^sub>F x in at a within T. x \ T \ x \ a" - by (simp add: eventually_at_filter) - moreover - from \openin _ _\ obtain U where "open U" "S = T \ U" - by (auto simp: openin_open) - then have "a \ U" using \a \ S\ by auto - from topological_tendstoD[OF tendsto_ident_at \open U\ \a \ U\] - have "\\<^sub>F x in at a within T. x \ U" by auto - ultimately - have "\\<^sub>F x in at a within T. f x = g x" - by eventually_elim (auto simp: \S = _\ eq) - then show ?thesis using f - by (rule Lim_transform_eventually) -qed - -lemma closure_Int_ballI: - assumes "\U. \openin (subtopology euclidean S) U; U \ {}\ \ T \ U \ {}" - shows "S \ closure T" -proof (clarsimp simp: closure_iff_nhds_not_empty) - fix x and A and V - assume "x \ S" "V \ A" "open V" "x \ V" "T \ A = {}" - then have "openin (subtopology euclidean S) (A \ V \ S)" - by (auto simp: openin_open intro!: exI[where x="V"]) - moreover have "A \ V \ S \ {}" using \x \ V\ \V \ A\ \x \ S\ - by auto - ultimately have "T \ (A \ V \ S) \ {}" - by (rule assms) - with \T \ A = {}\ show False by auto -qed - -lemma continuous_on_open_gen: - assumes "f ` S \ T" - shows "continuous_on S f \ - (\U. openin (subtopology euclidean T) U - \ openin (subtopology euclidean S) (S \ f -` U))" - (is "?lhs = ?rhs") -proof - assume ?lhs - then show ?rhs - by (clarsimp simp add: continuous_openin_preimage_eq openin_open) - (metis Int_assoc assms image_subset_iff_subset_vimage inf.absorb_iff1) -next - assume R [rule_format]: ?rhs - show ?lhs - proof (clarsimp simp add: continuous_openin_preimage_eq) - fix U::"'a set" - assume "open U" - then have "openin (subtopology euclidean S) (S \ f -` (U \ T))" - by (metis R inf_commute openin_open) - then show "openin (subtopology euclidean S) (S \ f -` U)" - by (metis Int_assoc Int_commute assms image_subset_iff_subset_vimage inf.absorb_iff2 vimage_Int) - qed -qed - -lemma continuous_openin_preimage: - "\continuous_on S f; f ` S \ T; openin (subtopology euclidean T) U\ - \ openin (subtopology euclidean S) (S \ f -` U)" - by (simp add: continuous_on_open_gen) - -lemma continuous_on_closed_gen: - assumes "f ` S \ T" - shows "continuous_on S f \ - (\U. closedin (subtopology euclidean T) U - \ closedin (subtopology euclidean S) (S \ f -` U))" - (is "?lhs = ?rhs") -proof - - have *: "U \ T \ S \ f -` (T - U) = S - (S \ f -` U)" for U - using assms by blast - show ?thesis - proof - assume L: ?lhs - show ?rhs - proof clarify - fix U - assume "closedin (subtopology euclidean T) U" - then show "closedin (subtopology euclidean S) (S \ f -` U)" - using L unfolding continuous_on_open_gen [OF assms] - by (metis * closedin_def inf_le1 topspace_euclidean_subtopology) - qed - next - assume R [rule_format]: ?rhs - show ?lhs - unfolding continuous_on_open_gen [OF assms] - by (metis * R inf_le1 openin_closedin_eq topspace_euclidean_subtopology) - qed -qed - -lemma continuous_closedin_preimage_gen: - assumes "continuous_on S f" "f ` S \ T" "closedin (subtopology euclidean T) U" - shows "closedin (subtopology euclidean S) (S \ f -` U)" -using assms continuous_on_closed_gen by blast - -lemma continuous_transform_within_openin: - assumes "continuous (at a within T) f" - and "openin (subtopology euclidean T) S" "a \ S" - and eq: "\x. x \ S \ f x = g x" - shows "continuous (at a within T) g" - using assms by (simp add: Lim_transform_within_openin continuous_within) - subsection \Closed Nest\