# HG changeset patch # User nipkow # Date 1548774791 -3600 # Node ID 7d83b0abbfd7dffb57cef6e731e5f31ecbcf7053 # Parent 7aafd0472661b8f82727d5fc034ca6d8a854d8f8 moved generalized material diff -r 7aafd0472661 -r 7d83b0abbfd7 src/HOL/Analysis/Abstract_Topology_2.thy --- a/src/HOL/Analysis/Abstract_Topology_2.thy Mon Jan 28 18:36:50 2019 -0500 +++ b/src/HOL/Analysis/Abstract_Topology_2.thy Tue Jan 29 16:13:11 2019 +0100 @@ -775,4 +775,224 @@ qed +subsection \Retractions\ + +definition%important retraction :: "('a::topological_space) set \ 'a set \ ('a \ 'a) \ bool" +where "retraction S T r \ + T \ S \ continuous_on S r \ r ` S \ T \ (\x\T. r x = x)" + +definition%important retract_of (infixl "retract'_of" 50) where +"T retract_of S \ (\r. retraction S T r)" + +lemma retraction_idempotent: "retraction S T r \ x \ S \ r (r x) = r x" + unfolding retraction_def by auto + +text \Preservation of fixpoints under (more general notion of) retraction\ + +lemma invertible_fixpoint_property: + fixes S :: "'a::topological_space set" + and T :: "'b::topological_space set" + assumes contt: "continuous_on T i" + and "i ` T \ S" + and contr: "continuous_on S r" + and "r ` S \ T" + and ri: "\y. y \ T \ r (i y) = y" + and FP: "\f. \continuous_on S f; f ` S \ S\ \ \x\S. f x = x" + and contg: "continuous_on T g" + and "g ` T \ T" + obtains y where "y \ T" and "g y = y" +proof - + have "\x\S. (i \ g \ r) x = x" + proof (rule FP) + show "continuous_on S (i \ g \ r)" + by (meson contt contr assms(4) contg assms(8) continuous_on_compose continuous_on_subset) + show "(i \ g \ r) ` S \ S" + using assms(2,4,8) by force + qed + then obtain x where x: "x \ S" "(i \ g \ r) x = x" .. + then have *: "g (r x) \ T" + using assms(4,8) by auto + have "r ((i \ g \ r) x) = r x" + using x by auto + then show ?thesis + using "*" ri that by auto +qed + +lemma homeomorphic_fixpoint_property: + fixes S :: "'a::topological_space set" + and T :: "'b::topological_space set" + assumes "S homeomorphic T" + shows "(\f. continuous_on S f \ f ` S \ S \ (\x\S. f x = x)) \ + (\g. continuous_on T g \ g ` T \ T \ (\y\T. g y = y))" + (is "?lhs = ?rhs") +proof - + obtain r i where r: + "\x\S. i (r x) = x" "r ` S = T" "continuous_on S r" + "\y\T. r (i y) = y" "i ` T = S" "continuous_on T i" + using assms unfolding homeomorphic_def homeomorphism_def by blast + show ?thesis + proof + assume ?lhs + with r show ?rhs + by (metis invertible_fixpoint_property[of T i S r] order_refl) + next + assume ?rhs + with r show ?lhs + by (metis invertible_fixpoint_property[of S r T i] order_refl) + qed +qed + +lemma retract_fixpoint_property: + fixes f :: "'a::topological_space \ 'b::topological_space" + and S :: "'a set" + assumes "T retract_of S" + and FP: "\f. \continuous_on S f; f ` S \ S\ \ \x\S. f x = x" + and contg: "continuous_on T g" + and "g ` T \ T" + obtains y where "y \ T" and "g y = y" +proof - + obtain h where "retraction S T h" + using assms(1) unfolding retract_of_def .. + then show ?thesis + unfolding retraction_def + using invertible_fixpoint_property[OF continuous_on_id _ _ _ _ FP] + by (metis assms(4) contg image_ident that) +qed + +lemma retraction: + "retraction S T r \ + T \ S \ continuous_on S r \ r ` S = T \ (\x \ T. r x = x)" + by (force simp: retraction_def) + +lemma retractionE: \ \yields properties normalized wrt. simp – less likely to loop\ + assumes "retraction S T r" + obtains "T = r ` S" "r ` S \ S" "continuous_on S r" "\x. x \ S \ r (r x) = r x" +proof (rule that) + from retraction [of S T r] assms + have "T \ S" "continuous_on S r" "r ` S = T" and "\x \ T. r x = x" + by simp_all + then show "T = r ` S" "r ` S \ S" "continuous_on S r" + by simp_all + from \\x \ T. r x = x\ have "r x = x" if "x \ T" for x + using that by simp + with \r ` S = T\ show "r (r x) = r x" if "x \ S" for x + using that by auto +qed + +lemma retract_ofE: \ \yields properties normalized wrt. simp – less likely to loop\ + assumes "T retract_of S" + obtains r where "T = r ` S" "r ` S \ S" "continuous_on S r" "\x. x \ S \ r (r x) = r x" +proof - + from assms obtain r where "retraction S T r" + by (auto simp add: retract_of_def) + with that show thesis + by (auto elim: retractionE) +qed + +lemma retract_of_imp_extensible: + assumes "S retract_of T" and "continuous_on S f" and "f ` S \ U" + obtains g where "continuous_on T g" "g ` T \ U" "\x. x \ S \ g x = f x" +proof - + from \S retract_of T\ obtain r where "retraction T S r" + by (auto simp add: retract_of_def) + show thesis + by (rule that [of "f \ r"]) + (use \continuous_on S f\ \f ` S \ U\ \retraction T S r\ in \auto simp: continuous_on_compose2 retraction\) +qed + +lemma idempotent_imp_retraction: + assumes "continuous_on S f" and "f ` S \ S" and "\x. x \ S \ f(f x) = f x" + shows "retraction S (f ` S) f" +by (simp add: assms retraction) + +lemma retraction_subset: + assumes "retraction S T r" and "T \ s'" and "s' \ S" + shows "retraction s' T r" + unfolding retraction_def + by (metis assms continuous_on_subset image_mono retraction) + +lemma retract_of_subset: + assumes "T retract_of S" and "T \ s'" and "s' \ S" + shows "T retract_of s'" +by (meson assms retract_of_def retraction_subset) + +lemma retraction_refl [simp]: "retraction S S (\x. x)" +by (simp add: retraction) + +lemma retract_of_refl [iff]: "S retract_of S" + unfolding retract_of_def retraction_def + using continuous_on_id by blast + +lemma retract_of_imp_subset: + "S retract_of T \ S \ T" +by (simp add: retract_of_def retraction_def) + +lemma retract_of_empty [simp]: + "({} retract_of S) \ S = {}" "(S retract_of {}) \ S = {}" +by (auto simp: retract_of_def retraction_def) + +lemma retract_of_singleton [iff]: "({x} retract_of S) \ x \ S" + unfolding retract_of_def retraction_def by force + +lemma retraction_comp: + "\retraction S T f; retraction T U g\ + \ retraction S U (g \ f)" +apply (auto simp: retraction_def intro: continuous_on_compose2) +by blast + +lemma retract_of_trans [trans]: + assumes "S retract_of T" and "T retract_of U" + shows "S retract_of U" +using assms by (auto simp: retract_of_def intro: retraction_comp) + +lemma closedin_retract: + fixes S :: "'a :: t2_space set" + assumes "S retract_of T" + shows "closedin (subtopology euclidean T) S" +proof - + obtain r where r: "S \ T" "continuous_on T r" "r ` T \ S" "\x. x \ S \ r x = x" + using assms by (auto simp: retract_of_def retraction_def) + have "S = {x\T. x = r x}" + using r by auto + also have "\ = T \ ((\x. (x, r x)) -` ({y. \x. y = (x, x)}))" + unfolding vimage_def mem_Times_iff fst_conv snd_conv + using r + by auto + also have "closedin (top_of_set T) \" + by (rule continuous_closedin_preimage) (auto intro!: closed_diagonal continuous_on_Pair r) + finally show ?thesis . +qed + +lemma closedin_self [simp]: "closedin (subtopology euclidean S) S" + by simp + +lemma retract_of_closed: + fixes S :: "'a :: t2_space set" + shows "\closed T; S retract_of T\ \ closed S" + by (metis closedin_retract closedin_closed_eq) + +lemma retract_of_compact: + "\compact T; S retract_of T\ \ compact S" + by (metis compact_continuous_image retract_of_def retraction) + +lemma retract_of_connected: + "\connected T; S retract_of T\ \ connected S" + by (metis Topological_Spaces.connected_continuous_image retract_of_def retraction) + +lemma retraction_imp_quotient_map: + "openin (subtopology euclidean S) (S \ r -` U) \ openin (subtopology euclidean T) U" + if retraction: "retraction S T r" and "U \ T" + using retraction apply (rule retractionE) + apply (rule continuous_right_inverse_imp_quotient_map [where g=r]) + using \U \ T\ apply (auto elim: continuous_on_subset) + done + +lemma retract_of_Times: + "\S retract_of s'; T retract_of t'\ \ (S \ T) retract_of (s' \ t')" +apply (simp add: retract_of_def retraction_def Sigma_mono, clarify) +apply (rename_tac f g) +apply (rule_tac x="\z. ((f \ fst) z, (g \ snd) z)" in exI) +apply (rule conjI continuous_intros | erule continuous_on_subset | force)+ +done + end \ No newline at end of file diff -r 7aafd0472661 -r 7d83b0abbfd7 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Jan 28 18:36:50 2019 -0500 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Tue Jan 29 16:13:11 2019 +0100 @@ -2343,226 +2343,4 @@ no_notation eucl_less (infix "Retractions\ - -definition%important retraction :: "('a::topological_space) set \ 'a set \ ('a \ 'a) \ bool" -where "retraction S T r \ - T \ S \ continuous_on S r \ r ` S \ T \ (\x\T. r x = x)" - -definition%important retract_of (infixl "retract'_of" 50) where -"T retract_of S \ (\r. retraction S T r)" - -lemma retraction_idempotent: "retraction S T r \ x \ S \ r (r x) = r x" - unfolding retraction_def by auto - -text \Preservation of fixpoints under (more general notion of) retraction\ - -lemma invertible_fixpoint_property: - fixes S :: "'a::topological_space set" - and T :: "'b::topological_space set" - assumes contt: "continuous_on T i" - and "i ` T \ S" - and contr: "continuous_on S r" - and "r ` S \ T" - and ri: "\y. y \ T \ r (i y) = y" - and FP: "\f. \continuous_on S f; f ` S \ S\ \ \x\S. f x = x" - and contg: "continuous_on T g" - and "g ` T \ T" - obtains y where "y \ T" and "g y = y" -proof - - have "\x\S. (i \ g \ r) x = x" - proof (rule FP) - show "continuous_on S (i \ g \ r)" - by (meson contt contr assms(4) contg assms(8) continuous_on_compose continuous_on_subset) - show "(i \ g \ r) ` S \ S" - using assms(2,4,8) by force - qed - then obtain x where x: "x \ S" "(i \ g \ r) x = x" .. - then have *: "g (r x) \ T" - using assms(4,8) by auto - have "r ((i \ g \ r) x) = r x" - using x by auto - then show ?thesis - using "*" ri that by auto -qed - -lemma homeomorphic_fixpoint_property: - fixes S :: "'a::topological_space set" - and T :: "'b::topological_space set" - assumes "S homeomorphic T" - shows "(\f. continuous_on S f \ f ` S \ S \ (\x\S. f x = x)) \ - (\g. continuous_on T g \ g ` T \ T \ (\y\T. g y = y))" - (is "?lhs = ?rhs") -proof - - obtain r i where r: - "\x\S. i (r x) = x" "r ` S = T" "continuous_on S r" - "\y\T. r (i y) = y" "i ` T = S" "continuous_on T i" - using assms unfolding homeomorphic_def homeomorphism_def by blast - show ?thesis - proof - assume ?lhs - with r show ?rhs - by (metis invertible_fixpoint_property[of T i S r] order_refl) - next - assume ?rhs - with r show ?lhs - by (metis invertible_fixpoint_property[of S r T i] order_refl) - qed -qed - -lemma retract_fixpoint_property: - fixes f :: "'a::topological_space \ 'b::topological_space" - and S :: "'a set" - assumes "T retract_of S" - and FP: "\f. \continuous_on S f; f ` S \ S\ \ \x\S. f x = x" - and contg: "continuous_on T g" - and "g ` T \ T" - obtains y where "y \ T" and "g y = y" -proof - - obtain h where "retraction S T h" - using assms(1) unfolding retract_of_def .. - then show ?thesis - unfolding retraction_def - using invertible_fixpoint_property[OF continuous_on_id _ _ _ _ FP] - by (metis assms(4) contg image_ident that) -qed - -lemma retraction: - "retraction S T r \ - T \ S \ continuous_on S r \ r ` S = T \ (\x \ T. r x = x)" - by (force simp: retraction_def) - -lemma retractionE: \ \yields properties normalized wrt. simp – less likely to loop\ - assumes "retraction S T r" - obtains "T = r ` S" "r ` S \ S" "continuous_on S r" "\x. x \ S \ r (r x) = r x" -proof (rule that) - from retraction [of S T r] assms - have "T \ S" "continuous_on S r" "r ` S = T" and "\x \ T. r x = x" - by simp_all - then show "T = r ` S" "r ` S \ S" "continuous_on S r" - by simp_all - from \\x \ T. r x = x\ have "r x = x" if "x \ T" for x - using that by simp - with \r ` S = T\ show "r (r x) = r x" if "x \ S" for x - using that by auto -qed - -lemma retract_ofE: \ \yields properties normalized wrt. simp – less likely to loop\ - assumes "T retract_of S" - obtains r where "T = r ` S" "r ` S \ S" "continuous_on S r" "\x. x \ S \ r (r x) = r x" -proof - - from assms obtain r where "retraction S T r" - by (auto simp add: retract_of_def) - with that show thesis - by (auto elim: retractionE) -qed - -lemma retract_of_imp_extensible: - assumes "S retract_of T" and "continuous_on S f" and "f ` S \ U" - obtains g where "continuous_on T g" "g ` T \ U" "\x. x \ S \ g x = f x" -proof - - from \S retract_of T\ obtain r where "retraction T S r" - by (auto simp add: retract_of_def) - show thesis - by (rule that [of "f \ r"]) - (use \continuous_on S f\ \f ` S \ U\ \retraction T S r\ in \auto simp: continuous_on_compose2 retraction\) -qed - -lemma idempotent_imp_retraction: - assumes "continuous_on S f" and "f ` S \ S" and "\x. x \ S \ f(f x) = f x" - shows "retraction S (f ` S) f" -by (simp add: assms retraction) - -lemma retraction_subset: - assumes "retraction S T r" and "T \ s'" and "s' \ S" - shows "retraction s' T r" - unfolding retraction_def - by (metis assms continuous_on_subset image_mono retraction) - -lemma retract_of_subset: - assumes "T retract_of S" and "T \ s'" and "s' \ S" - shows "T retract_of s'" -by (meson assms retract_of_def retraction_subset) - -lemma retraction_refl [simp]: "retraction S S (\x. x)" -by (simp add: retraction) - -lemma retract_of_refl [iff]: "S retract_of S" - unfolding retract_of_def retraction_def - using continuous_on_id by blast - -lemma retract_of_imp_subset: - "S retract_of T \ S \ T" -by (simp add: retract_of_def retraction_def) - -lemma retract_of_empty [simp]: - "({} retract_of S) \ S = {}" "(S retract_of {}) \ S = {}" -by (auto simp: retract_of_def retraction_def) - -lemma retract_of_singleton [iff]: "({x} retract_of S) \ x \ S" - unfolding retract_of_def retraction_def by force - -lemma retraction_comp: - "\retraction S T f; retraction T U g\ - \ retraction S U (g \ f)" -apply (auto simp: retraction_def intro: continuous_on_compose2) -by blast - -lemma retract_of_trans [trans]: - assumes "S retract_of T" and "T retract_of U" - shows "S retract_of U" -using assms by (auto simp: retract_of_def intro: retraction_comp) - -lemma closedin_retract: - fixes S :: "'a :: t2_space set" - assumes "S retract_of T" - shows "closedin (subtopology euclidean T) S" -proof - - obtain r where r: "S \ T" "continuous_on T r" "r ` T \ S" "\x. x \ S \ r x = x" - using assms by (auto simp: retract_of_def retraction_def) - have "S = {x\T. x = r x}" - using r by auto - also have "\ = T \ ((\x. (x, r x)) -` ({y. \x. y = (x, x)}))" - unfolding vimage_def mem_Times_iff fst_conv snd_conv - using r - by auto - also have "closedin (top_of_set T) \" - by (rule continuous_closedin_preimage) (auto intro!: closed_diagonal continuous_on_Pair r) - finally show ?thesis . -qed - -lemma closedin_self [simp]: "closedin (subtopology euclidean S) S" - by simp - -lemma retract_of_closed: - fixes S :: "'a :: t2_space set" - shows "\closed T; S retract_of T\ \ closed S" - by (metis closedin_retract closedin_closed_eq) - -lemma retract_of_compact: - "\compact T; S retract_of T\ \ compact S" - by (metis compact_continuous_image retract_of_def retraction) - -lemma retract_of_connected: - "\connected T; S retract_of T\ \ connected S" - by (metis Topological_Spaces.connected_continuous_image retract_of_def retraction) - -lemma retraction_imp_quotient_map: - "openin (subtopology euclidean S) (S \ r -` U) \ openin (subtopology euclidean T) U" - if retraction: "retraction S T r" and "U \ T" - using retraction apply (rule retractionE) - apply (rule continuous_right_inverse_imp_quotient_map [where g=r]) - using \U \ T\ apply (auto elim: continuous_on_subset) - done - -lemma retract_of_Times: - "\S retract_of s'; T retract_of t'\ \ (S \ T) retract_of (s' \ t')" -apply (simp add: retract_of_def retraction_def Sigma_mono, clarify) -apply (rename_tac f g) -apply (rule_tac x="\z. ((f \ fst) z, (g \ snd) z)" in exI) -apply (rule conjI continuous_intros | erule continuous_on_subset | force)+ -done - - end