author | wenzelm |
Tue, 21 Jun 2022 15:56:31 +0200 | |
changeset 75575 | 06f8b072f28e |
parent 73933 | fa92bc604c59 |
child 76796 | 454984e807db |
permissions | -rw-r--r-- |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1 |
(* Author: L C Paulson, University of Cambridge |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2 |
Author: Amine Chaieb, University of Cambridge |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
3 |
Author: Robert Himmelmann, TU Muenchen |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
4 |
Author: Brian Huffman, Portland State University |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
5 |
*) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
6 |
|
71198 | 7 |
section \<open>Elementary Metric Spaces\<close> |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
8 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
9 |
theory Elementary_Metric_Spaces |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
10 |
imports |
69616
d18dc9c5c456
split off theory combining Elementary_Topology and Abstract_Topology
immler
parents:
69615
diff
changeset
|
11 |
Abstract_Topology_2 |
70951
678b2abe9f7d
decision procedure for metric spaces, implemented by Maximilian Schäffeler
immler
parents:
70817
diff
changeset
|
12 |
Metric_Arith |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
13 |
begin |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
14 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
15 |
subsection \<open>Open and closed balls\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
16 |
|
70136 | 17 |
definition\<^marker>\<open>tag important\<close> ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
18 |
where "ball x e = {y. dist x y < e}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
19 |
|
70136 | 20 |
definition\<^marker>\<open>tag important\<close> cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
21 |
where "cball x e = {y. dist x y \<le> e}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
22 |
|
70136 | 23 |
definition\<^marker>\<open>tag important\<close> sphere :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
24 |
where "sphere x e = {y. dist x y = e}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
25 |
|
70951
678b2abe9f7d
decision procedure for metric spaces, implemented by Maximilian Schäffeler
immler
parents:
70817
diff
changeset
|
26 |
lemma mem_ball [simp, metric_unfold]: "y \<in> ball x e \<longleftrightarrow> dist x y < e" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
27 |
by (simp add: ball_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
28 |
|
70951
678b2abe9f7d
decision procedure for metric spaces, implemented by Maximilian Schäffeler
immler
parents:
70817
diff
changeset
|
29 |
lemma mem_cball [simp, metric_unfold]: "y \<in> cball x e \<longleftrightarrow> dist x y \<le> e" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
30 |
by (simp add: cball_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
31 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
32 |
lemma mem_sphere [simp]: "y \<in> sphere x e \<longleftrightarrow> dist x y = e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
33 |
by (simp add: sphere_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
34 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
35 |
lemma ball_trivial [simp]: "ball x 0 = {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
36 |
by (simp add: ball_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
37 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
38 |
lemma cball_trivial [simp]: "cball x 0 = {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
39 |
by (simp add: cball_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
40 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
41 |
lemma sphere_trivial [simp]: "sphere x 0 = {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
42 |
by (simp add: sphere_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
43 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
44 |
lemma disjoint_ballI: "dist x y \<ge> r+s \<Longrightarrow> ball x r \<inter> ball y s = {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
45 |
using dist_triangle_less_add not_le by fastforce |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
46 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
47 |
lemma disjoint_cballI: "dist x y > r + s \<Longrightarrow> cball x r \<inter> cball y s = {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
48 |
by (metis add_mono disjoint_iff_not_equal dist_triangle2 dual_order.trans leD mem_cball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
49 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
50 |
lemma sphere_empty [simp]: "r < 0 \<Longrightarrow> sphere a r = {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
51 |
for a :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
52 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
53 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
54 |
lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
55 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
56 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
57 |
lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
58 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
59 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
60 |
lemma ball_subset_cball [simp, intro]: "ball x e \<subseteq> cball x e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
61 |
by (simp add: subset_eq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
62 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
63 |
lemma mem_ball_imp_mem_cball: "x \<in> ball y e \<Longrightarrow> x \<in> cball y e" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
64 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
65 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
66 |
lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
67 |
by force |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
68 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
69 |
lemma cball_diff_sphere: "cball a r - sphere a r = ball a r" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
70 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
71 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
72 |
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
73 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
74 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
75 |
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
76 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
77 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
78 |
lemma mem_ball_leI: "x \<in> ball y e \<Longrightarrow> e \<le> f \<Longrightarrow> x \<in> ball y f" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
79 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
80 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
81 |
lemma mem_cball_leI: "x \<in> cball y e \<Longrightarrow> e \<le> f \<Longrightarrow> x \<in> cball y f" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
82 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
83 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
84 |
lemma cball_trans: "y \<in> cball z b \<Longrightarrow> x \<in> cball y a \<Longrightarrow> x \<in> cball z (b + a)" |
70960 | 85 |
by metric |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
86 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
87 |
lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
88 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
89 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
90 |
lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
91 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
92 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
93 |
lemma cball_max_Un: "cball a (max r s) = cball a r \<union> cball a s" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
94 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
95 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
96 |
lemma cball_min_Int: "cball a (min r s) = cball a r \<inter> cball a s" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
97 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
98 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
99 |
lemma cball_diff_eq_sphere: "cball a r - ball a r = sphere a r" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
100 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
101 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
102 |
lemma open_ball [intro, simp]: "open (ball x e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
103 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
104 |
have "open (dist x -` {..<e})" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
105 |
by (intro open_vimage open_lessThan continuous_intros) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
106 |
also have "dist x -` {..<e} = ball x e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
107 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
108 |
finally show ?thesis . |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
109 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
110 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
111 |
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)" |
71633 | 112 |
by (simp add: open_dist subset_eq Ball_def dist_commute) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
113 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
114 |
lemma openI [intro?]: "(\<And>x. x\<in>S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
115 |
by (auto simp: open_contains_ball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
116 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
117 |
lemma openE[elim?]: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
118 |
assumes "open S" "x\<in>S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
119 |
obtains e where "e>0" "ball x e \<subseteq> S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
120 |
using assms unfolding open_contains_ball by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
121 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
122 |
lemma open_contains_ball_eq: "open S \<Longrightarrow> x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
123 |
by (metis open_contains_ball subset_eq centre_in_ball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
124 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
125 |
lemma ball_eq_empty[simp]: "ball x e = {} \<longleftrightarrow> e \<le> 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
126 |
unfolding mem_ball set_eq_iff |
70960 | 127 |
by (simp add: not_less) metric |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
128 |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
129 |
lemma ball_empty: "e \<le> 0 \<Longrightarrow> ball x e = {}" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
130 |
by simp |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
131 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
132 |
lemma closed_cball [iff]: "closed (cball x e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
133 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
134 |
have "closed (dist x -` {..e})" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
135 |
by (intro closed_vimage closed_atMost continuous_intros) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
136 |
also have "dist x -` {..e} = cball x e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
137 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
138 |
finally show ?thesis . |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
139 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
140 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
141 |
lemma open_contains_cball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. cball x e \<subseteq> S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
142 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
143 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
144 |
fix x and e::real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
145 |
assume "x\<in>S" "e>0" "ball x e \<subseteq> S" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
146 |
then have "\<exists>d>0. cball x d \<subseteq> S" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
147 |
unfolding subset_eq by (rule_tac x="e/2" in exI, auto) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
148 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
149 |
moreover |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
150 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
151 |
fix x and e::real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
152 |
assume "x\<in>S" "e>0" "cball x e \<subseteq> S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
153 |
then have "\<exists>d>0. ball x d \<subseteq> S" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
154 |
using mem_ball_imp_mem_cball by blast |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
155 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
156 |
ultimately show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
157 |
unfolding open_contains_ball by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
158 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
159 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
160 |
lemma open_contains_cball_eq: "open S \<Longrightarrow> (\<forall>x. x \<in> S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
161 |
by (metis open_contains_cball subset_eq order_less_imp_le centre_in_cball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
162 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
163 |
lemma eventually_nhds_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>x. x \<in> ball z d) (nhds z)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
164 |
by (rule eventually_nhds_in_open) simp_all |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
165 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
166 |
lemma eventually_at_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<in> A) (at z within A)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
167 |
unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
168 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
169 |
lemma eventually_at_ball': "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<noteq> z \<and> t \<in> A) (at z within A)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
170 |
unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
171 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
172 |
lemma at_within_ball: "e > 0 \<Longrightarrow> dist x y < e \<Longrightarrow> at y within ball x e = at y" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
173 |
by (subst at_within_open) auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
174 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
175 |
lemma atLeastAtMost_eq_cball: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
176 |
fixes a b::real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
177 |
shows "{a .. b} = cball ((a + b)/2) ((b - a)/2)" |
71174 | 178 |
by (auto simp: dist_real_def field_simps) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
179 |
|
71028
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
180 |
lemma cball_eq_atLeastAtMost: |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
181 |
fixes a b::real |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
182 |
shows "cball a b = {a - b .. a + b}" |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
183 |
by (auto simp: dist_real_def) |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
184 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
185 |
lemma greaterThanLessThan_eq_ball: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
186 |
fixes a b::real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
187 |
shows "{a <..< b} = ball ((a + b)/2) ((b - a)/2)" |
71174 | 188 |
by (auto simp: dist_real_def field_simps) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
189 |
|
71028
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
190 |
lemma ball_eq_greaterThanLessThan: |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
191 |
fixes a b::real |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
192 |
shows "ball a b = {a - b <..< a + b}" |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
193 |
by (auto simp: dist_real_def) |
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
immler
parents:
70960
diff
changeset
|
194 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
195 |
lemma interior_ball [simp]: "interior (ball x e) = ball x e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
196 |
by (simp add: interior_open) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
197 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
198 |
lemma cball_eq_empty [simp]: "cball x e = {} \<longleftrightarrow> e < 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
199 |
apply (simp add: set_eq_iff not_le) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
200 |
apply (metis zero_le_dist dist_self order_less_le_trans) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
201 |
done |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
202 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
203 |
lemma cball_empty [simp]: "e < 0 \<Longrightarrow> cball x e = {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
204 |
by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
205 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
206 |
lemma cball_sing: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
207 |
fixes x :: "'a::metric_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
208 |
shows "e = 0 \<Longrightarrow> cball x e = {x}" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
209 |
by simp |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
210 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
211 |
lemma ball_divide_subset: "d \<ge> 1 \<Longrightarrow> ball x (e/d) \<subseteq> ball x e" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
212 |
by (metis ball_eq_empty div_by_1 frac_le linear subset_ball zero_less_one) |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
213 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
214 |
lemma ball_divide_subset_numeral: "ball x (e / numeral w) \<subseteq> ball x e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
215 |
using ball_divide_subset one_le_numeral by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
216 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
217 |
lemma cball_divide_subset: "d \<ge> 1 \<Longrightarrow> cball x (e/d) \<subseteq> cball x e" |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
218 |
apply (cases "e < 0", simp add: field_split_simps) |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
219 |
by (metis div_by_1 frac_le less_numeral_extra(1) not_le order_refl subset_cball) |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
220 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
221 |
lemma cball_divide_subset_numeral: "cball x (e / numeral w) \<subseteq> cball x e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
222 |
using cball_divide_subset one_le_numeral by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
223 |
|
71192
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
224 |
lemma cball_scale: |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
225 |
assumes "a \<noteq> 0" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
226 |
shows "(\<lambda>x. a *\<^sub>R x) ` cball c r = cball (a *\<^sub>R c :: 'a :: real_normed_vector) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
227 |
proof - |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
228 |
have 1: "(\<lambda>x. a *\<^sub>R x) ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)" if "a \<noteq> 0" for a r and c :: 'a |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
229 |
proof safe |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
230 |
fix x |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
231 |
assume x: "x \<in> cball c r" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
232 |
have "dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
233 |
by (auto simp: dist_norm) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
234 |
also have "a *\<^sub>R c - a *\<^sub>R x = a *\<^sub>R (c - x)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
235 |
by (simp add: algebra_simps) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
236 |
finally show "a *\<^sub>R x \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
237 |
using that x by (auto simp: dist_norm) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
238 |
qed |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
239 |
|
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
240 |
have "cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (\<lambda>x. a *\<^sub>R x) ` (\<lambda>x. inverse a *\<^sub>R x) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
241 |
unfolding image_image using assms by simp |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
242 |
also have "\<dots> \<subseteq> (\<lambda>x. a *\<^sub>R x) ` cball (inverse a *\<^sub>R (a *\<^sub>R c)) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
243 |
using assms by (intro image_mono 1) auto |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
244 |
also have "\<dots> = (\<lambda>x. a *\<^sub>R x) ` cball c r" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
245 |
using assms by (simp add: algebra_simps) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
246 |
finally have "cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (\<lambda>x. a *\<^sub>R x) ` cball c r" . |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
247 |
moreover from assms have "(\<lambda>x. a *\<^sub>R x) ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
248 |
by (intro 1) auto |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
249 |
ultimately show ?thesis by blast |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
250 |
qed |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
251 |
|
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
252 |
lemma ball_scale: |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
253 |
assumes "a \<noteq> 0" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
254 |
shows "(\<lambda>x. a *\<^sub>R x) ` ball c r = ball (a *\<^sub>R c :: 'a :: real_normed_vector) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
255 |
proof - |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
256 |
have 1: "(\<lambda>x. a *\<^sub>R x) ` ball c r \<subseteq> ball (a *\<^sub>R c) (\<bar>a\<bar> * r)" if "a \<noteq> 0" for a r and c :: 'a |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
257 |
proof safe |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
258 |
fix x |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
259 |
assume x: "x \<in> ball c r" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
260 |
have "dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
261 |
by (auto simp: dist_norm) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
262 |
also have "a *\<^sub>R c - a *\<^sub>R x = a *\<^sub>R (c - x)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
263 |
by (simp add: algebra_simps) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
264 |
finally show "a *\<^sub>R x \<in> ball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
265 |
using that x by (auto simp: dist_norm) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
266 |
qed |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
267 |
|
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
268 |
have "ball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (\<lambda>x. a *\<^sub>R x) ` (\<lambda>x. inverse a *\<^sub>R x) ` ball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
269 |
unfolding image_image using assms by simp |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
270 |
also have "\<dots> \<subseteq> (\<lambda>x. a *\<^sub>R x) ` ball (inverse a *\<^sub>R (a *\<^sub>R c)) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
271 |
using assms by (intro image_mono 1) auto |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
272 |
also have "\<dots> = (\<lambda>x. a *\<^sub>R x) ` ball c r" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
273 |
using assms by (simp add: algebra_simps) |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
274 |
finally have "ball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (\<lambda>x. a *\<^sub>R x) ` ball c r" . |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
275 |
moreover from assms have "(\<lambda>x. a *\<^sub>R x) ` ball c r \<subseteq> ball (a *\<^sub>R c) (\<bar>a\<bar> * r)" |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
276 |
by (intro 1) auto |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
277 |
ultimately show ?thesis by blast |
a8ccea88b725
Flattened dependency tree of HOL-Analysis
Manuel Eberl <eberlm@in.tum.de>
parents:
71174
diff
changeset
|
278 |
qed |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
279 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
280 |
subsection \<open>Limit Points\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
281 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
282 |
lemma islimpt_approachable: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
283 |
fixes x :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
284 |
shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
285 |
unfolding islimpt_iff_eventually eventually_at by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
286 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
287 |
lemma islimpt_approachable_le: "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
288 |
for x :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
289 |
unfolding islimpt_approachable |
72225 | 290 |
using approachable_lt_le2 [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x" and Q="\<lambda>x. True"] |
291 |
by auto |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
292 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
293 |
lemma limpt_of_limpts: "x islimpt {y. y islimpt S} \<Longrightarrow> x islimpt S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
294 |
for x :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
295 |
apply (clarsimp simp add: islimpt_approachable) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
296 |
apply (drule_tac x="e/2" in spec) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
297 |
apply (auto simp: simp del: less_divide_eq_numeral1) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
298 |
apply (drule_tac x="dist x' x" in spec) |
71174 | 299 |
apply (auto simp del: less_divide_eq_numeral1) |
70960 | 300 |
apply metric |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
301 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
302 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
303 |
lemma closed_limpts: "closed {x::'a::metric_space. x islimpt S}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
304 |
using closed_limpt limpt_of_limpts by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
305 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
306 |
lemma limpt_of_closure: "x islimpt closure S \<longleftrightarrow> x islimpt S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
307 |
for x :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
308 |
by (auto simp: closure_def islimpt_Un dest: limpt_of_limpts) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
309 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
310 |
lemma islimpt_eq_infinite_ball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> ball x e))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
311 |
apply (simp add: islimpt_eq_acc_point, safe) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
312 |
apply (metis Int_commute open_ball centre_in_ball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
313 |
by (metis open_contains_ball Int_mono finite_subset inf_commute subset_refl) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
314 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
315 |
lemma islimpt_eq_infinite_cball: "x islimpt S \<longleftrightarrow> (\<forall>e>0. infinite(S \<inter> cball x e))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
316 |
apply (simp add: islimpt_eq_infinite_ball, safe) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
317 |
apply (meson Int_mono ball_subset_cball finite_subset order_refl) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
318 |
by (metis open_ball centre_in_ball finite_Int inf.absorb_iff2 inf_assoc open_contains_cball_eq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
319 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
320 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
321 |
subsection \<open>Perfect Metric Spaces\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
322 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
323 |
lemma perfect_choose_dist: "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
324 |
for x :: "'a::{perfect_space,metric_space}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
325 |
using islimpt_UNIV [of x] by (simp add: islimpt_approachable) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
326 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
327 |
lemma cball_eq_sing: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
328 |
fixes x :: "'a::{metric_space,perfect_space}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
329 |
shows "cball x e = {x} \<longleftrightarrow> e = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
330 |
proof (rule linorder_cases) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
331 |
assume e: "0 < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
332 |
obtain a where "a \<noteq> x" "dist a x < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
333 |
using perfect_choose_dist [OF e] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
334 |
then have "a \<noteq> x" "dist x a \<le> e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
335 |
by (auto simp: dist_commute) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
336 |
with e show ?thesis by (auto simp: set_eq_iff) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
337 |
qed auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
338 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
339 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
340 |
subsection \<open>?\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
341 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
342 |
lemma finite_ball_include: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
343 |
fixes a :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
344 |
assumes "finite S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
345 |
shows "\<exists>e>0. S \<subseteq> ball a e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
346 |
using assms |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
347 |
proof induction |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
348 |
case (insert x S) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
349 |
then obtain e0 where "e0>0" and e0:"S \<subseteq> ball a e0" by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
350 |
define e where "e = max e0 (2 * dist a x)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
351 |
have "e>0" unfolding e_def using \<open>e0>0\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
352 |
moreover have "insert x S \<subseteq> ball a e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
353 |
using e0 \<open>e>0\<close> unfolding e_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
354 |
ultimately show ?case by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
355 |
qed (auto intro: zero_less_one) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
356 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
357 |
lemma finite_set_avoid: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
358 |
fixes a :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
359 |
assumes "finite S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
360 |
shows "\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<longrightarrow> d \<le> dist a x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
361 |
using assms |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
362 |
proof induction |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
363 |
case (insert x S) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
364 |
then obtain d where "d > 0" and d: "\<forall>x\<in>S. x \<noteq> a \<longrightarrow> d \<le> dist a x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
365 |
by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
366 |
show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
367 |
proof (cases "x = a") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
368 |
case True |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
369 |
with \<open>d > 0 \<close>d show ?thesis by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
370 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
371 |
case False |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
372 |
let ?d = "min d (dist a x)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
373 |
from False \<open>d > 0\<close> have dp: "?d > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
374 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
375 |
from d have d': "\<forall>x\<in>S. x \<noteq> a \<longrightarrow> ?d \<le> dist a x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
376 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
377 |
with dp False show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
378 |
by (metis insert_iff le_less min_less_iff_conj not_less) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
379 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
380 |
qed (auto intro: zero_less_one) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
381 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
382 |
lemma discrete_imp_closed: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
383 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
384 |
assumes e: "0 < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
385 |
and d: "\<forall>x \<in> S. \<forall>y \<in> S. dist y x < e \<longrightarrow> y = x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
386 |
shows "closed S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
387 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
388 |
have False if C: "\<And>e. e>0 \<Longrightarrow> \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" for x |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
389 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
390 |
from e have e2: "e/2 > 0" by arith |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
391 |
from C[rule_format, OF e2] obtain y where y: "y \<in> S" "y \<noteq> x" "dist y x < e/2" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
392 |
by blast |
70960 | 393 |
from e2 y(2) have mp: "min (e/2) (dist x y) > 0" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
394 |
by simp |
70960 | 395 |
from d y C[OF mp] show ?thesis |
396 |
by metric |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
397 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
398 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
399 |
by (metis islimpt_approachable closed_limpt [where 'a='a]) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
400 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
401 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
402 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
403 |
subsection \<open>Interior\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
404 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
405 |
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
406 |
using open_contains_ball_eq [where S="interior S"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
407 |
by (simp add: open_subset_interior) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
408 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
409 |
lemma mem_interior_cball: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
410 |
by (meson ball_subset_cball interior_subset mem_interior open_contains_cball open_interior |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
411 |
subset_trans) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
412 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
413 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
414 |
subsection \<open>Frontier\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
415 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
416 |
lemma frontier_straddle: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
417 |
fixes a :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
418 |
shows "a \<in> frontier S \<longleftrightarrow> (\<forall>e>0. (\<exists>x\<in>S. dist a x < e) \<and> (\<exists>x. x \<notin> S \<and> dist a x < e))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
419 |
unfolding frontier_def closure_interior |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
420 |
by (auto simp: mem_interior subset_eq ball_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
421 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
422 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
423 |
subsection \<open>Limits\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
424 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
425 |
proposition Lim: "(f \<longlongrightarrow> l) net \<longleftrightarrow> trivial_limit net \<or> (\<forall>e>0. eventually (\<lambda>x. dist (f x) l < e) net)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
426 |
by (auto simp: tendsto_iff trivial_limit_eq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
427 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
428 |
text \<open>Show that they yield usual definitions in the various cases.\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
429 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
430 |
proposition Lim_within_le: "(f \<longlongrightarrow> l)(at a within S) \<longleftrightarrow> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
431 |
(\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a \<le> d \<longrightarrow> dist (f x) l < e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
432 |
by (auto simp: tendsto_iff eventually_at_le) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
433 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
434 |
proposition Lim_within: "(f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
435 |
(\<forall>e >0. \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
436 |
by (auto simp: tendsto_iff eventually_at) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
437 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
438 |
corollary Lim_withinI [intro?]: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
439 |
assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l \<le> e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
440 |
shows "(f \<longlongrightarrow> l) (at a within S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
441 |
apply (simp add: Lim_within, clarify) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
442 |
apply (rule ex_forward [OF assms [OF half_gt_zero]], auto) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
443 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
444 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
445 |
proposition Lim_at: "(f \<longlongrightarrow> l) (at a) \<longleftrightarrow> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
446 |
(\<forall>e >0. \<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
447 |
by (auto simp: tendsto_iff eventually_at) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
448 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
449 |
lemma Lim_transform_within_set: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
450 |
fixes a :: "'a::metric_space" and l :: "'b::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
451 |
shows "\<lbrakk>(f \<longlongrightarrow> l) (at a within S); eventually (\<lambda>x. x \<in> S \<longleftrightarrow> x \<in> T) (at a)\<rbrakk> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
452 |
\<Longrightarrow> (f \<longlongrightarrow> l) (at a within T)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
453 |
apply (clarsimp simp: eventually_at Lim_within) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
454 |
apply (drule_tac x=e in spec, clarify) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
455 |
apply (rename_tac k) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
456 |
apply (rule_tac x="min d k" in exI, simp) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
457 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
458 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
459 |
text \<open>Another limit point characterization.\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
460 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
461 |
lemma limpt_sequential_inj: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
462 |
fixes x :: "'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
463 |
shows "x islimpt S \<longleftrightarrow> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
464 |
(\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> inj f \<and> (f \<longlongrightarrow> x) sequentially)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
465 |
(is "?lhs = ?rhs") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
466 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
467 |
assume ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
468 |
then have "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
469 |
by (force simp: islimpt_approachable) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
470 |
then obtain y where y: "\<And>e. e>0 \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
471 |
by metis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
472 |
define f where "f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse(2 ^ (Suc n))) (dist fn x)))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
473 |
have [simp]: "f 0 = y 1" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
474 |
"f(Suc n) = y (min (inverse(2 ^ (Suc n))) (dist (f n) x))" for n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
475 |
by (simp_all add: f_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
476 |
have f: "f n \<in> S \<and> (f n \<noteq> x) \<and> dist (f n) x < inverse(2 ^ n)" for n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
477 |
proof (induction n) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
478 |
case 0 show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
479 |
by (simp add: y) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
480 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
481 |
case (Suc n) then show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
482 |
apply (auto simp: y) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
483 |
by (metis half_gt_zero_iff inverse_positive_iff_positive less_divide_eq_numeral1(1) min_less_iff_conj y zero_less_dist_iff zero_less_numeral zero_less_power) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
484 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
485 |
show ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
486 |
proof (rule_tac x=f in exI, intro conjI allI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
487 |
show "\<And>n. f n \<in> S - {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
488 |
using f by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
489 |
have "dist (f n) x < dist (f m) x" if "m < n" for m n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
490 |
using that |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
491 |
proof (induction n) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
492 |
case 0 then show ?case by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
493 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
494 |
case (Suc n) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
495 |
then consider "m < n" | "m = n" using less_Suc_eq by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
496 |
then show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
497 |
proof cases |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
498 |
assume "m < n" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
499 |
have "dist (f(Suc n)) x = dist (y (min (inverse(2 ^ (Suc n))) (dist (f n) x))) x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
500 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
501 |
also have "\<dots> < dist (f n) x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
502 |
by (metis dist_pos_lt f min.strict_order_iff min_less_iff_conj y) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
503 |
also have "\<dots> < dist (f m) x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
504 |
using Suc.IH \<open>m < n\<close> by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
505 |
finally show ?thesis . |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
506 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
507 |
assume "m = n" then show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
508 |
by simp (metis dist_pos_lt f half_gt_zero_iff inverse_positive_iff_positive min_less_iff_conj y zero_less_numeral zero_less_power) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
509 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
510 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
511 |
then show "inj f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
512 |
by (metis less_irrefl linorder_injI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
513 |
show "f \<longlonglongrightarrow> x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
514 |
apply (rule tendstoI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
515 |
apply (rule_tac c="nat (ceiling(1/e))" in eventually_sequentiallyI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
516 |
apply (rule less_trans [OF f [THEN conjunct2, THEN conjunct2]]) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
517 |
apply (simp add: field_simps) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
518 |
by (meson le_less_trans mult_less_cancel_left not_le of_nat_less_two_power) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
519 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
520 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
521 |
assume ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
522 |
then show ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
523 |
by (fastforce simp add: islimpt_approachable lim_sequentially) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
524 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
525 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
526 |
lemma Lim_dist_ubound: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
527 |
assumes "\<not>(trivial_limit net)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
528 |
and "(f \<longlongrightarrow> l) net" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
529 |
and "eventually (\<lambda>x. dist a (f x) \<le> e) net" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
530 |
shows "dist a l \<le> e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
531 |
using assms by (fast intro: tendsto_le tendsto_intros) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
532 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
533 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
534 |
subsection \<open>Continuity\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
535 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
536 |
text\<open>Derive the epsilon-delta forms, which we often use as "definitions"\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
537 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
538 |
proposition continuous_within_eps_delta: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
539 |
"continuous (at x within s) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'\<in> s. dist x' x < d --> dist (f x') (f x) < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
540 |
unfolding continuous_within and Lim_within by fastforce |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
541 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
542 |
corollary continuous_at_eps_delta: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
543 |
"continuous (at x) f \<longleftrightarrow> (\<forall>e > 0. \<exists>d > 0. \<forall>x'. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
544 |
using continuous_within_eps_delta [of x UNIV f] by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
545 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
546 |
lemma continuous_at_right_real_increasing: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
547 |
fixes f :: "real \<Rightarrow> real" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
548 |
assumes nondecF: "\<And>x y. x \<le> y \<Longrightarrow> f x \<le> f y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
549 |
shows "continuous (at_right a) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f (a + d) - f a < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
550 |
apply (simp add: greaterThan_def dist_real_def continuous_within Lim_within_le) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
551 |
apply (intro all_cong ex_cong, safe) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
552 |
apply (erule_tac x="a + d" in allE, simp) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
553 |
apply (simp add: nondecF field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
554 |
apply (drule nondecF, simp) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
555 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
556 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
557 |
lemma continuous_at_left_real_increasing: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
558 |
assumes nondecF: "\<And> x y. x \<le> y \<Longrightarrow> f x \<le> ((f y) :: real)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
559 |
shows "(continuous (at_left (a :: real)) f) = (\<forall>e > 0. \<exists>delta > 0. f a - f (a - delta) < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
560 |
apply (simp add: lessThan_def dist_real_def continuous_within Lim_within_le) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
561 |
apply (intro all_cong ex_cong, safe) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
562 |
apply (erule_tac x="a - d" in allE, simp) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
563 |
apply (simp add: nondecF field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
564 |
apply (cut_tac x="a - d" and y=x in nondecF, simp_all) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
565 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
566 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
567 |
text\<open>Versions in terms of open balls.\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
568 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
569 |
lemma continuous_within_ball: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
570 |
"continuous (at x within s) f \<longleftrightarrow> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
571 |
(\<forall>e > 0. \<exists>d > 0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
572 |
(is "?lhs = ?rhs") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
573 |
proof |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
574 |
assume ?lhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
575 |
{ |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
576 |
fix e :: real |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
577 |
assume "e > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
578 |
then obtain d where d: "d>0" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
579 |
using \<open>?lhs\<close>[unfolded continuous_within Lim_within] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
580 |
{ |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
581 |
fix y |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
582 |
assume "y \<in> f ` (ball x d \<inter> s)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
583 |
then have "y \<in> ball (f x) e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
584 |
using d(2) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
585 |
using \<open>e > 0\<close> |
70960 | 586 |
by (auto simp: dist_commute) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
587 |
} |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
588 |
then have "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
589 |
using \<open>d > 0\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
590 |
unfolding subset_eq ball_def by (auto simp: dist_commute) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
591 |
} |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
592 |
then show ?rhs by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
593 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
594 |
assume ?rhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
595 |
then show ?lhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
596 |
unfolding continuous_within Lim_within ball_def subset_eq |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
597 |
apply (auto simp: dist_commute) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
598 |
apply (erule_tac x=e in allE, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
599 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
600 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
601 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
602 |
lemma continuous_at_ball: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
603 |
"continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f ` (ball x d) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
604 |
proof |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
605 |
assume ?lhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
606 |
then show ?rhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
607 |
unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
72225 | 608 |
by (metis dist_commute dist_pos_lt dist_self) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
609 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
610 |
assume ?rhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
611 |
then show ?lhs |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
612 |
unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
72225 | 613 |
by (metis dist_commute) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
614 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
615 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
616 |
text\<open>Define setwise continuity in terms of limits within the set.\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
617 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
618 |
lemma continuous_on_iff: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
619 |
"continuous_on s f \<longleftrightarrow> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
620 |
(\<forall>x\<in>s. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
621 |
unfolding continuous_on_def Lim_within |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
622 |
by (metis dist_pos_lt dist_self) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
623 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
624 |
lemma continuous_within_E: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
625 |
assumes "continuous (at x within s) f" "e>0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
626 |
obtains d where "d>0" "\<And>x'. \<lbrakk>x'\<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
627 |
using assms apply (simp add: continuous_within_eps_delta) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
628 |
apply (drule spec [of _ e], clarify) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
629 |
apply (rule_tac d="d/2" in that, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
630 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
631 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
632 |
lemma continuous_onI [intro?]: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
633 |
assumes "\<And>x e. \<lbrakk>e > 0; x \<in> s\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) \<le> e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
634 |
shows "continuous_on s f" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
635 |
apply (simp add: continuous_on_iff, clarify) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
636 |
apply (rule ex_forward [OF assms [OF half_gt_zero]], auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
637 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
638 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
639 |
text\<open>Some simple consequential lemmas.\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
640 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
641 |
lemma continuous_onE: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
642 |
assumes "continuous_on s f" "x\<in>s" "e>0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
643 |
obtains d where "d>0" "\<And>x'. \<lbrakk>x' \<in> s; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
644 |
using assms |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
645 |
apply (simp add: continuous_on_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
646 |
apply (elim ballE allE) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
647 |
apply (auto intro: that [where d="d/2" for d]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
648 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
649 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
650 |
text\<open>The usual transformation theorems.\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
651 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
652 |
lemma continuous_transform_within: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
653 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
654 |
assumes "continuous (at x within s) f" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
655 |
and "0 < d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
656 |
and "x \<in> s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
657 |
and "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
658 |
shows "continuous (at x within s) g" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
659 |
using assms |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
660 |
unfolding continuous_within |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
661 |
by (force intro: Lim_transform_within) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
662 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
663 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
664 |
subsection \<open>Closure and Limit Characterization\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
665 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
666 |
lemma closure_approachable: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
667 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
668 |
shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
669 |
apply (auto simp: closure_def islimpt_approachable) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
670 |
apply (metis dist_self) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
671 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
672 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
673 |
lemma closure_approachable_le: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
674 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
675 |
shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x \<le> e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
676 |
unfolding closure_approachable |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
677 |
using dense by force |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
678 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
679 |
lemma closure_approachableD: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
680 |
assumes "x \<in> closure S" "e>0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
681 |
shows "\<exists>y\<in>S. dist x y < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
682 |
using assms unfolding closure_approachable by (auto simp: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
683 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
684 |
lemma closed_approachable: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
685 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
686 |
shows "closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
687 |
by (metis closure_closed closure_approachable) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
688 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
689 |
lemma closure_contains_Inf: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
690 |
fixes S :: "real set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
691 |
assumes "S \<noteq> {}" "bdd_below S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
692 |
shows "Inf S \<in> closure S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
693 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
694 |
have *: "\<forall>x\<in>S. Inf S \<le> x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
695 |
using cInf_lower[of _ S] assms by metis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
696 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
697 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
698 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
699 |
then have "Inf S < Inf S + e" by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
700 |
with assms obtain x where "x \<in> S" "x < Inf S + e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
701 |
by (subst (asm) cInf_less_iff) auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
702 |
with * have "\<exists>x\<in>S. dist x (Inf S) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
703 |
by (intro bexI[of _ x]) (auto simp: dist_real_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
704 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
705 |
then show ?thesis unfolding closure_approachable by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
706 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
707 |
|
70617 | 708 |
lemma closure_contains_Sup: |
709 |
fixes S :: "real set" |
|
710 |
assumes "S \<noteq> {}" "bdd_above S" |
|
711 |
shows "Sup S \<in> closure S" |
|
712 |
proof - |
|
713 |
have *: "\<forall>x\<in>S. x \<le> Sup S" |
|
714 |
using cSup_upper[of _ S] assms by metis |
|
715 |
{ |
|
716 |
fix e :: real |
|
717 |
assume "e > 0" |
|
718 |
then have "Sup S - e < Sup S" by simp |
|
719 |
with assms obtain x where "x \<in> S" "Sup S - e < x" |
|
720 |
by (subst (asm) less_cSup_iff) auto |
|
721 |
with * have "\<exists>x\<in>S. dist x (Sup S) < e" |
|
722 |
by (intro bexI[of _ x]) (auto simp: dist_real_def) |
|
723 |
} |
|
724 |
then show ?thesis unfolding closure_approachable by auto |
|
725 |
qed |
|
726 |
||
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
727 |
lemma not_trivial_limit_within_ball: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
728 |
"\<not> trivial_limit (at x within S) \<longleftrightarrow> (\<forall>e>0. S \<inter> ball x e - {x} \<noteq> {})" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
729 |
(is "?lhs \<longleftrightarrow> ?rhs") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
730 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
731 |
show ?rhs if ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
732 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
733 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
734 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
735 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
736 |
then obtain y where "y \<in> S - {x}" and "dist y x < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
737 |
using \<open>?lhs\<close> not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
738 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
739 |
then have "y \<in> S \<inter> ball x e - {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
740 |
unfolding ball_def by (simp add: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
741 |
then have "S \<inter> ball x e - {x} \<noteq> {}" by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
742 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
743 |
then show ?thesis by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
744 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
745 |
show ?lhs if ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
746 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
747 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
748 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
749 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
750 |
then obtain y where "y \<in> S \<inter> ball x e - {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
751 |
using \<open>?rhs\<close> by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
752 |
then have "y \<in> S - {x}" and "dist y x < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
753 |
unfolding ball_def by (simp_all add: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
754 |
then have "\<exists>y \<in> S - {x}. dist y x < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
755 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
756 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
757 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
758 |
using not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
759 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
760 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
761 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
762 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
763 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
764 |
subsection \<open>Boundedness\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
765 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
766 |
(* FIXME: This has to be unified with BSEQ!! *) |
70136 | 767 |
definition\<^marker>\<open>tag important\<close> (in metric_space) bounded :: "'a set \<Rightarrow> bool" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
768 |
where "bounded S \<longleftrightarrow> (\<exists>x e. \<forall>y\<in>S. dist x y \<le> e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
769 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
770 |
lemma bounded_subset_cball: "bounded S \<longleftrightarrow> (\<exists>e x. S \<subseteq> cball x e \<and> 0 \<le> e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
771 |
unfolding bounded_def subset_eq by auto (meson order_trans zero_le_dist) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
772 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
773 |
lemma bounded_any_center: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>y\<in>S. dist a y \<le> e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
774 |
unfolding bounded_def |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
775 |
by auto (metis add.commute add_le_cancel_right dist_commute dist_triangle_le) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
776 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
777 |
lemma bounded_iff: "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. norm x \<le> a)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
778 |
unfolding bounded_any_center [where a=0] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
779 |
by (simp add: dist_norm) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
780 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
781 |
lemma bdd_above_norm: "bdd_above (norm ` X) \<longleftrightarrow> bounded X" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
782 |
by (simp add: bounded_iff bdd_above_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
783 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
784 |
lemma bounded_norm_comp: "bounded ((\<lambda>x. norm (f x)) ` S) = bounded (f ` S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
785 |
by (simp add: bounded_iff) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
786 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
787 |
lemma boundedI: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
788 |
assumes "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> B" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
789 |
shows "bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
790 |
using assms bounded_iff by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
791 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
792 |
lemma bounded_empty [simp]: "bounded {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
793 |
by (simp add: bounded_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
794 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
795 |
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
796 |
by (metis bounded_def subset_eq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
797 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
798 |
lemma bounded_interior[intro]: "bounded S \<Longrightarrow> bounded(interior S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
799 |
by (metis bounded_subset interior_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
800 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
801 |
lemma bounded_closure[intro]: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
802 |
assumes "bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
803 |
shows "bounded (closure S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
804 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
805 |
from assms obtain x and a where a: "\<forall>y\<in>S. dist x y \<le> a" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
806 |
unfolding bounded_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
807 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
808 |
fix y |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
809 |
assume "y \<in> closure S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
810 |
then obtain f where f: "\<forall>n. f n \<in> S" "(f \<longlongrightarrow> y) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
811 |
unfolding closure_sequential by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
812 |
have "\<forall>n. f n \<in> S \<longrightarrow> dist x (f n) \<le> a" using a by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
813 |
then have "eventually (\<lambda>n. dist x (f n) \<le> a) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
814 |
by (simp add: f(1)) |
72225 | 815 |
then have "dist x y \<le> a" |
816 |
using Lim_dist_ubound f(2) trivial_limit_sequentially by blast |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
817 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
818 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
819 |
unfolding bounded_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
820 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
821 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
822 |
lemma bounded_closure_image: "bounded (f ` closure S) \<Longrightarrow> bounded (f ` S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
823 |
by (simp add: bounded_subset closure_subset image_mono) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
824 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
825 |
lemma bounded_cball[simp,intro]: "bounded (cball x e)" |
72225 | 826 |
unfolding bounded_def using mem_cball by blast |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
827 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
828 |
lemma bounded_ball[simp,intro]: "bounded (ball x e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
829 |
by (metis ball_subset_cball bounded_cball bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
830 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
831 |
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
832 |
by (auto simp: bounded_def) (metis Un_iff bounded_any_center le_max_iff_disj) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
833 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
834 |
lemma bounded_Union[intro]: "finite F \<Longrightarrow> \<forall>S\<in>F. bounded S \<Longrightarrow> bounded (\<Union>F)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
835 |
by (induct rule: finite_induct[of F]) auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
836 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
837 |
lemma bounded_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. bounded (B x) \<Longrightarrow> bounded (\<Union>x\<in>A. B x)" |
72225 | 838 |
by auto |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
839 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
840 |
lemma bounded_insert [simp]: "bounded (insert x S) \<longleftrightarrow> bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
841 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
842 |
have "\<forall>y\<in>{x}. dist x y \<le> 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
843 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
844 |
then have "bounded {x}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
845 |
unfolding bounded_def by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
846 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
847 |
by (metis insert_is_Un bounded_Un) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
848 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
849 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
850 |
lemma bounded_subset_ballI: "S \<subseteq> ball x r \<Longrightarrow> bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
851 |
by (meson bounded_ball bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
852 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
853 |
lemma bounded_subset_ballD: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
854 |
assumes "bounded S" shows "\<exists>r. 0 < r \<and> S \<subseteq> ball x r" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
855 |
proof - |
70960 | 856 |
obtain e::real and y where "S \<subseteq> cball y e" "0 \<le> e" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
857 |
using assms by (auto simp: bounded_subset_cball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
858 |
then show ?thesis |
70960 | 859 |
by (intro exI[where x="dist x y + e + 1"]) metric |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
860 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
861 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
862 |
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
863 |
by (induct set: finite) simp_all |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
864 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
865 |
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
866 |
by (metis Int_lower1 Int_lower2 bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
867 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
868 |
lemma bounded_diff[intro]: "bounded S \<Longrightarrow> bounded (S - T)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
869 |
by (metis Diff_subset bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
870 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
871 |
lemma bounded_dist_comp: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
872 |
assumes "bounded (f ` S)" "bounded (g ` S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
873 |
shows "bounded ((\<lambda>x. dist (f x) (g x)) ` S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
874 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
875 |
from assms obtain M1 M2 where *: "dist (f x) undefined \<le> M1" "dist undefined (g x) \<le> M2" if "x \<in> S" for x |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
876 |
by (auto simp: bounded_any_center[of _ undefined] dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
877 |
have "dist (f x) (g x) \<le> M1 + M2" if "x \<in> S" for x |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
878 |
using *[OF that] |
70960 | 879 |
by metric |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
880 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
881 |
by (auto intro!: boundedI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
882 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
883 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
884 |
lemma bounded_Times: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
885 |
assumes "bounded s" "bounded t" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
886 |
shows "bounded (s \<times> t)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
887 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
888 |
obtain x y a b where "\<forall>z\<in>s. dist x z \<le> a" "\<forall>z\<in>t. dist y z \<le> b" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
889 |
using assms [unfolded bounded_def] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
890 |
then have "\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
891 |
by (auto simp: dist_Pair_Pair real_sqrt_le_mono add_mono power_mono) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
892 |
then show ?thesis unfolding bounded_any_center [where a="(x, y)"] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
893 |
qed |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
894 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
895 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
896 |
subsection \<open>Compactness\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
897 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
898 |
lemma compact_imp_bounded: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
899 |
assumes "compact U" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
900 |
shows "bounded U" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
901 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
902 |
have "compact U" "\<forall>x\<in>U. open (ball x 1)" "U \<subseteq> (\<Union>x\<in>U. ball x 1)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
903 |
using assms by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
904 |
then obtain D where D: "D \<subseteq> U" "finite D" "U \<subseteq> (\<Union>x\<in>D. ball x 1)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
905 |
by (metis compactE_image) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
906 |
from \<open>finite D\<close> have "bounded (\<Union>x\<in>D. ball x 1)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
907 |
by (simp add: bounded_UN) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
908 |
then show "bounded U" using \<open>U \<subseteq> (\<Union>x\<in>D. ball x 1)\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
909 |
by (rule bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
910 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
911 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
912 |
lemma closure_Int_ball_not_empty: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
913 |
assumes "S \<subseteq> closure T" "x \<in> S" "r > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
914 |
shows "T \<inter> ball x r \<noteq> {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
915 |
using assms centre_in_ball closure_iff_nhds_not_empty by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
916 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
917 |
lemma compact_sup_maxdistance: |
72225 | 918 |
fixes S :: "'a::metric_space set" |
919 |
assumes "compact S" |
|
920 |
and "S \<noteq> {}" |
|
921 |
shows "\<exists>x\<in>S. \<exists>y\<in>S. \<forall>u\<in>S. \<forall>v\<in>S. dist u v \<le> dist x y" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
922 |
proof - |
72225 | 923 |
have "compact (S \<times> S)" |
924 |
using \<open>compact S\<close> by (intro compact_Times) |
|
925 |
moreover have "S \<times> S \<noteq> {}" |
|
926 |
using \<open>S \<noteq> {}\<close> by auto |
|
927 |
moreover have "continuous_on (S \<times> S) (\<lambda>x. dist (fst x) (snd x))" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
928 |
by (intro continuous_at_imp_continuous_on ballI continuous_intros) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
929 |
ultimately show ?thesis |
72225 | 930 |
using continuous_attains_sup[of "S \<times> S" "\<lambda>x. dist (fst x) (snd x)"] by auto |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
931 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
932 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
933 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
934 |
subsubsection\<open>Totally bounded\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
935 |
|
72225 | 936 |
lemma cauchy_def: "Cauchy S \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m n. m \<ge> N \<and> n \<ge> N \<longrightarrow> dist (S m) (S n) < e)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
937 |
unfolding Cauchy_def by metis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
938 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
939 |
proposition seq_compact_imp_totally_bounded: |
72225 | 940 |
assumes "seq_compact S" |
941 |
shows "\<forall>e>0. \<exists>k. finite k \<and> k \<subseteq> S \<and> S \<subseteq> (\<Union>x\<in>k. ball x e)" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
942 |
proof - |
72225 | 943 |
{ fix e::real assume "e > 0" assume *: "\<And>k. finite k \<Longrightarrow> k \<subseteq> S \<Longrightarrow> \<not> S \<subseteq> (\<Union>x\<in>k. ball x e)" |
944 |
let ?Q = "\<lambda>x n r. r \<in> S \<and> (\<forall>m < (n::nat). \<not> (dist (x m) r < e))" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
945 |
have "\<exists>x. \<forall>n::nat. ?Q x n (x n)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
946 |
proof (rule dependent_wellorder_choice) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
947 |
fix n x assume "\<And>y. y < n \<Longrightarrow> ?Q x y (x y)" |
72225 | 948 |
then have "\<not> S \<subseteq> (\<Union>x\<in>x ` {0..<n}. ball x e)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
949 |
using *[of "x ` {0 ..< n}"] by (auto simp: subset_eq) |
72225 | 950 |
then obtain z where z:"z\<in>S" "z \<notin> (\<Union>x\<in>x ` {0..<n}. ball x e)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
951 |
unfolding subset_eq by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
952 |
show "\<exists>r. ?Q x n r" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
953 |
using z by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
954 |
qed simp |
72225 | 955 |
then obtain x where "\<forall>n::nat. x n \<in> S" and x:"\<And>n m. m < n \<Longrightarrow> \<not> (dist (x m) (x n) < e)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
956 |
by blast |
72225 | 957 |
then obtain l r where "l \<in> S" and r:"strict_mono r" and "((x \<circ> r) \<longlongrightarrow> l) sequentially" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
958 |
using assms by (metis seq_compact_def) |
72225 | 959 |
then have "Cauchy (x \<circ> r)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
960 |
using LIMSEQ_imp_Cauchy by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
961 |
then obtain N::nat where "\<And>m n. N \<le> m \<Longrightarrow> N \<le> n \<Longrightarrow> dist ((x \<circ> r) m) ((x \<circ> r) n) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
962 |
unfolding cauchy_def using \<open>e > 0\<close> by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
963 |
then have False |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
964 |
using x[of "r N" "r (N+1)"] r by (auto simp: strict_mono_def) } |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
965 |
then show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
966 |
by metis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
967 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
968 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
969 |
subsubsection\<open>Heine-Borel theorem\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
970 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
971 |
proposition seq_compact_imp_Heine_Borel: |
72225 | 972 |
fixes S :: "'a :: metric_space set" |
973 |
assumes "seq_compact S" |
|
974 |
shows "compact S" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
975 |
proof - |
72225 | 976 |
from seq_compact_imp_totally_bounded[OF \<open>seq_compact S\<close>] |
977 |
obtain f where f: "\<forall>e>0. finite (f e) \<and> f e \<subseteq> S \<and> S \<subseteq> (\<Union>x\<in>f e. ball x e)" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
978 |
unfolding choice_iff' .. |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
979 |
define K where "K = (\<lambda>(x, r). ball x r) ` ((\<Union>e \<in> \<rat> \<inter> {0 <..}. f e) \<times> \<rat>)" |
72225 | 980 |
have "countably_compact S" |
981 |
using \<open>seq_compact S\<close> by (rule seq_compact_imp_countably_compact) |
|
982 |
then show "compact S" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
983 |
proof (rule countably_compact_imp_compact) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
984 |
show "countable K" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
985 |
unfolding K_def using f |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
986 |
by (auto intro: countable_finite countable_subset countable_rat |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
987 |
intro!: countable_image countable_SIGMA countable_UN) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
988 |
show "\<forall>b\<in>K. open b" by (auto simp: K_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
989 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
990 |
fix T x |
72225 | 991 |
assume T: "open T" "x \<in> T" and x: "x \<in> S" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
992 |
from openE[OF T] obtain e where "0 < e" "ball x e \<subseteq> T" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
993 |
by auto |
72225 | 994 |
then have "0 < e/2" "ball x (e/2) \<subseteq> T" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
995 |
by auto |
72225 | 996 |
from Rats_dense_in_real[OF \<open>0 < e/2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e/2" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
997 |
by auto |
72225 | 998 |
from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> S\<close> obtain k where "k \<in> f r" "x \<in> ball k r" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
999 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1000 |
from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1001 |
by (auto simp: K_def) |
72225 | 1002 |
then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> S \<subseteq> T" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1003 |
proof (rule bexI[rotated], safe) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1004 |
fix y |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1005 |
assume "y \<in> ball k r" |
72225 | 1006 |
with \<open>r < e/2\<close> \<open>x \<in> ball k r\<close> have "dist x y < e" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1007 |
by (intro dist_triangle_half_r [of k _ e]) (auto simp: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1008 |
with \<open>ball x e \<subseteq> T\<close> show "y \<in> T" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1009 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1010 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1011 |
show "x \<in> ball k r" by fact |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1012 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1013 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1014 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1015 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1016 |
proposition compact_eq_seq_compact_metric: |
72225 | 1017 |
"compact (S :: 'a::metric_space set) \<longleftrightarrow> seq_compact S" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1018 |
using compact_imp_seq_compact seq_compact_imp_Heine_Borel by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1019 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1020 |
proposition compact_def: \<comment> \<open>this is the definition of compactness in HOL Light\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1021 |
"compact (S :: 'a::metric_space set) \<longleftrightarrow> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1022 |
(\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1023 |
unfolding compact_eq_seq_compact_metric seq_compact_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1024 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1025 |
subsubsection \<open>Complete the chain of compactness variants\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1026 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1027 |
proposition compact_eq_Bolzano_Weierstrass: |
72225 | 1028 |
fixes S :: "'a::metric_space set" |
1029 |
shows "compact S \<longleftrightarrow> (\<forall>T. infinite T \<and> T \<subseteq> S \<longrightarrow> (\<exists>x \<in> S. x islimpt T))" |
|
1030 |
using Bolzano_Weierstrass_imp_seq_compact Heine_Borel_imp_Bolzano_Weierstrass compact_eq_seq_compact_metric |
|
1031 |
by blast |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1032 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1033 |
proposition Bolzano_Weierstrass_imp_bounded: |
72225 | 1034 |
"(\<And>T. \<lbrakk>infinite T; T \<subseteq> S\<rbrakk> \<Longrightarrow> (\<exists>x \<in> S. x islimpt T)) \<Longrightarrow> bounded S" |
1035 |
using compact_imp_bounded unfolding compact_eq_Bolzano_Weierstrass by metis |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1036 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1037 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1038 |
subsection \<open>Banach fixed point theorem\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1039 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1040 |
theorem banach_fix:\<comment> \<open>TODO: rename to \<open>Banach_fix\<close>\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1041 |
assumes s: "complete s" "s \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1042 |
and c: "0 \<le> c" "c < 1" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1043 |
and f: "f ` s \<subseteq> s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1044 |
and lipschitz: "\<forall>x\<in>s. \<forall>y\<in>s. dist (f x) (f y) \<le> c * dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1045 |
shows "\<exists>!x\<in>s. f x = x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1046 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1047 |
from c have "1 - c > 0" by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1048 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1049 |
from s(2) obtain z0 where z0: "z0 \<in> s" by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1050 |
define z where "z n = (f ^^ n) z0" for n |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1051 |
with f z0 have z_in_s: "z n \<in> s" for n :: nat |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1052 |
by (induct n) auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1053 |
define d where "d = dist (z 0) (z 1)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1054 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1055 |
have fzn: "f (z n) = z (Suc n)" for n |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1056 |
by (simp add: z_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1057 |
have cf_z: "dist (z n) (z (Suc n)) \<le> (c ^ n) * d" for n :: nat |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1058 |
proof (induct n) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1059 |
case 0 |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1060 |
then show ?case |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1061 |
by (simp add: d_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1062 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1063 |
case (Suc m) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1064 |
with \<open>0 \<le> c\<close> have "c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1065 |
using mult_left_mono[of "dist (z m) (z (Suc m))" "c ^ m * d" c] by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1066 |
then show ?case |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1067 |
using lipschitz[THEN bspec[where x="z m"], OF z_in_s, THEN bspec[where x="z (Suc m)"], OF z_in_s] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1068 |
by (simp add: fzn mult_le_cancel_left) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1069 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1070 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1071 |
have cf_z2: "(1 - c) * dist (z m) (z (m + n)) \<le> (c ^ m) * d * (1 - c ^ n)" for n m :: nat |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1072 |
proof (induct n) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1073 |
case 0 |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1074 |
show ?case by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1075 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1076 |
case (Suc k) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1077 |
from c have "(1 - c) * dist (z m) (z (m + Suc k)) \<le> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1078 |
(1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1079 |
by (simp add: dist_triangle) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1080 |
also from c cf_z[of "m + k"] have "\<dots> \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1081 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1082 |
also from Suc have "\<dots> \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1083 |
by (simp add: field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1084 |
also have "\<dots> = (c ^ m) * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1085 |
by (simp add: power_add field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1086 |
also from c have "\<dots> \<le> (c ^ m) * d * (1 - c ^ Suc k)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1087 |
by (simp add: field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1088 |
finally show ?case by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1089 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1090 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1091 |
have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e" if "e > 0" for e |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1092 |
proof (cases "d = 0") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1093 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1094 |
from \<open>1 - c > 0\<close> have "(1 - c) * x \<le> 0 \<longleftrightarrow> x \<le> 0" for x |
72569
d56e4eeae967
mult_le_cancel_iff1, mult_le_cancel_iff2, mult_less_iff1 generalised from the real_ versions
paulson <lp15@cam.ac.uk>
parents:
72228
diff
changeset
|
1095 |
by (simp add: mult_le_0_iff) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1096 |
with c cf_z2[of 0] True have "z n = z0" for n |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1097 |
by (simp add: z_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1098 |
with \<open>e > 0\<close> show ?thesis by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1099 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1100 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1101 |
with zero_le_dist[of "z 0" "z 1"] have "d > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1102 |
by (metis d_def less_le) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1103 |
with \<open>1 - c > 0\<close> \<open>e > 0\<close> have "0 < e * (1 - c) / d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1104 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1105 |
with c obtain N where N: "c ^ N < e * (1 - c) / d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1106 |
using real_arch_pow_inv[of "e * (1 - c) / d" c] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1107 |
have *: "dist (z m) (z n) < e" if "m > n" and as: "m \<ge> N" "n \<ge> N" for m n :: nat |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1108 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1109 |
from c \<open>n \<ge> N\<close> have *: "c ^ n \<le> c ^ N" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1110 |
using power_decreasing[OF \<open>n\<ge>N\<close>, of c] by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1111 |
from c \<open>m > n\<close> have "1 - c ^ (m - n) > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1112 |
using power_strict_mono[of c 1 "m - n"] by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1113 |
with \<open>d > 0\<close> \<open>0 < 1 - c\<close> have **: "d * (1 - c ^ (m - n)) / (1 - c) > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1114 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1115 |
from cf_z2[of n "m - n"] \<open>m > n\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1116 |
have "dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1117 |
by (simp add: pos_le_divide_eq[OF \<open>1 - c > 0\<close>] mult.commute dist_commute) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1118 |
also have "\<dots> \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1119 |
using mult_right_mono[OF * order_less_imp_le[OF **]] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1120 |
by (simp add: mult.assoc) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1121 |
also have "\<dots> < (e * (1 - c) / d) * d * (1 - c ^ (m - n)) / (1 - c)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1122 |
using mult_strict_right_mono[OF N **] by (auto simp: mult.assoc) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1123 |
also from c \<open>d > 0\<close> \<open>1 - c > 0\<close> have "\<dots> = e * (1 - c ^ (m - n))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1124 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1125 |
also from c \<open>1 - c ^ (m - n) > 0\<close> \<open>e > 0\<close> have "\<dots> \<le> e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1126 |
using mult_right_le_one_le[of e "1 - c ^ (m - n)"] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1127 |
finally show ?thesis by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1128 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1129 |
have "dist (z n) (z m) < e" if "N \<le> m" "N \<le> n" for m n :: nat |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1130 |
proof (cases "n = m") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1131 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1132 |
with \<open>e > 0\<close> show ?thesis by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1133 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1134 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1135 |
with *[of n m] *[of m n] and that show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1136 |
by (auto simp: dist_commute nat_neq_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1137 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1138 |
then show ?thesis by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1139 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1140 |
then have "Cauchy z" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1141 |
by (simp add: cauchy_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1142 |
then obtain x where "x\<in>s" and x:"(z \<longlongrightarrow> x) sequentially" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1143 |
using s(1)[unfolded compact_def complete_def, THEN spec[where x=z]] and z_in_s by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1144 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1145 |
define e where "e = dist (f x) x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1146 |
have "e = 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1147 |
proof (rule ccontr) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1148 |
assume "e \<noteq> 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1149 |
then have "e > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1150 |
unfolding e_def using zero_le_dist[of "f x" x] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1151 |
by (metis dist_eq_0_iff dist_nz e_def) |
72225 | 1152 |
then obtain N where N:"\<forall>n\<ge>N. dist (z n) x < e/2" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1153 |
using x[unfolded lim_sequentially, THEN spec[where x="e/2"]] by auto |
72225 | 1154 |
then have N':"dist (z N) x < e/2" by auto |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1155 |
have *: "c * dist (z N) x \<le> dist (z N) x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1156 |
unfolding mult_le_cancel_right2 |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1157 |
using zero_le_dist[of "z N" x] and c |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1158 |
by (metis dist_eq_0_iff dist_nz order_less_asym less_le) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1159 |
have "dist (f (z N)) (f x) \<le> c * dist (z N) x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1160 |
using lipschitz[THEN bspec[where x="z N"], THEN bspec[where x=x]] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1161 |
using z_in_s[of N] \<open>x\<in>s\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1162 |
using c |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1163 |
by auto |
72225 | 1164 |
also have "\<dots> < e/2" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1165 |
using N' and c using * by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1166 |
finally show False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1167 |
unfolding fzn |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1168 |
using N[THEN spec[where x="Suc N"]] and dist_triangle_half_r[of "z (Suc N)" "f x" e x] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1169 |
unfolding e_def |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1170 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1171 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1172 |
then have "f x = x" by (auto simp: e_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1173 |
moreover have "y = x" if "f y = y" "y \<in> s" for y |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1174 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1175 |
from \<open>x \<in> s\<close> \<open>f x = x\<close> that have "dist x y \<le> c * dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1176 |
using lipschitz[THEN bspec[where x=x], THEN bspec[where x=y]] by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1177 |
with c and zero_le_dist[of x y] have "dist x y = 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1178 |
by (simp add: mult_le_cancel_right1) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1179 |
then show ?thesis by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1180 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1181 |
ultimately show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1182 |
using \<open>x\<in>s\<close> by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1183 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1184 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1185 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1186 |
subsection \<open>Edelstein fixed point theorem\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1187 |
|
72225 | 1188 |
theorem Edelstein_fix: |
1189 |
fixes S :: "'a::metric_space set" |
|
1190 |
assumes S: "compact S" "S \<noteq> {}" |
|
1191 |
and gs: "(g ` S) \<subseteq> S" |
|
1192 |
and dist: "\<forall>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> dist (g x) (g y) < dist x y" |
|
1193 |
shows "\<exists>!x\<in>S. g x = x" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1194 |
proof - |
72225 | 1195 |
let ?D = "(\<lambda>x. (x, x)) ` S" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1196 |
have D: "compact ?D" "?D \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1197 |
by (rule compact_continuous_image) |
72225 | 1198 |
(auto intro!: S continuous_Pair continuous_ident simp: continuous_on_eq_continuous_within) |
1199 |
||
1200 |
have "\<And>x y e. x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> 0 < e \<Longrightarrow> dist y x < e \<Longrightarrow> dist (g y) (g x) < e" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1201 |
using dist by fastforce |
72225 | 1202 |
then have "continuous_on S g" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1203 |
by (auto simp: continuous_on_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1204 |
then have cont: "continuous_on ?D (\<lambda>x. dist ((g \<circ> fst) x) (snd x))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1205 |
unfolding continuous_on_eq_continuous_within |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1206 |
by (intro continuous_dist ballI continuous_within_compose) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1207 |
(auto intro!: continuous_fst continuous_snd continuous_ident simp: image_image) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1208 |
|
72225 | 1209 |
obtain a where "a \<in> S" and le: "\<And>x. x \<in> S \<Longrightarrow> dist (g a) a \<le> dist (g x) x" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1210 |
using continuous_attains_inf[OF D cont] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1211 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1212 |
have "g a = a" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1213 |
proof (rule ccontr) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1214 |
assume "g a \<noteq> a" |
72225 | 1215 |
with \<open>a \<in> S\<close> gs have "dist (g (g a)) (g a) < dist (g a) a" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1216 |
by (intro dist[rule_format]) auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1217 |
moreover have "dist (g a) a \<le> dist (g (g a)) (g a)" |
72225 | 1218 |
using \<open>a \<in> S\<close> gs by (intro le) auto |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1219 |
ultimately show False by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1220 |
qed |
72225 | 1221 |
moreover have "\<And>x. x \<in> S \<Longrightarrow> g x = x \<Longrightarrow> x = a" |
1222 |
using dist[THEN bspec[where x=a]] \<open>g a = a\<close> and \<open>a\<in>S\<close> by auto |
|
1223 |
ultimately show "\<exists>!x\<in>S. g x = x" |
|
1224 |
using \<open>a \<in> S\<close> by blast |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1225 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1226 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1227 |
subsection \<open>The diameter of a set\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1228 |
|
70136 | 1229 |
definition\<^marker>\<open>tag important\<close> diameter :: "'a::metric_space set \<Rightarrow> real" where |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1230 |
"diameter S = (if S = {} then 0 else SUP (x,y)\<in>S\<times>S. dist x y)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1231 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1232 |
lemma diameter_empty [simp]: "diameter{} = 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1233 |
by (auto simp: diameter_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1234 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1235 |
lemma diameter_singleton [simp]: "diameter{x} = 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1236 |
by (auto simp: diameter_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1237 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1238 |
lemma diameter_le: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1239 |
assumes "S \<noteq> {} \<or> 0 \<le> d" |
72225 | 1240 |
and no: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> norm(x - y) \<le> d" |
1241 |
shows "diameter S \<le> d" |
|
1242 |
using assms |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1243 |
by (auto simp: dist_norm diameter_def intro: cSUP_least) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1244 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1245 |
lemma diameter_bounded_bound: |
72225 | 1246 |
fixes S :: "'a :: metric_space set" |
1247 |
assumes S: "bounded S" "x \<in> S" "y \<in> S" |
|
1248 |
shows "dist x y \<le> diameter S" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1249 |
proof - |
72225 | 1250 |
from S obtain z d where z: "\<And>x. x \<in> S \<Longrightarrow> dist z x \<le> d" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1251 |
unfolding bounded_def by auto |
72225 | 1252 |
have "bdd_above (case_prod dist ` (S\<times>S))" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1253 |
proof (intro bdd_aboveI, safe) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1254 |
fix a b |
72225 | 1255 |
assume "a \<in> S" "b \<in> S" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1256 |
with z[of a] z[of b] dist_triangle[of a b z] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1257 |
show "dist a b \<le> 2 * d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1258 |
by (simp add: dist_commute) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1259 |
qed |
72225 | 1260 |
moreover have "(x,y) \<in> S\<times>S" using S by auto |
1261 |
ultimately have "dist x y \<le> (SUP (x,y)\<in>S\<times>S. dist x y)" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1262 |
by (rule cSUP_upper2) simp |
72225 | 1263 |
with \<open>x \<in> S\<close> show ?thesis |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1264 |
by (auto simp: diameter_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1265 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1266 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1267 |
lemma diameter_lower_bounded: |
72225 | 1268 |
fixes S :: "'a :: metric_space set" |
1269 |
assumes S: "bounded S" |
|
1270 |
and d: "0 < d" "d < diameter S" |
|
1271 |
shows "\<exists>x\<in>S. \<exists>y\<in>S. d < dist x y" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1272 |
proof (rule ccontr) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1273 |
assume contr: "\<not> ?thesis" |
72225 | 1274 |
moreover have "S \<noteq> {}" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1275 |
using d by (auto simp: diameter_def) |
72225 | 1276 |
ultimately have "diameter S \<le> d" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1277 |
by (auto simp: not_less diameter_def intro!: cSUP_least) |
72225 | 1278 |
with \<open>d < diameter S\<close> show False by auto |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1279 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1280 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1281 |
lemma diameter_bounded: |
72225 | 1282 |
assumes "bounded S" |
1283 |
shows "\<forall>x\<in>S. \<forall>y\<in>S. dist x y \<le> diameter S" |
|
1284 |
and "\<forall>d>0. d < diameter S \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>S. dist x y > d)" |
|
1285 |
using diameter_bounded_bound[of S] diameter_lower_bounded[of S] assms |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1286 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1287 |
|
72225 | 1288 |
lemma bounded_two_points: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>x\<in>S. \<forall>y\<in>S. dist x y \<le> e)" |
1289 |
by (meson bounded_def diameter_bounded(1)) |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1290 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1291 |
lemma diameter_compact_attained: |
72225 | 1292 |
assumes "compact S" |
1293 |
and "S \<noteq> {}" |
|
1294 |
shows "\<exists>x\<in>S. \<exists>y\<in>S. dist x y = diameter S" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1295 |
proof - |
72225 | 1296 |
have b: "bounded S" using assms(1) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1297 |
by (rule compact_imp_bounded) |
72225 | 1298 |
then obtain x y where xys: "x\<in>S" "y\<in>S" |
1299 |
and xy: "\<forall>u\<in>S. \<forall>v\<in>S. dist u v \<le> dist x y" |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1300 |
using compact_sup_maxdistance[OF assms] by auto |
72225 | 1301 |
then have "diameter S \<le> dist x y" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1302 |
unfolding diameter_def |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1303 |
apply clarsimp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1304 |
apply (rule cSUP_least, fast+) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1305 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1306 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1307 |
by (metis b diameter_bounded_bound order_antisym xys) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1308 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1309 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1310 |
lemma diameter_ge_0: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1311 |
assumes "bounded S" shows "0 \<le> diameter S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1312 |
by (metis all_not_in_conv assms diameter_bounded_bound diameter_empty dist_self order_refl) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1313 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1314 |
lemma diameter_subset: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1315 |
assumes "S \<subseteq> T" "bounded T" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1316 |
shows "diameter S \<le> diameter T" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1317 |
proof (cases "S = {} \<or> T = {}") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1318 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1319 |
with assms show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1320 |
by (force simp: diameter_ge_0) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1321 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1322 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1323 |
then have "bdd_above ((\<lambda>x. case x of (x, xa) \<Rightarrow> dist x xa) ` (T \<times> T))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1324 |
using \<open>bounded T\<close> diameter_bounded_bound by (force simp: bdd_above_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1325 |
with False \<open>S \<subseteq> T\<close> show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1326 |
apply (simp add: diameter_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1327 |
apply (rule cSUP_subset_mono, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1328 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1329 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1330 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1331 |
lemma diameter_closure: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1332 |
assumes "bounded S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1333 |
shows "diameter(closure S) = diameter S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1334 |
proof (rule order_antisym) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1335 |
have "False" if "diameter S < diameter (closure S)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1336 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1337 |
define d where "d = diameter(closure S) - diameter(S)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1338 |
have "d > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1339 |
using that by (simp add: d_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1340 |
then have "diameter(closure(S)) - d / 2 < diameter(closure(S))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1341 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1342 |
have dd: "diameter (closure S) - d / 2 = (diameter(closure(S)) + diameter(S)) / 2" |
70817
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents:
70724
diff
changeset
|
1343 |
by (simp add: d_def field_split_simps) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1344 |
have bocl: "bounded (closure S)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1345 |
using assms by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1346 |
moreover have "0 \<le> diameter S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1347 |
using assms diameter_ge_0 by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1348 |
ultimately obtain x y where "x \<in> closure S" "y \<in> closure S" and xy: "diameter(closure(S)) - d / 2 < dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1349 |
using diameter_bounded(2) [OF bocl, rule_format, of "diameter(closure(S)) - d / 2"] \<open>d > 0\<close> d_def by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1350 |
then obtain x' y' where x'y': "x' \<in> S" "dist x' x < d/4" "y' \<in> S" "dist y' y < d/4" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1351 |
using closure_approachable |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1352 |
by (metis \<open>0 < d\<close> zero_less_divide_iff zero_less_numeral) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1353 |
then have "dist x' y' \<le> diameter S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1354 |
using assms diameter_bounded_bound by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1355 |
with x'y' have "dist x y \<le> d / 4 + diameter S + d / 4" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1356 |
by (meson add_mono_thms_linordered_semiring(1) dist_triangle dist_triangle3 less_eq_real_def order_trans) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1357 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1358 |
using xy d_def by linarith |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1359 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1360 |
then show "diameter (closure S) \<le> diameter S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1361 |
by fastforce |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1362 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1363 |
show "diameter S \<le> diameter (closure S)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1364 |
by (simp add: assms bounded_closure closure_subset diameter_subset) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1365 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1366 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1367 |
proposition Lebesgue_number_lemma: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1368 |
assumes "compact S" "\<C> \<noteq> {}" "S \<subseteq> \<Union>\<C>" and ope: "\<And>B. B \<in> \<C> \<Longrightarrow> open B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1369 |
obtains \<delta> where "0 < \<delta>" "\<And>T. \<lbrakk>T \<subseteq> S; diameter T < \<delta>\<rbrakk> \<Longrightarrow> \<exists>B \<in> \<C>. T \<subseteq> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1370 |
proof (cases "S = {}") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1371 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1372 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1373 |
by (metis \<open>\<C> \<noteq> {}\<close> zero_less_one empty_subsetI equals0I subset_trans that) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1374 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1375 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1376 |
{ fix x assume "x \<in> S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1377 |
then obtain C where C: "x \<in> C" "C \<in> \<C>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1378 |
using \<open>S \<subseteq> \<Union>\<C>\<close> by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1379 |
then obtain r where r: "r>0" "ball x (2*r) \<subseteq> C" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1380 |
by (metis mult.commute mult_2_right not_le ope openE field_sum_of_halves zero_le_numeral zero_less_mult_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1381 |
then have "\<exists>r C. r > 0 \<and> ball x (2*r) \<subseteq> C \<and> C \<in> \<C>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1382 |
using C by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1383 |
} |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1384 |
then obtain r where r: "\<And>x. x \<in> S \<Longrightarrow> r x > 0 \<and> (\<exists>C \<in> \<C>. ball x (2*r x) \<subseteq> C)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1385 |
by metis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1386 |
then have "S \<subseteq> (\<Union>x \<in> S. ball x (r x))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1387 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1388 |
then obtain \<T> where "finite \<T>" "S \<subseteq> \<Union>\<T>" and \<T>: "\<T> \<subseteq> (\<lambda>x. ball x (r x)) ` S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1389 |
by (rule compactE [OF \<open>compact S\<close>]) auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1390 |
then obtain S0 where "S0 \<subseteq> S" "finite S0" and S0: "\<T> = (\<lambda>x. ball x (r x)) ` S0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1391 |
by (meson finite_subset_image) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1392 |
then have "S0 \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1393 |
using False \<open>S \<subseteq> \<Union>\<T>\<close> by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1394 |
define \<delta> where "\<delta> = Inf (r ` S0)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1395 |
have "\<delta> > 0" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1396 |
using \<open>finite S0\<close> \<open>S0 \<subseteq> S\<close> \<open>S0 \<noteq> {}\<close> r by (auto simp: \<delta>_def finite_less_Inf_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1397 |
show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1398 |
proof |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1399 |
show "0 < \<delta>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1400 |
by (simp add: \<open>0 < \<delta>\<close>) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1401 |
show "\<exists>B \<in> \<C>. T \<subseteq> B" if "T \<subseteq> S" and dia: "diameter T < \<delta>" for T |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1402 |
proof (cases "T = {}") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1403 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1404 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1405 |
using \<open>\<C> \<noteq> {}\<close> by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1406 |
next |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1407 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1408 |
then obtain y where "y \<in> T" by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1409 |
then have "y \<in> S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1410 |
using \<open>T \<subseteq> S\<close> by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1411 |
then obtain x where "x \<in> S0" and x: "y \<in> ball x (r x)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1412 |
using \<open>S \<subseteq> \<Union>\<T>\<close> S0 that by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1413 |
have "ball y \<delta> \<subseteq> ball y (r x)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1414 |
by (metis \<delta>_def \<open>S0 \<noteq> {}\<close> \<open>finite S0\<close> \<open>x \<in> S0\<close> empty_is_image finite_imageI finite_less_Inf_iff imageI less_irrefl not_le subset_ball) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1415 |
also have "... \<subseteq> ball x (2*r x)" |
70960 | 1416 |
using x by metric |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1417 |
finally obtain C where "C \<in> \<C>" "ball y \<delta> \<subseteq> C" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1418 |
by (meson r \<open>S0 \<subseteq> S\<close> \<open>x \<in> S0\<close> dual_order.trans subsetCE) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1419 |
have "bounded T" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1420 |
using \<open>compact S\<close> bounded_subset compact_imp_bounded \<open>T \<subseteq> S\<close> by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1421 |
then have "T \<subseteq> ball y \<delta>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1422 |
using \<open>y \<in> T\<close> dia diameter_bounded_bound by fastforce |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1423 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1424 |
apply (rule_tac x=C in bexI) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1425 |
using \<open>ball y \<delta> \<subseteq> C\<close> \<open>C \<in> \<C>\<close> by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1426 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1427 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1428 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1429 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1430 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1431 |
subsection \<open>Metric spaces with the Heine-Borel property\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1432 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1433 |
text \<open> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1434 |
A metric space (or topological vector space) is said to have the |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1435 |
Heine-Borel property if every closed and bounded subset is compact. |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1436 |
\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1437 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1438 |
class heine_borel = metric_space + |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1439 |
assumes bounded_imp_convergent_subsequence: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1440 |
"bounded (range f) \<Longrightarrow> \<exists>l r. strict_mono (r::nat\<Rightarrow>nat) \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1441 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1442 |
proposition bounded_closed_imp_seq_compact: |
72225 | 1443 |
fixes S::"'a::heine_borel set" |
1444 |
assumes "bounded S" |
|
1445 |
and "closed S" |
|
1446 |
shows "seq_compact S" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1447 |
proof (unfold seq_compact_def, clarify) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1448 |
fix f :: "nat \<Rightarrow> 'a" |
72225 | 1449 |
assume f: "\<forall>n. f n \<in> S" |
1450 |
with \<open>bounded S\<close> have "bounded (range f)" |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1451 |
by (auto intro: bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1452 |
obtain l r where r: "strict_mono (r :: nat \<Rightarrow> nat)" and l: "((f \<circ> r) \<longlongrightarrow> l) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1453 |
using bounded_imp_convergent_subsequence [OF \<open>bounded (range f)\<close>] by auto |
72225 | 1454 |
from f have fr: "\<forall>n. (f \<circ> r) n \<in> S" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1455 |
by simp |
72225 | 1456 |
have "l \<in> S" using \<open>closed S\<close> fr l |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1457 |
by (rule closed_sequentially) |
72225 | 1458 |
show "\<exists>l\<in>S. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" |
1459 |
using \<open>l \<in> S\<close> r l by blast |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1460 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1461 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1462 |
lemma compact_eq_bounded_closed: |
72225 | 1463 |
fixes S :: "'a::heine_borel set" |
1464 |
shows "compact S \<longleftrightarrow> bounded S \<and> closed S" |
|
1465 |
using bounded_closed_imp_seq_compact compact_eq_seq_compact_metric compact_imp_bounded compact_imp_closed |
|
1466 |
by auto |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1467 |
|
73885
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1468 |
lemma bounded_infinite_imp_islimpt: |
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1469 |
fixes S :: "'a::heine_borel set" |
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1470 |
assumes "T \<subseteq> S" "bounded S" "infinite T" |
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1471 |
obtains x where "x islimpt S" |
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1472 |
by (meson assms closed_limpt compact_eq_Bolzano_Weierstrass compact_eq_bounded_closed islimpt_subset) |
26171a89466a
A few useful lemmas about derivatives, colinearity and other topics
paulson <lp15@cam.ac.uk>
parents:
72569
diff
changeset
|
1473 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1474 |
lemma compact_Inter: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1475 |
fixes \<F> :: "'a :: heine_borel set set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1476 |
assumes com: "\<And>S. S \<in> \<F> \<Longrightarrow> compact S" and "\<F> \<noteq> {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1477 |
shows "compact(\<Inter> \<F>)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1478 |
using assms |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1479 |
by (meson Inf_lower all_not_in_conv bounded_subset closed_Inter compact_eq_bounded_closed) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1480 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1481 |
lemma compact_closure [simp]: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1482 |
fixes S :: "'a::heine_borel set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1483 |
shows "compact(closure S) \<longleftrightarrow> bounded S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1484 |
by (meson bounded_closure bounded_subset closed_closure closure_subset compact_eq_bounded_closed) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1485 |
|
70136 | 1486 |
instance\<^marker>\<open>tag important\<close> real :: heine_borel |
1487 |
proof |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1488 |
fix f :: "nat \<Rightarrow> real" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1489 |
assume f: "bounded (range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1490 |
obtain r :: "nat \<Rightarrow> nat" where r: "strict_mono r" "monoseq (f \<circ> r)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1491 |
unfolding comp_def by (metis seq_monosub) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1492 |
then have "Bseq (f \<circ> r)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1493 |
unfolding Bseq_eq_bounded using f |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1494 |
by (metis BseqI' bounded_iff comp_apply rangeI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1495 |
with r show "\<exists>l r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1496 |
using Bseq_monoseq_convergent[of "f \<circ> r"] by (auto simp: convergent_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1497 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1498 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1499 |
lemma compact_lemma_general: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1500 |
fixes f :: "nat \<Rightarrow> 'a" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1501 |
fixes proj::"'a \<Rightarrow> 'b \<Rightarrow> 'c::heine_borel" (infixl "proj" 60) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1502 |
fixes unproj:: "('b \<Rightarrow> 'c) \<Rightarrow> 'a" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1503 |
assumes finite_basis: "finite basis" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1504 |
assumes bounded_proj: "\<And>k. k \<in> basis \<Longrightarrow> bounded ((\<lambda>x. x proj k) ` range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1505 |
assumes proj_unproj: "\<And>e k. k \<in> basis \<Longrightarrow> (unproj e) proj k = e k" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1506 |
assumes unproj_proj: "\<And>x. unproj (\<lambda>k. x proj k) = x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1507 |
shows "\<forall>d\<subseteq>basis. \<exists>l::'a. \<exists> r::nat\<Rightarrow>nat. |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1508 |
strict_mono r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1509 |
proof safe |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1510 |
fix d :: "'b set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1511 |
assume d: "d \<subseteq> basis" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1512 |
with finite_basis have "finite d" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1513 |
by (blast intro: finite_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1514 |
from this d show "\<exists>l::'a. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1515 |
(\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) proj i) (l proj i) < e) sequentially)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1516 |
proof (induct d) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1517 |
case empty |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1518 |
then show ?case |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1519 |
unfolding strict_mono_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1520 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1521 |
case (insert k d) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1522 |
have k[intro]: "k \<in> basis" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1523 |
using insert by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1524 |
have s': "bounded ((\<lambda>x. x proj k) ` range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1525 |
using k |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1526 |
by (rule bounded_proj) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1527 |
obtain l1::"'a" and r1 where r1: "strict_mono r1" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1528 |
and lr1: "\<forall>e > 0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1529 |
using insert(3) using insert(4) by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1530 |
have f': "\<forall>n. f (r1 n) proj k \<in> (\<lambda>x. x proj k) ` range f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1531 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1532 |
have "bounded (range (\<lambda>i. f (r1 i) proj k))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1533 |
by (metis (lifting) bounded_subset f' image_subsetI s') |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1534 |
then obtain l2 r2 where r2:"strict_mono r2" and lr2:"((\<lambda>i. f (r1 (r2 i)) proj k) \<longlongrightarrow> l2) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1535 |
using bounded_imp_convergent_subsequence[of "\<lambda>i. f (r1 i) proj k"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1536 |
by (auto simp: o_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1537 |
define r where "r = r1 \<circ> r2" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1538 |
have r:"strict_mono r" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1539 |
using r1 and r2 unfolding r_def o_def strict_mono_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1540 |
moreover |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1541 |
define l where "l = unproj (\<lambda>i. if i = k then l2 else l1 proj i)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1542 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1543 |
fix e::real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1544 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1545 |
from lr1 \<open>e > 0\<close> have N1: "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1546 |
by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1547 |
from lr2 \<open>e > 0\<close> have N2:"eventually (\<lambda>n. dist (f (r1 (r2 n)) proj k) l2 < e) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1548 |
by (rule tendstoD) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1549 |
from r2 N1 have N1': "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 (r2 n)) proj i) (l1 proj i) < e) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1550 |
by (rule eventually_subseq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1551 |
have "eventually (\<lambda>n. \<forall>i\<in>(insert k d). dist (f (r n) proj i) (l proj i) < e) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1552 |
using N1' N2 |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1553 |
by eventually_elim (insert insert.prems, auto simp: l_def r_def o_def proj_unproj) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1554 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1555 |
ultimately show ?case by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1556 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1557 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1558 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1559 |
lemma bounded_fst: "bounded s \<Longrightarrow> bounded (fst ` s)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1560 |
unfolding bounded_def |
73932
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
desharna
parents:
72569
diff
changeset
|
1561 |
by (metis (erased, opaque_lifting) dist_fst_le image_iff order_trans) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1562 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1563 |
lemma bounded_snd: "bounded s \<Longrightarrow> bounded (snd ` s)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1564 |
unfolding bounded_def |
73932
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
desharna
parents:
72569
diff
changeset
|
1565 |
by (metis (no_types, opaque_lifting) dist_snd_le image_iff order.trans) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1566 |
|
70136 | 1567 |
instance\<^marker>\<open>tag important\<close> prod :: (heine_borel, heine_borel) heine_borel |
1568 |
proof |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1569 |
fix f :: "nat \<Rightarrow> 'a \<times> 'b" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1570 |
assume f: "bounded (range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1571 |
then have "bounded (fst ` range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1572 |
by (rule bounded_fst) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1573 |
then have s1: "bounded (range (fst \<circ> f))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1574 |
by (simp add: image_comp) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1575 |
obtain l1 r1 where r1: "strict_mono r1" and l1: "(\<lambda>n. fst (f (r1 n))) \<longlonglongrightarrow> l1" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1576 |
using bounded_imp_convergent_subsequence [OF s1] unfolding o_def by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1577 |
from f have s2: "bounded (range (snd \<circ> f \<circ> r1))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1578 |
by (auto simp: image_comp intro: bounded_snd bounded_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1579 |
obtain l2 r2 where r2: "strict_mono r2" and l2: "((\<lambda>n. snd (f (r1 (r2 n)))) \<longlongrightarrow> l2) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1580 |
using bounded_imp_convergent_subsequence [OF s2] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1581 |
unfolding o_def by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1582 |
have l1': "((\<lambda>n. fst (f (r1 (r2 n)))) \<longlongrightarrow> l1) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1583 |
using LIMSEQ_subseq_LIMSEQ [OF l1 r2] unfolding o_def . |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1584 |
have l: "((f \<circ> (r1 \<circ> r2)) \<longlongrightarrow> (l1, l2)) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1585 |
using tendsto_Pair [OF l1' l2] unfolding o_def by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1586 |
have r: "strict_mono (r1 \<circ> r2)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1587 |
using r1 r2 unfolding strict_mono_def by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1588 |
show "\<exists>l r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1589 |
using l r by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1590 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1591 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1592 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1593 |
subsection \<open>Completeness\<close> |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1594 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1595 |
proposition (in metric_space) completeI: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1596 |
assumes "\<And>f. \<forall>n. f n \<in> s \<Longrightarrow> Cauchy f \<Longrightarrow> \<exists>l\<in>s. f \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1597 |
shows "complete s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1598 |
using assms unfolding complete_def by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1599 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1600 |
proposition (in metric_space) completeE: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1601 |
assumes "complete s" and "\<forall>n. f n \<in> s" and "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1602 |
obtains l where "l \<in> s" and "f \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1603 |
using assms unfolding complete_def by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1604 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1605 |
(* TODO: generalize to uniform spaces *) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1606 |
lemma compact_imp_complete: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1607 |
fixes s :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1608 |
assumes "compact s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1609 |
shows "complete s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1610 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1611 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1612 |
fix f |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1613 |
assume as: "(\<forall>n::nat. f n \<in> s)" "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1614 |
from as(1) obtain l r where lr: "l\<in>s" "strict_mono r" "(f \<circ> r) \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1615 |
using assms unfolding compact_def by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1616 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1617 |
note lr' = seq_suble [OF lr(2)] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1618 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1619 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1620 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1621 |
from as(2) obtain N where N:"\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (f m) (f n) < e/2" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1622 |
unfolding cauchy_def |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1623 |
using \<open>e > 0\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1624 |
apply (erule_tac x="e/2" in allE, auto) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1625 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1626 |
from lr(3)[unfolded lim_sequentially, THEN spec[where x="e/2"]] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1627 |
obtain M where M:"\<forall>n\<ge>M. dist ((f \<circ> r) n) l < e/2" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1628 |
using \<open>e > 0\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1629 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1630 |
fix n :: nat |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1631 |
assume n: "n \<ge> max N M" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1632 |
have "dist ((f \<circ> r) n) l < e/2" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1633 |
using n M by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1634 |
moreover have "r n \<ge> N" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1635 |
using lr'[of n] n by auto |
72225 | 1636 |
then have "dist (f n) ((f \<circ> r) n) < e/2" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1637 |
using N and n by auto |
70960 | 1638 |
ultimately have "dist (f n) l < e" using n M |
1639 |
by metric |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1640 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1641 |
then have "\<exists>N. \<forall>n\<ge>N. dist (f n) l < e" by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1642 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1643 |
then have "\<exists>l\<in>s. (f \<longlongrightarrow> l) sequentially" using \<open>l\<in>s\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1644 |
unfolding lim_sequentially by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1645 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1646 |
then show ?thesis unfolding complete_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1647 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1648 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1649 |
proposition compact_eq_totally_bounded: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1650 |
"compact s \<longleftrightarrow> complete s \<and> (\<forall>e>0. \<exists>k. finite k \<and> s \<subseteq> (\<Union>x\<in>k. ball x e))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1651 |
(is "_ \<longleftrightarrow> ?rhs") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1652 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1653 |
assume assms: "?rhs" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1654 |
then obtain k where k: "\<And>e. 0 < e \<Longrightarrow> finite (k e)" "\<And>e. 0 < e \<Longrightarrow> s \<subseteq> (\<Union>x\<in>k e. ball x e)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1655 |
by (auto simp: choice_iff') |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1656 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1657 |
show "compact s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1658 |
proof cases |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1659 |
assume "s = {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1660 |
then show "compact s" by (simp add: compact_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1661 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1662 |
assume "s \<noteq> {}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1663 |
show ?thesis |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1664 |
unfolding compact_def |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1665 |
proof safe |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1666 |
fix f :: "nat \<Rightarrow> 'a" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1667 |
assume f: "\<forall>n. f n \<in> s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1668 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1669 |
define e where "e n = 1 / (2 * Suc n)" for n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1670 |
then have [simp]: "\<And>n. 0 < e n" by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1671 |
define B where "B n U = (SOME b. infinite {n. f n \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U))" for n U |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1672 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1673 |
fix n U |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1674 |
assume "infinite {n. f n \<in> U}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1675 |
then have "\<exists>b\<in>k (e n). infinite {i\<in>{n. f n \<in> U}. f i \<in> ball b (e n)}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1676 |
using k f by (intro pigeonhole_infinite_rel) (auto simp: subset_eq) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1677 |
then obtain a where |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1678 |
"a \<in> k (e n)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1679 |
"infinite {i \<in> {n. f n \<in> U}. f i \<in> ball a (e n)}" .. |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1680 |
then have "\<exists>b. infinite {i. f i \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1681 |
by (intro exI[of _ "ball a (e n) \<inter> U"] exI[of _ a]) (auto simp: ac_simps) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1682 |
from someI_ex[OF this] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1683 |
have "infinite {i. f i \<in> B n U}" "\<exists>x. B n U \<subseteq> ball x (e n) \<inter> U" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1684 |
unfolding B_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1685 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1686 |
note B = this |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1687 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1688 |
define F where "F = rec_nat (B 0 UNIV) B" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1689 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1690 |
fix n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1691 |
have "infinite {i. f i \<in> F n}" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1692 |
by (induct n) (auto simp: F_def B) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1693 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1694 |
then have F: "\<And>n. \<exists>x. F (Suc n) \<subseteq> ball x (e n) \<inter> F n" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1695 |
using B by (simp add: F_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1696 |
then have F_dec: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1697 |
using decseq_SucI[of F] by (auto simp: decseq_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1698 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1699 |
obtain sel where sel: "\<And>k i. i < sel k i" "\<And>k i. f (sel k i) \<in> F k" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1700 |
proof (atomize_elim, unfold all_conj_distrib[symmetric], intro choice allI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1701 |
fix k i |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1702 |
have "infinite ({n. f n \<in> F k} - {.. i})" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1703 |
using \<open>infinite {n. f n \<in> F k}\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1704 |
from infinite_imp_nonempty[OF this] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1705 |
show "\<exists>x>i. f x \<in> F k" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1706 |
by (simp add: set_eq_iff not_le conj_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1707 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1708 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1709 |
define t where "t = rec_nat (sel 0 0) (\<lambda>n i. sel (Suc n) i)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1710 |
have "strict_mono t" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1711 |
unfolding strict_mono_Suc_iff by (simp add: t_def sel) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1712 |
moreover have "\<forall>i. (f \<circ> t) i \<in> s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1713 |
using f by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1714 |
moreover |
72225 | 1715 |
have t: "(f \<circ> t) n \<in> F n" for n |
1716 |
by (cases n) (simp_all add: t_def sel) |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1717 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1718 |
have "Cauchy (f \<circ> t)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1719 |
proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1720 |
fix r :: real and N n m |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1721 |
assume "1 / Suc N < r" "Suc N \<le> n" "Suc N \<le> m" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1722 |
then have "(f \<circ> t) n \<in> F (Suc N)" "(f \<circ> t) m \<in> F (Suc N)" "2 * e N < r" |
71174 | 1723 |
using F_dec t by (auto simp: e_def field_simps) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1724 |
with F[of N] obtain x where "dist x ((f \<circ> t) n) < e N" "dist x ((f \<circ> t) m) < e N" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1725 |
by (auto simp: subset_eq) |
70960 | 1726 |
with \<open>2 * e N < r\<close> show "dist ((f \<circ> t) m) ((f \<circ> t) n) < r" |
1727 |
by metric |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1728 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1729 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1730 |
ultimately show "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1731 |
using assms unfolding complete_def by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1732 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1733 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1734 |
qed (metis compact_imp_complete compact_imp_seq_compact seq_compact_imp_totally_bounded) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1735 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1736 |
lemma cauchy_imp_bounded: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1737 |
assumes "Cauchy s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1738 |
shows "bounded (range s)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1739 |
proof - |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1740 |
from assms obtain N :: nat where "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < 1" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1741 |
unfolding cauchy_def by force |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1742 |
then have N:"\<forall>n. N \<le> n \<longrightarrow> dist (s N) (s n) < 1" by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1743 |
moreover |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1744 |
have "bounded (s ` {0..N})" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1745 |
using finite_imp_bounded[of "s ` {1..N}"] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1746 |
then obtain a where a:"\<forall>x\<in>s ` {0..N}. dist (s N) x \<le> a" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1747 |
unfolding bounded_any_center [where a="s N"] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1748 |
ultimately show "?thesis" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1749 |
unfolding bounded_any_center [where a="s N"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1750 |
apply (rule_tac x="max a 1" in exI, auto) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1751 |
apply (erule_tac x=y in allE) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1752 |
apply (erule_tac x=y in ballE, auto) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1753 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1754 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1755 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1756 |
instance heine_borel < complete_space |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1757 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1758 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1759 |
then have "bounded (range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1760 |
by (rule cauchy_imp_bounded) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1761 |
then have "compact (closure (range f))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1762 |
unfolding compact_eq_bounded_closed by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1763 |
then have "complete (closure (range f))" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1764 |
by (rule compact_imp_complete) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1765 |
moreover have "\<forall>n. f n \<in> closure (range f)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1766 |
using closure_subset [of "range f"] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1767 |
ultimately have "\<exists>l\<in>closure (range f). (f \<longlongrightarrow> l) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1768 |
using \<open>Cauchy f\<close> unfolding complete_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1769 |
then show "convergent f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1770 |
unfolding convergent_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1771 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1772 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1773 |
lemma complete_UNIV: "complete (UNIV :: ('a::complete_space) set)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1774 |
proof (rule completeI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1775 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1776 |
then have "convergent f" by (rule Cauchy_convergent) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1777 |
then show "\<exists>l\<in>UNIV. f \<longlonglongrightarrow> l" unfolding convergent_def by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1778 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1779 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1780 |
lemma complete_imp_closed: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1781 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1782 |
assumes "complete S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1783 |
shows "closed S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1784 |
proof (unfold closed_sequential_limits, clarify) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1785 |
fix f x assume "\<forall>n. f n \<in> S" and "f \<longlonglongrightarrow> x" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1786 |
from \<open>f \<longlonglongrightarrow> x\<close> have "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1787 |
by (rule LIMSEQ_imp_Cauchy) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1788 |
with \<open>complete S\<close> and \<open>\<forall>n. f n \<in> S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1789 |
by (rule completeE) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1790 |
from \<open>f \<longlonglongrightarrow> x\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "x = l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1791 |
by (rule LIMSEQ_unique) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1792 |
with \<open>l \<in> S\<close> show "x \<in> S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1793 |
by simp |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1794 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1795 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1796 |
lemma complete_Int_closed: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1797 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1798 |
assumes "complete S" and "closed t" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1799 |
shows "complete (S \<inter> t)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1800 |
proof (rule completeI) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1801 |
fix f assume "\<forall>n. f n \<in> S \<inter> t" and "Cauchy f" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1802 |
then have "\<forall>n. f n \<in> S" and "\<forall>n. f n \<in> t" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1803 |
by simp_all |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1804 |
from \<open>complete S\<close> obtain l where "l \<in> S" and "f \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1805 |
using \<open>\<forall>n. f n \<in> S\<close> and \<open>Cauchy f\<close> by (rule completeE) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1806 |
from \<open>closed t\<close> and \<open>\<forall>n. f n \<in> t\<close> and \<open>f \<longlonglongrightarrow> l\<close> have "l \<in> t" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1807 |
by (rule closed_sequentially) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1808 |
with \<open>l \<in> S\<close> and \<open>f \<longlonglongrightarrow> l\<close> show "\<exists>l\<in>S \<inter> t. f \<longlonglongrightarrow> l" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1809 |
by fast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1810 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1811 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1812 |
lemma complete_closed_subset: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1813 |
fixes S :: "'a::metric_space set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1814 |
assumes "closed S" and "S \<subseteq> t" and "complete t" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1815 |
shows "complete S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1816 |
using assms complete_Int_closed [of t S] by (simp add: Int_absorb1) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1817 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1818 |
lemma complete_eq_closed: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1819 |
fixes S :: "('a::complete_space) set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1820 |
shows "complete S \<longleftrightarrow> closed S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1821 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1822 |
assume "closed S" then show "complete S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1823 |
using subset_UNIV complete_UNIV by (rule complete_closed_subset) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1824 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1825 |
assume "complete S" then show "closed S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1826 |
by (rule complete_imp_closed) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1827 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1828 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1829 |
lemma convergent_eq_Cauchy: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1830 |
fixes S :: "nat \<Rightarrow> 'a::complete_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1831 |
shows "(\<exists>l. (S \<longlongrightarrow> l) sequentially) \<longleftrightarrow> Cauchy S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1832 |
unfolding Cauchy_convergent_iff convergent_def .. |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1833 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1834 |
lemma convergent_imp_bounded: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1835 |
fixes S :: "nat \<Rightarrow> 'a::metric_space" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1836 |
shows "(S \<longlongrightarrow> l) sequentially \<Longrightarrow> bounded (range S)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1837 |
by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1838 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1839 |
lemma frontier_subset_compact: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1840 |
fixes S :: "'a::heine_borel set" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1841 |
shows "compact S \<Longrightarrow> frontier S \<subseteq> S" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1842 |
using frontier_subset_closed compact_eq_bounded_closed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1843 |
by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
1844 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1845 |
lemma continuous_closed_imp_Cauchy_continuous: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1846 |
fixes S :: "('a::complete_space) set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1847 |
shows "\<lbrakk>continuous_on S f; closed S; Cauchy \<sigma>; \<And>n. (\<sigma> n) \<in> S\<rbrakk> \<Longrightarrow> Cauchy(f \<circ> \<sigma>)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1848 |
apply (simp add: complete_eq_closed [symmetric] continuous_on_sequentially) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1849 |
by (meson LIMSEQ_imp_Cauchy complete_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1850 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1851 |
lemma banach_fix_type: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1852 |
fixes f::"'a::complete_space\<Rightarrow>'a" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1853 |
assumes c:"0 \<le> c" "c < 1" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1854 |
and lipschitz:"\<forall>x. \<forall>y. dist (f x) (f y) \<le> c * dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1855 |
shows "\<exists>!x. (f x = x)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1856 |
using assms banach_fix[OF complete_UNIV UNIV_not_empty assms(1,2) subset_UNIV, of f] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1857 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1858 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1859 |
|
70136 | 1860 |
subsection\<^marker>\<open>tag unimportant\<close>\<open> Finite intersection property\<close> |
69615
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1861 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1862 |
text\<open>Also developed in HOL's toplogical spaces theory, but the Heine-Borel type class isn't available there.\<close> |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1863 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1864 |
lemma closed_imp_fip: |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1865 |
fixes S :: "'a::heine_borel set" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1866 |
assumes "closed S" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1867 |
and T: "T \<in> \<F>" "bounded T" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1868 |
and clof: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1869 |
and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1870 |
shows "S \<inter> \<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1871 |
proof - |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1872 |
have "compact (S \<inter> T)" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1873 |
using \<open>closed S\<close> clof compact_eq_bounded_closed T by blast |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1874 |
then have "(S \<inter> T) \<inter> \<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1875 |
apply (rule compact_imp_fip) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1876 |
apply (simp add: clof) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1877 |
by (metis Int_assoc complete_lattice_class.Inf_insert finite_insert insert_subset none \<open>T \<in> \<F>\<close>) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1878 |
then show ?thesis by blast |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1879 |
qed |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1880 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1881 |
lemma closed_imp_fip_compact: |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1882 |
fixes S :: "'a::heine_borel set" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1883 |
shows |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1884 |
"\<lbrakk>closed S; \<And>T. T \<in> \<F> \<Longrightarrow> compact T; |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1885 |
\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> S \<inter> \<Inter>\<F>' \<noteq> {}\<rbrakk> |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1886 |
\<Longrightarrow> S \<inter> \<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1887 |
by (metis Inf_greatest closed_imp_fip compact_eq_bounded_closed empty_subsetI finite.emptyI inf.orderE) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1888 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1889 |
lemma closed_fip_Heine_Borel: |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1890 |
fixes \<F> :: "'a::heine_borel set set" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1891 |
assumes "closed S" "T \<in> \<F>" "bounded T" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1892 |
and "\<And>T. T \<in> \<F> \<Longrightarrow> closed T" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1893 |
and "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter>\<F>' \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1894 |
shows "\<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1895 |
proof - |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1896 |
have "UNIV \<inter> \<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1897 |
using assms closed_imp_fip [OF closed_UNIV] by auto |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1898 |
then show ?thesis by simp |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1899 |
qed |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1900 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1901 |
lemma compact_fip_Heine_Borel: |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1902 |
fixes \<F> :: "'a::heine_borel set set" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1903 |
assumes clof: "\<And>T. T \<in> \<F> \<Longrightarrow> compact T" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1904 |
and none: "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter>\<F>' \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1905 |
shows "\<Inter>\<F> \<noteq> {}" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1906 |
by (metis InterI all_not_in_conv clof closed_fip_Heine_Borel compact_eq_bounded_closed none) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1907 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1908 |
lemma compact_sequence_with_limit: |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1909 |
fixes f :: "nat \<Rightarrow> 'a::heine_borel" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1910 |
shows "(f \<longlongrightarrow> l) sequentially \<Longrightarrow> compact (insert l (range f))" |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1911 |
apply (simp add: compact_eq_bounded_closed, auto) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1912 |
apply (simp add: convergent_imp_bounded) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1913 |
by (simp add: closed_limpt islimpt_insert sequence_unique_limpt) |
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1914 |
|
e502cd4d7062
moved material from Connected.thy to more appropriate places
immler
parents:
69613
diff
changeset
|
1915 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1916 |
subsection \<open>Properties of Balls and Spheres\<close> |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1917 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1918 |
lemma compact_cball[simp]: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1919 |
fixes x :: "'a::heine_borel" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1920 |
shows "compact (cball x e)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1921 |
using compact_eq_bounded_closed bounded_cball closed_cball |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1922 |
by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1923 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1924 |
lemma compact_frontier_bounded[intro]: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1925 |
fixes S :: "'a::heine_borel set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1926 |
shows "bounded S \<Longrightarrow> compact (frontier S)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1927 |
unfolding frontier_def |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1928 |
using compact_eq_bounded_closed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1929 |
by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1930 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1931 |
lemma compact_frontier[intro]: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1932 |
fixes S :: "'a::heine_borel set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1933 |
shows "compact S \<Longrightarrow> compact (frontier S)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1934 |
using compact_eq_bounded_closed compact_frontier_bounded |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1935 |
by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1936 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1937 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1938 |
subsection \<open>Distance from a Set\<close> |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1939 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1940 |
lemma distance_attains_sup: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1941 |
assumes "compact s" "s \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1942 |
shows "\<exists>x\<in>s. \<forall>y\<in>s. dist a y \<le> dist a x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1943 |
proof (rule continuous_attains_sup [OF assms]) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1944 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1945 |
fix x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1946 |
assume "x\<in>s" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1947 |
have "(dist a \<longlongrightarrow> dist a x) (at x within s)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1948 |
by (intro tendsto_dist tendsto_const tendsto_ident_at) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1949 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1950 |
then show "continuous_on s (dist a)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1951 |
unfolding continuous_on .. |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1952 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1953 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1954 |
text \<open>For \emph{minimal} distance, we only need closure, not compactness.\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1955 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1956 |
lemma distance_attains_inf: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1957 |
fixes a :: "'a::heine_borel" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1958 |
assumes "closed s" and "s \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1959 |
obtains x where "x\<in>s" "\<And>y. y \<in> s \<Longrightarrow> dist a x \<le> dist a y" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1960 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1961 |
from assms obtain b where "b \<in> s" by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1962 |
let ?B = "s \<inter> cball a (dist b a)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1963 |
have "?B \<noteq> {}" using \<open>b \<in> s\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1964 |
by (auto simp: dist_commute) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1965 |
moreover have "continuous_on ?B (dist a)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1966 |
by (auto intro!: continuous_at_imp_continuous_on continuous_dist continuous_ident continuous_const) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1967 |
moreover have "compact ?B" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1968 |
by (intro closed_Int_compact \<open>closed s\<close> compact_cball) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1969 |
ultimately obtain x where "x \<in> ?B" "\<forall>y\<in>?B. dist a x \<le> dist a y" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1970 |
by (metis continuous_attains_inf) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1971 |
with that show ?thesis by fastforce |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1972 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1973 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
1974 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1975 |
subsection \<open>Infimum Distance\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1976 |
|
70136 | 1977 |
definition\<^marker>\<open>tag important\<close> "infdist x A = (if A = {} then 0 else INF a\<in>A. dist x a)" |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1978 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1979 |
lemma bdd_below_image_dist[intro, simp]: "bdd_below (dist x ` A)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1980 |
by (auto intro!: zero_le_dist) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1981 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1982 |
lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = (INF a\<in>A. dist x a)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1983 |
by (simp add: infdist_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1984 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1985 |
lemma infdist_nonneg: "0 \<le> infdist x A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1986 |
by (auto simp: infdist_def intro: cINF_greatest) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1987 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1988 |
lemma infdist_le: "a \<in> A \<Longrightarrow> infdist x A \<le> dist x a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1989 |
by (auto intro: cINF_lower simp add: infdist_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1990 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1991 |
lemma infdist_le2: "a \<in> A \<Longrightarrow> dist x a \<le> d \<Longrightarrow> infdist x A \<le> d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1992 |
by (auto intro!: cINF_lower2 simp add: infdist_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1993 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1994 |
lemma infdist_zero[simp]: "a \<in> A \<Longrightarrow> infdist a A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1995 |
by (auto intro!: antisym infdist_nonneg infdist_le2) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
1996 |
|
70724 | 1997 |
lemma infdist_Un_min: |
1998 |
assumes "A \<noteq> {}" "B \<noteq> {}" |
|
1999 |
shows "infdist x (A \<union> B) = min (infdist x A) (infdist x B)" |
|
2000 |
using assms by (simp add: infdist_def cINF_union inf_real_def) |
|
2001 |
||
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2002 |
lemma infdist_triangle: "infdist x A \<le> infdist y A + dist x y" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2003 |
proof (cases "A = {}") |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2004 |
case True |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2005 |
then show ?thesis by (simp add: infdist_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2006 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2007 |
case False |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2008 |
then obtain a where "a \<in> A" by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2009 |
have "infdist x A \<le> Inf {dist x y + dist y a |a. a \<in> A}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2010 |
proof (rule cInf_greatest) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2011 |
from \<open>A \<noteq> {}\<close> show "{dist x y + dist y a |a. a \<in> A} \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2012 |
by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2013 |
fix d |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2014 |
assume "d \<in> {dist x y + dist y a |a. a \<in> A}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2015 |
then obtain a where d: "d = dist x y + dist y a" "a \<in> A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2016 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2017 |
show "infdist x A \<le> d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2018 |
unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2019 |
proof (rule cINF_lower2) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2020 |
show "a \<in> A" by fact |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2021 |
show "dist x a \<le> d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2022 |
unfolding d by (rule dist_triangle) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2023 |
qed simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2024 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2025 |
also have "\<dots> = dist x y + infdist y A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2026 |
proof (rule cInf_eq, safe) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2027 |
fix a |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2028 |
assume "a \<in> A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2029 |
then show "dist x y + infdist y A \<le> dist x y + dist y a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2030 |
by (auto intro: infdist_le) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2031 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2032 |
fix i |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2033 |
assume inf: "\<And>d. d \<in> {dist x y + dist y a |a. a \<in> A} \<Longrightarrow> i \<le> d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2034 |
then have "i - dist x y \<le> infdist y A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2035 |
unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>] using \<open>a \<in> A\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2036 |
by (intro cINF_greatest) (auto simp: field_simps) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2037 |
then show "i \<le> dist x y + infdist y A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2038 |
by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2039 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2040 |
finally show ?thesis by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2041 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2042 |
|
70724 | 2043 |
lemma infdist_triangle_abs: "\<bar>infdist x A - infdist y A\<bar> \<le> dist x y" |
2044 |
by (metis (full_types) abs_diff_le_iff diff_le_eq dist_commute infdist_triangle) |
|
2045 |
||
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2046 |
lemma in_closure_iff_infdist_zero: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2047 |
assumes "A \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2048 |
shows "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2049 |
proof |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2050 |
assume "x \<in> closure A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2051 |
show "infdist x A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2052 |
proof (rule ccontr) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2053 |
assume "infdist x A \<noteq> 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2054 |
with infdist_nonneg[of x A] have "infdist x A > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2055 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2056 |
then have "ball x (infdist x A) \<inter> closure A = {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2057 |
apply auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2058 |
apply (metis \<open>x \<in> closure A\<close> closure_approachable dist_commute infdist_le not_less) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2059 |
done |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2060 |
then have "x \<notin> closure A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2061 |
by (metis \<open>0 < infdist x A\<close> centre_in_ball disjoint_iff_not_equal) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2062 |
then show False using \<open>x \<in> closure A\<close> by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2063 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2064 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2065 |
assume x: "infdist x A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2066 |
then obtain a where "a \<in> A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2067 |
by atomize_elim (metis all_not_in_conv assms) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2068 |
show "x \<in> closure A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2069 |
unfolding closure_approachable |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2070 |
apply safe |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2071 |
proof (rule ccontr) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2072 |
fix e :: real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2073 |
assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2074 |
assume "\<not> (\<exists>y\<in>A. dist y x < e)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2075 |
then have "infdist x A \<ge> e" using \<open>a \<in> A\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2076 |
unfolding infdist_def |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2077 |
by (force simp: dist_commute intro: cINF_greatest) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2078 |
with x \<open>e > 0\<close> show False by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2079 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2080 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2081 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2082 |
lemma in_closed_iff_infdist_zero: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2083 |
assumes "closed A" "A \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2084 |
shows "x \<in> A \<longleftrightarrow> infdist x A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2085 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2086 |
have "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2087 |
by (rule in_closure_iff_infdist_zero) fact |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2088 |
with assms show ?thesis by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2089 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2090 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2091 |
lemma infdist_pos_not_in_closed: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2092 |
assumes "closed S" "S \<noteq> {}" "x \<notin> S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2093 |
shows "infdist x S > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2094 |
using in_closed_iff_infdist_zero[OF assms(1) assms(2), of x] assms(3) infdist_nonneg le_less by fastforce |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2095 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2096 |
lemma |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2097 |
infdist_attains_inf: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2098 |
fixes X::"'a::heine_borel set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2099 |
assumes "closed X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2100 |
assumes "X \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2101 |
obtains x where "x \<in> X" "infdist y X = dist y x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2102 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2103 |
have "bdd_below (dist y ` X)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2104 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2105 |
from distance_attains_inf[OF assms, of y] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2106 |
obtain x where INF: "x \<in> X" "\<And>z. z \<in> X \<Longrightarrow> dist y x \<le> dist y z" by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2107 |
have "infdist y X = dist y x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2108 |
by (auto simp: infdist_def assms |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2109 |
intro!: antisym cINF_lower[OF _ \<open>x \<in> X\<close>] cINF_greatest[OF assms(2) INF(2)]) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2110 |
with \<open>x \<in> X\<close> show ?thesis .. |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2111 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2112 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2113 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2114 |
text \<open>Every metric space is a T4 space:\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2115 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2116 |
instance metric_space \<subseteq> t4_space |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2117 |
proof |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2118 |
fix S T::"'a set" assume H: "closed S" "closed T" "S \<inter> T = {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2119 |
consider "S = {}" | "T = {}" | "S \<noteq> {} \<and> T \<noteq> {}" by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2120 |
then show "\<exists>U V. open U \<and> open V \<and> S \<subseteq> U \<and> T \<subseteq> V \<and> U \<inter> V = {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2121 |
proof (cases) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2122 |
case 1 |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2123 |
show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2124 |
apply (rule exI[of _ "{}"], rule exI[of _ UNIV]) using 1 by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2125 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2126 |
case 2 |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2127 |
show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2128 |
apply (rule exI[of _ UNIV], rule exI[of _ "{}"]) using 2 by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2129 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2130 |
case 3 |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2131 |
define U where "U = (\<Union>x\<in>S. ball x ((infdist x T)/2))" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2132 |
have A: "open U" unfolding U_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2133 |
have "infdist x T > 0" if "x \<in> S" for x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2134 |
using H that 3 by (auto intro!: infdist_pos_not_in_closed) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2135 |
then have B: "S \<subseteq> U" unfolding U_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2136 |
define V where "V = (\<Union>x\<in>T. ball x ((infdist x S)/2))" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2137 |
have C: "open V" unfolding V_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2138 |
have "infdist x S > 0" if "x \<in> T" for x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2139 |
using H that 3 by (auto intro!: infdist_pos_not_in_closed) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2140 |
then have D: "T \<subseteq> V" unfolding V_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2141 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2142 |
have "(ball x ((infdist x T)/2)) \<inter> (ball y ((infdist y S)/2)) = {}" if "x \<in> S" "y \<in> T" for x y |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2143 |
proof auto |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2144 |
fix z assume H: "dist x z * 2 < infdist x T" "dist y z * 2 < infdist y S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2145 |
have "2 * dist x y \<le> 2 * dist x z + 2 * dist y z" |
70960 | 2146 |
by metric |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2147 |
also have "... < infdist x T + infdist y S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2148 |
using H by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2149 |
finally have "dist x y < infdist x T \<or> dist x y < infdist y S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2150 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2151 |
then show False |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2152 |
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) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2153 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2154 |
then have E: "U \<inter> V = {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2155 |
unfolding U_def V_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2156 |
show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2157 |
apply (rule exI[of _ U], rule exI[of _ V]) using A B C D E by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2158 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2159 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2160 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2161 |
lemma tendsto_infdist [tendsto_intros]: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2162 |
assumes f: "(f \<longlongrightarrow> l) F" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2163 |
shows "((\<lambda>x. infdist (f x) A) \<longlongrightarrow> infdist l A) F" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2164 |
proof (rule tendstoI) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2165 |
fix e ::real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2166 |
assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2167 |
from tendstoD[OF f this] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2168 |
show "eventually (\<lambda>x. dist (infdist (f x) A) (infdist l A) < e) F" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2169 |
proof (eventually_elim) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2170 |
fix x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2171 |
from infdist_triangle[of l A "f x"] infdist_triangle[of "f x" A l] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2172 |
have "dist (infdist (f x) A) (infdist l A) \<le> dist (f x) l" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2173 |
by (simp add: dist_commute dist_real_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2174 |
also assume "dist (f x) l < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2175 |
finally show "dist (infdist (f x) A) (infdist l A) < e" . |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2176 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2177 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2178 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2179 |
lemma continuous_infdist[continuous_intros]: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2180 |
assumes "continuous F f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2181 |
shows "continuous F (\<lambda>x. infdist (f x) A)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2182 |
using assms unfolding continuous_def by (rule tendsto_infdist) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2183 |
|
70723
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
2184 |
lemma continuous_on_infdist [continuous_intros]: |
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
2185 |
assumes "continuous_on S f" |
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
2186 |
shows "continuous_on S (\<lambda>x. infdist (f x) A)" |
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
2187 |
using assms unfolding continuous_on by (auto intro: tendsto_infdist) |
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
2188 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2189 |
lemma compact_infdist_le: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2190 |
fixes A::"'a::heine_borel set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2191 |
assumes "A \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2192 |
assumes "compact A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2193 |
assumes "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2194 |
shows "compact {x. infdist x A \<le> e}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2195 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2196 |
from continuous_closed_vimage[of "{0..e}" "\<lambda>x. infdist x A"] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2197 |
continuous_infdist[OF continuous_ident, of _ UNIV A] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2198 |
have "closed {x. infdist x A \<le> e}" by (auto simp: vimage_def infdist_nonneg) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2199 |
moreover |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2200 |
from assms obtain x0 b where b: "\<And>x. x \<in> A \<Longrightarrow> dist x0 x \<le> b" "closed A" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2201 |
by (auto simp: compact_eq_bounded_closed bounded_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2202 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2203 |
fix y |
70960 | 2204 |
assume "infdist y A \<le> e" |
2205 |
moreover |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2206 |
from infdist_attains_inf[OF \<open>closed A\<close> \<open>A \<noteq> {}\<close>, of y] |
70960 | 2207 |
obtain z where "z \<in> A" "infdist y A = dist y z" by blast |
2208 |
ultimately |
|
2209 |
have "dist x0 y \<le> b + e" using b by metric |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2210 |
} then |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2211 |
have "bounded {x. infdist x A \<le> e}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2212 |
by (auto simp: bounded_any_center[where a=x0] intro!: exI[where x="b + e"]) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2213 |
ultimately show "compact {x. infdist x A \<le> e}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2214 |
by (simp add: compact_eq_bounded_closed) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2215 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2216 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2217 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2218 |
subsection \<open>Separation between Points and Sets\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2219 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2220 |
proposition separate_point_closed: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2221 |
fixes s :: "'a::heine_borel set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2222 |
assumes "closed s" and "a \<notin> s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2223 |
shows "\<exists>d>0. \<forall>x\<in>s. d \<le> dist a x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2224 |
proof (cases "s = {}") |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2225 |
case True |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2226 |
then show ?thesis by(auto intro!: exI[where x=1]) |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2227 |
next |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2228 |
case False |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2229 |
from assms obtain x where "x\<in>s" "\<forall>y\<in>s. dist a x \<le> dist a y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2230 |
using \<open>s \<noteq> {}\<close> by (blast intro: distance_attains_inf [of s a]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2231 |
with \<open>x\<in>s\<close> show ?thesis using dist_pos_lt[of a x] and\<open>a \<notin> s\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2232 |
by blast |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2233 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2234 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2235 |
proposition separate_compact_closed: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2236 |
fixes s t :: "'a::heine_borel set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2237 |
assumes "compact s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2238 |
and t: "closed t" "s \<inter> t = {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2239 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2240 |
proof cases |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2241 |
assume "s \<noteq> {} \<and> t \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2242 |
then have "s \<noteq> {}" "t \<noteq> {}" by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2243 |
let ?inf = "\<lambda>x. infdist x t" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2244 |
have "continuous_on s ?inf" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2245 |
by (auto intro!: continuous_at_imp_continuous_on continuous_infdist continuous_ident) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2246 |
then obtain x where x: "x \<in> s" "\<forall>y\<in>s. ?inf x \<le> ?inf y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2247 |
using continuous_attains_inf[OF \<open>compact s\<close> \<open>s \<noteq> {}\<close>] by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2248 |
then have "0 < ?inf x" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2249 |
using t \<open>t \<noteq> {}\<close> in_closed_iff_infdist_zero by (auto simp: less_le infdist_nonneg) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2250 |
moreover have "\<forall>x'\<in>s. \<forall>y\<in>t. ?inf x \<le> dist x' y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2251 |
using x by (auto intro: order_trans infdist_le) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2252 |
ultimately show ?thesis by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2253 |
qed (auto intro!: exI[of _ 1]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2254 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2255 |
proposition separate_closed_compact: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2256 |
fixes s t :: "'a::heine_borel set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2257 |
assumes "closed s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2258 |
and "compact t" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2259 |
and "s \<inter> t = {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2260 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2261 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2262 |
have *: "t \<inter> s = {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2263 |
using assms(3) by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2264 |
show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2265 |
using separate_compact_closed[OF assms(2,1) *] by (force simp: dist_commute) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2266 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2267 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2268 |
proposition compact_in_open_separated: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2269 |
fixes A::"'a::heine_borel set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2270 |
assumes "A \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2271 |
assumes "compact A" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2272 |
assumes "open B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2273 |
assumes "A \<subseteq> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2274 |
obtains e where "e > 0" "{x. infdist x A \<le> e} \<subseteq> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2275 |
proof atomize_elim |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2276 |
have "closed (- B)" "compact A" "- B \<inter> A = {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2277 |
using assms by (auto simp: open_Diff compact_eq_bounded_closed) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2278 |
from separate_closed_compact[OF this] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2279 |
obtain d'::real where d': "d'>0" "\<And>x y. x \<notin> B \<Longrightarrow> y \<in> A \<Longrightarrow> d' \<le> dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2280 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2281 |
define d where "d = d' / 2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2282 |
hence "d>0" "d < d'" using d' by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2283 |
with d' have d: "\<And>x y. x \<notin> B \<Longrightarrow> y \<in> A \<Longrightarrow> d < dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2284 |
by force |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2285 |
show "\<exists>e>0. {x. infdist x A \<le> e} \<subseteq> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2286 |
proof (rule ccontr) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2287 |
assume "\<nexists>e. 0 < e \<and> {x. infdist x A \<le> e} \<subseteq> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2288 |
with \<open>d > 0\<close> obtain x where x: "infdist x A \<le> d" "x \<notin> B" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2289 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2290 |
from assms have "closed A" "A \<noteq> {}" by (auto simp: compact_eq_bounded_closed) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2291 |
from infdist_attains_inf[OF this] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2292 |
obtain y where y: "y \<in> A" "infdist x A = dist x y" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2293 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2294 |
have "dist x y \<le> d" using x y by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2295 |
also have "\<dots> < dist x y" using y d x by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2296 |
finally show False by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2297 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2298 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2299 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2300 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2301 |
subsection \<open>Uniform Continuity\<close> |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2302 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2303 |
lemma uniformly_continuous_onE: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2304 |
assumes "uniformly_continuous_on s f" "0 < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2305 |
obtains d where "d>0" "\<And>x x'. \<lbrakk>x\<in>s; x'\<in>s; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2306 |
using assms |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2307 |
by (auto simp: uniformly_continuous_on_def) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2308 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2309 |
lemma uniformly_continuous_on_sequentially: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2310 |
"uniformly_continuous_on s f \<longleftrightarrow> (\<forall>x y. (\<forall>n. x n \<in> s) \<and> (\<forall>n. y n \<in> s) \<and> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2311 |
(\<lambda>n. dist (x n) (y n)) \<longlonglongrightarrow> 0 \<longrightarrow> (\<lambda>n. dist (f(x n)) (f(y n))) \<longlonglongrightarrow> 0)" (is "?lhs = ?rhs") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2312 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2313 |
assume ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2314 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2315 |
fix x y |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2316 |
assume x: "\<forall>n. x n \<in> s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2317 |
and y: "\<forall>n. y n \<in> s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2318 |
and xy: "((\<lambda>n. dist (x n) (y n)) \<longlongrightarrow> 0) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2319 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2320 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2321 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2322 |
then obtain d where "d > 0" and d: "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2323 |
using \<open>?lhs\<close>[unfolded uniformly_continuous_on_def, THEN spec[where x=e]] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2324 |
obtain N where N: "\<forall>n\<ge>N. dist (x n) (y n) < d" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2325 |
using xy[unfolded lim_sequentially dist_norm] and \<open>d>0\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2326 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2327 |
fix n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2328 |
assume "n\<ge>N" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2329 |
then have "dist (f (x n)) (f (y n)) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2330 |
using N[THEN spec[where x=n]] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2331 |
using d[THEN bspec[where x="x n"], THEN bspec[where x="y n"]] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2332 |
using x and y |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2333 |
by (simp add: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2334 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2335 |
then have "\<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2336 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2337 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2338 |
then have "((\<lambda>n. dist (f(x n)) (f(y n))) \<longlongrightarrow> 0) sequentially" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2339 |
unfolding lim_sequentially and dist_real_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2340 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2341 |
then show ?rhs by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2342 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2343 |
assume ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2344 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2345 |
assume "\<not> ?lhs" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2346 |
then obtain e where "e > 0" "\<forall>d>0. \<exists>x\<in>s. \<exists>x'\<in>s. dist x' x < d \<and> \<not> dist (f x') (f x) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2347 |
unfolding uniformly_continuous_on_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2348 |
then obtain fa where fa: |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2349 |
"\<forall>x. 0 < x \<longrightarrow> fst (fa x) \<in> s \<and> snd (fa x) \<in> s \<and> dist (fst (fa x)) (snd (fa x)) < x \<and> \<not> dist (f (fst (fa x))) (f (snd (fa x))) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2350 |
using choice[of "\<lambda>d x. d>0 \<longrightarrow> fst x \<in> s \<and> snd x \<in> s \<and> dist (snd x) (fst x) < d \<and> \<not> dist (f (snd x)) (f (fst x)) < e"] |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2351 |
unfolding Bex_def |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2352 |
by (auto simp: dist_commute) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2353 |
define x where "x n = fst (fa (inverse (real n + 1)))" for n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2354 |
define y where "y n = snd (fa (inverse (real n + 1)))" for n |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2355 |
have xyn: "\<forall>n. x n \<in> s \<and> y n \<in> s" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2356 |
and xy0: "\<forall>n. dist (x n) (y n) < inverse (real n + 1)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2357 |
and fxy:"\<forall>n. \<not> dist (f (x n)) (f (y n)) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2358 |
unfolding x_def and y_def using fa |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2359 |
by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2360 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2361 |
fix e :: real |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2362 |
assume "e > 0" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2363 |
then obtain N :: nat where "N \<noteq> 0" and N: "0 < inverse (real N) \<and> inverse (real N) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2364 |
unfolding real_arch_inverse[of e] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2365 |
{ |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2366 |
fix n :: nat |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2367 |
assume "n \<ge> N" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2368 |
then have "inverse (real n + 1) < inverse (real N)" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2369 |
using of_nat_0_le_iff and \<open>N\<noteq>0\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2370 |
also have "\<dots> < e" using N by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2371 |
finally have "inverse (real n + 1) < e" by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2372 |
then have "dist (x n) (y n) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2373 |
using xy0[THEN spec[where x=n]] by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2374 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2375 |
then have "\<exists>N. \<forall>n\<ge>N. dist (x n) (y n) < e" by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2376 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2377 |
then have "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2378 |
using \<open>?rhs\<close>[THEN spec[where x=x], THEN spec[where x=y]] and xyn |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2379 |
unfolding lim_sequentially dist_real_def by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2380 |
then have False using fxy and \<open>e>0\<close> by auto |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2381 |
} |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2382 |
then show ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2383 |
unfolding uniformly_continuous_on_def by blast |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2384 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2385 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2386 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2387 |
subsection \<open>Continuity on a Compact Domain Implies Uniform Continuity\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2388 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2389 |
text\<open>From the proof of the Heine-Borel theorem: Lemma 2 in section 3.7, page 69 of |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2390 |
J. C. Burkill and H. Burkill. A Second Course in Mathematical Analysis (CUP, 2002)\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2391 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2392 |
lemma Heine_Borel_lemma: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2393 |
assumes "compact S" and Ssub: "S \<subseteq> \<Union>\<G>" and opn: "\<And>G. G \<in> \<G> \<Longrightarrow> open G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2394 |
obtains e where "0 < e" "\<And>x. x \<in> S \<Longrightarrow> \<exists>G \<in> \<G>. ball x e \<subseteq> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2395 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2396 |
have False if neg: "\<And>e. 0 < e \<Longrightarrow> \<exists>x \<in> S. \<forall>G \<in> \<G>. \<not> ball x e \<subseteq> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2397 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2398 |
have "\<exists>x \<in> S. \<forall>G \<in> \<G>. \<not> ball x (1 / Suc n) \<subseteq> G" for n |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2399 |
using neg by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2400 |
then obtain f where "\<And>n. f n \<in> S" and fG: "\<And>G n. G \<in> \<G> \<Longrightarrow> \<not> ball (f n) (1 / Suc n) \<subseteq> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2401 |
by metis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2402 |
then obtain l r where "l \<in> S" "strict_mono r" and to_l: "(f \<circ> r) \<longlonglongrightarrow> l" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2403 |
using \<open>compact S\<close> compact_def that by metis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2404 |
then obtain G where "l \<in> G" "G \<in> \<G>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2405 |
using Ssub by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2406 |
then obtain e where "0 < e" and e: "\<And>z. dist z l < e \<Longrightarrow> z \<in> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2407 |
using opn open_dist by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2408 |
obtain N1 where N1: "\<And>n. n \<ge> N1 \<Longrightarrow> dist (f (r n)) l < e/2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2409 |
using to_l apply (simp add: lim_sequentially) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2410 |
using \<open>0 < e\<close> half_gt_zero that by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2411 |
obtain N2 where N2: "of_nat N2 > 2/e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2412 |
using reals_Archimedean2 by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2413 |
obtain x where "x \<in> ball (f (r (max N1 N2))) (1 / real (Suc (r (max N1 N2))))" and "x \<notin> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2414 |
using fG [OF \<open>G \<in> \<G>\<close>, of "r (max N1 N2)"] by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2415 |
then have "dist (f (r (max N1 N2))) x < 1 / real (Suc (r (max N1 N2)))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2416 |
by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2417 |
also have "... \<le> 1 / real (Suc (max N1 N2))" |
70817
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents:
70724
diff
changeset
|
2418 |
apply (simp add: field_split_simps del: max.bounded_iff) |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2419 |
using \<open>strict_mono r\<close> seq_suble by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2420 |
also have "... \<le> 1 / real (Suc N2)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2421 |
by (simp add: field_simps) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2422 |
also have "... < e/2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2423 |
using N2 \<open>0 < e\<close> by (simp add: field_simps) |
72225 | 2424 |
finally have "dist (f (r (max N1 N2))) x < e/2" . |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2425 |
moreover have "dist (f (r (max N1 N2))) l < e/2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2426 |
using N1 max.cobounded1 by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2427 |
ultimately have "dist x l < e" |
70960 | 2428 |
by metric |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2429 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2430 |
using e \<open>x \<notin> G\<close> by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2431 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2432 |
then show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2433 |
by (meson that) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2434 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2435 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2436 |
lemma compact_uniformly_equicontinuous: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2437 |
assumes "compact S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2438 |
and cont: "\<And>x e. \<lbrakk>x \<in> S; 0 < e\<rbrakk> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2439 |
\<Longrightarrow> \<exists>d. 0 < d \<and> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2440 |
(\<forall>f \<in> \<F>. \<forall>x' \<in> S. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2441 |
and "0 < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2442 |
obtains d where "0 < d" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2443 |
"\<And>f x x'. \<lbrakk>f \<in> \<F>; x \<in> S; x' \<in> S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2444 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2445 |
obtain d where d_pos: "\<And>x e. \<lbrakk>x \<in> S; 0 < e\<rbrakk> \<Longrightarrow> 0 < d x e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2446 |
and d_dist : "\<And>x x' e f. \<lbrakk>dist x' x < d x e; x \<in> S; x' \<in> S; 0 < e; f \<in> \<F>\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2447 |
using cont by metis |
72225 | 2448 |
let ?\<G> = "((\<lambda>x. ball x (d x (e/2))) ` S)" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2449 |
have Ssub: "S \<subseteq> \<Union> ?\<G>" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2450 |
by clarsimp (metis d_pos \<open>0 < e\<close> dist_self half_gt_zero_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2451 |
then obtain k where "0 < k" and k: "\<And>x. x \<in> S \<Longrightarrow> \<exists>G \<in> ?\<G>. ball x k \<subseteq> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2452 |
by (rule Heine_Borel_lemma [OF \<open>compact S\<close>]) auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2453 |
moreover have "dist (f v) (f u) < e" if "f \<in> \<F>" "u \<in> S" "v \<in> S" "dist v u < k" for f u v |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2454 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2455 |
obtain G where "G \<in> ?\<G>" "u \<in> G" "v \<in> G" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2456 |
using k that |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2457 |
by (metis \<open>dist v u < k\<close> \<open>u \<in> S\<close> \<open>0 < k\<close> centre_in_ball subsetD dist_commute mem_ball) |
72225 | 2458 |
then obtain w where w: "dist w u < d w (e/2)" "dist w v < d w (e/2)" "w \<in> S" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2459 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2460 |
with that d_dist have "dist (f w) (f v) < e/2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2461 |
by (metis \<open>0 < e\<close> dist_commute half_gt_zero) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2462 |
moreover |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2463 |
have "dist (f w) (f u) < e/2" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2464 |
using that d_dist w by (metis \<open>0 < e\<close> dist_commute divide_pos_pos zero_less_numeral) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2465 |
ultimately show ?thesis |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2466 |
using dist_triangle_half_r by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2467 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2468 |
ultimately show ?thesis using that by blast |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2469 |
qed |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2470 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2471 |
corollary compact_uniformly_continuous: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2472 |
fixes f :: "'a :: metric_space \<Rightarrow> 'b :: metric_space" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2473 |
assumes f: "continuous_on S f" and S: "compact S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2474 |
shows "uniformly_continuous_on S f" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2475 |
using f |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2476 |
unfolding continuous_on_iff uniformly_continuous_on_def |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2477 |
by (force intro: compact_uniformly_equicontinuous [OF S, of "{f}"]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2478 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2479 |
|
70136 | 2480 |
subsection\<^marker>\<open>tag unimportant\<close>\<open> Theorems relating continuity and uniform continuity to closures\<close> |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2481 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2482 |
lemma continuous_on_closure: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2483 |
"continuous_on (closure S) f \<longleftrightarrow> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2484 |
(\<forall>x e. x \<in> closure S \<and> 0 < e |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2485 |
\<longrightarrow> (\<exists>d. 0 < d \<and> (\<forall>y. y \<in> S \<and> dist y x < d \<longrightarrow> dist (f y) (f x) < e)))" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2486 |
(is "?lhs = ?rhs") |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2487 |
proof |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2488 |
assume ?lhs then show ?rhs |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2489 |
unfolding continuous_on_iff by (metis Un_iff closure_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2490 |
next |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2491 |
assume R [rule_format]: ?rhs |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2492 |
show ?lhs |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2493 |
proof |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2494 |
fix x and e::real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2495 |
assume "0 < e" and x: "x \<in> closure S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2496 |
obtain \<delta>::real where "\<delta> > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2497 |
and \<delta>: "\<And>y. \<lbrakk>y \<in> S; dist y x < \<delta>\<rbrakk> \<Longrightarrow> dist (f y) (f x) < e/2" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2498 |
using R [of x "e/2"] \<open>0 < e\<close> x by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2499 |
have "dist (f y) (f x) \<le> e" if y: "y \<in> closure S" and dyx: "dist y x < \<delta>/2" for y |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2500 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2501 |
obtain \<delta>'::real where "\<delta>' > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2502 |
and \<delta>': "\<And>z. \<lbrakk>z \<in> S; dist z y < \<delta>'\<rbrakk> \<Longrightarrow> dist (f z) (f y) < e/2" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2503 |
using R [of y "e/2"] \<open>0 < e\<close> y by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2504 |
obtain z where "z \<in> S" and z: "dist z y < min \<delta>' \<delta> / 2" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2505 |
using closure_approachable y |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2506 |
by (metis \<open>0 < \<delta>'\<close> \<open>0 < \<delta>\<close> divide_pos_pos min_less_iff_conj zero_less_numeral) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2507 |
have "dist (f z) (f y) < e/2" |
70960 | 2508 |
using \<delta>' [OF \<open>z \<in> S\<close>] z \<open>0 < \<delta>'\<close> by metric |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2509 |
moreover have "dist (f z) (f x) < e/2" |
70960 | 2510 |
using \<delta>[OF \<open>z \<in> S\<close>] z dyx by metric |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2511 |
ultimately show ?thesis |
70960 | 2512 |
by metric |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2513 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2514 |
then show "\<exists>d>0. \<forall>x'\<in>closure S. dist x' x < d \<longrightarrow> dist (f x') (f x) \<le> e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2515 |
by (rule_tac x="\<delta>/2" in exI) (simp add: \<open>\<delta> > 0\<close>) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2516 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2517 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2518 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2519 |
lemma continuous_on_closure_sequentially: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2520 |
fixes f :: "'a::metric_space \<Rightarrow> 'b :: metric_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2521 |
shows |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2522 |
"continuous_on (closure S) f \<longleftrightarrow> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2523 |
(\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2524 |
(is "?lhs = ?rhs") |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2525 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2526 |
have "continuous_on (closure S) f \<longleftrightarrow> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2527 |
(\<forall>x \<in> closure S. continuous (at x within S) f)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2528 |
by (force simp: continuous_on_closure continuous_within_eps_delta) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2529 |
also have "... = ?rhs" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2530 |
by (force simp: continuous_within_sequentially) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2531 |
finally show ?thesis . |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2532 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2533 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2534 |
lemma uniformly_continuous_on_closure: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2535 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2536 |
assumes ucont: "uniformly_continuous_on S f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2537 |
and cont: "continuous_on (closure S) f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2538 |
shows "uniformly_continuous_on (closure S) f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2539 |
unfolding uniformly_continuous_on_def |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2540 |
proof (intro allI impI) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2541 |
fix e::real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2542 |
assume "0 < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2543 |
then obtain d::real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2544 |
where "d>0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2545 |
and d: "\<And>x x'. \<lbrakk>x\<in>S; x'\<in>S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e/3" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2546 |
using ucont [unfolded uniformly_continuous_on_def, rule_format, of "e/3"] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2547 |
show "\<exists>d>0. \<forall>x\<in>closure S. \<forall>x'\<in>closure S. dist x' x < d \<longrightarrow> dist (f x') (f x) < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2548 |
proof (rule exI [where x="d/3"], clarsimp simp: \<open>d > 0\<close>) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2549 |
fix x y |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2550 |
assume x: "x \<in> closure S" and y: "y \<in> closure S" and dyx: "dist y x * 3 < d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2551 |
obtain d1::real where "d1 > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2552 |
and d1: "\<And>w. \<lbrakk>w \<in> closure S; dist w x < d1\<rbrakk> \<Longrightarrow> dist (f w) (f x) < e/3" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2553 |
using cont [unfolded continuous_on_iff, rule_format, of "x" "e/3"] \<open>0 < e\<close> x by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2554 |
obtain x' where "x' \<in> S" and x': "dist x' x < min d1 (d / 3)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2555 |
using closure_approachable [of x S] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2556 |
by (metis \<open>0 < d1\<close> \<open>0 < d\<close> divide_pos_pos min_less_iff_conj x zero_less_numeral) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2557 |
obtain d2::real where "d2 > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2558 |
and d2: "\<forall>w \<in> closure S. dist w y < d2 \<longrightarrow> dist (f w) (f y) < e/3" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2559 |
using cont [unfolded continuous_on_iff, rule_format, of "y" "e/3"] \<open>0 < e\<close> y by auto |
70960 | 2560 |
obtain y' where "y' \<in> S" and y': "dist y' y < min d2 (d / 3)" |
2561 |
using closure_approachable [of y S] |
|
2562 |
by (metis \<open>0 < d2\<close> \<open>0 < d\<close> divide_pos_pos min_less_iff_conj y zero_less_numeral) |
|
2563 |
have "dist x' x < d/3" using x' by auto |
|
2564 |
then have "dist x' y' < d" |
|
2565 |
using dyx y' by metric |
|
2566 |
then have "dist (f x') (f y') < e/3" |
|
2567 |
by (rule d [OF \<open>y' \<in> S\<close> \<open>x' \<in> S\<close>]) |
|
2568 |
moreover have "dist (f x') (f x) < e/3" using \<open>x' \<in> S\<close> closure_subset x' d1 |
|
2569 |
by (simp add: closure_def) |
|
2570 |
moreover have "dist (f y') (f y) < e/3" using \<open>y' \<in> S\<close> closure_subset y' d2 |
|
2571 |
by (simp add: closure_def) |
|
2572 |
ultimately show "dist (f y) (f x) < e" by metric |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2573 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2574 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2575 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2576 |
lemma uniformly_continuous_on_extension_at_closure: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2577 |
fixes f::"'a::metric_space \<Rightarrow> 'b::complete_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2578 |
assumes uc: "uniformly_continuous_on X f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2579 |
assumes "x \<in> closure X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2580 |
obtains l where "(f \<longlongrightarrow> l) (at x within X)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2581 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2582 |
from assms obtain xs where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2583 |
by (auto simp: closure_sequential) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2584 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2585 |
from uniformly_continuous_on_Cauchy[OF uc LIMSEQ_imp_Cauchy, OF xs] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2586 |
obtain l where l: "(\<lambda>n. f (xs n)) \<longlonglongrightarrow> l" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2587 |
by atomize_elim (simp only: convergent_eq_Cauchy) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2588 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2589 |
have "(f \<longlongrightarrow> l) (at x within X)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2590 |
proof (safe intro!: Lim_within_LIMSEQ) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2591 |
fix xs' |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2592 |
assume "\<forall>n. xs' n \<noteq> x \<and> xs' n \<in> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2593 |
and xs': "xs' \<longlonglongrightarrow> x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2594 |
then have "xs' n \<noteq> x" "xs' n \<in> X" for n by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2595 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2596 |
from uniformly_continuous_on_Cauchy[OF uc LIMSEQ_imp_Cauchy, OF \<open>xs' \<longlonglongrightarrow> x\<close> \<open>xs' _ \<in> X\<close>] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2597 |
obtain l' where l': "(\<lambda>n. f (xs' n)) \<longlonglongrightarrow> l'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2598 |
by atomize_elim (simp only: convergent_eq_Cauchy) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2599 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2600 |
show "(\<lambda>n. f (xs' n)) \<longlonglongrightarrow> l" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2601 |
proof (rule tendstoI) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2602 |
fix e::real assume "e > 0" |
72225 | 2603 |
define e' where "e' \<equiv> e/2" |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2604 |
have "e' > 0" using \<open>e > 0\<close> by (simp add: e'_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2605 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2606 |
have "\<forall>\<^sub>F n in sequentially. dist (f (xs n)) l < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2607 |
by (simp add: \<open>0 < e'\<close> l tendstoD) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2608 |
moreover |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2609 |
from uc[unfolded uniformly_continuous_on_def, rule_format, OF \<open>e' > 0\<close>] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2610 |
obtain d where d: "d > 0" "\<And>x x'. x \<in> X \<Longrightarrow> x' \<in> X \<Longrightarrow> dist x x' < d \<Longrightarrow> dist (f x) (f x') < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2611 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2612 |
have "\<forall>\<^sub>F n in sequentially. dist (xs n) (xs' n) < d" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2613 |
by (auto intro!: \<open>0 < d\<close> order_tendstoD tendsto_eq_intros xs xs') |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2614 |
ultimately |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2615 |
show "\<forall>\<^sub>F n in sequentially. dist (f (xs' n)) l < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2616 |
proof eventually_elim |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2617 |
case (elim n) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2618 |
have "dist (f (xs' n)) l \<le> dist (f (xs n)) (f (xs' n)) + dist (f (xs n)) l" |
70960 | 2619 |
by metric |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2620 |
also have "dist (f (xs n)) (f (xs' n)) < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2621 |
by (auto intro!: d xs \<open>xs' _ \<in> _\<close> elim) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2622 |
also note \<open>dist (f (xs n)) l < e'\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2623 |
also have "e' + e' = e" by (simp add: e'_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2624 |
finally show ?case by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2625 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2626 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2627 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2628 |
thus ?thesis .. |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2629 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2630 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2631 |
lemma uniformly_continuous_on_extension_on_closure: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2632 |
fixes f::"'a::metric_space \<Rightarrow> 'b::complete_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2633 |
assumes uc: "uniformly_continuous_on X f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2634 |
obtains g where "uniformly_continuous_on (closure X) g" "\<And>x. x \<in> X \<Longrightarrow> f x = g x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2635 |
"\<And>Y h x. X \<subseteq> Y \<Longrightarrow> Y \<subseteq> closure X \<Longrightarrow> continuous_on Y h \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> f x = h x) \<Longrightarrow> x \<in> Y \<Longrightarrow> h x = g x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2636 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2637 |
from uc have cont_f: "continuous_on X f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2638 |
by (simp add: uniformly_continuous_imp_continuous) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2639 |
obtain y where y: "(f \<longlongrightarrow> y x) (at x within X)" if "x \<in> closure X" for x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2640 |
apply atomize_elim |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2641 |
apply (rule choice) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2642 |
using uniformly_continuous_on_extension_at_closure[OF assms] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2643 |
by metis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2644 |
let ?g = "\<lambda>x. if x \<in> X then f x else y x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2645 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2646 |
have "uniformly_continuous_on (closure X) ?g" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2647 |
unfolding uniformly_continuous_on_def |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2648 |
proof safe |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2649 |
fix e::real assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2650 |
define e' where "e' \<equiv> e / 3" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2651 |
have "e' > 0" using \<open>e > 0\<close> by (simp add: e'_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2652 |
from uc[unfolded uniformly_continuous_on_def, rule_format, OF \<open>0 < e'\<close>] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2653 |
obtain d where "d > 0" and d: "\<And>x x'. x \<in> X \<Longrightarrow> x' \<in> X \<Longrightarrow> dist x' x < d \<Longrightarrow> dist (f x') (f x) < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2654 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2655 |
define d' where "d' = d / 3" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2656 |
have "d' > 0" using \<open>d > 0\<close> by (simp add: d'_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2657 |
show "\<exists>d>0. \<forall>x\<in>closure X. \<forall>x'\<in>closure X. dist x' x < d \<longrightarrow> dist (?g x') (?g x) < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2658 |
proof (safe intro!: exI[where x=d'] \<open>d' > 0\<close>) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2659 |
fix x x' assume x: "x \<in> closure X" and x': "x' \<in> closure X" and dist: "dist x' x < d'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2660 |
then obtain xs xs' where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2661 |
and xs': "xs' \<longlonglongrightarrow> x'" "\<And>n. xs' n \<in> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2662 |
by (auto simp: closure_sequential) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2663 |
have "\<forall>\<^sub>F n in sequentially. dist (xs' n) x' < d'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2664 |
and "\<forall>\<^sub>F n in sequentially. dist (xs n) x < d'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2665 |
by (auto intro!: \<open>0 < d'\<close> order_tendstoD tendsto_eq_intros xs xs') |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2666 |
moreover |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2667 |
have "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> y x" if "x \<in> closure X" "x \<notin> X" "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X" for xs x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2668 |
using that not_eventuallyD |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2669 |
by (force intro!: filterlim_compose[OF y[OF \<open>x \<in> closure X\<close>]] simp: filterlim_at) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2670 |
then have "(\<lambda>x. f (xs' x)) \<longlonglongrightarrow> ?g x'" "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> ?g x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2671 |
using x x' |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2672 |
by (auto intro!: continuous_on_tendsto_compose[OF cont_f] simp: xs' xs) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2673 |
then have "\<forall>\<^sub>F n in sequentially. dist (f (xs' n)) (?g x') < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2674 |
"\<forall>\<^sub>F n in sequentially. dist (f (xs n)) (?g x) < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2675 |
by (auto intro!: \<open>0 < e'\<close> order_tendstoD tendsto_eq_intros) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2676 |
ultimately |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2677 |
have "\<forall>\<^sub>F n in sequentially. dist (?g x') (?g x) < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2678 |
proof eventually_elim |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2679 |
case (elim n) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2680 |
have "dist (?g x') (?g x) \<le> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2681 |
dist (f (xs' n)) (?g x') + dist (f (xs' n)) (f (xs n)) + dist (f (xs n)) (?g x)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2682 |
by (metis add.commute add_le_cancel_left dist_commute dist_triangle dist_triangle_le) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2683 |
also |
70960 | 2684 |
from \<open>dist (xs' n) x' < d'\<close> \<open>dist x' x < d'\<close> \<open>dist (xs n) x < d'\<close> |
2685 |
have "dist (xs' n) (xs n) < d" unfolding d'_def by metric |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2686 |
with \<open>xs _ \<in> X\<close> \<open>xs' _ \<in> X\<close> have "dist (f (xs' n)) (f (xs n)) < e'" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2687 |
by (rule d) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2688 |
also note \<open>dist (f (xs' n)) (?g x') < e'\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2689 |
also note \<open>dist (f (xs n)) (?g x) < e'\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2690 |
finally show ?case by (simp add: e'_def) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2691 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2692 |
then show "dist (?g x') (?g x) < e" by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2693 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2694 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2695 |
moreover have "f x = ?g x" if "x \<in> X" for x using that by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2696 |
moreover |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2697 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2698 |
fix Y h x |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2699 |
assume Y: "x \<in> Y" "X \<subseteq> Y" "Y \<subseteq> closure X" and cont_h: "continuous_on Y h" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2700 |
and extension: "(\<And>x. x \<in> X \<Longrightarrow> f x = h x)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2701 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2702 |
assume "x \<notin> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2703 |
have "x \<in> closure X" using Y by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2704 |
then obtain xs where xs: "xs \<longlonglongrightarrow> x" "\<And>n. xs n \<in> X" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2705 |
by (auto simp: closure_sequential) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2706 |
from continuous_on_tendsto_compose[OF cont_h xs(1)] xs(2) Y |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2707 |
have hx: "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> h x" |
69712 | 2708 |
by (auto simp: subsetD extension) |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2709 |
then have "(\<lambda>x. f (xs x)) \<longlonglongrightarrow> y x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2710 |
using \<open>x \<notin> X\<close> not_eventuallyD xs(2) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2711 |
by (force intro!: filterlim_compose[OF y[OF \<open>x \<in> closure X\<close>]] simp: filterlim_at xs) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2712 |
with hx have "h x = y x" by (rule LIMSEQ_unique) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2713 |
} then |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2714 |
have "h x = ?g x" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2715 |
using extension by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2716 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2717 |
ultimately show ?thesis .. |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2718 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2719 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2720 |
lemma bounded_uniformly_continuous_image: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2721 |
fixes f :: "'a :: heine_borel \<Rightarrow> 'b :: heine_borel" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2722 |
assumes "uniformly_continuous_on S f" "bounded S" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2723 |
shows "bounded(f ` S)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2724 |
by (metis (no_types, lifting) assms bounded_closure_image compact_closure compact_continuous_image compact_eq_bounded_closed image_cong uniformly_continuous_imp_continuous uniformly_continuous_on_extension_on_closure) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2725 |
|
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2726 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2727 |
subsection \<open>With Abstract Topology (TODO: move and remove dependency?)\<close> |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2728 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2729 |
lemma openin_contains_ball: |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2730 |
"openin (top_of_set T) S \<longleftrightarrow> |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2731 |
S \<subseteq> T \<and> (\<forall>x \<in> S. \<exists>e. 0 < e \<and> ball x e \<inter> T \<subseteq> S)" |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2732 |
(is "?lhs = ?rhs") |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2733 |
proof |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2734 |
assume ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2735 |
then show ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2736 |
apply (simp add: openin_open) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2737 |
apply (metis Int_commute Int_mono inf.cobounded2 open_contains_ball order_refl subsetCE) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2738 |
done |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2739 |
next |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2740 |
assume ?rhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2741 |
then show ?lhs |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2742 |
apply (simp add: openin_euclidean_subtopology_iff) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2743 |
by (metis (no_types) Int_iff dist_commute inf.absorb_iff2 mem_ball) |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2744 |
qed |
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2745 |
|
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2746 |
lemma openin_contains_cball: |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2747 |
"openin (top_of_set T) S \<longleftrightarrow> |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2748 |
S \<subseteq> T \<and> (\<forall>x \<in> S. \<exists>e. 0 < e \<and> cball x e \<inter> T \<subseteq> S)" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2749 |
(is "?lhs = ?rhs") |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2750 |
proof |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2751 |
assume ?lhs |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2752 |
then show ?rhs |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2753 |
by (force simp add: openin_contains_ball intro: exI [where x="_/2"]) |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2754 |
next |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2755 |
assume ?rhs |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2756 |
then show ?lhs |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2757 |
by (force simp add: openin_contains_ball) |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
2758 |
qed |
69544
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
immler
parents:
diff
changeset
|
2759 |
|
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2760 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2761 |
subsection \<open>Closed Nest\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2762 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2763 |
text \<open>Bounded closed nest property (proof does not use Heine-Borel)\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2764 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2765 |
lemma bounded_closed_nest: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2766 |
fixes S :: "nat \<Rightarrow> ('a::heine_borel) set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2767 |
assumes "\<And>n. closed (S n)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2768 |
and "\<And>n. S n \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2769 |
and "\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2770 |
and "bounded (S 0)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2771 |
obtains a where "\<And>n. a \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2772 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2773 |
from assms(2) obtain x where x: "\<forall>n. x n \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2774 |
using choice[of "\<lambda>n x. x \<in> S n"] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2775 |
from assms(4,1) have "seq_compact (S 0)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2776 |
by (simp add: bounded_closed_imp_seq_compact) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2777 |
then obtain l r where lr: "l \<in> S 0" "strict_mono r" "(x \<circ> r) \<longlonglongrightarrow> l" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2778 |
using x and assms(3) unfolding seq_compact_def by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2779 |
have "\<forall>n. l \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2780 |
proof |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2781 |
fix n :: nat |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2782 |
have "closed (S n)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2783 |
using assms(1) by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2784 |
moreover have "\<forall>i. (x \<circ> r) i \<in> S i" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2785 |
using x and assms(3) and lr(2) [THEN seq_suble] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2786 |
then have "\<forall>i. (x \<circ> r) (i + n) \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2787 |
using assms(3) by (fast intro!: le_add2) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2788 |
moreover have "(\<lambda>i. (x \<circ> r) (i + n)) \<longlonglongrightarrow> l" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2789 |
using lr(3) by (rule LIMSEQ_ignore_initial_segment) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2790 |
ultimately show "l \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2791 |
by (rule closed_sequentially) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2792 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2793 |
then show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2794 |
using that by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2795 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2796 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2797 |
text \<open>Decreasing case does not even need compactness, just completeness.\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2798 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2799 |
lemma decreasing_closed_nest: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2800 |
fixes S :: "nat \<Rightarrow> ('a::complete_space) set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2801 |
assumes "\<And>n. closed (S n)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2802 |
"\<And>n. S n \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2803 |
"\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2804 |
"\<And>e. e>0 \<Longrightarrow> \<exists>n. \<forall>x\<in>S n. \<forall>y\<in>S n. dist x y < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2805 |
obtains a where "\<And>n. a \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2806 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2807 |
have "\<forall>n. \<exists>x. x \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2808 |
using assms(2) by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2809 |
then have "\<exists>t. \<forall>n. t n \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2810 |
using choice[of "\<lambda>n x. x \<in> S n"] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2811 |
then obtain t where t: "\<forall>n. t n \<in> S n" by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2812 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2813 |
fix e :: real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2814 |
assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2815 |
then obtain N where N: "\<forall>x\<in>S N. \<forall>y\<in>S N. dist x y < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2816 |
using assms(4) by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2817 |
{ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2818 |
fix m n :: nat |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2819 |
assume "N \<le> m \<and> N \<le> n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2820 |
then have "t m \<in> S N" "t n \<in> S N" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2821 |
using assms(3) t unfolding subset_eq t by blast+ |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2822 |
then have "dist (t m) (t n) < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2823 |
using N by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2824 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2825 |
then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (t m) (t n) < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2826 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2827 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2828 |
then have "Cauchy t" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2829 |
unfolding cauchy_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2830 |
then obtain l where l:"(t \<longlongrightarrow> l) sequentially" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2831 |
using complete_UNIV unfolding complete_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2832 |
{ fix n :: nat |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2833 |
{ fix e :: real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2834 |
assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2835 |
then obtain N :: nat where N: "\<forall>n\<ge>N. dist (t n) l < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2836 |
using l[unfolded lim_sequentially] by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2837 |
have "t (max n N) \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2838 |
by (meson assms(3) contra_subsetD max.cobounded1 t) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2839 |
then have "\<exists>y\<in>S n. dist y l < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2840 |
using N max.cobounded2 by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2841 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2842 |
then have "l \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2843 |
using closed_approachable[of "S n" l] assms(1) by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2844 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2845 |
then show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2846 |
using that by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2847 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2848 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2849 |
text \<open>Strengthen it to the intersection actually being a singleton.\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2850 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2851 |
lemma decreasing_closed_nest_sing: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2852 |
fixes S :: "nat \<Rightarrow> 'a::complete_space set" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2853 |
assumes "\<And>n. closed(S n)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2854 |
"\<And>n. S n \<noteq> {}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2855 |
"\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2856 |
"\<And>e. e>0 \<Longrightarrow> \<exists>n. \<forall>x \<in> (S n). \<forall> y\<in>(S n). dist x y < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2857 |
shows "\<exists>a. \<Inter>(range S) = {a}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2858 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2859 |
obtain a where a: "\<forall>n. a \<in> S n" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2860 |
using decreasing_closed_nest[of S] using assms by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2861 |
{ fix b |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2862 |
assume b: "b \<in> \<Inter>(range S)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2863 |
{ fix e :: real |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2864 |
assume "e > 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2865 |
then have "dist a b < e" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2866 |
using assms(4) and b and a by blast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2867 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2868 |
then have "dist a b = 0" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2869 |
by (metis dist_eq_0_iff dist_nz less_le) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2870 |
} |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2871 |
with a have "\<Inter>(range S) = {a}" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2872 |
unfolding image_def by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2873 |
then show ?thesis .. |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2874 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2875 |
|
70136 | 2876 |
subsection\<^marker>\<open>tag unimportant\<close> \<open>Making a continuous function avoid some value in a neighbourhood\<close> |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2877 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2878 |
lemma continuous_within_avoid: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2879 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2880 |
assumes "continuous (at x within s) f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2881 |
and "f x \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2882 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e --> f y \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2883 |
proof - |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2884 |
obtain U where "open U" and "f x \<in> U" and "a \<notin> U" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2885 |
using t1_space [OF \<open>f x \<noteq> a\<close>] by fast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2886 |
have "(f \<longlongrightarrow> f x) (at x within s)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2887 |
using assms(1) by (simp add: continuous_within) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2888 |
then have "eventually (\<lambda>y. f y \<in> U) (at x within s)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2889 |
using \<open>open U\<close> and \<open>f x \<in> U\<close> |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2890 |
unfolding tendsto_def by fast |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2891 |
then have "eventually (\<lambda>y. f y \<noteq> a) (at x within s)" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2892 |
using \<open>a \<notin> U\<close> by (fast elim: eventually_mono) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2893 |
then show ?thesis |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2894 |
using \<open>f x \<noteq> a\<close> by (auto simp: dist_commute eventually_at) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2895 |
qed |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2896 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2897 |
lemma continuous_at_avoid: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2898 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2899 |
assumes "continuous (at x) f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2900 |
and "f x \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2901 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2902 |
using assms continuous_within_avoid[of x UNIV f a] by simp |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2903 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2904 |
lemma continuous_on_avoid: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2905 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2906 |
assumes "continuous_on s f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2907 |
and "x \<in> s" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2908 |
and "f x \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2909 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e \<longrightarrow> f y \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2910 |
using assms(1)[unfolded continuous_on_eq_continuous_within, THEN bspec[where x=x], |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2911 |
OF assms(2)] continuous_within_avoid[of x s f a] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2912 |
using assms(3) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2913 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2914 |
|
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2915 |
lemma continuous_on_open_avoid: |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2916 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2917 |
assumes "continuous_on s f" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2918 |
and "open s" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2919 |
and "x \<in> s" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2920 |
and "f x \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2921 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2922 |
using assms(1)[unfolded continuous_on_eq_continuous_at[OF assms(2)], THEN bspec[where x=x], OF assms(3)] |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2923 |
using continuous_at_avoid[of x f a] assms(4) |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2924 |
by auto |
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
2925 |
|
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2926 |
subsection \<open>Consequences for Real Numbers\<close> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2927 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2928 |
lemma closed_contains_Inf: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2929 |
fixes S :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2930 |
shows "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> closed S \<Longrightarrow> Inf S \<in> S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2931 |
by (metis closure_contains_Inf closure_closed) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2932 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2933 |
lemma closed_subset_contains_Inf: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2934 |
fixes A C :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2935 |
shows "closed C \<Longrightarrow> A \<subseteq> C \<Longrightarrow> A \<noteq> {} \<Longrightarrow> bdd_below A \<Longrightarrow> Inf A \<in> C" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2936 |
by (metis closure_contains_Inf closure_minimal subset_eq) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2937 |
|
70617 | 2938 |
lemma closed_contains_Sup: |
2939 |
fixes S :: "real set" |
|
2940 |
shows "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> closed S \<Longrightarrow> Sup S \<in> S" |
|
2941 |
by (subst closure_closed[symmetric], assumption, rule closure_contains_Sup) |
|
2942 |
||
2943 |
lemma closed_subset_contains_Sup: |
|
2944 |
fixes A C :: "real set" |
|
2945 |
shows "closed C \<Longrightarrow> A \<subseteq> C \<Longrightarrow> A \<noteq> {} \<Longrightarrow> bdd_above A \<Longrightarrow> Sup A \<in> C" |
|
2946 |
by (metis closure_contains_Sup closure_minimal subset_eq) |
|
2947 |
||
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2948 |
lemma atLeastAtMost_subset_contains_Inf: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2949 |
fixes A :: "real set" and a b :: real |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2950 |
shows "A \<noteq> {} \<Longrightarrow> a \<le> b \<Longrightarrow> A \<subseteq> {a..b} \<Longrightarrow> Inf A \<in> {a..b}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2951 |
by (rule closed_subset_contains_Inf) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2952 |
(auto intro: closed_real_atLeastAtMost intro!: bdd_belowI[of A a]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2953 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2954 |
lemma bounded_real: "bounded (S::real set) \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. \<bar>x\<bar> \<le> a)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2955 |
by (simp add: bounded_iff) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2956 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2957 |
lemma bounded_imp_bdd_above: "bounded S \<Longrightarrow> bdd_above (S :: real set)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2958 |
by (auto simp: bounded_def bdd_above_def dist_real_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2959 |
(metis abs_le_D1 abs_minus_commute diff_le_eq) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2960 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2961 |
lemma bounded_imp_bdd_below: "bounded S \<Longrightarrow> bdd_below (S :: real set)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2962 |
by (auto simp: bounded_def bdd_below_def dist_real_def) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2963 |
(metis abs_le_D1 add.commute diff_le_eq) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2964 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2965 |
lemma bounded_has_Sup: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2966 |
fixes S :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2967 |
assumes "bounded S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2968 |
and "S \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2969 |
shows "\<forall>x\<in>S. x \<le> Sup S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2970 |
and "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2971 |
proof |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2972 |
show "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2973 |
using assms by (metis cSup_least) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2974 |
qed (metis cSup_upper assms(1) bounded_imp_bdd_above) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2975 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2976 |
lemma Sup_insert: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2977 |
fixes S :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2978 |
shows "bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2979 |
by (auto simp: bounded_imp_bdd_above sup_max cSup_insert_If) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2980 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2981 |
lemma bounded_has_Inf: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2982 |
fixes S :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2983 |
assumes "bounded S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2984 |
and "S \<noteq> {}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2985 |
shows "\<forall>x\<in>S. x \<ge> Inf S" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2986 |
and "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2987 |
proof |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2988 |
show "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2989 |
using assms by (metis cInf_greatest) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2990 |
qed (metis cInf_lower assms(1) bounded_imp_bdd_below) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2991 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2992 |
lemma Inf_insert: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2993 |
fixes S :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2994 |
shows "bounded S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2995 |
by (auto simp: bounded_imp_bdd_below inf_min cInf_insert_If) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2996 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2997 |
lemma open_real: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2998 |
fixes s :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
2999 |
shows "open s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e>0. \<forall>x'. \<bar>x' - x\<bar> < e --> x' \<in> s)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3000 |
unfolding open_dist dist_norm by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3001 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3002 |
lemma islimpt_approachable_real: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3003 |
fixes s :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3004 |
shows "x islimpt s \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3005 |
unfolding islimpt_approachable dist_norm by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3006 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3007 |
lemma closed_real: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3008 |
fixes s :: "real set" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3009 |
shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0. \<exists>x' \<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3010 |
unfolding closed_limpt islimpt_approachable dist_norm by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3011 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3012 |
lemma continuous_at_real_range: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3013 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3014 |
shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> \<bar>f x' - f x\<bar> < e)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3015 |
unfolding continuous_at |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3016 |
unfolding Lim_at |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3017 |
unfolding dist_norm |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3018 |
apply auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3019 |
apply (erule_tac x=e in allE, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3020 |
apply (rule_tac x=d in exI, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3021 |
apply (erule_tac x=x' in allE, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3022 |
apply (erule_tac x=e in allE, auto) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3023 |
done |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3024 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3025 |
lemma continuous_on_real_range: |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3026 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3027 |
shows "continuous_on s f \<longleftrightarrow> |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3028 |
(\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e))" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3029 |
unfolding continuous_on_iff dist_norm by simp |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3030 |
|
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3031 |
lemma continuous_on_closed_Collect_le: |
69618 | 3032 |
fixes f g :: "'a::topological_space \<Rightarrow> real" |
69613
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3033 |
assumes f: "continuous_on s f" and g: "continuous_on s g" and s: "closed s" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3034 |
shows "closed {x \<in> s. f x \<le> g x}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3035 |
proof - |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3036 |
have "closed ((\<lambda>x. g x - f x) -` {0..} \<inter> s)" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3037 |
using closed_real_atLeast continuous_on_diff [OF g f] |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3038 |
by (simp add: continuous_on_closed_vimage [OF s]) |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3039 |
also have "((\<lambda>x. g x - f x) -` {0..} \<inter> s) = {x\<in>s. f x \<le> g x}" |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3040 |
by auto |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3041 |
finally show ?thesis . |
1331e57b54c6
moved material from Connected.thy to more appropriate places
immler
parents:
69611
diff
changeset
|
3042 |
qed |
69611
42cc3609fedf
moved some material from Connected.thy to more appropriate places
immler
parents:
69544
diff
changeset
|
3043 |
|
69618 | 3044 |
lemma continuous_le_on_closure: |
3045 |
fixes a::real |
|
3046 |
assumes f: "continuous_on (closure s) f" |
|
3047 |
and x: "x \<in> closure(s)" |
|
3048 |
and xlo: "\<And>x. x \<in> s ==> f(x) \<le> a" |
|
3049 |
shows "f(x) \<le> a" |
|
3050 |
using image_closure_subset [OF f, where T=" {x. x \<le> a}" ] assms |
|
3051 |
continuous_on_closed_Collect_le[of "UNIV" "\<lambda>x. x" "\<lambda>x. a"] |
|
3052 |
by auto |
|
3053 |
||
3054 |
lemma continuous_ge_on_closure: |
|
3055 |
fixes a::real |
|
3056 |
assumes f: "continuous_on (closure s) f" |
|
3057 |
and x: "x \<in> closure(s)" |
|
3058 |
and xlo: "\<And>x. x \<in> s ==> f(x) \<ge> a" |
|
3059 |
shows "f(x) \<ge> a" |
|
3060 |
using image_closure_subset [OF f, where T=" {x. a \<le> x}"] assms |
|
3061 |
continuous_on_closed_Collect_le[of "UNIV" "\<lambda>x. a" "\<lambda>x. x"] |
|
3062 |
by auto |
|
3063 |
||
3064 |
||
3065 |
subsection\<open>The infimum of the distance between two sets\<close> |
|
3066 |
||
70136 | 3067 |
definition\<^marker>\<open>tag important\<close> setdist :: "'a::metric_space set \<Rightarrow> 'a set \<Rightarrow> real" where |
69618 | 3068 |
"setdist s t \<equiv> |
3069 |
(if s = {} \<or> t = {} then 0 |
|
3070 |
else Inf {dist x y| x y. x \<in> s \<and> y \<in> t})" |
|
3071 |
||
3072 |
lemma setdist_empty1 [simp]: "setdist {} t = 0" |
|
3073 |
by (simp add: setdist_def) |
|
3074 |
||
3075 |
lemma setdist_empty2 [simp]: "setdist t {} = 0" |
|
3076 |
by (simp add: setdist_def) |
|
3077 |
||
3078 |
lemma setdist_pos_le [simp]: "0 \<le> setdist s t" |
|
3079 |
by (auto simp: setdist_def ex_in_conv [symmetric] intro: cInf_greatest) |
|
3080 |
||
3081 |
lemma le_setdistI: |
|
3082 |
assumes "s \<noteq> {}" "t \<noteq> {}" "\<And>x y. \<lbrakk>x \<in> s; y \<in> t\<rbrakk> \<Longrightarrow> d \<le> dist x y" |
|
3083 |
shows "d \<le> setdist s t" |
|
3084 |
using assms |
|
3085 |
by (auto simp: setdist_def Set.ex_in_conv [symmetric] intro: cInf_greatest) |
|
3086 |
||
3087 |
lemma setdist_le_dist: "\<lbrakk>x \<in> s; y \<in> t\<rbrakk> \<Longrightarrow> setdist s t \<le> dist x y" |
|
3088 |
unfolding setdist_def |
|
3089 |
by (auto intro!: bdd_belowI [where m=0] cInf_lower) |
|
3090 |
||
3091 |
lemma le_setdist_iff: |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3092 |
"d \<le> setdist S T \<longleftrightarrow> |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3093 |
(\<forall>x \<in> S. \<forall>y \<in> T. d \<le> dist x y) \<and> (S = {} \<or> T = {} \<longrightarrow> d \<le> 0)" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3094 |
apply (cases "S = {} \<or> T = {}") |
69618 | 3095 |
apply (force simp add: setdist_def) |
3096 |
apply (intro iffI conjI) |
|
3097 |
using setdist_le_dist apply fastforce |
|
3098 |
apply (auto simp: intro: le_setdistI) |
|
3099 |
done |
|
3100 |
||
3101 |
lemma setdist_ltE: |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3102 |
assumes "setdist S T < b" "S \<noteq> {}" "T \<noteq> {}" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3103 |
obtains x y where "x \<in> S" "y \<in> T" "dist x y < b" |
69618 | 3104 |
using assms |
3105 |
by (auto simp: not_le [symmetric] le_setdist_iff) |
|
3106 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3107 |
lemma setdist_refl: "setdist S S = 0" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3108 |
apply (cases "S = {}") |
69618 | 3109 |
apply (force simp add: setdist_def) |
3110 |
apply (rule antisym [OF _ setdist_pos_le]) |
|
3111 |
apply (metis all_not_in_conv dist_self setdist_le_dist) |
|
3112 |
done |
|
3113 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3114 |
lemma setdist_sym: "setdist S T = setdist T S" |
69618 | 3115 |
by (force simp: setdist_def dist_commute intro!: arg_cong [where f=Inf]) |
3116 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3117 |
lemma setdist_triangle: "setdist S T \<le> setdist S {a} + setdist {a} T" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3118 |
proof (cases "S = {} \<or> T = {}") |
69618 | 3119 |
case True then show ?thesis |
3120 |
using setdist_pos_le by fastforce |
|
3121 |
next |
|
3122 |
case False |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3123 |
then have "\<And>x. x \<in> S \<Longrightarrow> setdist S T - dist x a \<le> setdist {a} T" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3124 |
apply (intro le_setdistI) |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3125 |
apply (simp_all add: algebra_simps) |
69618 | 3126 |
apply (metis dist_commute dist_triangle3 order_trans [OF setdist_le_dist]) |
3127 |
done |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3128 |
then have "setdist S T - setdist {a} T \<le> setdist S {a}" |
69618 | 3129 |
using False by (fastforce intro: le_setdistI) |
3130 |
then show ?thesis |
|
3131 |
by (simp add: algebra_simps) |
|
3132 |
qed |
|
3133 |
||
3134 |
lemma setdist_singletons [simp]: "setdist {x} {y} = dist x y" |
|
3135 |
by (simp add: setdist_def) |
|
3136 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3137 |
lemma setdist_Lipschitz: "\<bar>setdist {x} S - setdist {y} S\<bar> \<le> dist x y" |
69618 | 3138 |
apply (subst setdist_singletons [symmetric]) |
3139 |
by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym) |
|
3140 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3141 |
lemma continuous_at_setdist [continuous_intros]: "continuous (at x) (\<lambda>y. (setdist {y} S))" |
69618 | 3142 |
by (force simp: continuous_at_eps_delta dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) |
3143 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3144 |
lemma continuous_on_setdist [continuous_intros]: "continuous_on T (\<lambda>y. (setdist {y} S))" |
69618 | 3145 |
by (metis continuous_at_setdist continuous_at_imp_continuous_on) |
3146 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3147 |
lemma uniformly_continuous_on_setdist: "uniformly_continuous_on T (\<lambda>y. (setdist {y} S))" |
69618 | 3148 |
by (force simp: uniformly_continuous_on_def dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) |
3149 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3150 |
lemma setdist_subset_right: "\<lbrakk>T \<noteq> {}; T \<subseteq> u\<rbrakk> \<Longrightarrow> setdist S u \<le> setdist S T" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3151 |
apply (cases "S = {} \<or> u = {}", force) |
69618 | 3152 |
apply (auto simp: setdist_def intro!: bdd_belowI [where m=0] cInf_superset_mono) |
3153 |
done |
|
3154 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3155 |
lemma setdist_subset_left: "\<lbrakk>S \<noteq> {}; S \<subseteq> T\<rbrakk> \<Longrightarrow> setdist T u \<le> setdist S u" |
69618 | 3156 |
by (metis setdist_subset_right setdist_sym) |
3157 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3158 |
lemma setdist_closure_1 [simp]: "setdist (closure S) T = setdist S T" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3159 |
proof (cases "S = {} \<or> T = {}") |
69618 | 3160 |
case True then show ?thesis by force |
3161 |
next |
|
3162 |
case False |
|
3163 |
{ fix y |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3164 |
assume "y \<in> T" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3165 |
have "continuous_on (closure S) (\<lambda>a. dist a y)" |
69618 | 3166 |
by (auto simp: continuous_intros dist_norm) |
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3167 |
then have *: "\<And>x. x \<in> closure S \<Longrightarrow> setdist S T \<le> dist x y" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3168 |
by (fast intro: setdist_le_dist \<open>y \<in> T\<close> continuous_ge_on_closure) |
69618 | 3169 |
} note * = this |
3170 |
show ?thesis |
|
3171 |
apply (rule antisym) |
|
3172 |
using False closure_subset apply (blast intro: setdist_subset_left) |
|
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3173 |
using False * apply (force intro!: le_setdistI) |
69618 | 3174 |
done |
3175 |
qed |
|
3176 |
||
72228
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3177 |
lemma setdist_closure_2 [simp]: "setdist T (closure S) = setdist T S" |
aa7cb84983e9
minor tidying, also s->S and t->T
paulson <lp15@cam.ac.uk>
parents:
72225
diff
changeset
|
3178 |
by (metis setdist_closure_1 setdist_sym) |
69618 | 3179 |
|
3180 |
lemma setdist_eq_0I: "\<lbrakk>x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> setdist S T = 0" |
|
3181 |
by (metis antisym dist_self setdist_le_dist setdist_pos_le) |
|
3182 |
||
3183 |
lemma setdist_unique: |
|
3184 |
"\<lbrakk>a \<in> S; b \<in> T; \<And>x y. x \<in> S \<and> y \<in> T ==> dist a b \<le> dist x y\<rbrakk> |
|
3185 |
\<Longrightarrow> setdist S T = dist a b" |
|
3186 |
by (force simp add: setdist_le_dist le_setdist_iff intro: antisym) |
|
3187 |
||
3188 |
lemma setdist_le_sing: "x \<in> S ==> setdist S T \<le> setdist {x} T" |
|
3189 |
using setdist_subset_left by auto |
|
3190 |
||
69918
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3191 |
lemma infdist_eq_setdist: "infdist x A = setdist {x} A" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3192 |
by (simp add: infdist_def setdist_def Setcompr_eq_image) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3193 |
|
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3194 |
lemma setdist_eq_infdist: "setdist A B = (if A = {} then 0 else INF a\<in>A. infdist a B)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3195 |
proof - |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3196 |
have "Inf {dist x y |x y. x \<in> A \<and> y \<in> B} = (INF x\<in>A. Inf (dist x ` B))" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3197 |
if "b \<in> B" "a \<in> A" for a b |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3198 |
proof (rule order_antisym) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3199 |
have "Inf {dist x y |x y. x \<in> A \<and> y \<in> B} \<le> Inf (dist x ` B)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3200 |
if "b \<in> B" "a \<in> A" "x \<in> A" for x |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3201 |
proof - |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3202 |
have *: "\<And>b'. b' \<in> B \<Longrightarrow> Inf {dist x y |x y. x \<in> A \<and> y \<in> B} \<le> dist x b'" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3203 |
by (metis (mono_tags, lifting) ex_in_conv setdist_def setdist_le_dist that(3)) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3204 |
show ?thesis |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3205 |
using that by (subst conditionally_complete_lattice_class.le_cInf_iff) (auto simp: *)+ |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3206 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3207 |
then show "Inf {dist x y |x y. x \<in> A \<and> y \<in> B} \<le> (INF x\<in>A. Inf (dist x ` B))" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3208 |
using that |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3209 |
by (subst conditionally_complete_lattice_class.le_cInf_iff) (auto simp: bdd_below_def) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3210 |
next |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3211 |
have *: "\<And>x y. \<lbrakk>b \<in> B; a \<in> A; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. Inf (dist a ` B) \<le> dist x y" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3212 |
by (meson bdd_below_image_dist cINF_lower) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3213 |
show "(INF x\<in>A. Inf (dist x ` B)) \<le> Inf {dist x y |x y. x \<in> A \<and> y \<in> B}" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3214 |
proof (rule conditionally_complete_lattice_class.cInf_mono) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3215 |
show "bdd_below ((\<lambda>x. Inf (dist x ` B)) ` A)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3216 |
by (metis (no_types, lifting) bdd_belowI2 ex_in_conv infdist_def infdist_nonneg that(1)) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3217 |
qed (use that in \<open>auto simp: *\<close>) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3218 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3219 |
then show ?thesis |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3220 |
by (auto simp: setdist_def infdist_def) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3221 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3222 |
|
70724 | 3223 |
lemma infdist_mono: |
3224 |
assumes "A \<subseteq> B" "A \<noteq> {}" |
|
3225 |
shows "infdist x B \<le> infdist x A" |
|
3226 |
by (simp add: assms infdist_eq_setdist setdist_subset_right) |
|
3227 |
||
3228 |
lemma infdist_singleton [simp]: |
|
3229 |
"infdist x {y} = dist x y" |
|
3230 |
by (simp add: infdist_eq_setdist) |
|
3231 |
||
69918
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3232 |
proposition setdist_attains_inf: |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3233 |
assumes "compact B" "B \<noteq> {}" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3234 |
obtains y where "y \<in> B" "setdist A B = infdist y A" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3235 |
proof (cases "A = {}") |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3236 |
case True |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3237 |
then show thesis |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3238 |
by (metis assms diameter_compact_attained infdist_def setdist_def that) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3239 |
next |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3240 |
case False |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3241 |
obtain y where "y \<in> B" and min: "\<And>y'. y' \<in> B \<Longrightarrow> infdist y A \<le> infdist y' A" |
70723
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
3242 |
by (metis continuous_attains_inf [OF assms continuous_on_infdist] continuous_on_id) |
69918
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3243 |
show thesis |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3244 |
proof |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3245 |
have "setdist A B = (INF y\<in>B. infdist y A)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3246 |
by (metis \<open>B \<noteq> {}\<close> setdist_eq_infdist setdist_sym) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3247 |
also have "\<dots> = infdist y A" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3248 |
proof (rule order_antisym) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3249 |
show "(INF y\<in>B. infdist y A) \<le> infdist y A" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3250 |
proof (rule cInf_lower) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3251 |
show "infdist y A \<in> (\<lambda>y. infdist y A) ` B" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3252 |
using \<open>y \<in> B\<close> by blast |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3253 |
show "bdd_below ((\<lambda>y. infdist y A) ` B)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3254 |
by (meson bdd_belowI2 infdist_nonneg) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3255 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3256 |
next |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3257 |
show "infdist y A \<le> (INF y\<in>B. infdist y A)" |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3258 |
by (simp add: \<open>B \<noteq> {}\<close> cINF_greatest min) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3259 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3260 |
finally show "setdist A B = infdist y A" . |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3261 |
qed (fact \<open>y \<in> B\<close>) |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3262 |
qed |
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents:
69712
diff
changeset
|
3263 |
|
70723
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents:
70617
diff
changeset
|
3264 |
end |