43 |
43 |
44 instantiation |
44 instantiation |
45 "*" :: (topological_space, topological_space) topological_space |
45 "*" :: (topological_space, topological_space) topological_space |
46 begin |
46 begin |
47 |
47 |
48 definition topo_prod_def: |
48 definition open_prod_def: |
49 "topo = {S. \<forall>x\<in>S. \<exists>A\<in>topo. \<exists>B\<in>topo. x \<in> A \<times> B \<and> A \<times> B \<subseteq> S}" |
49 "open (S :: ('a \<times> 'b) set) \<longleftrightarrow> |
|
50 (\<forall>x\<in>S. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S)" |
50 |
51 |
51 instance proof |
52 instance proof |
52 show "(UNIV :: ('a \<times> 'b) set) \<in> topo" |
53 show "open (UNIV :: ('a \<times> 'b) set)" |
53 unfolding topo_prod_def by (auto intro: topo_UNIV) |
54 unfolding open_prod_def by auto |
54 next |
55 next |
55 fix S T :: "('a \<times> 'b) set" |
56 fix S T :: "('a \<times> 'b) set" |
56 assume "S \<in> topo" "T \<in> topo" thus "S \<inter> T \<in> topo" |
57 assume "open S" "open T" thus "open (S \<inter> T)" |
57 unfolding topo_prod_def |
58 unfolding open_prod_def |
58 apply clarify |
59 apply clarify |
59 apply (drule (1) bspec)+ |
60 apply (drule (1) bspec)+ |
60 apply (clarify, rename_tac Sa Ta Sb Tb) |
61 apply (clarify, rename_tac Sa Ta Sb Tb) |
61 apply (rule_tac x="Sa \<inter> Ta" in rev_bexI) |
62 apply (rule_tac x="Sa \<inter> Ta" in exI) |
62 apply (simp add: topo_Int) |
63 apply (rule_tac x="Sb \<inter> Tb" in exI) |
63 apply (rule_tac x="Sb \<inter> Tb" in rev_bexI) |
64 apply (simp add: open_Int) |
64 apply (simp add: topo_Int) |
|
65 apply fast |
65 apply fast |
66 done |
66 done |
67 next |
67 next |
68 fix T :: "('a \<times> 'b) set set" |
68 fix K :: "('a \<times> 'b) set set" |
69 assume "T \<subseteq> topo" thus "\<Union>T \<in> topo" |
69 assume "\<forall>S\<in>K. open S" thus "open (\<Union>K)" |
70 unfolding topo_prod_def Bex_def by fast |
70 unfolding open_prod_def by fast |
71 qed |
71 qed |
72 |
72 |
73 end |
73 end |
74 |
74 |
75 subsection {* Product is a metric space *} |
75 subsection {* Product is a metric space *} |
102 done |
102 done |
103 next |
103 next |
104 (* FIXME: long proof! *) |
104 (* FIXME: long proof! *) |
105 (* Maybe it would be easier to define topological spaces *) |
105 (* Maybe it would be easier to define topological spaces *) |
106 (* in terms of neighborhoods instead of open sets? *) |
106 (* in terms of neighborhoods instead of open sets? *) |
107 show "topo = {S::('a \<times> 'b) set. \<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S}" |
107 fix S :: "('a \<times> 'b) set" |
108 unfolding topo_prod_def topo_dist |
108 show "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S)" |
109 apply (safe, rename_tac S a b) |
109 unfolding open_prod_def open_dist |
|
110 apply safe |
110 apply (drule (1) bspec) |
111 apply (drule (1) bspec) |
111 apply clarify |
112 apply clarify |
112 apply (drule (1) bspec)+ |
113 apply (drule (1) bspec)+ |
113 apply (clarify, rename_tac r s) |
114 apply (clarify, rename_tac r s) |
114 apply (rule_tac x="min r s" in exI, simp) |
115 apply (rule_tac x="min r s" in exI, simp) |
119 apply (drule spec, erule mp) |
120 apply (drule spec, erule mp) |
120 apply (erule le_less_trans [OF real_sqrt_sum_squares_ge1]) |
121 apply (erule le_less_trans [OF real_sqrt_sum_squares_ge1]) |
121 apply (drule spec, erule mp) |
122 apply (drule spec, erule mp) |
122 apply (erule le_less_trans [OF real_sqrt_sum_squares_ge2]) |
123 apply (erule le_less_trans [OF real_sqrt_sum_squares_ge2]) |
123 |
124 |
124 apply (rename_tac S a b) |
|
125 apply (drule (1) bspec) |
125 apply (drule (1) bspec) |
126 apply clarify |
126 apply clarify |
127 apply (subgoal_tac "\<exists>r>0. \<exists>s>0. e = sqrt (r\<twosuperior> + s\<twosuperior>)") |
127 apply (subgoal_tac "\<exists>r>0. \<exists>s>0. e = sqrt (r\<twosuperior> + s\<twosuperior>)") |
128 apply clarify |
128 apply clarify |
129 apply (rule_tac x="{y. dist y a < r}" in rev_bexI) |
129 apply (rule_tac x="{y. dist y a < r}" in exI) |
|
130 apply (rule_tac x="{y. dist y b < s}" in exI) |
|
131 apply (rule conjI) |
130 apply clarify |
132 apply clarify |
131 apply (rule_tac x="r - dist x a" in exI, rule conjI, simp) |
133 apply (rule_tac x="r - dist x a" in exI, rule conjI, simp) |
132 apply clarify |
134 apply clarify |
133 apply (rule le_less_trans [OF dist_triangle]) |
135 apply (rule le_less_trans [OF dist_triangle]) |
134 apply (erule less_le_trans [OF add_strict_right_mono], simp) |
136 apply (erule less_le_trans [OF add_strict_right_mono], simp) |
135 apply (rule_tac x="{y. dist y b < s}" in rev_bexI) |
137 apply (rule conjI) |
136 apply clarify |
138 apply clarify |
137 apply (rule_tac x="s - dist x b" in exI, rule conjI, simp) |
139 apply (rule_tac x="s - dist x b" in exI, rule conjI, simp) |
138 apply clarify |
140 apply clarify |
139 apply (rule le_less_trans [OF dist_triangle]) |
141 apply (rule le_less_trans [OF dist_triangle]) |
140 apply (erule less_le_trans [OF add_strict_right_mono], simp) |
142 apply (erule less_le_trans [OF add_strict_right_mono], simp) |
161 |
163 |
162 lemma tendsto_fst: |
164 lemma tendsto_fst: |
163 assumes "(f ---> a) net" |
165 assumes "(f ---> a) net" |
164 shows "((\<lambda>x. fst (f x)) ---> fst a) net" |
166 shows "((\<lambda>x. fst (f x)) ---> fst a) net" |
165 proof (rule topological_tendstoI) |
167 proof (rule topological_tendstoI) |
166 fix S assume "S \<in> topo" "fst a \<in> S" |
168 fix S assume "open S" "fst a \<in> S" |
167 then have "fst -` S \<in> topo" "a \<in> fst -` S" |
169 then have "open (fst -` S)" "a \<in> fst -` S" |
168 unfolding topo_prod_def |
170 unfolding open_prod_def |
169 apply simp_all |
171 apply simp_all |
170 apply clarify |
172 apply clarify |
171 apply (erule rev_bexI, simp) |
173 apply (rule exI, erule conjI) |
172 apply (rule rev_bexI [OF topo_UNIV]) |
174 apply (rule exI, rule conjI [OF open_UNIV]) |
173 apply auto |
175 apply auto |
174 done |
176 done |
175 with assms have "eventually (\<lambda>x. f x \<in> fst -` S) net" |
177 with assms have "eventually (\<lambda>x. f x \<in> fst -` S) net" |
176 by (rule topological_tendstoD) |
178 by (rule topological_tendstoD) |
177 then show "eventually (\<lambda>x. fst (f x) \<in> S) net" |
179 then show "eventually (\<lambda>x. fst (f x) \<in> S) net" |
180 |
182 |
181 lemma tendsto_snd: |
183 lemma tendsto_snd: |
182 assumes "(f ---> a) net" |
184 assumes "(f ---> a) net" |
183 shows "((\<lambda>x. snd (f x)) ---> snd a) net" |
185 shows "((\<lambda>x. snd (f x)) ---> snd a) net" |
184 proof (rule topological_tendstoI) |
186 proof (rule topological_tendstoI) |
185 fix S assume "S \<in> topo" "snd a \<in> S" |
187 fix S assume "open S" "snd a \<in> S" |
186 then have "snd -` S \<in> topo" "a \<in> snd -` S" |
188 then have "open (snd -` S)" "a \<in> snd -` S" |
187 unfolding topo_prod_def |
189 unfolding open_prod_def |
188 apply simp_all |
190 apply simp_all |
189 apply clarify |
191 apply clarify |
190 apply (rule rev_bexI [OF topo_UNIV]) |
192 apply (rule exI, rule conjI [OF open_UNIV]) |
191 apply (erule rev_bexI) |
193 apply (rule exI, erule conjI) |
192 apply auto |
194 apply auto |
193 done |
195 done |
194 with assms have "eventually (\<lambda>x. f x \<in> snd -` S) net" |
196 with assms have "eventually (\<lambda>x. f x \<in> snd -` S) net" |
195 by (rule topological_tendstoD) |
197 by (rule topological_tendstoD) |
196 then show "eventually (\<lambda>x. snd (f x) \<in> S) net" |
198 then show "eventually (\<lambda>x. snd (f x) \<in> S) net" |
199 |
201 |
200 lemma tendsto_Pair: |
202 lemma tendsto_Pair: |
201 assumes "(f ---> a) net" and "(g ---> b) net" |
203 assumes "(f ---> a) net" and "(g ---> b) net" |
202 shows "((\<lambda>x. (f x, g x)) ---> (a, b)) net" |
204 shows "((\<lambda>x. (f x, g x)) ---> (a, b)) net" |
203 proof (rule topological_tendstoI) |
205 proof (rule topological_tendstoI) |
204 fix S assume "S \<in> topo" "(a, b) \<in> S" |
206 fix S assume "open S" "(a, b) \<in> S" |
205 then obtain A B where "A \<in> topo" "B \<in> topo" "a \<in> A" "b \<in> B" "A \<times> B \<subseteq> S" |
207 then obtain A B where "open A" "open B" "a \<in> A" "b \<in> B" "A \<times> B \<subseteq> S" |
206 unfolding topo_prod_def by auto |
208 unfolding open_prod_def by auto |
207 have "eventually (\<lambda>x. f x \<in> A) net" |
209 have "eventually (\<lambda>x. f x \<in> A) net" |
208 using `(f ---> a) net` `A \<in> topo` `a \<in> A` |
210 using `(f ---> a) net` `open A` `a \<in> A` |
209 by (rule topological_tendstoD) |
211 by (rule topological_tendstoD) |
210 moreover |
212 moreover |
211 have "eventually (\<lambda>x. g x \<in> B) net" |
213 have "eventually (\<lambda>x. g x \<in> B) net" |
212 using `(g ---> b) net` `B \<in> topo` `b \<in> B` |
214 using `(g ---> b) net` `open B` `b \<in> B` |
213 by (rule topological_tendstoD) |
215 by (rule topological_tendstoD) |
214 ultimately |
216 ultimately |
215 show "eventually (\<lambda>x. (f x, g x) \<in> S) net" |
217 show "eventually (\<lambda>x. (f x, g x) \<in> S) net" |
216 by (rule eventually_elim2) |
218 by (rule eventually_elim2) |
217 (simp add: subsetD [OF `A \<times> B \<subseteq> S`]) |
219 (simp add: subsetD [OF `A \<times> B \<subseteq> S`]) |