# HG changeset patch # User paulson # Date 1598715033 -3600 # Node ID 5e26a4bca0c2d9f370c127213a159c6b87bd91d9 # Parent d36c109bc7738c43602406c6ebc0e153f260cec8# Parent 341b15d092f2515462b98444900580f8e0d752f6 merged diff -r d36c109bc773 -r 5e26a4bca0c2 src/HOL/Analysis/Abstract_Topology_2.thy --- a/src/HOL/Analysis/Abstract_Topology_2.thy Fri Aug 28 16:14:19 2020 +0200 +++ b/src/HOL/Analysis/Abstract_Topology_2.thy Sat Aug 29 16:30:33 2020 +0100 @@ -15,15 +15,7 @@ text \Combination of Elementary and Abstract Topology\ -(* FIXME: move elsewhere *) - -lemma approachable_lt_le: "(\(d::real) > 0. \x. f x < d \ P x) \ (\d>0. \x. f x \ d \ P x)" - apply auto - apply (rule_tac x="d/2" in exI) - apply auto - done - -lemma approachable_lt_le2: \ \like the above, but pushes aside an extra formula\ +lemma approachable_lt_le2: "(\(d::real) > 0. \x. Q x \ f x < d \ P x) \ (\d>0. \x. f x \ d \ Q x \ P x)" apply auto apply (rule_tac x="d/2" in exI, auto) @@ -251,10 +243,8 @@ from \finite D\ show "finite ?D" by (rule finite_imageI) from \S \ \D\ show "S \ \?D" - apply (rule subset_trans, clarsimp) - apply (frule subsetD [OF \D \ ?C\, THEN f_inv_into_f]) - apply (erule rev_bexI, fast) - done + apply (rule subset_trans) + by (metis Int_Union Int_lower2 \D \ (\) S ` C\ image_inv_into_cancel) qed then show "\D\C. finite D \ S \ \D" .. qed @@ -587,9 +577,7 @@ proof - have [simp]: "S \ f -` f ` S = S" by auto show ?thesis - using ope [OF T] - apply (simp add: continuous_on_open) - by (meson ope openin_imp_subset openin_trans) + by (meson T continuous_on_open_gen ope openin_imp_subset) qed lemma quotient_map_imp_continuous_closed: @@ -601,9 +589,7 @@ proof - have [simp]: "S \ f -` f ` S = S" by auto show ?thesis - using ope [OF T] - apply (simp add: continuous_on_closed) - by (metis (no_types, lifting) ope closedin_imp_subset closedin_trans) + by (meson T closedin_imp_subset continuous_on_closed_gen ope) qed lemma open_map_imp_quotient_map: @@ -1612,5 +1598,4 @@ connected_component_of_set X x = connected_component_of_set X y" by (meson connected_component_of_nonoverlap) - end \ No newline at end of file diff -r d36c109bc773 -r 5e26a4bca0c2 src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Fri Aug 28 16:14:19 2020 +0200 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Sat Aug 29 16:30:33 2020 +0100 @@ -294,9 +294,8 @@ lemma islimpt_approachable_le: "x islimpt S \ (\e>0. \x'\ S. x' \ x \ dist x' x \ e)" for x :: "'a::metric_space" unfolding islimpt_approachable - using approachable_lt_le [where f="\y. dist y x" and P="\y. y \ S \ y = x", - THEN arg_cong [where f=Not]] - by (simp add: Bex_def conj_commute conj_left_commute) + using approachable_lt_le2 [where f="\y. dist y x" and P="\y. y \ S \ y = x" and Q="\x. True"] + by auto lemma limpt_of_limpts: "x islimpt {y. y islimpt S} \ x islimpt S" for x :: "'a::metric_space" @@ -613,22 +612,12 @@ assume ?lhs then show ?rhs unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball - apply auto - apply (erule_tac x=e in allE, auto) - apply (rule_tac x=d in exI, auto) - apply (erule_tac x=xa in allE) - apply (auto simp: dist_commute) - done + by (metis dist_commute dist_pos_lt dist_self) next assume ?rhs then show ?lhs unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball - apply auto - apply (erule_tac x=e in allE, auto) - apply (rule_tac x=d in exI, auto) - apply (erule_tac x="f xa" in allE) - apply (auto simp: dist_commute) - done + by (metis dist_commute) qed text\Define setwise continuity in terms of limits within the set.\ @@ -830,12 +819,8 @@ have "\n. f n \ S \ dist x (f n) \ a" using a by simp then have "eventually (\n. dist x (f n) \ a) sequentially" by (simp add: f(1)) - have "dist x y \ a" - apply (rule Lim_dist_ubound [of sequentially f]) - apply (rule trivial_limit_sequentially) - apply (rule f(2)) - apply fact - done + then have "dist x y \ a" + using Lim_dist_ubound f(2) trivial_limit_sequentially by blast } then show ?thesis unfolding bounded_def by auto @@ -845,10 +830,7 @@ by (simp add: bounded_subset closure_subset image_mono) lemma bounded_cball[simp,intro]: "bounded (cball x e)" - apply (simp add: bounded_def) - apply (rule_tac x=x in exI) - apply (rule_tac x=e in exI, auto) - done + unfolding bounded_def using mem_cball by blast lemma bounded_ball[simp,intro]: "bounded (ball x e)" by (metis ball_subset_cball bounded_cball bounded_subset) @@ -860,7 +842,7 @@ by (induct rule: finite_induct[of F]) auto lemma bounded_UN [intro]: "finite A \ \x\A. bounded (B x) \ bounded (\x\A. B x)" - by (induct set: finite) auto + by auto lemma bounded_insert [simp]: "bounded (insert x S) \ bounded S" proof - @@ -940,48 +922,48 @@ using assms centre_in_ball closure_iff_nhds_not_empty by blast lemma compact_sup_maxdistance: - fixes s :: "'a::metric_space set" - assumes "compact s" - and "s \ {}" - shows "\x\s. \y\s. \u\s. \v\s. dist u v \ dist x y" + fixes S :: "'a::metric_space set" + assumes "compact S" + and "S \ {}" + shows "\x\S. \y\S. \u\S. \v\S. dist u v \ dist x y" proof - - have "compact (s \ s)" - using \compact s\ by (intro compact_Times) - moreover have "s \ s \ {}" - using \s \ {}\ by auto - moreover have "continuous_on (s \ s) (\x. dist (fst x) (snd x))" + have "compact (S \ S)" + using \compact S\ by (intro compact_Times) + moreover have "S \ S \ {}" + using \S \ {}\ by auto + moreover have "continuous_on (S \ S) (\x. dist (fst x) (snd x))" by (intro continuous_at_imp_continuous_on ballI continuous_intros) ultimately show ?thesis - using continuous_attains_sup[of "s \ s" "\x. dist (fst x) (snd x)"] by auto + using continuous_attains_sup[of "S \ S" "\x. dist (fst x) (snd x)"] by auto qed subsubsection\Totally bounded\ -lemma cauchy_def: "Cauchy s \ (\e>0. \N. \m n. m \ N \ n \ N \ dist (s m) (s n) < e)" +lemma cauchy_def: "Cauchy S \ (\e>0. \N. \m n. m \ N \ n \ N \ dist (S m) (S n) < e)" unfolding Cauchy_def by metis proposition seq_compact_imp_totally_bounded: - assumes "seq_compact s" - shows "\e>0. \k. finite k \ k \ s \ s \ (\x\k. ball x e)" + assumes "seq_compact S" + shows "\e>0. \k. finite k \ k \ S \ S \ (\x\k. ball x e)" proof - - { fix e::real assume "e > 0" assume *: "\k. finite k \ k \ s \ \ s \ (\x\k. ball x e)" - let ?Q = "\x n r. r \ s \ (\m < (n::nat). \ (dist (x m) r < e))" + { fix e::real assume "e > 0" assume *: "\k. finite k \ k \ S \ \ S \ (\x\k. ball x e)" + let ?Q = "\x n r. r \ S \ (\m < (n::nat). \ (dist (x m) r < e))" have "\x. \n::nat. ?Q x n (x n)" proof (rule dependent_wellorder_choice) fix n x assume "\y. y < n \ ?Q x y (x y)" - then have "\ s \ (\x\x ` {0.. S \ (\x\x ` {0..s" "z \ (\x\x ` {0..S" "z \ (\x\x ` {0..r. ?Q x n r" using z by auto qed simp - then obtain x where "\n::nat. x n \ s" and x:"\n m. m < n \ \ (dist (x m) (x n) < e)" + then obtain x where "\n::nat. x n \ S" and x:"\n m. m < n \ \ (dist (x m) (x n) < e)" by blast - then obtain l r where "l \ s" and r:"strict_mono r" and "((x \ r) \ l) sequentially" + then obtain l r where "l \ S" and r:"strict_mono r" and "((x \ r) \ l) sequentially" using assms by (metis seq_compact_def) - from this(3) have "Cauchy (x \ r)" + then have "Cauchy (x \ r)" using LIMSEQ_imp_Cauchy by auto then obtain N::nat where "\m n. N \ m \ N \ n \ dist ((x \ r) m) ((x \ r) n) < e" unfolding cauchy_def using \e > 0\ by blast @@ -994,17 +976,17 @@ subsubsection\Heine-Borel theorem\ proposition seq_compact_imp_Heine_Borel: - fixes s :: "'a :: metric_space set" - assumes "seq_compact s" - shows "compact s" + fixes S :: "'a :: metric_space set" + assumes "seq_compact S" + shows "compact S" proof - - from seq_compact_imp_totally_bounded[OF \seq_compact s\] - obtain f where f: "\e>0. finite (f e) \ f e \ s \ s \ (\x\f e. ball x e)" + from seq_compact_imp_totally_bounded[OF \seq_compact S\] + obtain f where f: "\e>0. finite (f e) \ f e \ S \ S \ (\x\f e. ball x e)" unfolding choice_iff' .. define K where "K = (\(x, r). ball x r) ` ((\e \ \ \ {0 <..}. f e) \ \)" - have "countably_compact s" - using \seq_compact s\ by (rule seq_compact_imp_countably_compact) - then show "compact s" + have "countably_compact S" + using \seq_compact S\ by (rule seq_compact_imp_countably_compact) + then show "compact S" proof (rule countably_compact_imp_compact) show "countable K" unfolding K_def using f @@ -1013,22 +995,22 @@ show "\b\K. open b" by (auto simp: K_def) next fix T x - assume T: "open T" "x \ T" and x: "x \ s" + assume T: "open T" "x \ T" and x: "x \ S" from openE[OF T] obtain e where "0 < e" "ball x e \ T" by auto - then have "0 < e / 2" "ball x (e / 2) \ T" + then have "0 < e/2" "ball x (e/2) \ T" by auto - from Rats_dense_in_real[OF \0 < e / 2\] obtain r where "r \ \" "0 < r" "r < e / 2" + from Rats_dense_in_real[OF \0 < e/2\] obtain r where "r \ \" "0 < r" "r < e/2" by auto - from f[rule_format, of r] \0 < r\ \x \ s\ obtain k where "k \ f r" "x \ ball k r" + from f[rule_format, of r] \0 < r\ \x \ S\ obtain k where "k \ f r" "x \ ball k r" by auto from \r \ \\ \0 < r\ \k \ f r\ have "ball k r \ K" by (auto simp: K_def) - then show "\b\K. x \ b \ b \ s \ T" + then show "\b\K. x \ b \ b \ S \ T" proof (rule bexI[rotated], safe) fix y assume "y \ ball k r" - with \r < e / 2\ \x \ ball k r\ have "dist x y < e" + with \r < e/2\ \x \ ball k r\ have "dist x y < e" by (intro dist_triangle_half_r [of k _ e]) (auto simp: dist_commute) with \ball x e \ T\ show "y \ T" by auto @@ -1039,7 +1021,7 @@ qed proposition compact_eq_seq_compact_metric: - "compact (s :: 'a::metric_space set) \ seq_compact s" + "compact (S :: 'a::metric_space set) \ seq_compact S" using compact_imp_seq_compact seq_compact_imp_Heine_Borel by blast proposition compact_def: \ \this is the definition of compactness in HOL Light\ @@ -1050,22 +1032,14 @@ subsubsection \Complete the chain of compactness variants\ proposition compact_eq_Bolzano_Weierstrass: - fixes s :: "'a::metric_space set" - shows "compact s \ (\t. infinite t \ t \ s --> (\x \ s. x islimpt t))" - (is "?lhs = ?rhs") -proof - assume ?lhs - then show ?rhs - using Heine_Borel_imp_Bolzano_Weierstrass[of s] by auto -next - assume ?rhs - then show ?lhs - unfolding compact_eq_seq_compact_metric by (rule Bolzano_Weierstrass_imp_seq_compact) -qed + fixes S :: "'a::metric_space set" + shows "compact S \ (\T. infinite T \ T \ S \ (\x \ S. x islimpt T))" + using Bolzano_Weierstrass_imp_seq_compact Heine_Borel_imp_Bolzano_Weierstrass compact_eq_seq_compact_metric + by blast proposition Bolzano_Weierstrass_imp_bounded: - "\t. infinite t \ t \ s \ (\x \ s. x islimpt t) \ bounded s" - using compact_imp_bounded unfolding compact_eq_Bolzano_Weierstrass . + "(\T. \infinite T; T \ S\ \ (\x \ S. x islimpt T)) \ bounded S" + using compact_imp_bounded unfolding compact_eq_Bolzano_Weierstrass by metis subsection \Banach fixed point theorem\ @@ -1182,9 +1156,9 @@ then have "e > 0" unfolding e_def using zero_le_dist[of "f x" x] by (metis dist_eq_0_iff dist_nz e_def) - then obtain N where N:"\n\N. dist (z n) x < e / 2" + then obtain N where N:"\n\N. dist (z n) x < e/2" using x[unfolded lim_sequentially, THEN spec[where x="e/2"]] by auto - then have N':"dist (z N) x < e / 2" by auto + then have N':"dist (z N) x < e/2" by auto have *: "c * dist (z N) x \ dist (z N) x" unfolding mult_le_cancel_right2 using zero_le_dist[of "z N" x] and c @@ -1194,7 +1168,7 @@ using z_in_s[of N] \x\s\ using c by auto - also have "\ < e / 2" + also have "\ < e/2" using N' and c using * by auto finally show False unfolding fzn @@ -1218,43 +1192,43 @@ subsection \Edelstein fixed point theorem\ -theorem edelstein_fix:\ \TODO: rename to \Edelstein_fix\\ - fixes s :: "'a::metric_space set" - assumes s: "compact s" "s \ {}" - and gs: "(g ` s) \ s" - and dist: "\x\s. \y\s. x \ y \ dist (g x) (g y) < dist x y" - shows "\!x\s. g x = x" +theorem Edelstein_fix: + fixes S :: "'a::metric_space set" + assumes S: "compact S" "S \ {}" + and gs: "(g ` S) \ S" + and dist: "\x\S. \y\S. x \ y \ dist (g x) (g y) < dist x y" + shows "\!x\S. g x = x" proof - - let ?D = "(\x. (x, x)) ` s" + let ?D = "(\x. (x, x)) ` S" have D: "compact ?D" "?D \ {}" by (rule compact_continuous_image) - (auto intro!: s continuous_Pair continuous_ident simp: continuous_on_eq_continuous_within) - - have "\x y e. x \ s \ y \ s \ 0 < e \ dist y x < e \ dist (g y) (g x) < e" + (auto intro!: S continuous_Pair continuous_ident simp: continuous_on_eq_continuous_within) + + have "\x y e. x \ S \ y \ S \ 0 < e \ dist y x < e \ dist (g y) (g x) < e" using dist by fastforce - then have "continuous_on s g" + then have "continuous_on S g" by (auto simp: continuous_on_iff) then have cont: "continuous_on ?D (\x. dist ((g \ fst) x) (snd x))" unfolding continuous_on_eq_continuous_within by (intro continuous_dist ballI continuous_within_compose) (auto intro!: continuous_fst continuous_snd continuous_ident simp: image_image) - obtain a where "a \ s" and le: "\x. x \ s \ dist (g a) a \ dist (g x) x" + obtain a where "a \ S" and le: "\x. x \ S \ dist (g a) a \ dist (g x) x" using continuous_attains_inf[OF D cont] by auto have "g a = a" proof (rule ccontr) assume "g a \ a" - with \a \ s\ gs have "dist (g (g a)) (g a) < dist (g a) a" + with \a \ S\ gs have "dist (g (g a)) (g a) < dist (g a) a" by (intro dist[rule_format]) auto moreover have "dist (g a) a \ dist (g (g a)) (g a)" - using \a \ s\ gs by (intro le) auto + using \a \ S\ gs by (intro le) auto ultimately show False by auto qed - moreover have "\x. x \ s \ g x = x \ x = a" - using dist[THEN bspec[where x=a]] \g a = a\ and \a\s\ by auto - ultimately show "\!x\s. g x = x" - using \a \ s\ by blast + moreover have "\x. x \ S \ g x = x \ x = a" + using dist[THEN bspec[where x=a]] \g a = a\ and \a\S\ by auto + ultimately show "\!x\S. g x = x" + using \a \ S\ by blast qed subsection \The diameter of a set\ @@ -1270,72 +1244,68 @@ lemma diameter_le: assumes "S \ {} \ 0 \ d" - and no: "\x y. \x \ S; y \ S\ \ norm(x - y) \ d" - shows "diameter S \ d" -using assms + and no: "\x y. \x \ S; y \ S\ \ norm(x - y) \ d" + shows "diameter S \ d" + using assms by (auto simp: dist_norm diameter_def intro: cSUP_least) lemma diameter_bounded_bound: - fixes s :: "'a :: metric_space set" - assumes s: "bounded s" "x \ s" "y \ s" - shows "dist x y \ diameter s" + fixes S :: "'a :: metric_space set" + assumes S: "bounded S" "x \ S" "y \ S" + shows "dist x y \ diameter S" proof - - from s obtain z d where z: "\x. x \ s \ dist z x \ d" + from S obtain z d where z: "\x. x \ S \ dist z x \ d" unfolding bounded_def by auto - have "bdd_above (case_prod dist ` (s\s))" + have "bdd_above (case_prod dist ` (S\S))" proof (intro bdd_aboveI, safe) fix a b - assume "a \ s" "b \ s" + assume "a \ S" "b \ S" with z[of a] z[of b] dist_triangle[of a b z] show "dist a b \ 2 * d" by (simp add: dist_commute) qed - moreover have "(x,y) \ s\s" using s by auto - ultimately have "dist x y \ (SUP (x,y)\s\s. dist x y)" + moreover have "(x,y) \ S\S" using S by auto + ultimately have "dist x y \ (SUP (x,y)\S\S. dist x y)" by (rule cSUP_upper2) simp - with \x \ s\ show ?thesis + with \x \ S\ show ?thesis by (auto simp: diameter_def) qed lemma diameter_lower_bounded: - fixes s :: "'a :: metric_space set" - assumes s: "bounded s" - and d: "0 < d" "d < diameter s" - shows "\x\s. \y\s. d < dist x y" + fixes S :: "'a :: metric_space set" + assumes S: "bounded S" + and d: "0 < d" "d < diameter S" + shows "\x\S. \y\S. d < dist x y" proof (rule ccontr) assume contr: "\ ?thesis" - moreover have "s \ {}" + moreover have "S \ {}" using d by (auto simp: diameter_def) - ultimately have "diameter s \ d" + ultimately have "diameter S \ d" by (auto simp: not_less diameter_def intro!: cSUP_least) - with \d < diameter s\ show False by auto + with \d < diameter S\ show False by auto qed lemma diameter_bounded: - assumes "bounded s" - shows "\x\s. \y\s. dist x y \ diameter s" - and "\d>0. d < diameter s \ (\x\s. \y\s. dist x y > d)" - using diameter_bounded_bound[of s] diameter_lower_bounded[of s] assms + assumes "bounded S" + shows "\x\S. \y\S. dist x y \ diameter S" + and "\d>0. d < diameter S \ (\x\S. \y\S. dist x y > d)" + using diameter_bounded_bound[of S] diameter_lower_bounded[of S] assms by auto -lemma bounded_two_points: - "bounded S \ (\e. \x\S. \y\S. dist x y \ e)" - apply (rule iffI) - subgoal using diameter_bounded(1) by auto - subgoal using bounded_any_center[of S] by meson - done +lemma bounded_two_points: "bounded S \ (\e. \x\S. \y\S. dist x y \ e)" + by (meson bounded_def diameter_bounded(1)) lemma diameter_compact_attained: - assumes "compact s" - and "s \ {}" - shows "\x\s. \y\s. dist x y = diameter s" + assumes "compact S" + and "S \ {}" + shows "\x\S. \y\S. dist x y = diameter S" proof - - have b: "bounded s" using assms(1) + have b: "bounded S" using assms(1) by (rule compact_imp_bounded) - then obtain x y where xys: "x\s" "y\s" - and xy: "\u\s. \v\s. dist u v \ dist x y" + then obtain x y where xys: "x\S" "y\S" + and xy: "\u\S. \v\S. dist u v \ dist x y" using compact_sup_maxdistance[OF assms] by auto - then have "diameter s \ dist x y" + then have "diameter S \ dist x y" unfolding diameter_def apply clarsimp apply (rule cSUP_least, fast+) @@ -1477,41 +1447,30 @@ "bounded (range f) \ \l r. strict_mono (r::nat\nat) \ ((f \ r) \ l) sequentially" proposition bounded_closed_imp_seq_compact: - fixes s::"'a::heine_borel set" - assumes "bounded s" - and "closed s" - shows "seq_compact s" + fixes S::"'a::heine_borel set" + assumes "bounded S" + and "closed S" + shows "seq_compact S" proof (unfold seq_compact_def, clarify) fix f :: "nat \ 'a" - assume f: "\n. f n \ s" - with \bounded s\ have "bounded (range f)" + assume f: "\n. f n \ S" + with \bounded S\ have "bounded (range f)" by (auto intro: bounded_subset) obtain l r where r: "strict_mono (r :: nat \ nat)" and l: "((f \ r) \ l) sequentially" using bounded_imp_convergent_subsequence [OF \bounded (range f)\] by auto - from f have fr: "\n. (f \ r) n \ s" + from f have fr: "\n. (f \ r) n \ S" by simp - have "l \ s" using \closed s\ fr l + have "l \ S" using \closed S\ fr l by (rule closed_sequentially) - show "\l\s. \r. strict_mono r \ ((f \ r) \ l) sequentially" - using \l \ s\ r l by blast + show "\l\S. \r. strict_mono r \ ((f \ r) \ l) sequentially" + using \l \ S\ r l by blast qed lemma compact_eq_bounded_closed: - fixes s :: "'a::heine_borel set" - shows "compact s \ bounded s \ closed s" - (is "?lhs = ?rhs") -proof - assume ?lhs - then show ?rhs - using compact_imp_closed compact_imp_bounded - by blast -next - assume ?rhs - then show ?lhs - using bounded_closed_imp_seq_compact[of s] - unfolding compact_eq_seq_compact_metric - by auto -qed + fixes S :: "'a::heine_borel set" + shows "compact S \ bounded S \ closed S" + using bounded_closed_imp_seq_compact compact_eq_seq_compact_metric compact_imp_bounded compact_imp_closed + by auto lemma compact_Inter: fixes \ :: "'a :: heine_borel set set" @@ -1675,7 +1634,7 @@ using n M by auto moreover have "r n \ N" using lr'[of n] n by auto - then have "dist (f n) ((f \ r) n) < e / 2" + then have "dist (f n) ((f \ r) n) < e/2" using N and n by auto ultimately have "dist (f n) l < e" using n M by metric @@ -1754,12 +1713,8 @@ moreover have "\i. (f \ t) i \ s" using f by auto moreover - { - fix n - have "(f \ t) n \ F n" - by (cases n) (simp_all add: t_def sel) - } - note t = this + have t: "(f \ t) n \ F n" for n + by (cases n) (simp_all add: t_def sel) have "Cauchy (f \ t)" proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE) @@ -2467,7 +2422,7 @@ by (simp add: field_simps) also have "... < e/2" using N2 \0 < e\ by (simp add: field_simps) - finally have "dist (f (r (max N1 N2))) x < e / 2" . + finally have "dist (f (r (max N1 N2))) x < e/2" . moreover have "dist (f (r (max N1 N2))) l < e/2" using N1 max.cobounded1 by blast ultimately have "dist x l < e" @@ -2491,7 +2446,7 @@ obtain d where d_pos: "\x e. \x \ S; 0 < e\ \ 0 < d x e" and d_dist : "\x x' e f. \dist x' x < d x e; x \ S; x' \ S; 0 < e; f \ \\ \ dist (f x') (f x) < e" using cont by metis - let ?\ = "((\x. ball x (d x (e / 2))) ` S)" + let ?\ = "((\x. ball x (d x (e/2))) ` S)" have Ssub: "S \ \ ?\" by clarsimp (metis d_pos \0 < e\ dist_self half_gt_zero_iff) then obtain k where "0 < k" and k: "\x. x \ S \ \G \ ?\. ball x k \ G" @@ -2501,7 +2456,7 @@ obtain G where "G \ ?\" "u \ G" "v \ G" using k that by (metis \dist v u < k\ \u \ S\ \0 < k\ centre_in_ball subsetD dist_commute mem_ball) - then obtain w where w: "dist w u < d w (e / 2)" "dist w v < d w (e / 2)" "w \ S" + then obtain w where w: "dist w u < d w (e/2)" "dist w v < d w (e/2)" "w \ S" by auto with that d_dist have "dist (f w) (f v) < e/2" by (metis \0 < e\ dist_commute half_gt_zero) @@ -2646,7 +2601,7 @@ show "(\n. f (xs' n)) \ l" proof (rule tendstoI) fix e::real assume "e > 0" - define e' where "e' \ e / 2" + define e' where "e' \ e/2" have "e' > 0" using \e > 0\ by (simp add: e'_def) have "\\<^sub>F n in sequentially. dist (f (xs n)) l < e'" diff -r d36c109bc773 -r 5e26a4bca0c2 src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Fri Aug 28 16:14:19 2020 +0200 +++ b/src/HOL/Analysis/Elementary_Topology.thy Sat Aug 29 16:30:33 2020 +0100 @@ -822,14 +822,10 @@ lemma interior_singleton [simp]: "interior {a} = {}" for a :: "'a::perfect_space" - apply (rule interior_unique, simp_all) - using not_open_singleton subset_singletonD - apply fastforce - done + by (meson interior_eq interior_subset not_open_singleton subset_singletonD) lemma interior_Int [simp]: "interior (S \ T) = interior S \ interior T" - by (intro equalityI Int_mono Int_greatest interior_mono Int_lower1 - Int_lower2 interior_maximal interior_subset open_Int open_interior) + by (meson Int_mono Int_subset_iff antisym_conv interior_maximal interior_subset open_Int open_interior) lemma eventually_nhds_in_nhd: "x \ interior s \ eventually (\y. y \ s) (nhds x)" using interior_subset[of s] by (subst eventually_nhds) blast @@ -2586,10 +2582,7 @@ then have "g ` t = s" by auto ultimately show ?thesis unfolding homeomorphism_def homeomorphic_def - apply (rule_tac x=g in exI) - using g and assms(3) and continuous_on_inv[OF assms(2,1), of g, unfolded assms(3)] and assms(2) - apply auto - done + using assms continuous_on_inv by fastforce qed lemma homeomorphic_compact: