# HG changeset patch # User paulson # Date 1551967685 0 # Node ID 11065b70407da6cd54eb9c0fa029acf9bddc7339 # Parent 6ebe97815275995cfdd487c69e8e8a62bcff4fe4 new material for Analysis diff -r 6ebe97815275 -r 11065b70407d src/HOL/Analysis/Abstract_Limits.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Analysis/Abstract_Limits.thy Thu Mar 07 14:08:05 2019 +0000 @@ -0,0 +1,296 @@ +theory Abstract_Limits + imports + Abstract_Topology +begin + +subsection\nhdsin and atin\ + +definition nhdsin :: "'a topology \ 'a \ 'a filter" + where "nhdsin X a = + (if a \ topspace X then (INF S:{S. openin X S \ a \ S}. principal S) else bot)" + +definition atin :: "'a topology \ 'a \ 'a filter" + where "atin X a \ inf (nhdsin X a) (principal (topspace X - {a}))" + + +lemma nhdsin_degenerate [simp]: "a \ topspace X \ nhdsin X a = bot" + and atin_degenerate [simp]: "a \ topspace X \ atin X a = bot" + by (simp_all add: nhdsin_def atin_def) + +lemma eventually_nhdsin: + "eventually P (nhdsin X a) \ a \ topspace X \ (\S. openin X S \ a \ S \ (\x\S. P x))" +proof (cases "a \ topspace X") + case True + hence "nhdsin X a = (INF S:{S. openin X S \ a \ S}. principal S)" + by (simp add: nhdsin_def) + also have "eventually P \ \ (\S. openin X S \ a \ S \ (\x\S. P x))" + using True by (subst eventually_INF_base) (auto simp: eventually_principal) + finally show ?thesis using True by simp +qed auto + +lemma eventually_atin: + "eventually P (atin X a) \ a \ topspace X \ + (\U. openin X U \ a \ U \ (\x \ U - {a}. P x))" +proof (cases "a \ topspace X") + case True + hence "eventually P (atin X a) \ (\S. openin X S \ + a \ S \ (\x\S. x \ topspace X \ x \ a \ P x))" + by (simp add: atin_def eventually_inf_principal eventually_nhdsin) + also have "\ \ (\U. openin X U \ a \ U \ (\x \ U - {a}. P x))" + using openin_subset by (intro ex_cong) auto + finally show ?thesis by (simp add: True) +qed auto + + +subsection\Limits in a topological space\ + +definition limit :: "'a topology \ ('b \ 'a) \ 'a \ 'b filter \ bool" where + "limit X f l F \ l \ topspace X \ (\U. openin X U \ l \ U \ eventually (\x. f x \ U) F)" + +lemma limit_euclideanreal_iff [simp]: "limit euclideanreal f l F \ (f \ l) F" + by (auto simp: limit_def tendsto_def) + +lemma limit_in_topspace: "limit X f l F \ l \ topspace X" + by (simp add: limit_def) + +lemma limit_const: "limit X (\a. l) l F \ l \ topspace X" + by (simp add: limit_def) + +lemma limit_real_const: "limit euclideanreal (\a. l) l F" + by (simp add: limit_def) + +lemma limit_eventually: + "\l \ topspace X; eventually (\x. f x = l) F\ \ limit X f l F" + by (auto simp: limit_def eventually_mono) + +lemma limit_subsequence: + "\strict_mono r; limit X f l sequentially\ \ limit X (f \ r) l sequentially" + unfolding limit_def using eventually_subseq by fastforce + +lemma limit_subtopology: + "limit (subtopology X S) f l F + \ l \ S \ eventually (\a. f a \ S) F \ limit X f l F" (is "?lhs = ?rhs") +proof (cases "l \ S \ topspace X") + case True + show ?thesis + proof + assume L: ?lhs + with True + have "\\<^sub>F b in F. f b \ topspace X \ S" + by (metis (no_types) limit_def openin_topspace topspace_subtopology) + with L show ?rhs + apply (clarsimp simp add: limit_def eventually_mono topspace_subtopology openin_subtopology_alt) + apply (drule_tac x="S \ U" in spec, force simp: elim: eventually_mono) + done + next + assume ?rhs + then show ?lhs + using eventually_elim2 + by (fastforce simp add: limit_def topspace_subtopology openin_subtopology_alt) + qed +qed (auto simp: limit_def topspace_subtopology) + + +lemma limit_sequentially: + "limit X S l sequentially \ + l \ topspace X \ (\U. openin X U \ l \ U \ (\N. \n. N \ n \ S n \ U))" + by (simp add: limit_def eventually_sequentially) + +lemma limit_sequentially_offset: + "limit X f l sequentially \ limit X (\i. f (i + k)) l sequentially" + unfolding limit_sequentially + by (metis add.commute le_add2 order_trans) + +lemma limit_sequentially_offset_rev: + assumes "limit X (\i. f (i + k)) l sequentially" + shows "limit X f l sequentially" +proof - + have "\N. \n\N. f n \ U" if U: "openin X U" "l \ U" for U + proof - + obtain N where "\n. n\N \ f (n + k) \ U" + using assms U unfolding limit_sequentially by blast + then have "\n\N+k. f n \ U" + by (metis add_leD2 le_add_diff_inverse ordered_cancel_comm_monoid_diff_class.le_diff_conv2 add.commute) + then show ?thesis .. + qed + with assms show ?thesis + unfolding limit_sequentially + by simp +qed + +lemma limit_atin: + "limit Y f y (atin X x) \ + y \ topspace Y \ + (x \ topspace X + \ (\V. openin Y V \ y \ V + \ (\U. openin X U \ x \ U \ f ` (U - {x}) \ V)))" + by (auto simp: limit_def eventually_atin image_subset_iff) + +lemma limit_atin_self: + "limit Y f (f a) (atin X a) \ + f a \ topspace Y \ + (a \ topspace X + \ (\V. openin Y V \ f a \ V + \ (\U. openin X U \ a \ U \ f ` U \ V)))" + unfolding limit_atin by fastforce + +lemma limit_trivial: + "\trivial_limit F; y \ topspace X\ \ limit X f y F" + by (simp add: limit_def) + +lemma limit_transform_eventually: + "\eventually (\x. f x = g x) F; limit X f l F\ \ limit X g l F" + unfolding limit_def using eventually_elim2 by fastforce + +lemma continuous_map_limit: + assumes "continuous_map X Y g" and f: "limit X f l F" + shows "limit Y (g \ f) (g l) F" +proof - + have "g l \ topspace Y" + by (meson assms continuous_map_def limit_in_topspace) + moreover + have "\U. \\V. openin X V \ l \ V \ (\\<^sub>F x in F. f x \ V); openin Y U; g l \ U\ + \ \\<^sub>F x in F. g (f x) \ U" + using assms eventually_mono + by (fastforce simp: limit_def dest!: openin_continuous_map_preimage) + ultimately show ?thesis + using f by (fastforce simp add: limit_def) +qed + + +subsection\Pointwise continuity in topological spaces\ + +definition topcontinuous_at where + "topcontinuous_at X Y f x \ + x \ topspace X \ + (\x \ topspace X. f x \ topspace Y) \ + (\V. openin Y V \ f x \ V + \ (\U. openin X U \ x \ U \ (\y \ U. f y \ V)))" + +lemma topcontinuous_at_atin: + "topcontinuous_at X Y f x \ + x \ topspace X \ + (\x \ topspace X. f x \ topspace Y) \ + limit Y f (f x) (atin X x)" + unfolding topcontinuous_at_def + by (fastforce simp add: limit_atin)+ + +lemma continuous_map_eq_topcontinuous_at: + "continuous_map X Y f \ (\x \ topspace X. topcontinuous_at X Y f x)" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + by (auto simp: continuous_map_def topcontinuous_at_def) +next + assume R: ?rhs + then show ?lhs + apply (auto simp: continuous_map_def topcontinuous_at_def) + apply (subst openin_subopen, safe) + apply (drule bspec, assumption) + using openin_subset[of X] apply (auto simp: subset_iff dest!: spec) + done +qed + +lemma continuous_map_atin: + "continuous_map X Y f \ (\x \ topspace X. limit Y f (f x) (atin X x))" + by (auto simp: limit_def topcontinuous_at_atin continuous_map_eq_topcontinuous_at) + +lemma limit_continuous_map: + "\continuous_map X Y f; a \ topspace X; f a = b\ \ limit Y f b (atin X a)" + by (auto simp: continuous_map_atin) + + +subsection\Combining theorems for continuous functions into the reals\ + +lemma continuous_map_real_const [simp,continuous_intros]: + "continuous_map X euclideanreal (\x. c)" + by simp + +lemma continuous_map_real_mult [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g\ + \ continuous_map X euclideanreal (\x. f x * g x)" + by (simp add: continuous_map_atin tendsto_mult) + +lemma continuous_map_real_pow [continuous_intros]: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. f x ^ n)" + by (induction n) (auto simp: continuous_map_real_mult) + +lemma continuous_map_real_mult_left: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. c * f x)" + by (simp add: continuous_map_atin tendsto_mult) + +lemma continuous_map_real_mult_left_eq: + "continuous_map X euclideanreal (\x. c * f x) \ c = 0 \ continuous_map X euclideanreal f" +proof (cases "c = 0") + case False + have "continuous_map X euclideanreal (\x. c * f x) \ continuous_map X euclideanreal f" + apply (frule continuous_map_real_mult_left [where c="inverse c"]) + apply (simp add: field_simps False) + done + with False show ?thesis + using continuous_map_real_mult_left by blast +qed simp + +lemma continuous_map_real_mult_right: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. f x * c)" + by (simp add: continuous_map_atin tendsto_mult) + +lemma continuous_map_real_mult_right_eq: + "continuous_map X euclideanreal (\x. f x * c) \ c = 0 \ continuous_map X euclideanreal f" + by (simp add: mult.commute flip: continuous_map_real_mult_left_eq) + +lemma continuous_map_real_minus [continuous_intros]: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. - f x)" + by (simp add: continuous_map_atin tendsto_minus) + +lemma continuous_map_real_minus_eq: + "continuous_map X euclideanreal (\x. - f x) \ continuous_map X euclideanreal f" + using continuous_map_real_mult_left_eq [where c = "-1"] by auto + +lemma continuous_map_real_add [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g\ + \ continuous_map X euclideanreal (\x. f x + g x)" + by (simp add: continuous_map_atin tendsto_add) + +lemma continuous_map_real_diff [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g\ + \ continuous_map X euclideanreal (\x. f x - g x)" + by (simp add: continuous_map_atin tendsto_diff) + +lemma continuous_map_real_abs [continuous_intros]: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. abs(f x))" + by (simp add: continuous_map_atin tendsto_rabs) + +lemma continuous_map_real_max [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g\ + \ continuous_map X euclideanreal (\x. max (f x) (g x))" + by (simp add: continuous_map_atin tendsto_max) + +lemma continuous_map_real_min [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g\ + \ continuous_map X euclideanreal (\x. min (f x) (g x))" + by (simp add: continuous_map_atin tendsto_min) + +lemma continuous_map_sum [continuous_intros]: + "\finite I; \i. i \ I \ continuous_map X euclideanreal (\x. f x i)\ + \ continuous_map X euclideanreal (\x. sum (f x) I)" + by (simp add: continuous_map_atin tendsto_sum) + +lemma continuous_map_prod [continuous_intros]: + "\finite I; + \i. i \ I \ continuous_map X euclideanreal (\x. f x i)\ + \ continuous_map X euclideanreal (\x. prod (f x) I)" + by (simp add: continuous_map_atin tendsto_prod) + +lemma continuous_map_real_inverse [continuous_intros]: + "\continuous_map X euclideanreal f; \x. x \ topspace X \ f x \ 0\ + \ continuous_map X euclideanreal (\x. inverse(f x))" + by (simp add: continuous_map_atin tendsto_inverse) + +lemma continuous_map_real_divide [continuous_intros]: + "\continuous_map X euclideanreal f; continuous_map X euclideanreal g; \x. x \ topspace X \ g x \ 0\ + \ continuous_map X euclideanreal (\x. f x / g x)" + by (simp add: continuous_map_atin tendsto_divide) + +end diff -r 6ebe97815275 -r 11065b70407d src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Wed Mar 06 21:44:30 2019 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Thu Mar 07 14:08:05 2019 +0000 @@ -290,7 +290,7 @@ lemma openin_relative_to: "(openin X relative_to S) = openin (subtopology X S)" by (force simp: relative_to_def openin_subtopology) -lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \ V" +lemma topspace_subtopology [simp]: "topspace (subtopology U V) = topspace U \ V" by (auto simp: topspace_def openin_subtopology) lemma topspace_subtopology_subset: @@ -597,7 +597,7 @@ {x \ topspace X. (\T. x \ T \ openin X T \ (\y\x. y \ S \ y \ T))}" -lemma derived_set_of_restrict: +lemma derived_set_of_restrict [simp]: "X derived_set_of (topspace X \ S) = X derived_set_of S" by (simp add: derived_set_of_def) (metis openin_subset subset_iff) @@ -624,7 +624,7 @@ "S \ T \ X derived_set_of S \ X derived_set_of T" unfolding derived_set_of_def by blast -lemma derived_set_of_union: +lemma derived_set_of_Un: "X derived_set_of (S \ T) = X derived_set_of S \ X derived_set_of T" (is "?lhs = ?rhs") proof show "?lhs \ ?rhs" @@ -634,12 +634,12 @@ by (simp add: derived_set_of_mono) qed -lemma derived_set_of_unions: +lemma derived_set_of_Union: "finite \ \ X derived_set_of (\\) = (\S \ \. X derived_set_of S)" proof (induction \ rule: finite_induct) case (insert S \) then show ?case - by (simp add: derived_set_of_union) + by (simp add: derived_set_of_Un) qed auto lemma derived_set_of_topspace: @@ -745,7 +745,7 @@ by auto (meson closure_of_mono inf_mono subset_iff) lemma closure_of_Un [simp]: "X closure_of (S \ T) = X closure_of S \ X closure_of T" - by (simp add: Un_assoc Un_left_commute closure_of_alt derived_set_of_union inf_sup_distrib1) + by (simp add: Un_assoc Un_left_commute closure_of_alt derived_set_of_Un inf_sup_distrib1) lemma closure_of_Union: "finite \ \ X closure_of (\\) = (\S \ \. X closure_of S)" @@ -1545,6 +1545,26 @@ lemma continuous_map_iff_continuous_real [simp]: "continuous_map (subtopology euclideanreal S) euclideanreal g = continuous_on S g" by (force simp: continuous_map openin_subtopology continuous_on_open_invariant) +lemma continuous_map_iff_continuous_real2 [simp]: "continuous_map euclideanreal euclideanreal g = continuous_on UNIV g" + by (metis continuous_map_iff_continuous_real subtopology_UNIV) + +lemma continuous_map_openin_preimage_eq: + "continuous_map X Y f \ + f ` (topspace X) \ topspace Y \ (\U. openin Y U \ openin X (topspace X \ f -` U))" + by (auto simp: continuous_map_def vimage_def Int_def) + +lemma continuous_map_closedin_preimage_eq: + "continuous_map X Y f \ + f ` (topspace X) \ topspace Y \ (\U. closedin Y U \ closedin X (topspace X \ f -` U))" + by (auto simp: continuous_map_closedin vimage_def Int_def) + +lemma continuous_map_square_root: "continuous_map euclideanreal euclideanreal sqrt" + by (simp add: continuous_at_imp_continuous_on isCont_real_sqrt) + +lemma continuous_map_sqrt [continuous_intros]: + "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. sqrt(f x))" + by (meson continuous_map_compose continuous_map_eq continuous_map_square_root o_apply) + lemma continuous_map_id [simp]: "continuous_map X X id" unfolding continuous_map_def using openin_subopen topspace_def by fastforce diff -r 6ebe97815275 -r 11065b70407d src/HOL/Analysis/Analysis.thy --- a/src/HOL/Analysis/Analysis.thy Wed Mar 06 21:44:30 2019 +0100 +++ b/src/HOL/Analysis/Analysis.thy Thu Mar 07 14:08:05 2019 +0000 @@ -5,6 +5,7 @@ Determinants (* Topology *) Connected + Abstract_Limits (* Functional Analysis *) Elementary_Normed_Spaces Norm_Arith @@ -27,6 +28,7 @@ Bounded_Continuous_Function Abstract_Topology Function_Topology + T1_Spaces Infinite_Products Infinite_Set_Sum Weierstrass_Theorems diff -r 6ebe97815275 -r 11065b70407d src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Wed Mar 06 21:44:30 2019 +0100 +++ b/src/HOL/Analysis/Function_Topology.thy Thu Mar 07 14:08:05 2019 +0000 @@ -546,7 +546,7 @@ done qed -lemma topspace_product_topology: +lemma topspace_product_topology [simp]: "topspace (product_topology T I) = (\\<^sub>E i\I. topspace(T i))" proof show "topspace (product_topology T I) \ (\\<^sub>E i\I. topspace (T i))" @@ -700,21 +700,101 @@ by meson qed - -lemma topspace_product_topology_alt: - "topspace (product_topology Y I) = {f \ extensional I. \k \ I. f k \ topspace(Y k)}" - by (force simp: product_topology PiE_def) +lemma closure_of_product_topology: + "(product_topology X I) closure_of (PiE I S) = PiE I (\i. (X i) closure_of (S i))" +proof - + have *: "(\T. f \ T \ openin (product_topology X I) T \ (\y\Pi\<^sub>E I S. y \ T)) + \ (\i \ I. \T. f i \ T \ openin (X i) T \ S i \ T \ {})" + (is "?lhs = ?rhs") + if top: "\i. i \ I \ f i \ topspace (X i)" and ext: "f \ extensional I" for f + proof + assume L[rule_format]: ?lhs + show ?rhs + proof clarify + fix i T + assume "i \ I" "f i \ T" "openin (X i) T" "S i \ T = {}" + then have "openin (product_topology X I) ((\\<^sub>E i\I. topspace (X i)) \ {x. x i \ T})" + by (force simp: openin_product_topology intro: arbitrary_union_of_inc relative_to_inc finite_intersection_of_inc) + then show "False" + using L [of "topspace (product_topology X I) \ {f. f i \ T}"] \S i \ T = {}\ \f i \ T\ \i \ I\ + by (auto simp: top ext PiE_iff) + qed + next + assume R [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp: openin_product_topology union_of_def arbitrary_def) + fix \ U + assume + \: "\ \ Collect + (finite intersection_of (\F. \i U. F = {x. x i \ U} \ i \ I \ openin (X i) U) relative_to + (\\<^sub>E i\I. topspace (X i)))" and + "f \ U" "U \ \" + then have "(finite intersection_of (\F. \i U. F = {x. x i \ U} \ i \ I \ openin (X i) U) + relative_to (\\<^sub>E i\I. topspace (X i))) U" + by blast + with \f \ U\ \U \ \\ + obtain \ where "finite \" + and \: "\C. C \ \ \ \i \ I. \V. openin (X i) V \ C = {x. x i \ V}" + and "topspace (product_topology X I) \ \ \ \ U" "f \ topspace (product_topology X I) \ \ \" + apply (clarsimp simp add: relative_to_def intersection_of_def) + apply (rule that, auto dest!: subsetD) + done + then have "f \ PiE I (topspace \ X)" "f \ \\" and subU: "PiE I (topspace \ X) \ \\ \ U" + by (auto simp: PiE_iff) + have *: "f i \ topspace (X i) \ \{U. openin (X i) U \ {x. x i \ U} \ \} + \ openin (X i) (topspace (X i) \ \{U. openin (X i) U \ {x. x i \ U} \ \})" + if "i \ I" for i + proof - + have "finite ((\U. {x. x i \ U}) -` \)" + proof (rule finite_vimageI [OF \finite \\]) + show "inj (\U. {x. x i \ U})" + by (auto simp: inj_on_def) + qed + then have fin: "finite {U. openin (X i) U \ {x. x i \ U} \ \}" + by (rule rev_finite_subset) auto + have "openin (X i) (\ (insert (topspace (X i)) {U. openin (X i) U \ {x. x i \ U} \ \}))" + by (rule openin_Inter) (auto simp: fin) + then show ?thesis + using \f \ \ \\ by (fastforce simp: that top) + qed + define \ where "\ \ \i. topspace (X i) \ \{U. openin (X i) U \ {f. f i \ U} \ \}" + have "\i \ I. \x. x \ S i \ \ i" + using R [OF _ *] unfolding \_def by blast + then obtain \ where \ [rule_format]: "\i \ I. \ i \ S i \ \ i" + by metis + show "\y\Pi\<^sub>E I S. \x\\. y \ x" + proof + show "\U \ \. (\i \ I. \ i) \ U" + proof + have "restrict \ I \ PiE I (topspace \ X) \ \\" + using \ by (fastforce simp: \_def PiE_def dest: \) + then show "restrict \ I \ U" + using subU by blast + qed (rule \U \ \\) + next + show "(\i \ I. \ i) \ Pi\<^sub>E I S" + using \ by simp + qed + qed + qed + show ?thesis + apply (simp add: * closure_of_def PiE_iff set_eq_iff cong: conj_cong) + by metis +qed -lemma openin_product_topology_alt: - "openin (product_topology X I) S \ - (\x \ S. \U. finite {i \ I. U i \ topspace(X i)} \ - (\i \ I. openin (X i) (U i)) \ x \ Pi\<^sub>E I U \ Pi\<^sub>E I U \ S)" - apply (simp add: openin_product_topology arbitrary_union_of_alt product_topology_base_alt, auto) - apply (drule bspec; blast) +corollary closedin_product_topology: + "closedin (product_topology X I) (PiE I S) \ PiE I S = {} \ (\i \ I. closedin (X i) (S i))" + apply (simp add: PiE_eq PiE_eq_empty_iff closure_of_product_topology flip: closure_of_eq) + apply (metis closure_of_empty) done +corollary closedin_product_topology_singleton: + "f \ extensional I \ closedin (product_topology X I) {f} \ (\i \ I. closedin (X i) {f i})" + using PiE_singleton closedin_product_topology [of X I] + by (metis (no_types, lifting) all_not_in_conv insertI1) -text \The basic property of the product topology is the continuity of projections:\ + +subsubsection \The basic property of the product topology is the continuity of projections:\ lemma continuous_on_topo_product_coordinates [simp]: assumes "i \ I" diff -r 6ebe97815275 -r 11065b70407d src/HOL/Analysis/Ordered_Euclidean_Space.thy --- a/src/HOL/Analysis/Ordered_Euclidean_Space.thy Wed Mar 06 21:44:30 2019 +0100 +++ b/src/HOL/Analysis/Ordered_Euclidean_Space.thy Thu Mar 07 14:08:05 2019 +0000 @@ -242,6 +242,27 @@ shows "path_connected {a..b}" using is_interval_cc is_interval_path_connected by blast +lemma path_connected_Ioi[simp]: "path_connected {a<..}" for a :: real + by (simp add: convex_imp_path_connected) + +lemma path_connected_Ici[simp]: "path_connected {a..}" for a :: real + by (simp add: convex_imp_path_connected) + +lemma path_connected_Iio[simp]: "path_connected {..T1 spaces with equivalences to many naturally "nice" properties. \ + +theory T1_Spaces +imports Function_Topology +begin + +definition t1_space where + "t1_space X \ \x \ topspace X. \y \ topspace X. x\y \ (\U. openin X U \ x \ U \ y \ U)" + +lemma t1_space_expansive: + "\topspace Y = topspace X; \U. openin X U \ openin Y U\ \ t1_space X \ t1_space Y" + by (metis t1_space_def) + +lemma t1_space_alt: + "t1_space X \ (\x \ topspace X. \y \ topspace X. x\y \ (\U. closedin X U \ x \ U \ y \ U))" + by (metis DiffE DiffI closedin_def openin_closedin_eq t1_space_def) + +lemma t1_space_empty: "topspace X = {} \ t1_space X" + by (simp add: t1_space_def) + +lemma t1_space_derived_set_of_singleton: + "t1_space X \ (\x \ topspace X. X derived_set_of {x} = {})" + apply (simp add: t1_space_def derived_set_of_def, safe) + apply (metis openin_topspace) + by force + +lemma t1_space_derived_set_of_finite: + "t1_space X \ (\S. finite S \ X derived_set_of S = {})" +proof (intro iffI allI impI) + fix S :: "'a set" + assume "finite S" + then have fin: "finite ((\x. {x}) ` (topspace X \ S))" + by blast + assume "t1_space X" + then have "X derived_set_of (\x \ topspace X \ S. {x}) = {}" + unfolding derived_set_of_Union [OF fin] + by (auto simp: t1_space_derived_set_of_singleton) + then have "X derived_set_of (topspace X \ S) = {}" + by simp + then show "X derived_set_of S = {}" + by simp +qed (auto simp: t1_space_derived_set_of_singleton) + +lemma t1_space_closedin_singleton: + "t1_space X \ (\x \ topspace X. closedin X {x})" + apply (rule iffI) + apply (simp add: closedin_contains_derived_set t1_space_derived_set_of_singleton) + using t1_space_alt by auto + +lemma closedin_t1_singleton: + "\t1_space X; a \ topspace X\ \ closedin X {a}" + by (simp add: t1_space_closedin_singleton) + +lemma t1_space_closedin_finite: + "t1_space X \ (\S. finite S \ S \ topspace X \ closedin X S)" + apply (rule iffI) + apply (simp add: closedin_contains_derived_set t1_space_derived_set_of_finite) + by (simp add: t1_space_closedin_singleton) + +lemma closure_of_singleton: + "t1_space X \ X closure_of {a} = (if a \ topspace X then {a} else {})" + by (simp add: closure_of_eq t1_space_closedin_singleton closure_of_eq_empty_gen) + +lemma separated_in_singleton: + assumes "t1_space X" + shows "separatedin X {a} S \ a \ topspace X \ S \ topspace X \ (a \ X closure_of S)" + "separatedin X S {a} \ a \ topspace X \ S \ topspace X \ (a \ X closure_of S)" + unfolding separatedin_def + using assms closure_of closure_of_singleton by fastforce+ + +lemma t1_space_openin_delete: + "t1_space X \ (\U x. openin X U \ x \ U \ openin X (U - {x}))" + apply (rule iffI) + apply (meson closedin_t1_singleton in_mono openin_diff openin_subset) + by (simp add: closedin_def t1_space_closedin_singleton) + +lemma t1_space_openin_delete_alt: + "t1_space X \ (\U x. openin X U \ openin X (U - {x}))" + by (metis Diff_empty Diff_insert0 t1_space_openin_delete) + + +lemma t1_space_singleton_Inter_open: + "t1_space X \ (\x \ topspace X. \{U. openin X U \ x \ U} = {x})" (is "?P=?Q") + and t1_space_Inter_open_supersets: + "t1_space X \ (\S. S \ topspace X \ \{U. openin X U \ S \ U} = S)" (is "?P=?R") +proof - + have "?R \ ?Q" + apply clarify + apply (drule_tac x="{x}" in spec, simp) + done + moreover have "?Q \ ?P" + apply (clarsimp simp add: t1_space_def) + apply (drule_tac x=x in bspec) + apply (simp_all add: set_eq_iff) + by (metis (no_types, lifting)) + moreover have "?P \ ?R" + proof (clarsimp simp add: t1_space_closedin_singleton, rule subset_antisym) + fix S + assume S: "\x\topspace X. closedin X {x}" "S \ topspace X" + then show "\ {U. openin X U \ S \ U} \ S" + apply clarsimp + by (metis Diff_insert_absorb Set.set_insert closedin_def openin_topspace subset_insert) + qed force + ultimately show "?P=?Q" "?P=?R" + by auto +qed + +lemma t1_space_derived_set_of_infinite_openin: + "t1_space X \ + (\S. X derived_set_of S = + {x \ topspace X. \U. x \ U \ openin X U \ infinite(S \ U)})" + (is "_ = ?rhs") +proof + assume "t1_space X" + show ?rhs + proof safe + fix S x U + assume "x \ X derived_set_of S" "x \ U" "openin X U" "finite (S \ U)" + with \t1_space X\ show "False" + apply (simp add: t1_space_derived_set_of_finite) + by (metis IntI empty_iff empty_subsetI inf_commute openin_Int_derived_set_of_subset subset_antisym) + next + fix S x + have eq: "(\y. (y \ x) \ y \ S \ y \ T) \ ~((S \ T) \ {x})" for x S T + by blast + assume "x \ topspace X" "\U. x \ U \ openin X U \ infinite (S \ U)" + then show "x \ X derived_set_of S" + apply (clarsimp simp add: derived_set_of_def eq) + by (meson finite.emptyI finite.insertI finite_subset) + qed (auto simp: in_derived_set_of) +qed (auto simp: t1_space_derived_set_of_singleton) + +lemma finite_t1_space_imp_discrete_topology: + "\topspace X = U; finite U; t1_space X\ \ X = discrete_topology U" + by (metis discrete_topology_unique_derived_set t1_space_derived_set_of_finite) + +lemma t1_space_subtopology: "t1_space X \ t1_space(subtopology X U)" + by (simp add: derived_set_of_subtopology t1_space_derived_set_of_finite) + +lemma closedin_derived_set_of_gen: + "t1_space X \ closedin X (X derived_set_of S)" + apply (clarsimp simp add: in_derived_set_of closedin_contains_derived_set derived_set_of_subset_topspace) + by (metis DiffD2 insert_Diff insert_iff t1_space_openin_delete) + +lemma derived_set_of_derived_set_subset_gen: + "t1_space X \ X derived_set_of (X derived_set_of S) \ X derived_set_of S" + by (meson closedin_contains_derived_set closedin_derived_set_of_gen) + +lemma subtopology_eq_discrete_topology_gen_finite: + "\t1_space X; finite S\ \ subtopology X S = discrete_topology(topspace X \ S)" + by (simp add: subtopology_eq_discrete_topology_gen t1_space_derived_set_of_finite) + +lemma subtopology_eq_discrete_topology_finite: + "\t1_space X; S \ topspace X; finite S\ + \ subtopology X S = discrete_topology S" + by (simp add: subtopology_eq_discrete_topology_eq t1_space_derived_set_of_finite) + +lemma t1_space_closed_map_image: + "\closed_map X Y f; f ` (topspace X) = topspace Y; t1_space X\ \ t1_space Y" + by (metis closed_map_def finite_subset_image t1_space_closedin_finite) + +lemma homeomorphic_t1_space: "X homeomorphic_space Y \ (t1_space X \ t1_space Y)" + apply (clarsimp simp add: homeomorphic_space_def) + by (meson homeomorphic_eq_everything_map homeomorphic_maps_map t1_space_closed_map_image) + +proposition t1_space_product_topology: + "t1_space (product_topology X I) +\ topspace(product_topology X I) = {} \ (\i \ I. t1_space (X i))" +proof (cases "topspace(product_topology X I) = {}") + case True + then show ?thesis + using True t1_space_empty by blast +next + case False + then obtain f where f: "f \ (\\<^sub>E i\I. topspace(X i))" + by fastforce + have "t1_space (product_topology X I) \ (\i\I. t1_space (X i))" + proof (intro iffI ballI) + show "t1_space (X i)" if "t1_space (product_topology X I)" and "i \ I" for i + proof - + have clo: "\h. h \ (\\<^sub>E i\I. topspace (X i)) \ closedin (product_topology X I) {h}" + using that by (simp add: t1_space_closedin_singleton) + show ?thesis + unfolding t1_space_closedin_singleton + proof clarify + show "closedin (X i) {xi}" if "xi \ topspace (X i)" for xi + using clo [of "\j \ I. if i=j then xi else f j"] f that \i \ I\ + by (fastforce simp add: closedin_product_topology_singleton) + qed + qed + next + next + show "t1_space (product_topology X I)" if "\i\I. t1_space (X i)" + using that + by (simp add: t1_space_closedin_singleton Ball_def PiE_iff closedin_product_topology_singleton) + qed + then show ?thesis + using False by blast +qed + +end diff -r 6ebe97815275 -r 11065b70407d src/HOL/Library/Equipollence.thy --- a/src/HOL/Library/Equipollence.thy Wed Mar 06 21:44:30 2019 +0100 +++ b/src/HOL/Library/Equipollence.thy Thu Mar 07 14:08:05 2019 +0000 @@ -82,7 +82,6 @@ apply (simp add: infinite_countable_subset) using infinite_iff_countable_subset by blast - lemma bij_betw_iff_bijections: "bij_betw f A B \ (\g. (\x \ A. f x \ B \ g(f x) = x) \ (\y \ B. g y \ A \ f(g y) = y))" (is "?lhs = ?rhs") @@ -114,9 +113,23 @@ using * by (auto simp: image_def) qed +lemma singleton_lepoll: "{x} \ insert y A" + by (force simp: lepoll_def) + +lemma singleton_eqpoll: "{x} \ {y}" + by (blast intro: lepoll_antisym singleton_lepoll) + +lemma subset_singleton_iff_lepoll: "(\x. S \ {x}) \ S \ {()}" +proof safe + show "S \ {()}" if "S \ {x}" for x + using subset_imp_lepoll [OF that] by (simp add: singleton_eqpoll lepoll_trans2) + show "\x. S \ {x}" if "S \ {()}" + by (metis (no_types, hide_lams) image_empty image_insert lepoll_iff that) +qed + + subsection\The strict relation\ - lemma lesspoll_not_refl [iff]: "~ (i \ i)" by (simp add: lepoll_antisym lesspoll_def)