# HG changeset patch # User huffman # Date 1314289022 25200 # Node ID ea85d78a994eaf36abc0631309ea9b35e59e0869 # Parent 219a6fe4cfae6c16ef5919bbaf7af3ab2fea0f78 simplify definition of 'interior'; add lemmas interiorI and interiorE; change lemmas interior_unique and closure_unique to rule_format; tidy some proofs; diff -r 219a6fe4cfae -r ea85d78a994e src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Wed Aug 24 16:08:21 2011 -0700 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Thu Aug 25 09:17:02 2011 -0700 @@ -3453,22 +3453,27 @@ ultimately show ?thesis using injpi by auto qed qed qed auto qed -lemma homeomorphic_convex_compact_lemma: fixes s::"('a::euclidean_space) set" - assumes "convex s" "compact s" "cball 0 1 \ s" +lemma homeomorphic_convex_compact_lemma: + fixes s :: "('a::euclidean_space) set" + assumes "convex s" and "compact s" and "cball 0 1 \ s" shows "s homeomorphic (cball (0::'a) 1)" - apply(rule starlike_compact_projective[OF assms(2-3)]) proof(rule,rule,rule,erule conjE) - fix x u assume as:"x \ s" "0 \ u" "u < (1::real)" - hence "u *\<^sub>R x \ interior s" unfolding interior_def mem_Collect_eq - apply(rule_tac x="ball (u *\<^sub>R x) (1 - u)" in exI) apply(rule, rule open_ball) - unfolding centre_in_ball apply rule defer apply(rule) unfolding mem_ball proof- - fix y assume "dist (u *\<^sub>R x) y < 1 - u" - hence "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \ s" - using assms(3) apply(erule_tac subsetD) unfolding mem_cball dist_commute dist_norm - unfolding group_add_class.diff_0 group_add_class.diff_0_right norm_minus_cancel norm_scaleR - apply (rule mult_left_le_imp_le[of "1 - u"]) - unfolding mult_assoc[symmetric] using `u<1` by auto - thus "y \ s" using assms(1)[unfolded convex_def, rule_format, of "inverse(1 - u) *\<^sub>R (y - u *\<^sub>R x)" x "1 - u" u] - using as unfolding scaleR_scaleR by auto qed auto +proof (rule starlike_compact_projective[OF assms(2-3)], clarify) + fix x u assume "x \ s" and "0 \ u" and "u < (1::real)" + have "open (ball (u *\<^sub>R x) (1 - u))" by (rule open_ball) + moreover have "u *\<^sub>R x \ ball (u *\<^sub>R x) (1 - u)" + unfolding centre_in_ball using `u < 1` by simp + moreover have "ball (u *\<^sub>R x) (1 - u) \ s" + proof + fix y assume "y \ ball (u *\<^sub>R x) (1 - u)" + hence "dist (u *\<^sub>R x) y < 1 - u" unfolding mem_ball . + with `u < 1` have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \ cball 0 1" + by (simp add: dist_norm inverse_eq_divide norm_minus_commute) + with assms(3) have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \ s" .. + with assms(1) have "(1 - u) *\<^sub>R ((y - u *\<^sub>R x) /\<^sub>R (1 - u)) + u *\<^sub>R x \ s" + using `x \ s` `0 \ u` `u < 1` [THEN less_imp_le] by (rule mem_convex) + thus "y \ s" using `u < 1` by simp + qed + ultimately have "u *\<^sub>R x \ interior s" .. thus "u *\<^sub>R x \ s - frontier s" using frontier_def and interior_subset by auto qed lemma homeomorphic_convex_compact_cball: fixes e::real and s::"('a::euclidean_space) set" diff -r 219a6fe4cfae -r ea85d78a994e src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Aug 24 16:08:21 2011 -0700 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Thu Aug 25 09:17:02 2011 -0700 @@ -555,37 +555,58 @@ subsection {* Interior of a Set *} -definition "interior S = {x. \T. open T \ x \ T \ T \ S}" +definition "interior S = \{T. open T \ T \ S}" + +lemma interiorI [intro?]: + assumes "open T" and "x \ T" and "T \ S" + shows "x \ interior S" + using assms unfolding interior_def by fast + +lemma interiorE [elim?]: + assumes "x \ interior S" + obtains T where "open T" and "x \ T" and "T \ S" + using assms unfolding interior_def by fast + +lemma open_interior [simp, intro]: "open (interior S)" + by (simp add: interior_def open_Union) + +lemma interior_subset: "interior S \ S" + by (auto simp add: interior_def) + +lemma interior_maximal: "T \ S \ open T \ T \ interior S" + by (auto simp add: interior_def) + +lemma interior_open: "open S \ interior S = S" + by (intro equalityI interior_subset interior_maximal subset_refl) lemma interior_eq: "interior S = S \ open S" - apply (simp add: set_eq_iff interior_def) - apply (subst (2) open_subopen) by (safe, blast+) - -lemma interior_open: "open S ==> (interior S = S)" by (metis interior_eq) - -lemma interior_empty[simp]: "interior {} = {}" by (simp add: interior_def) - -lemma open_interior[simp, intro]: "open(interior S)" - apply (simp add: interior_def) - apply (subst open_subopen) by blast - -lemma interior_interior[simp]: "interior(interior S) = interior S" by (metis interior_eq open_interior) -lemma interior_subset: "interior S \ S" by (auto simp add: interior_def) -lemma subset_interior: "S \ T ==> (interior S) \ (interior T)" by (auto simp add: interior_def) -lemma interior_maximal: "T \ S \ open T ==> T \ (interior S)" by (auto simp add: interior_def) -lemma interior_unique: "T \ S \ open T \ (\T'. T' \ S \ open T' \ T' \ T) \ interior S = T" - by (metis equalityI interior_maximal interior_subset open_interior) -lemma mem_interior: "x \ interior S \ (\e. 0 < e \ ball x e \ S)" - apply (simp add: interior_def) - by (metis open_contains_ball centre_in_ball open_ball subset_trans) - -lemma open_subset_interior: "open S ==> S \ interior T \ S \ T" + by (metis open_interior interior_open) + +lemma open_subset_interior: "open S \ S \ interior T \ S \ T" by (metis interior_maximal interior_subset subset_trans) -lemma interior_inter[simp]: "interior(S \ T) = interior S \ interior T" - apply (rule equalityI, simp) - apply (metis Int_lower1 Int_lower2 subset_interior) - by (metis Int_mono interior_subset open_Int open_interior open_subset_interior) +lemma interior_empty [simp]: "interior {} = {}" + using open_empty by (rule interior_open) + +lemma interior_interior [simp]: "interior (interior S) = interior S" + using open_interior by (rule interior_open) + +lemma subset_interior: "S \ T \ interior S \ interior T" + by (auto simp add: interior_def) (* TODO: rename to interior_mono *) + +lemma interior_unique: + assumes "T \ S" and "open T" + assumes "\T'. T' \ S \ open T' \ T' \ T" + shows "interior S = T" + by (intro equalityI assms interior_subset open_interior interior_maximal) + +lemma interior_inter [simp]: "interior (S \ T) = interior S \ interior T" + by (intro equalityI Int_mono Int_greatest subset_interior Int_lower1 + Int_lower2 interior_maximal interior_subset open_Int open_interior) + +lemma mem_interior: "x \ interior S \ (\e>0. ball x e \ S)" + using open_contains_ball_eq [where S="interior S"] + by (simp add: open_subset_interior) lemma interior_limit_point [intro]: fixes x :: "'a::perfect_space" @@ -599,21 +620,20 @@ lemma interior_closed_Un_empty_interior: assumes cS: "closed S" and iT: "interior T = {}" - shows "interior(S \ T) = interior S" + shows "interior (S \ T) = interior S" proof - show "interior S \ interior (S\T)" - by (rule subset_interior, blast) + show "interior S \ interior (S \ T)" + by (rule subset_interior, rule Un_upper1) next show "interior (S \ T) \ interior S" proof fix x assume "x \ interior (S \ T)" - then obtain R where "open R" "x \ R" "R \ S \ T" - unfolding interior_def by fast + then obtain R where "open R" "x \ R" "R \ S \ T" .. show "x \ interior S" proof (rule ccontr) assume "x \ interior S" with `x \ R` `open R` obtain y where "y \ R - S" - unfolding interior_def set_eq_iff by fast + unfolding interior_def by fast from `open R` `closed S` have "open (R - S)" by (rule open_Diff) from `R \ S \ T` have "R - S \ T" by fast from `y \ R - S` `open (R - S)` `R - S \ T` `interior T = {}` @@ -628,15 +648,16 @@ by (intro Sigma_mono interior_subset) show "open (interior A \ interior B)" by (intro open_Times open_interior) - show "\T. T \ A \ B \ open T \ T \ interior A \ interior B" - apply (simp add: open_prod_def, clarify) - apply (drule (1) bspec, clarify, rename_tac C D) - apply (simp add: interior_def, rule conjI) - apply (rule_tac x=C in exI, clarsimp) - apply (rule SigmaD1, erule subsetD, erule subsetD, erule (1) SigmaI) - apply (rule_tac x=D in exI, clarsimp) - apply (rule SigmaD2, erule subsetD, erule subsetD, erule (1) SigmaI) - done + fix T assume "T \ A \ B" and "open T" thus "T \ interior A \ interior B" + proof (safe) + fix x y assume "(x, y) \ T" + then obtain C D where "open C" "open D" "C \ D \ T" "x \ C" "y \ D" + using `open T` unfolding open_prod_def by fast + hence "open C" "open D" "C \ A" "D \ B" "x \ C" "y \ D" + using `T \ A \ B` by auto + thus "x \ interior A" and "y \ interior B" + by (auto intro: interiorI) + qed qed @@ -657,57 +678,33 @@ unfolding closure_def by simp lemma closure_hull: "closure S = closed hull S" -proof- - have "S \ closure S" - by (rule closure_subset) - moreover - have "closed (closure S)" - by (rule closed_closure) - moreover - { fix t - assume *:"S \ t" "closed t" - { fix x - assume "x islimpt S" - hence "x islimpt t" using *(1) - using islimpt_subset[of x, of S, of t] - by blast - } - with * have "closure S \ t" - unfolding closure_def - using closed_limpt[of t] - by auto - } - ultimately show ?thesis - by (rule hull_unique [symmetric]) -qed + unfolding hull_def closure_interior interior_def by auto lemma closure_eq: "closure S = S \ closed S" - unfolding closure_hull - using hull_eq[of closed, OF closed_Inter, of S] - by metis - -lemma closure_closed[simp]: "closed S \ closure S = S" - using closure_eq[of S] - by simp - -lemma closure_closure[simp]: "closure (closure S) = closure S" + unfolding closure_hull using closed_Inter by (rule hull_eq) + +lemma closure_closed [simp]: "closed S \ closure S = S" + unfolding closure_eq . + +lemma closure_closure [simp]: "closure (closure S) = closure S" unfolding closure_hull by (rule hull_hull) lemma subset_closure: "S \ T \ closure S \ closure T" unfolding closure_hull by (rule hull_mono) -lemma closure_minimal: "S \ T \ closed T \ closure S \ T" +lemma closure_minimal: "S \ T \ closed T \ closure S \ T" unfolding closure_hull by (rule hull_minimal) -lemma closure_unique: "S \ T \ closed T \ (\ T'. S \ T' \ closed T' \ T \ T') \ closure S = T" - using hull_unique[of S T closed] - unfolding closure_hull - by simp - -lemma closure_empty[simp]: "closure {} = {}" +lemma closure_unique: + assumes "S \ T" and "closed T" + assumes "\T'. S \ T' \ closed T' \ T \ T'" + shows "closure S = T" + using assms unfolding closure_hull by (rule hull_unique) + +lemma closure_empty [simp]: "closure {} = {}" using closed_empty by (rule closure_closed) -lemma closure_univ[simp]: "closure UNIV = UNIV" +lemma closure_univ [simp]: "closure UNIV = UNIV" using closed_UNIV by (rule closure_closed) lemma closure_union [simp]: "closure (S \ T) = closure S \ closure T" @@ -752,19 +749,19 @@ by blast qed -lemma closure_complement: "closure(- S) = - interior(S)" +lemma closure_complement: "closure (- S) = - interior S" unfolding closure_interior by simp -lemma interior_complement: "interior(- S) = - closure(S)" +lemma interior_complement: "interior (- S) = - closure S" unfolding closure_interior by simp lemma closure_Times: "closure (A \ B) = closure A \ closure B" -proof (intro closure_unique conjI) +proof (rule closure_unique) show "A \ B \ closure A \ closure B" by (intro Sigma_mono closure_subset) show "closed (closure A \ closure B)" by (intro closed_Times closed_closure) - show "\T. A \ B \ T \ closed T \ closure A \ closure B \ T" + fix T assume "A \ B \ T" and "closed T" thus "closure A \ closure B \ T" apply (simp add: closed_def open_prod_def, clarify) apply (rule ccontr) apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D) @@ -1038,8 +1035,7 @@ assumes "x \ interior S" shows "eventually P (at x within S) \ eventually P (at x)" (is "?lhs = ?rhs") proof- - from assms obtain T where T: "open T" "x \ T" "T \ S" - unfolding interior_def by fast + from assms obtain T where T: "open T" "x \ T" "T \ S" .. { assume "?lhs" then obtain A where "open A" "x \ A" "\y\A. y \ x \ y \ S \ P y" unfolding Limits.eventually_within Limits.eventually_at_topological @@ -2731,8 +2727,8 @@ fixes x :: "'a::t1_space" shows "closure (insert x s) = insert x (closure s)" apply (rule closure_unique) -apply (rule conjI [OF insert_mono [OF closure_subset]]) -apply (rule conjI [OF closed_insert [OF closed_closure]]) +apply (rule insert_mono [OF closure_subset]) +apply (rule closed_insert [OF closed_closure]) apply (simp add: closure_minimal) done @@ -3299,10 +3295,9 @@ unfolding continuous_on by (metis subset_eq Lim_within_subset) lemma continuous_on_interior: - shows "continuous_on s f \ x \ interior s ==> continuous (at x) f" -unfolding interior_def -apply simp -by (meson continuous_on_eq_continuous_at continuous_on_subset) + shows "continuous_on s f \ x \ interior s \ continuous (at x) f" + by (erule interiorE, drule (1) continuous_on_subset, + simp add: continuous_on_eq_continuous_at) lemma continuous_on_eq: "(\x \ s. f x = g x) \ continuous_on s f \ continuous_on s g" @@ -3744,13 +3739,20 @@ lemma interior_image_subset: assumes "\x. continuous (at x) f" "inj f" shows "interior (f ` s) \ f ` (interior s)" - apply rule unfolding interior_def mem_Collect_eq image_iff apply safe -proof- fix x T assume as:"open T" "x \ T" "T \ f ` s" - hence "x \ f ` s" by auto then guess y unfolding image_iff .. note y=this - thus "\xa\{x. \T. open T \ x \ T \ T \ s}. x = f xa" apply(rule_tac x=y in bexI) using assms as - apply safe apply(rule_tac x="{x. f x \ T}" in exI) apply(safe,rule continuous_open_preimage_univ) - proof- fix x assume "f x \ T" hence "f x \ f ` s" using as by auto - thus "x \ s" unfolding inj_image_mem_iff[OF assms(2)] . qed auto qed +proof + fix x assume "x \ interior (f ` s)" + then obtain T where as: "open T" "x \ T" "T \ f ` s" .. + hence "x \ f ` s" by auto + then obtain y where y: "y \ s" "x = f y" by auto + have "open (vimage f T)" + using assms(1) `open T` by (rule continuous_open_vimage) + moreover have "y \ vimage f T" + using `x = f y` `x \ T` by simp + moreover have "vimage f T \ s" + using `T \ image f s` `inj f` unfolding inj_on_def subset_eq by auto + ultimately have "y \ interior s" .. + with `x = f y` show "x \ f ` interior s" .. +qed text {* Equality of continuous functions on closure and related results. *} @@ -4818,13 +4820,15 @@ finally show "closed {a .. b}" . qed -lemma interior_closed_interval[intro]: fixes a :: "'a::ordered_euclidean_space" shows - "interior {a .. b} = {a<.. ?L" using interior_maximal[OF interval_open_subset_closed open_interval] by auto + show "?R \ ?L" using interval_open_subset_closed open_interval + by (rule interior_maximal) next - { fix x assume "\T. open T \ x \ T \ T \ {a..b}" - then obtain s where s:"open s" "x \ s" "s \ {a..b}" by auto + { fix x assume "x \ interior {a..b}" + then obtain s where s:"open s" "x \ s" "s \ {a..b}" .. then obtain e where "e>0" and e:"\x'. dist x' x < e \ x' \ {a..b}" unfolding open_dist and subset_eq by auto { fix i assume i:"iR basis i) x < e" @@ -4839,7 +4843,7 @@ hence "a $$ i < x $$ i" and "x $$ i < b $$ i" unfolding euclidean_simps unfolding basis_component using `e>0` i by auto } hence "x \ {a<.. ?R" unfolding interior_def and subset_eq by auto + thus "?L \ ?R" .. qed lemma bounded_closed_interval: fixes a :: "'a::ordered_euclidean_space" shows "bounded {a .. b}"