1394 have "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
1394 have "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
1395 by (rule in_closure_iff_infdist_zero) fact |
1395 by (rule in_closure_iff_infdist_zero) fact |
1396 with assms show ?thesis by simp |
1396 with assms show ?thesis by simp |
1397 qed |
1397 qed |
1398 |
1398 |
|
1399 lemma infdist_pos_not_in_closed: |
|
1400 assumes "closed S" "S \<noteq> {}" "x \<notin> S" |
|
1401 shows "infdist x S > 0" |
|
1402 using in_closed_iff_infdist_zero[OF assms(1) assms(2), of x] assms(3) infdist_nonneg le_less by fastforce |
|
1403 |
|
1404 text \<open>Every metric space is a T4 space:\<close> |
|
1405 |
|
1406 instance metric_space \<subseteq> t4_space |
|
1407 proof |
|
1408 fix S T::"'a set" assume H: "closed S" "closed T" "S \<inter> T = {}" |
|
1409 consider "S = {}" | "T = {}" | "S \<noteq> {} \<and> T \<noteq> {}" by auto |
|
1410 then show "\<exists>U V. open U \<and> open V \<and> S \<subseteq> U \<and> T \<subseteq> V \<and> U \<inter> V = {}" |
|
1411 proof (cases) |
|
1412 case 1 |
|
1413 show ?thesis |
|
1414 apply (rule exI[of _ "{}"], rule exI[of _ UNIV]) using 1 by auto |
|
1415 next |
|
1416 case 2 |
|
1417 show ?thesis |
|
1418 apply (rule exI[of _ UNIV], rule exI[of _ "{}"]) using 2 by auto |
|
1419 next |
|
1420 case 3 |
|
1421 define U where "U = (\<Union>x\<in>S. ball x ((infdist x T)/2))" |
|
1422 have A: "open U" unfolding U_def by auto |
|
1423 have "infdist x T > 0" if "x \<in> S" for x |
|
1424 using H that 3 by (auto intro!: infdist_pos_not_in_closed) |
|
1425 then have B: "S \<subseteq> U" unfolding U_def by auto |
|
1426 define V where "V = (\<Union>x\<in>T. ball x ((infdist x S)/2))" |
|
1427 have C: "open V" unfolding V_def by auto |
|
1428 have "infdist x S > 0" if "x \<in> T" for x |
|
1429 using H that 3 by (auto intro!: infdist_pos_not_in_closed) |
|
1430 then have D: "T \<subseteq> V" unfolding V_def by auto |
|
1431 |
|
1432 have "(ball x ((infdist x T)/2)) \<inter> (ball y ((infdist y S)/2)) = {}" if "x \<in> S" "y \<in> T" for x y |
|
1433 proof (auto) |
|
1434 fix z assume H: "dist x z * 2 < infdist x T" "dist y z * 2 < infdist y S" |
|
1435 have "2 * dist x y \<le> 2 * dist x z + 2 * dist y z" |
|
1436 using dist_triangle[of x y z] by (auto simp add: dist_commute) |
|
1437 also have "... < infdist x T + infdist y S" |
|
1438 using H by auto |
|
1439 finally have "dist x y < infdist x T \<or> dist x y < infdist y S" |
|
1440 by auto |
|
1441 then show False |
|
1442 using infdist_le[OF \<open>x \<in> S\<close>, of y] infdist_le[OF \<open>y \<in> T\<close>, of x] by (auto simp add: dist_commute) |
|
1443 qed |
|
1444 then have E: "U \<inter> V = {}" |
|
1445 unfolding U_def V_def by auto |
|
1446 show ?thesis |
|
1447 apply (rule exI[of _ U], rule exI[of _ V]) using A B C D E by auto |
|
1448 qed |
|
1449 qed |
|
1450 |
1399 lemma tendsto_infdist [tendsto_intros]: |
1451 lemma tendsto_infdist [tendsto_intros]: |
1400 assumes f: "(f \<longlongrightarrow> l) F" |
1452 assumes f: "(f \<longlongrightarrow> l) F" |
1401 shows "((\<lambda>x. infdist (f x) A) \<longlongrightarrow> infdist l A) F" |
1453 shows "((\<lambda>x. infdist (f x) A) \<longlongrightarrow> infdist l A) F" |
1402 proof (rule tendstoI) |
1454 proof (rule tendstoI) |
1403 fix e ::real |
1455 fix e ::real |