diff -r 71e1aa0d9421 -r 71366be2c647 src/HOL/Analysis/Abstract_Metric_Spaces.thy --- a/src/HOL/Analysis/Abstract_Metric_Spaces.thy Wed Jul 05 16:50:07 2023 +0100 +++ b/src/HOL/Analysis/Abstract_Metric_Spaces.thy Thu Jul 06 16:59:12 2023 +0100 @@ -144,24 +144,6 @@ by (auto simp: openin_mtopology) qed -(* -lemma metric_injective_image: - "\f m s. - f ` s \ M \ - (\x y. x \ s \ y \ s \ f x = f y \ x = y) - \ (mspace(metric(s,\(x,y). d (f x) (f y))) = s) \ - (d(metric(s,\(x,y). d (f x) (f y))) = - \(x,y). d (f x) (f y))" -oops - REWRITE_TAC[\; FORALL_IN_IMAGE; INJECTIVE_ON_ALT] THEN - REPEAT GEN_TAC THEN STRIP_TAC THEN - REWRITE_TAC[mspace; d; GSYM PAIR_EQ] THEN - REWRITE_TAC[GSYM(CONJUNCT2 metric_tybij); is_metric_space] THEN - REWRITE_TAC[GSYM mspace; GSYM d] THEN - ASM_SIMP_TAC[MDIST_POS_LE; MDIST_TRIANGLE; MDIST_0] THEN - ASM_MESON_TAC[MDIST_SYM]);; -*) - lemma mtopology_base: "mtopology = topology(arbitrary union_of (\U. \x \ M. \r>0. U = mball x r))" proof - @@ -266,8 +248,6 @@ by (metis centre_in_mball_iff gt0 openin_mball topspace_mtopology x y) qed - - subsection\Bounded sets\ definition mbounded where "mbounded S \ (\x B. S \ mcball x B)" @@ -656,6 +636,33 @@ lemma (in Metric_space) metrizable_space_mtopology: "metrizable_space mtopology" using local.Metric_space_axioms metrizable_space_def by blast +lemma (in Metric_space) first_countable_mtopology: "first_countable mtopology" +proof (clarsimp simp add: first_countable_def) + fix x + assume "x \ M" + define \ where "\ \ mball x ` {r \ \. 0 < r}" + show "\\. countable \ \ (\V\\. openin mtopology V) \ (\U. openin mtopology U \ x \ U \ (\V\\. x \ V \ V \ U))" + proof (intro exI conjI ballI) + show "countable \" + by (simp add: \_def countable_rat) + show "\U. openin mtopology U \ x \ U \ (\V\\. x \ V \ V \ U)" + proof clarify + fix U + assume "openin mtopology U" and "x \ U" + then obtain r where "r>0" and r: "mball x r \ U" + by (meson openin_mtopology) + then obtain q where "q \ Rats" "0 < q" "q < r" + using Rats_dense_in_real by blast + then show "\V\\. x \ V \ V \ U" + unfolding \_def using \x \ M\ r by fastforce + qed + qed (auto simp: \_def) +qed + +lemma metrizable_imp_first_countable: + "metrizable_space X \ first_countable X" + by (force simp add: metrizable_space_def Metric_space.first_countable_mtopology) + lemma openin_mtopology_eq_open [simp]: "openin Met_TC.mtopology = open" by (simp add: Met_TC.mtopology_def)