| author | hoelzl | 
| Wed, 15 Jun 2016 15:55:02 +0200 | |
| changeset 63330 | 8d591640c3bd | 
| parent 63317 | ca187a9f66da | 
| child 63332 | f164526d8727 | 
| permissions | -rw-r--r-- | 
| 52265 | 1  | 
(* Title: HOL/Topological_Spaces.thy  | 
| 51471 | 2  | 
Author: Brian Huffman  | 
3  | 
Author: Johannes Hölzl  | 
|
4  | 
*)  | 
|
5  | 
||
| 60758 | 6  | 
section \<open>Topological Spaces\<close>  | 
| 51471 | 7  | 
|
8  | 
theory Topological_Spaces  | 
|
| 51773 | 9  | 
imports Main Conditionally_Complete_Lattices  | 
| 51471 | 10  | 
begin  | 
11  | 
||
| 57953 | 12  | 
named_theorems continuous_intros "structural introduction rules for continuity"  | 
13  | 
||
| 60758 | 14  | 
subsection \<open>Topological space\<close>  | 
| 51471 | 15  | 
|
16  | 
class "open" =  | 
|
17  | 
fixes "open" :: "'a set \<Rightarrow> bool"  | 
|
18  | 
||
19  | 
class topological_space = "open" +  | 
|
20  | 
assumes open_UNIV [simp, intro]: "open UNIV"  | 
|
21  | 
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)"  | 
|
| 60585 | 22  | 
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)"  | 
| 51471 | 23  | 
begin  | 
24  | 
||
25  | 
definition  | 
|
26  | 
closed :: "'a set \<Rightarrow> bool" where  | 
|
27  | 
"closed S \<longleftrightarrow> open (- S)"  | 
|
28  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
29  | 
lemma open_empty [continuous_intros, intro, simp]: "open {}"
 | 
| 51471 | 30  | 
  using open_Union [of "{}"] by simp
 | 
31  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
32  | 
lemma open_Un [continuous_intros, intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<union> T)"  | 
| 51471 | 33  | 
  using open_Union [of "{S, T}"] by simp
 | 
34  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
35  | 
lemma open_UN [continuous_intros, intro]: "\<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union>x\<in>A. B x)"  | 
| 56166 | 36  | 
using open_Union [of "B ` A"] by simp  | 
| 51471 | 37  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
38  | 
lemma open_Inter [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)"  | 
| 51471 | 39  | 
by (induct set: finite) auto  | 
40  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
41  | 
lemma open_INT [continuous_intros, intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Inter>x\<in>A. B x)"  | 
| 56166 | 42  | 
using open_Inter [of "B ` A"] by simp  | 
| 51471 | 43  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
44  | 
lemma openI:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
45  | 
assumes "\<And>x. x \<in> S \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
46  | 
shows "open S"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
47  | 
proof -  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
48  | 
  have "open (\<Union>{T. open T \<and> T \<subseteq> S})" by auto
 | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
49  | 
  moreover have "\<Union>{T. open T \<and> T \<subseteq> S} = S" by (auto dest!: assms)
 | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
50  | 
ultimately show "open S" by simp  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
51  | 
qed  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
52  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
53  | 
lemma closed_empty [continuous_intros, intro, simp]:  "closed {}"
 | 
| 51471 | 54  | 
unfolding closed_def by simp  | 
55  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
56  | 
lemma closed_Un [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)"  | 
| 51471 | 57  | 
unfolding closed_def by auto  | 
58  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
59  | 
lemma closed_UNIV [continuous_intros, intro, simp]: "closed UNIV"  | 
| 51471 | 60  | 
unfolding closed_def by simp  | 
61  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
62  | 
lemma closed_Int [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<inter> T)"  | 
| 51471 | 63  | 
unfolding closed_def by auto  | 
64  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
65  | 
lemma closed_INT [continuous_intros, intro]: "\<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Inter>x\<in>A. B x)"  | 
| 51471 | 66  | 
unfolding closed_def by auto  | 
67  | 
||
| 60585 | 68  | 
lemma closed_Inter [continuous_intros, intro]: "\<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter>K)"  | 
| 51471 | 69  | 
unfolding closed_def uminus_Inf by auto  | 
70  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
71  | 
lemma closed_Union [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. closed T \<Longrightarrow> closed (\<Union>S)"  | 
| 51471 | 72  | 
by (induct set: finite) auto  | 
73  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
74  | 
lemma closed_UN [continuous_intros, intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Union>x\<in>A. B x)"  | 
| 56166 | 75  | 
using closed_Union [of "B ` A"] by simp  | 
| 51471 | 76  | 
|
77  | 
lemma open_closed: "open S \<longleftrightarrow> closed (- S)"  | 
|
| 63170 | 78  | 
by (simp add: closed_def)  | 
| 51471 | 79  | 
|
80  | 
lemma closed_open: "closed S \<longleftrightarrow> open (- S)"  | 
|
| 63170 | 81  | 
by (rule closed_def)  | 
| 51471 | 82  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
83  | 
lemma open_Diff [continuous_intros, intro]: "open S \<Longrightarrow> closed T \<Longrightarrow> open (S - T)"  | 
| 63170 | 84  | 
by (simp add: closed_open Diff_eq open_Int)  | 
| 51471 | 85  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
86  | 
lemma closed_Diff [continuous_intros, intro]: "closed S \<Longrightarrow> open T \<Longrightarrow> closed (S - T)"  | 
| 63170 | 87  | 
by (simp add: open_closed Diff_eq closed_Int)  | 
| 51471 | 88  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
89  | 
lemma open_Compl [continuous_intros, intro]: "closed S \<Longrightarrow> open (- S)"  | 
| 63170 | 90  | 
by (simp add: closed_open)  | 
| 51471 | 91  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
92  | 
lemma closed_Compl [continuous_intros, intro]: "open S \<Longrightarrow> closed (- S)"  | 
| 63170 | 93  | 
by (simp add: open_closed)  | 
| 51471 | 94  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
95  | 
lemma open_Collect_neg: "closed {x. P x} \<Longrightarrow> open {x. \<not> P x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
96  | 
unfolding Collect_neg_eq by (rule open_Compl)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
97  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
98  | 
lemma open_Collect_conj: assumes "open {x. P x}" "open {x. Q x}" shows "open {x. P x \<and> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
99  | 
using open_Int[OF assms] by (simp add: Int_def)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
100  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
101  | 
lemma open_Collect_disj: assumes "open {x. P x}" "open {x. Q x}" shows "open {x. P x \<or> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
102  | 
using open_Un[OF assms] by (simp add: Un_def)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
103  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
104  | 
lemma open_Collect_ex: "(\<And>i. open {x. P i x}) \<Longrightarrow> open {x. \<exists>i. P i x}"
 | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
105  | 
  using open_UN[of UNIV "\<lambda>i. {x. P i x}"] unfolding Collect_ex_eq by simp
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
106  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
107  | 
lemma open_Collect_imp: "closed {x. P x} \<Longrightarrow> open {x. Q x} \<Longrightarrow> open {x. P x \<longrightarrow> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
108  | 
unfolding imp_conv_disj by (intro open_Collect_disj open_Collect_neg)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
109  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
110  | 
lemma open_Collect_const: "open {x. P}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
111  | 
by (cases P) auto  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
112  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
113  | 
lemma closed_Collect_neg: "open {x. P x} \<Longrightarrow> closed {x. \<not> P x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
114  | 
unfolding Collect_neg_eq by (rule closed_Compl)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
115  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
116  | 
lemma closed_Collect_conj: assumes "closed {x. P x}" "closed {x. Q x}" shows "closed {x. P x \<and> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
117  | 
using closed_Int[OF assms] by (simp add: Int_def)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
118  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
119  | 
lemma closed_Collect_disj: assumes "closed {x. P x}" "closed {x. Q x}" shows "closed {x. P x \<or> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
120  | 
using closed_Un[OF assms] by (simp add: Un_def)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
121  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
122  | 
lemma closed_Collect_all: "(\<And>i. closed {x. P i x}) \<Longrightarrow> closed {x. \<forall>i. P i x}"
 | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
123  | 
  using closed_INT[of UNIV "\<lambda>i. {x. P i x}"] unfolding Collect_all_eq by simp
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
124  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
125  | 
lemma closed_Collect_imp: "open {x. P x} \<Longrightarrow> closed {x. Q x} \<Longrightarrow> closed {x. P x \<longrightarrow> Q x}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
126  | 
unfolding imp_conv_disj by (intro closed_Collect_disj closed_Collect_neg)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
127  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
128  | 
lemma closed_Collect_const: "closed {x. P}"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
129  | 
by (cases P) auto  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
130  | 
|
| 51471 | 131  | 
end  | 
132  | 
||
| 60758 | 133  | 
subsection\<open>Hausdorff and other separation properties\<close>  | 
| 51471 | 134  | 
|
135  | 
class t0_space = topological_space +  | 
|
136  | 
assumes t0_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> \<not> (x \<in> U \<longleftrightarrow> y \<in> U)"  | 
|
137  | 
||
138  | 
class t1_space = topological_space +  | 
|
139  | 
assumes t1_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"  | 
|
140  | 
||
141  | 
instance t1_space \<subseteq> t0_space  | 
|
142  | 
proof qed (fast dest: t1_space)  | 
|
143  | 
||
144  | 
lemma separation_t1:  | 
|
145  | 
fixes x y :: "'a::t1_space"  | 
|
146  | 
shows "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)"  | 
|
147  | 
using t1_space[of x y] by blast  | 
|
148  | 
||
| 63301 | 149  | 
lemma closed_singleton [iff]:  | 
| 51471 | 150  | 
fixes a :: "'a::t1_space"  | 
151  | 
  shows "closed {a}"
 | 
|
152  | 
proof -  | 
|
153  | 
  let ?T = "\<Union>{S. open S \<and> a \<notin> S}"
 | 
|
154  | 
have "open ?T" by (simp add: open_Union)  | 
|
155  | 
  also have "?T = - {a}"
 | 
|
156  | 
by (simp add: set_eq_iff separation_t1, auto)  | 
|
157  | 
  finally show "closed {a}" unfolding closed_def .
 | 
|
158  | 
qed  | 
|
159  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
160  | 
lemma closed_insert [continuous_intros, simp]:  | 
| 51471 | 161  | 
fixes a :: "'a::t1_space"  | 
162  | 
assumes "closed S" shows "closed (insert a S)"  | 
|
163  | 
proof -  | 
|
164  | 
from closed_singleton assms  | 
|
165  | 
  have "closed ({a} \<union> S)" by (rule closed_Un)
 | 
|
166  | 
thus "closed (insert a S)" by simp  | 
|
167  | 
qed  | 
|
168  | 
||
169  | 
lemma finite_imp_closed:  | 
|
170  | 
fixes S :: "'a::t1_space set"  | 
|
171  | 
shows "finite S \<Longrightarrow> closed S"  | 
|
172  | 
by (induct set: finite, simp_all)  | 
|
173  | 
||
| 60758 | 174  | 
text \<open>T2 spaces are also known as Hausdorff spaces.\<close>  | 
| 51471 | 175  | 
|
176  | 
class t2_space = topological_space +  | 
|
177  | 
  assumes hausdorff: "x \<noteq> y \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
|
178  | 
||
179  | 
instance t2_space \<subseteq> t1_space  | 
|
180  | 
proof qed (fast dest: hausdorff)  | 
|
181  | 
||
182  | 
lemma separation_t2:  | 
|
183  | 
fixes x y :: "'a::t2_space"  | 
|
184  | 
  shows "x \<noteq> y \<longleftrightarrow> (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})"
 | 
|
185  | 
using hausdorff[of x y] by blast  | 
|
186  | 
||
187  | 
lemma separation_t0:  | 
|
188  | 
fixes x y :: "'a::t0_space"  | 
|
189  | 
shows "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> ~(x\<in>U \<longleftrightarrow> y\<in>U))"  | 
|
190  | 
using t0_space[of x y] by blast  | 
|
191  | 
||
| 60758 | 192  | 
text \<open>A perfect space is a topological space with no isolated points.\<close>  | 
| 51471 | 193  | 
|
194  | 
class perfect_space = topological_space +  | 
|
195  | 
  assumes not_open_singleton: "\<not> open {x}"
 | 
|
196  | 
||
| 
62381
 
a6479cb85944
New and revised material for (multivariate) analysis
 
paulson <lp15@cam.ac.uk> 
parents: 
62369 
diff
changeset
 | 
197  | 
lemma UNIV_not_singleton: "UNIV \<noteq> {x::'a::perfect_space}"
 | 
| 
 
a6479cb85944
New and revised material for (multivariate) analysis
 
paulson <lp15@cam.ac.uk> 
parents: 
62369 
diff
changeset
 | 
198  | 
by (metis open_UNIV not_open_singleton)  | 
| 
 
a6479cb85944
New and revised material for (multivariate) analysis
 
paulson <lp15@cam.ac.uk> 
parents: 
62369 
diff
changeset
 | 
199  | 
|
| 51471 | 200  | 
|
| 60758 | 201  | 
subsection \<open>Generators for toplogies\<close>  | 
| 51471 | 202  | 
|
203  | 
inductive generate_topology for S where  | 
|
204  | 
UNIV: "generate_topology S UNIV"  | 
|
205  | 
| Int: "generate_topology S a \<Longrightarrow> generate_topology S b \<Longrightarrow> generate_topology S (a \<inter> b)"  | 
|
206  | 
| UN: "(\<And>k. k \<in> K \<Longrightarrow> generate_topology S k) \<Longrightarrow> generate_topology S (\<Union>K)"  | 
|
207  | 
| Basis: "s \<in> S \<Longrightarrow> generate_topology S s"  | 
|
208  | 
||
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
209  | 
hide_fact (open) UNIV Int UN Basis  | 
| 
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
210  | 
|
| 
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
211  | 
lemma generate_topology_Union:  | 
| 51471 | 212  | 
"(\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union>k\<in>I. K k)"  | 
| 56166 | 213  | 
using generate_topology.UN [of "K ` I"] by auto  | 
| 51471 | 214  | 
|
215  | 
lemma topological_space_generate_topology:  | 
|
216  | 
"class.topological_space (generate_topology S)"  | 
|
| 61169 | 217  | 
by standard (auto intro: generate_topology.intros)  | 
| 51471 | 218  | 
|
| 60758 | 219  | 
subsection \<open>Order topologies\<close>  | 
| 51471 | 220  | 
|
221  | 
class order_topology = order + "open" +  | 
|
222  | 
  assumes open_generated_order: "open = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
223  | 
begin  | 
|
224  | 
||
225  | 
subclass topological_space  | 
|
226  | 
unfolding open_generated_order  | 
|
227  | 
by (rule topological_space_generate_topology)  | 
|
228  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
229  | 
lemma open_greaterThan [continuous_intros, simp]: "open {a <..}"
 | 
| 51471 | 230  | 
unfolding open_generated_order by (auto intro: generate_topology.Basis)  | 
231  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
232  | 
lemma open_lessThan [continuous_intros, simp]: "open {..< a}"
 | 
| 51471 | 233  | 
unfolding open_generated_order by (auto intro: generate_topology.Basis)  | 
234  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
235  | 
lemma open_greaterThanLessThan [continuous_intros, simp]: "open {a <..< b}"
 | 
| 51471 | 236  | 
unfolding greaterThanLessThan_eq by (simp add: open_Int)  | 
237  | 
||
238  | 
end  | 
|
239  | 
||
240  | 
class linorder_topology = linorder + order_topology  | 
|
241  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
242  | 
lemma closed_atMost [continuous_intros, simp]: "closed {.. a::'a::linorder_topology}"
 | 
| 51471 | 243  | 
by (simp add: closed_open)  | 
244  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
245  | 
lemma closed_atLeast [continuous_intros, simp]: "closed {a::'a::linorder_topology ..}"
 | 
| 51471 | 246  | 
by (simp add: closed_open)  | 
247  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
248  | 
lemma closed_atLeastAtMost [continuous_intros, simp]: "closed {a::'a::linorder_topology .. b}"
 | 
| 51471 | 249  | 
proof -  | 
250  | 
  have "{a .. b} = {a ..} \<inter> {.. b}"
 | 
|
251  | 
by auto  | 
|
252  | 
then show ?thesis  | 
|
253  | 
by (simp add: closed_Int)  | 
|
254  | 
qed  | 
|
255  | 
||
256  | 
lemma (in linorder) less_separate:  | 
|
257  | 
assumes "x < y"  | 
|
258  | 
  shows "\<exists>a b. x \<in> {..< a} \<and> y \<in> {b <..} \<and> {..< a} \<inter> {b <..} = {}"
 | 
|
| 53381 | 259  | 
proof (cases "\<exists>z. x < z \<and> z < y")  | 
260  | 
case True  | 
|
261  | 
then obtain z where "x < z \<and> z < y" ..  | 
|
| 51471 | 262  | 
  then have "x \<in> {..< z} \<and> y \<in> {z <..} \<and> {z <..} \<inter> {..< z} = {}"
 | 
263  | 
by auto  | 
|
264  | 
then show ?thesis by blast  | 
|
265  | 
next  | 
|
| 53381 | 266  | 
case False  | 
| 60758 | 267  | 
  with \<open>x < y\<close> have "x \<in> {..< y} \<and> y \<in> {x <..} \<and> {x <..} \<inter> {..< y} = {}"
 | 
| 51471 | 268  | 
by auto  | 
269  | 
then show ?thesis by blast  | 
|
270  | 
qed  | 
|
271  | 
||
272  | 
instance linorder_topology \<subseteq> t2_space  | 
|
273  | 
proof  | 
|
274  | 
fix x y :: 'a  | 
|
275  | 
from less_separate[of x y] less_separate[of y x]  | 
|
276  | 
  show "x \<noteq> y \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
|
277  | 
by (elim neqE) (metis open_lessThan open_greaterThan Int_commute)+  | 
|
278  | 
qed  | 
|
279  | 
||
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
280  | 
lemma (in linorder_topology) open_right:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
281  | 
  assumes "open S" "x \<in> S" and gt_ex: "x < y" shows "\<exists>b>x. {x ..< b} \<subseteq> S"
 | 
| 51471 | 282  | 
using assms unfolding open_generated_order  | 
283  | 
proof induction  | 
|
284  | 
case (Int A B)  | 
|
285  | 
  then obtain a b where "a > x" "{x ..< a} \<subseteq> A"  "b > x" "{x ..< b} \<subseteq> B" by auto
 | 
|
286  | 
then show ?case by (auto intro!: exI[of _ "min a b"])  | 
|
287  | 
next  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
288  | 
case (Basis S) then show ?case by (fastforce intro: exI[of _ y] gt_ex)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
289  | 
qed blast+  | 
| 51471 | 290  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
291  | 
lemma (in linorder_topology) open_left:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
292  | 
  assumes "open S" "x \<in> S" and lt_ex: "y < x" shows "\<exists>b<x. {b <.. x} \<subseteq> S"
 | 
| 51471 | 293  | 
using assms unfolding open_generated_order  | 
294  | 
proof induction  | 
|
295  | 
case (Int A B)  | 
|
296  | 
  then obtain a b where "a < x" "{a <.. x} \<subseteq> A"  "b < x" "{b <.. x} \<subseteq> B" by auto
 | 
|
297  | 
then show ?case by (auto intro!: exI[of _ "max a b"])  | 
|
298  | 
next  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
299  | 
case (Basis S) then show ?case by (fastforce intro: exI[of _ y] lt_ex)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
300  | 
qed blast+  | 
| 51471 | 301  | 
|
| 62369 | 302  | 
subsection \<open>Setup some topologies\<close>  | 
303  | 
||
| 60758 | 304  | 
subsubsection \<open>Boolean is an order topology\<close>  | 
| 59106 | 305  | 
|
| 62369 | 306  | 
text \<open>It is a discrete topology, but don't have a type class for it (yet).\<close>  | 
307  | 
||
308  | 
class discrete_topology = topological_space +  | 
|
309  | 
assumes open_discrete: "\<And>A. open A"  | 
|
310  | 
||
311  | 
instance discrete_topology < t2_space  | 
|
312  | 
proof  | 
|
313  | 
  fix x y :: 'a assume "x \<noteq> y" then show "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
|
314  | 
    by (intro exI[of _ "{_}"]) (auto intro!: open_discrete)
 | 
|
315  | 
qed  | 
|
316  | 
||
317  | 
instantiation bool :: linorder_topology  | 
|
| 59106 | 318  | 
begin  | 
319  | 
||
320  | 
definition open_bool :: "bool set \<Rightarrow> bool" where  | 
|
321  | 
  "open_bool = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
322  | 
||
323  | 
instance  | 
|
324  | 
proof qed (rule open_bool_def)  | 
|
325  | 
||
326  | 
end  | 
|
327  | 
||
| 62369 | 328  | 
instance bool :: discrete_topology  | 
329  | 
proof  | 
|
330  | 
fix A :: "bool set"  | 
|
| 59106 | 331  | 
  have *: "{False <..} = {True}" "{..< True} = {False}"
 | 
332  | 
by auto  | 
|
333  | 
  have "A = UNIV \<or> A = {} \<or> A = {False <..} \<or> A = {..< True}"
 | 
|
| 63171 | 334  | 
using subset_UNIV[of A] unfolding UNIV_bool * by blast  | 
| 59106 | 335  | 
then show "open A"  | 
336  | 
by auto  | 
|
337  | 
qed  | 
|
338  | 
||
| 62369 | 339  | 
instantiation nat :: linorder_topology  | 
340  | 
begin  | 
|
341  | 
||
342  | 
definition open_nat :: "nat set \<Rightarrow> bool" where  | 
|
343  | 
  "open_nat = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
344  | 
||
345  | 
instance  | 
|
346  | 
proof qed (rule open_nat_def)  | 
|
347  | 
||
348  | 
end  | 
|
349  | 
||
350  | 
instance nat :: discrete_topology  | 
|
351  | 
proof  | 
|
352  | 
fix A :: "nat set"  | 
|
353  | 
  have "open {n}" for n :: nat
 | 
|
354  | 
proof (cases n)  | 
|
355  | 
case 0  | 
|
356  | 
    moreover have "{0} = {..<1::nat}"
 | 
|
357  | 
by auto  | 
|
358  | 
ultimately show ?thesis  | 
|
359  | 
by auto  | 
|
360  | 
next  | 
|
361  | 
case (Suc n')  | 
|
362  | 
    moreover then have "{n} = {..<Suc n} \<inter> {n' <..}"
 | 
|
363  | 
by auto  | 
|
364  | 
ultimately show ?thesis  | 
|
365  | 
by (auto intro: open_lessThan open_greaterThan)  | 
|
366  | 
qed  | 
|
367  | 
  then have "open (\<Union>a\<in>A. {a})"
 | 
|
368  | 
by (intro open_UN) auto  | 
|
369  | 
then show "open A"  | 
|
370  | 
by simp  | 
|
371  | 
qed  | 
|
372  | 
||
373  | 
instantiation int :: linorder_topology  | 
|
374  | 
begin  | 
|
375  | 
||
376  | 
definition open_int :: "int set \<Rightarrow> bool" where  | 
|
377  | 
  "open_int = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
378  | 
||
379  | 
instance  | 
|
380  | 
proof qed (rule open_int_def)  | 
|
381  | 
||
382  | 
end  | 
|
383  | 
||
384  | 
instance int :: discrete_topology  | 
|
385  | 
proof  | 
|
386  | 
fix A :: "int set"  | 
|
387  | 
  have "{..<i + 1} \<inter> {i-1 <..} = {i}" for i :: int
 | 
|
388  | 
by auto  | 
|
389  | 
  then have "open {i}" for i :: int
 | 
|
390  | 
using open_Int[OF open_lessThan[of "i + 1"] open_greaterThan[of "i - 1"]] by auto  | 
|
391  | 
  then have "open (\<Union>a\<in>A. {a})"
 | 
|
392  | 
by (intro open_UN) auto  | 
|
393  | 
then show "open A"  | 
|
394  | 
by simp  | 
|
395  | 
qed  | 
|
396  | 
||
| 60758 | 397  | 
subsubsection \<open>Topological filters\<close>  | 
| 51471 | 398  | 
|
399  | 
definition (in topological_space) nhds :: "'a \<Rightarrow> 'a filter"  | 
|
| 57276 | 400  | 
  where "nhds a = (INF S:{S. open S \<and> a \<in> S}. principal S)"
 | 
| 51471 | 401  | 
|
| 
62533
 
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
 
paulson <lp15@cam.ac.uk> 
parents: 
62397 
diff
changeset
 | 
402  | 
definition (in topological_space) at_within :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a filter" ("at (_)/ within (_)" [1000, 60] 60)
 | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
403  | 
  where "at a within s = inf (nhds a) (principal (s - {a}))"
 | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
404  | 
|
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
405  | 
abbreviation (in topological_space) at :: "'a \<Rightarrow> 'a filter" ("at") where
 | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
406  | 
"at x \<equiv> at x within (CONST UNIV)"  | 
| 51471 | 407  | 
|
| 51473 | 408  | 
abbreviation (in order_topology) at_right :: "'a \<Rightarrow> 'a filter" where  | 
| 51471 | 409  | 
  "at_right x \<equiv> at x within {x <..}"
 | 
410  | 
||
| 51473 | 411  | 
abbreviation (in order_topology) at_left :: "'a \<Rightarrow> 'a filter" where  | 
| 51471 | 412  | 
  "at_left x \<equiv> at x within {..< x}"
 | 
413  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
414  | 
lemma (in topological_space) nhds_generated_topology:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
415  | 
  "open = generate_topology T \<Longrightarrow> nhds x = (INF S:{S\<in>T. x \<in> S}. principal S)"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
416  | 
unfolding nhds_def  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
417  | 
proof (safe intro!: antisym INF_greatest)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
418  | 
fix S assume "generate_topology T S" "x \<in> S"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
419  | 
  then show "(INF S:{S \<in> T. x \<in> S}. principal S) \<le> principal S"
 | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
420  | 
by induction  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
421  | 
(auto intro: INF_lower order_trans simp add: inf_principal[symmetric] simp del: inf_principal)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
422  | 
qed (auto intro!: INF_lower intro: generate_topology.intros)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
423  | 
|
| 51473 | 424  | 
lemma (in topological_space) eventually_nhds:  | 
| 51471 | 425  | 
"eventually P (nhds a) \<longleftrightarrow> (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))"  | 
| 57276 | 426  | 
unfolding nhds_def by (subst eventually_INF_base) (auto simp: eventually_principal)  | 
| 51471 | 427  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
428  | 
lemma (in topological_space) eventually_nhds_in_open:  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
429  | 
"open s \<Longrightarrow> x \<in> s \<Longrightarrow> eventually (\<lambda>y. y \<in> s) (nhds x)"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
430  | 
by (subst eventually_nhds) blast  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
431  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
432  | 
lemma eventually_nhds_x_imp_x:  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
433  | 
"eventually P (nhds x) \<Longrightarrow> P x"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
434  | 
by (subst (asm) eventually_nhds) blast  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
435  | 
|
| 51471 | 436  | 
lemma nhds_neq_bot [simp]: "nhds a \<noteq> bot"  | 
437  | 
unfolding trivial_limit_def eventually_nhds by simp  | 
|
438  | 
||
| 
60182
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
439  | 
lemma (in t1_space) t1_space_nhds:  | 
| 
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
440  | 
"x \<noteq> y \<Longrightarrow> (\<forall>\<^sub>F x in nhds x. x \<noteq> y)"  | 
| 
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
441  | 
by (drule t1_space) (auto simp: eventually_nhds)  | 
| 
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
442  | 
|
| 62369 | 443  | 
lemma (in topological_space) nhds_discrete_open: "open {x} \<Longrightarrow> nhds x = principal {x}"
 | 
444  | 
  by (auto simp: nhds_def intro!: antisym INF_greatest INF_lower2[of "{x}"])
 | 
|
445  | 
||
446  | 
lemma (in discrete_topology) nhds_discrete: "nhds x = principal {x}"
 | 
|
447  | 
by (simp add: nhds_discrete_open open_discrete)  | 
|
448  | 
||
449  | 
lemma (in discrete_topology) at_discrete: "at x within S = bot"  | 
|
450  | 
unfolding at_within_def nhds_discrete by simp  | 
|
451  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
452  | 
lemma at_within_eq: "at x within s = (INF S:{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
453  | 
unfolding nhds_def at_within_def by (subst INF_inf_const2[symmetric]) (auto simp add: Diff_Int_distrib)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
454  | 
|
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
455  | 
lemma eventually_at_filter:  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
456  | 
"eventually P (at a within s) \<longleftrightarrow> eventually (\<lambda>x. x \<noteq> a \<longrightarrow> x \<in> s \<longrightarrow> P x) (nhds a)"  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
457  | 
unfolding at_within_def eventually_inf_principal by (simp add: imp_conjL[symmetric] conj_commute)  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
458  | 
|
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
459  | 
lemma at_le: "s \<subseteq> t \<Longrightarrow> at x within s \<le> at x within t"  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
460  | 
unfolding at_within_def by (intro inf_mono) auto  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
461  | 
|
| 51471 | 462  | 
lemma eventually_at_topological:  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
463  | 
"eventually P (at a within s) \<longleftrightarrow> (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. x \<noteq> a \<longrightarrow> x \<in> s \<longrightarrow> P x))"  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
464  | 
unfolding eventually_nhds eventually_at_filter by simp  | 
| 51471 | 465  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
466  | 
lemma at_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> at a within S = at a"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
467  | 
unfolding filter_eq_iff eventually_at_topological by (metis open_Int Int_iff UNIV_I)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
468  | 
|
| 61234 | 469  | 
lemma at_within_open_NO_MATCH:  | 
470  | 
"a \<in> s \<Longrightarrow> open s \<Longrightarrow> NO_MATCH UNIV s \<Longrightarrow> at a within s = at a"  | 
|
471  | 
by (simp only: at_within_open)  | 
|
472  | 
||
| 61245 | 473  | 
lemma at_within_nhd:  | 
474  | 
  assumes "x \<in> S" "open S" "T \<inter> S - {x} = U \<inter> S - {x}"
 | 
|
475  | 
shows "at x within T = at x within U"  | 
|
476  | 
unfolding filter_eq_iff eventually_at_filter  | 
|
477  | 
proof (intro allI eventually_subst)  | 
|
478  | 
have "eventually (\<lambda>x. x \<in> S) (nhds x)"  | 
|
479  | 
using \<open>x \<in> S\<close> \<open>open S\<close> by (auto simp: eventually_nhds)  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
480  | 
then show "\<forall>\<^sub>F n in nhds x. (n \<noteq> x \<longrightarrow> n \<in> T \<longrightarrow> P n) = (n \<noteq> x \<longrightarrow> n \<in> U \<longrightarrow> P n)" for P  | 
| 61245 | 481  | 
    by eventually_elim (insert \<open>T \<inter> S - {x} = U \<inter> S - {x}\<close>, blast)
 | 
482  | 
qed  | 
|
483  | 
||
| 53859 | 484  | 
lemma at_within_empty [simp]: "at a within {} = bot"
 | 
485  | 
unfolding at_within_def by simp  | 
|
486  | 
||
| 53860 | 487  | 
lemma at_within_union: "at x within (S \<union> T) = sup (at x within S) (at x within T)"  | 
488  | 
unfolding filter_eq_iff eventually_sup eventually_at_filter  | 
|
489  | 
by (auto elim!: eventually_rev_mp)  | 
|
490  | 
||
| 51471 | 491  | 
lemma at_eq_bot_iff: "at a = bot \<longleftrightarrow> open {a}"
 | 
492  | 
unfolding trivial_limit_def eventually_at_topological  | 
|
493  | 
  by (safe, case_tac "S = {a}", simp, fast, fast)
 | 
|
494  | 
||
495  | 
lemma at_neq_bot [simp]: "at (a::'a::perfect_space) \<noteq> bot"  | 
|
496  | 
by (simp add: at_eq_bot_iff not_open_singleton)  | 
|
497  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
498  | 
lemma (in order_topology) nhds_order: "nhds x =  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
499  | 
  inf (INF a:{x <..}. principal {..< a}) (INF a:{..< x}. principal {a <..})"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
500  | 
proof -  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
501  | 
  have 1: "{S \<in> range lessThan \<union> range greaterThan. x \<in> S} =
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
502  | 
      (\<lambda>a. {..< a}) ` {x <..} \<union> (\<lambda>a. {a <..}) ` {..< x}"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
503  | 
by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
504  | 
show ?thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
505  | 
unfolding nhds_generated_topology[OF open_generated_order] INF_union 1 INF_image comp_def ..  | 
| 51471 | 506  | 
qed  | 
507  | 
||
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
508  | 
lemma filterlim_at_within_If:  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
509  | 
  assumes "filterlim f G (at x within (A \<inter> {x. P x}))"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
510  | 
  assumes "filterlim g G (at x within (A \<inter> {x. \<not>P x}))"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
511  | 
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x within A)"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
512  | 
proof (rule filterlim_If)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
513  | 
note assms(1)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
514  | 
  also have "at x within (A \<inter> {x. P x}) = inf (nhds x) (principal (A \<inter> Collect P - {x}))"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
515  | 
by (simp add: at_within_def)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
516  | 
  also have "A \<inter> Collect P - {x} = (A - {x}) \<inter> Collect P" by blast
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
517  | 
also have "inf (nhds x) (principal \<dots>) = inf (at x within A) (principal (Collect P))"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
518  | 
by (simp add: at_within_def inf_assoc)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
519  | 
finally show "filterlim f G (inf (at x within A) (principal (Collect P)))" .  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
520  | 
next  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
521  | 
note assms(2)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
522  | 
  also have "at x within (A \<inter> {x. \<not>P x}) = inf (nhds x) (principal (A \<inter> {x. \<not>P x} - {x}))"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
523  | 
by (simp add: at_within_def)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
524  | 
  also have "A \<inter> {x. \<not>P x} - {x} = (A - {x}) \<inter> {x. \<not>P x}" by blast
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
525  | 
  also have "inf (nhds x) (principal \<dots>) = inf (at x within A) (principal {x. \<not>P x})"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
526  | 
by (simp add: at_within_def inf_assoc)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
527  | 
  finally show "filterlim g G (inf (at x within A) (principal {x. \<not>P x}))" .
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
528  | 
qed  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
529  | 
|
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
530  | 
lemma filterlim_at_If:  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
531  | 
  assumes "filterlim f G (at x within {x. P x})"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
532  | 
  assumes "filterlim g G (at x within {x. \<not>P x})"
 | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
533  | 
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x)"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
534  | 
using assms by (intro filterlim_at_within_If) simp_all  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
535  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
536  | 
lemma (in linorder_topology) at_within_order: "UNIV \<noteq> {x} \<Longrightarrow>
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
537  | 
  at x within s = inf (INF a:{x <..}. principal ({..< a} \<inter> s - {x}))
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
538  | 
                      (INF a:{..< x}. principal ({a <..} \<inter> s - {x}))"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
539  | 
proof (cases "{x <..} = {}" "{..< x} = {}" rule: case_split[case_product case_split])
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
540  | 
  assume "UNIV \<noteq> {x}" "{x<..} = {}" "{..< x} = {}"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
541  | 
  moreover have "UNIV = {..< x} \<union> {x} \<union> {x <..}"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
542  | 
by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
543  | 
ultimately show ?thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
544  | 
by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
545  | 
qed (auto simp: at_within_def nhds_order Int_Diff inf_principal[symmetric] INF_inf_const2  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
546  | 
inf_sup_aci[where 'a="'a filter"]  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
547  | 
simp del: inf_principal)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
548  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
549  | 
lemma (in linorder_topology) at_left_eq:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
550  | 
  "y < x \<Longrightarrow> at_left x = (INF a:{..< x}. principal {a <..< x})"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
551  | 
by (subst at_within_order)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
552  | 
(auto simp: greaterThan_Int_greaterThan greaterThanLessThan_eq[symmetric] min.absorb2 INF_constant  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
553  | 
intro!: INF_lower2 inf_absorb2)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
554  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
555  | 
lemma (in linorder_topology) eventually_at_left:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
556  | 
"y < x \<Longrightarrow> eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
557  | 
unfolding at_left_eq by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
558  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
559  | 
lemma (in linorder_topology) at_right_eq:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
560  | 
  "x < y \<Longrightarrow> at_right x = (INF a:{x <..}. principal {x <..< a})"
 | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
561  | 
by (subst at_within_order)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
562  | 
(auto simp: lessThan_Int_lessThan greaterThanLessThan_eq[symmetric] max.absorb2 INF_constant Int_commute  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
563  | 
intro!: INF_lower2 inf_absorb1)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
564  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
565  | 
lemma (in linorder_topology) eventually_at_right:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
566  | 
"x < y \<Longrightarrow> eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
567  | 
unfolding at_right_eq by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)  | 
| 51471 | 568  | 
|
| 62083 | 569  | 
lemma eventually_at_right_less: "\<forall>\<^sub>F y in at_right (x::'a::{linorder_topology, no_top}). x < y"
 | 
570  | 
using gt_ex[of x] eventually_at_right[of x] by auto  | 
|
571  | 
||
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
572  | 
lemma trivial_limit_at_right_top: "at_right (top::_::{order_top, linorder_topology}) = bot"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
573  | 
unfolding filter_eq_iff eventually_at_topological by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
574  | 
|
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
575  | 
lemma trivial_limit_at_left_bot: "at_left (bot::_::{order_bot, linorder_topology}) = bot"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
576  | 
unfolding filter_eq_iff eventually_at_topological by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
577  | 
|
| 51471 | 578  | 
lemma trivial_limit_at_left_real [simp]:  | 
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
579  | 
  "\<not> trivial_limit (at_left (x::'a::{no_bot, dense_order, linorder_topology}))"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
580  | 
using lt_ex[of x]  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
581  | 
by safe (auto simp add: trivial_limit_def eventually_at_left dest: dense)  | 
| 51471 | 582  | 
|
583  | 
lemma trivial_limit_at_right_real [simp]:  | 
|
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
584  | 
  "\<not> trivial_limit (at_right (x::'a::{no_top, dense_order, linorder_topology}))"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
585  | 
using gt_ex[of x]  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
586  | 
by safe (auto simp add: trivial_limit_def eventually_at_right dest: dense)  | 
| 51471 | 587  | 
|
588  | 
lemma at_eq_sup_left_right: "at (x::'a::linorder_topology) = sup (at_left x) (at_right x)"  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
589  | 
by (auto simp: eventually_at_filter filter_eq_iff eventually_sup  | 
| 61810 | 590  | 
elim: eventually_elim2 eventually_mono)  | 
| 51471 | 591  | 
|
592  | 
lemma eventually_at_split:  | 
|
593  | 
"eventually P (at (x::'a::linorder_topology)) \<longleftrightarrow> eventually P (at_left x) \<and> eventually P (at_right x)"  | 
|
594  | 
by (subst at_eq_sup_left_right) (simp add: eventually_sup)  | 
|
595  | 
||
| 60758 | 596  | 
subsubsection \<open>Tendsto\<close>  | 
| 51471 | 597  | 
|
598  | 
abbreviation (in topological_space)  | 
|
| 61973 | 599  | 
  tendsto :: "('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b filter \<Rightarrow> bool" (infixr "\<longlongrightarrow>" 55) where
 | 
600  | 
"(f \<longlongrightarrow> l) F \<equiv> filterlim f (nhds l) F"  | 
|
| 51471 | 601  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
602  | 
definition (in t2_space) Lim :: "'f filter \<Rightarrow> ('f \<Rightarrow> 'a) \<Rightarrow> 'a" where
 | 
| 61973 | 603  | 
"Lim A f = (THE l. (f \<longlongrightarrow> l) A)"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
604  | 
|
| 61973 | 605  | 
lemma tendsto_eq_rhs: "(f \<longlongrightarrow> x) F \<Longrightarrow> x = y \<Longrightarrow> (f \<longlongrightarrow> y) F"  | 
| 51471 | 606  | 
by simp  | 
607  | 
||
| 57953 | 608  | 
named_theorems tendsto_intros "introduction rules for tendsto"  | 
| 60758 | 609  | 
setup \<open>  | 
| 51471 | 610  | 
  Global_Theory.add_thms_dynamic (@{binding tendsto_eq_intros},
 | 
| 57953 | 611  | 
fn context =>  | 
612  | 
      Named_Theorems.get (Context.proof_of context) @{named_theorems tendsto_intros}
 | 
|
613  | 
      |> map_filter (try (fn thm => @{thm tendsto_eq_rhs} OF [thm])))
 | 
|
| 60758 | 614  | 
\<close>  | 
| 51471 | 615  | 
|
| 51473 | 616  | 
lemma (in topological_space) tendsto_def:  | 
| 61973 | 617  | 
"(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) F)"  | 
| 57276 | 618  | 
unfolding nhds_def filterlim_INF filterlim_principal by auto  | 
| 51471 | 619  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
620  | 
lemma tendsto_cong:  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
621  | 
assumes "eventually (\<lambda>x. f x = g x) F"  | 
| 61973 | 622  | 
shows "(f \<longlongrightarrow> c) F \<longleftrightarrow> (g \<longlongrightarrow> c) F"  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
623  | 
by (rule filterlim_cong[OF refl refl assms])  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
624  | 
|
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
625  | 
|
| 61973 | 626  | 
lemma tendsto_mono: "F \<le> F' \<Longrightarrow> (f \<longlongrightarrow> l) F' \<Longrightarrow> (f \<longlongrightarrow> l) F"  | 
| 51471 | 627  | 
unfolding tendsto_def le_filter_def by fast  | 
628  | 
||
| 61973 | 629  | 
lemma tendsto_within_subset: "(f \<longlongrightarrow> l) (at x within S) \<Longrightarrow> T \<subseteq> S \<Longrightarrow> (f \<longlongrightarrow> l) (at x within T)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
630  | 
by (blast intro: tendsto_mono at_le)  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
631  | 
|
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
632  | 
lemma filterlim_at:  | 
| 61973 | 633  | 
"(LIM x F. f x :> at b within s) \<longleftrightarrow> (eventually (\<lambda>x. f x \<in> s \<and> f x \<noteq> b) F \<and> (f \<longlongrightarrow> b) F)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
634  | 
by (simp add: at_within_def filterlim_inf filterlim_principal conj_commute)  | 
| 
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
635  | 
|
| 51473 | 636  | 
lemma (in topological_space) topological_tendstoI:  | 
| 61973 | 637  | 
"(\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F) \<Longrightarrow> (f \<longlongrightarrow> l) F"  | 
| 51471 | 638  | 
unfolding tendsto_def by auto  | 
639  | 
||
| 51473 | 640  | 
lemma (in topological_space) topological_tendstoD:  | 
| 61973 | 641  | 
"(f \<longlongrightarrow> l) F \<Longrightarrow> open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F"  | 
| 51471 | 642  | 
unfolding tendsto_def by auto  | 
643  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
644  | 
lemma (in order_topology) order_tendsto_iff:  | 
| 61973 | 645  | 
"(f \<longlongrightarrow> x) F \<longleftrightarrow> (\<forall>l<x. eventually (\<lambda>x. l < f x) F) \<and> (\<forall>u>x. eventually (\<lambda>x. f x < u) F)"  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
646  | 
unfolding nhds_order filterlim_inf filterlim_INF filterlim_principal by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
647  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
648  | 
lemma (in order_topology) order_tendstoI:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
649  | 
"(\<And>a. a < y \<Longrightarrow> eventually (\<lambda>x. a < f x) F) \<Longrightarrow> (\<And>a. y < a \<Longrightarrow> eventually (\<lambda>x. f x < a) F) \<Longrightarrow>  | 
| 61973 | 650  | 
(f \<longlongrightarrow> y) F"  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
651  | 
unfolding order_tendsto_iff by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
652  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
653  | 
lemma (in order_topology) order_tendstoD:  | 
| 61973 | 654  | 
assumes "(f \<longlongrightarrow> y) F"  | 
| 51471 | 655  | 
shows "a < y \<Longrightarrow> eventually (\<lambda>x. a < f x) F"  | 
656  | 
and "y < a \<Longrightarrow> eventually (\<lambda>x. f x < a) F"  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
657  | 
using assms unfolding order_tendsto_iff by auto  | 
| 51471 | 658  | 
|
| 61973 | 659  | 
lemma tendsto_bot [simp]: "(f \<longlongrightarrow> a) bot"  | 
| 51471 | 660  | 
unfolding tendsto_def by simp  | 
661  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
662  | 
lemma (in linorder_topology) tendsto_max:  | 
| 61973 | 663  | 
assumes X: "(X \<longlongrightarrow> x) net"  | 
664  | 
assumes Y: "(Y \<longlongrightarrow> y) net"  | 
|
665  | 
shows "((\<lambda>x. max (X x) (Y x)) \<longlongrightarrow> max x y) net"  | 
|
| 56949 | 666  | 
proof (rule order_tendstoI)  | 
667  | 
fix a assume "a < max x y"  | 
|
668  | 
then show "eventually (\<lambda>x. a < max (X x) (Y x)) net"  | 
|
669  | 
using order_tendstoD(1)[OF X, of a] order_tendstoD(1)[OF Y, of a]  | 
|
| 61810 | 670  | 
by (auto simp: less_max_iff_disj elim: eventually_mono)  | 
| 56949 | 671  | 
next  | 
672  | 
fix a assume "max x y < a"  | 
|
673  | 
then show "eventually (\<lambda>x. max (X x) (Y x) < a) net"  | 
|
674  | 
using order_tendstoD(2)[OF X, of a] order_tendstoD(2)[OF Y, of a]  | 
|
675  | 
by (auto simp: eventually_conj_iff)  | 
|
676  | 
qed  | 
|
677  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
678  | 
lemma (in linorder_topology) tendsto_min:  | 
| 61973 | 679  | 
assumes X: "(X \<longlongrightarrow> x) net"  | 
680  | 
assumes Y: "(Y \<longlongrightarrow> y) net"  | 
|
681  | 
shows "((\<lambda>x. min (X x) (Y x)) \<longlongrightarrow> min x y) net"  | 
|
| 56949 | 682  | 
proof (rule order_tendstoI)  | 
683  | 
fix a assume "a < min x y"  | 
|
684  | 
then show "eventually (\<lambda>x. a < min (X x) (Y x)) net"  | 
|
685  | 
using order_tendstoD(1)[OF X, of a] order_tendstoD(1)[OF Y, of a]  | 
|
686  | 
by (auto simp: eventually_conj_iff)  | 
|
687  | 
next  | 
|
688  | 
fix a assume "min x y < a"  | 
|
689  | 
then show "eventually (\<lambda>x. min (X x) (Y x) < a) net"  | 
|
690  | 
using order_tendstoD(2)[OF X, of a] order_tendstoD(2)[OF Y, of a]  | 
|
| 61810 | 691  | 
by (auto simp: min_less_iff_disj elim: eventually_mono)  | 
| 56949 | 692  | 
qed  | 
693  | 
||
| 61973 | 694  | 
lemma tendsto_ident_at [tendsto_intros, simp, intro]: "((\<lambda>x. x) \<longlongrightarrow> a) (at a within s)"  | 
| 51471 | 695  | 
unfolding tendsto_def eventually_at_topological by auto  | 
696  | 
||
| 61973 | 697  | 
lemma (in topological_space) tendsto_const [tendsto_intros, simp, intro]: "((\<lambda>x. k) \<longlongrightarrow> k) F"  | 
| 51471 | 698  | 
by (simp add: tendsto_def)  | 
699  | 
||
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
700  | 
lemma (in t2_space) tendsto_unique:  | 
| 61973 | 701  | 
assumes "F \<noteq> bot" and "(f \<longlongrightarrow> a) F" and "(f \<longlongrightarrow> b) F"  | 
| 51471 | 702  | 
shows "a = b"  | 
703  | 
proof (rule ccontr)  | 
|
704  | 
assume "a \<noteq> b"  | 
|
705  | 
  obtain U V where "open U" "open V" "a \<in> U" "b \<in> V" "U \<inter> V = {}"
 | 
|
| 60758 | 706  | 
using hausdorff [OF \<open>a \<noteq> b\<close>] by fast  | 
| 51471 | 707  | 
have "eventually (\<lambda>x. f x \<in> U) F"  | 
| 61973 | 708  | 
using \<open>(f \<longlongrightarrow> a) F\<close> \<open>open U\<close> \<open>a \<in> U\<close> by (rule topological_tendstoD)  | 
| 51471 | 709  | 
moreover  | 
710  | 
have "eventually (\<lambda>x. f x \<in> V) F"  | 
|
| 61973 | 711  | 
using \<open>(f \<longlongrightarrow> b) F\<close> \<open>open V\<close> \<open>b \<in> V\<close> by (rule topological_tendstoD)  | 
| 51471 | 712  | 
ultimately  | 
713  | 
have "eventually (\<lambda>x. False) F"  | 
|
714  | 
proof eventually_elim  | 
|
715  | 
case (elim x)  | 
|
716  | 
hence "f x \<in> U \<inter> V" by simp  | 
|
| 60758 | 717  | 
    with \<open>U \<inter> V = {}\<close> show ?case by simp
 | 
| 51471 | 718  | 
qed  | 
| 60758 | 719  | 
with \<open>\<not> trivial_limit F\<close> show "False"  | 
| 51471 | 720  | 
by (simp add: trivial_limit_def)  | 
721  | 
qed  | 
|
722  | 
||
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
723  | 
lemma (in t2_space) tendsto_const_iff:  | 
| 61973 | 724  | 
assumes "\<not> trivial_limit F" shows "((\<lambda>x. a :: 'a) \<longlongrightarrow> b) F \<longleftrightarrow> a = b"  | 
| 
58729
 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 
hoelzl 
parents: 
57953 
diff
changeset
 | 
725  | 
by (auto intro!: tendsto_unique [OF assms tendsto_const])  | 
| 51471 | 726  | 
|
727  | 
lemma increasing_tendsto:  | 
|
728  | 
fixes f :: "_ \<Rightarrow> 'a::order_topology"  | 
|
729  | 
assumes bdd: "eventually (\<lambda>n. f n \<le> l) F"  | 
|
730  | 
and en: "\<And>x. x < l \<Longrightarrow> eventually (\<lambda>n. x < f n) F"  | 
|
| 61973 | 731  | 
shows "(f \<longlongrightarrow> l) F"  | 
| 61810 | 732  | 
using assms by (intro order_tendstoI) (auto elim!: eventually_mono)  | 
| 51471 | 733  | 
|
734  | 
lemma decreasing_tendsto:  | 
|
735  | 
fixes f :: "_ \<Rightarrow> 'a::order_topology"  | 
|
736  | 
assumes bdd: "eventually (\<lambda>n. l \<le> f n) F"  | 
|
737  | 
and en: "\<And>x. l < x \<Longrightarrow> eventually (\<lambda>n. f n < x) F"  | 
|
| 61973 | 738  | 
shows "(f \<longlongrightarrow> l) F"  | 
| 61810 | 739  | 
using assms by (intro order_tendstoI) (auto elim!: eventually_mono)  | 
| 51471 | 740  | 
|
741  | 
lemma tendsto_sandwich:  | 
|
742  | 
fixes f g h :: "'a \<Rightarrow> 'b::order_topology"  | 
|
743  | 
assumes ev: "eventually (\<lambda>n. f n \<le> g n) net" "eventually (\<lambda>n. g n \<le> h n) net"  | 
|
| 61973 | 744  | 
assumes lim: "(f \<longlongrightarrow> c) net" "(h \<longlongrightarrow> c) net"  | 
745  | 
shows "(g \<longlongrightarrow> c) net"  | 
|
| 51471 | 746  | 
proof (rule order_tendstoI)  | 
747  | 
fix a show "a < c \<Longrightarrow> eventually (\<lambda>x. a < g x) net"  | 
|
748  | 
using order_tendstoD[OF lim(1), of a] ev by (auto elim: eventually_elim2)  | 
|
749  | 
next  | 
|
750  | 
fix a show "c < a \<Longrightarrow> eventually (\<lambda>x. g x < a) net"  | 
|
751  | 
using order_tendstoD[OF lim(2), of a] ev by (auto elim: eventually_elim2)  | 
|
752  | 
qed  | 
|
753  | 
||
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
754  | 
lemma limit_frequently_eq:  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
755  | 
assumes "F \<noteq> bot"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
756  | 
assumes "frequently (\<lambda>x. f x = c) F"  | 
| 61973 | 757  | 
assumes "(f \<longlongrightarrow> d) F"  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
758  | 
shows "d = (c :: 'a :: t1_space)"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
759  | 
proof (rule ccontr)  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
760  | 
assume "d \<noteq> c"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
761  | 
from t1_space[OF this] obtain U where "open U" "d \<in> U" "c \<notin> U" by blast  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
762  | 
from this assms have "eventually (\<lambda>x. f x \<in> U) F" unfolding tendsto_def by blast  | 
| 61799 | 763  | 
hence "eventually (\<lambda>x. f x \<noteq> c) F" by eventually_elim (insert \<open>c \<notin> U\<close>, blast)  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
764  | 
with assms(2) show False unfolding frequently_def by contradiction  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
765  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
766  | 
|
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
767  | 
lemma tendsto_imp_eventually_ne:  | 
| 61973 | 768  | 
assumes "F \<noteq> bot" "(f \<longlongrightarrow> c) F" "c \<noteq> (c' :: 'a :: t1_space)"  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
769  | 
shows "eventually (\<lambda>z. f z \<noteq> c') F"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
770  | 
proof (rule ccontr)  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
771  | 
assume "\<not>eventually (\<lambda>z. f z \<noteq> c') F"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
772  | 
hence "frequently (\<lambda>z. f z = c') F" by (simp add: frequently_def)  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
773  | 
from limit_frequently_eq[OF assms(1) this assms(2)] and assms(3) show False by contradiction  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
774  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
775  | 
|
| 51471 | 776  | 
lemma tendsto_le:  | 
777  | 
fixes f g :: "'a \<Rightarrow> 'b::linorder_topology"  | 
|
778  | 
assumes F: "\<not> trivial_limit F"  | 
|
| 61973 | 779  | 
assumes x: "(f \<longlongrightarrow> x) F" and y: "(g \<longlongrightarrow> y) F"  | 
| 51471 | 780  | 
assumes ev: "eventually (\<lambda>x. g x \<le> f x) F"  | 
781  | 
shows "y \<le> x"  | 
|
782  | 
proof (rule ccontr)  | 
|
783  | 
assume "\<not> y \<le> x"  | 
|
784  | 
  with less_separate[of x y] obtain a b where xy: "x < a" "b < y" "{..<a} \<inter> {b<..} = {}"
 | 
|
785  | 
by (auto simp: not_le)  | 
|
786  | 
then have "eventually (\<lambda>x. f x < a) F" "eventually (\<lambda>x. b < g x) F"  | 
|
787  | 
using x y by (auto intro: order_tendstoD)  | 
|
788  | 
with ev have "eventually (\<lambda>x. False) F"  | 
|
789  | 
by eventually_elim (insert xy, fastforce)  | 
|
790  | 
with F show False  | 
|
791  | 
by (simp add: eventually_False)  | 
|
792  | 
qed  | 
|
793  | 
||
794  | 
lemma tendsto_le_const:  | 
|
795  | 
fixes f :: "'a \<Rightarrow> 'b::linorder_topology"  | 
|
796  | 
assumes F: "\<not> trivial_limit F"  | 
|
| 61973 | 797  | 
assumes x: "(f \<longlongrightarrow> x) F" and a: "eventually (\<lambda>i. a \<le> f i) F"  | 
| 51471 | 798  | 
shows "a \<le> x"  | 
799  | 
using F x tendsto_const a by (rule tendsto_le)  | 
|
800  | 
||
| 56289 | 801  | 
lemma tendsto_ge_const:  | 
802  | 
fixes f :: "'a \<Rightarrow> 'b::linorder_topology"  | 
|
803  | 
assumes F: "\<not> trivial_limit F"  | 
|
| 61973 | 804  | 
assumes x: "(f \<longlongrightarrow> x) F" and a: "eventually (\<lambda>i. a \<ge> f i) F"  | 
| 56289 | 805  | 
shows "a \<ge> x"  | 
806  | 
by (rule tendsto_le [OF F tendsto_const x a])  | 
|
807  | 
||
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
808  | 
|
| 60758 | 809  | 
subsubsection \<open>Rules about @{const Lim}\<close>
 | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
810  | 
|
| 57276 | 811  | 
lemma tendsto_Lim:  | 
| 61973 | 812  | 
"\<not>(trivial_limit net) \<Longrightarrow> (f \<longlongrightarrow> l) net \<Longrightarrow> Lim net f = l"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
813  | 
unfolding Lim_def using tendsto_unique[of net f] by auto  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
814  | 
|
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
815  | 
lemma Lim_ident_at: "\<not> trivial_limit (at x within s) \<Longrightarrow> Lim (at x within s) (\<lambda>x. x) = x"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
816  | 
by (rule tendsto_Lim[OF _ tendsto_ident_at]) auto  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
817  | 
|
| 51471 | 818  | 
lemma filterlim_at_bot_at_right:  | 
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
819  | 
fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"  | 
| 51471 | 820  | 
assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
821  | 
assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"  | 
|
822  | 
assumes Q: "eventually Q (at_right a)" and bound: "\<And>b. Q b \<Longrightarrow> a < b"  | 
|
823  | 
assumes P: "eventually P at_bot"  | 
|
824  | 
shows "filterlim f at_bot (at_right a)"  | 
|
825  | 
proof -  | 
|
826  | 
from P obtain x where x: "\<And>y. y \<le> x \<Longrightarrow> P y"  | 
|
827  | 
unfolding eventually_at_bot_linorder by auto  | 
|
828  | 
show ?thesis  | 
|
829  | 
proof (intro filterlim_at_bot_le[THEN iffD2] allI impI)  | 
|
830  | 
fix z assume "z \<le> x"  | 
|
831  | 
with x have "P z" by auto  | 
|
832  | 
have "eventually (\<lambda>x. x \<le> g z) (at_right a)"  | 
|
| 60758 | 833  | 
using bound[OF bij(2)[OF \<open>P z\<close>]]  | 
834  | 
unfolding eventually_at_right[OF bound[OF bij(2)[OF \<open>P z\<close>]]] by (auto intro!: exI[of _ "g z"])  | 
|
| 51471 | 835  | 
with Q show "eventually (\<lambda>x. f x \<le> z) (at_right a)"  | 
| 60758 | 836  | 
by eventually_elim (metis bij \<open>P z\<close> mono)  | 
| 51471 | 837  | 
qed  | 
838  | 
qed  | 
|
839  | 
||
840  | 
lemma filterlim_at_top_at_left:  | 
|
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
841  | 
fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"  | 
| 51471 | 842  | 
assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
843  | 
assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"  | 
|
844  | 
assumes Q: "eventually Q (at_left a)" and bound: "\<And>b. Q b \<Longrightarrow> b < a"  | 
|
845  | 
assumes P: "eventually P at_top"  | 
|
846  | 
shows "filterlim f at_top (at_left a)"  | 
|
847  | 
proof -  | 
|
848  | 
from P obtain x where x: "\<And>y. x \<le> y \<Longrightarrow> P y"  | 
|
849  | 
unfolding eventually_at_top_linorder by auto  | 
|
850  | 
show ?thesis  | 
|
851  | 
proof (intro filterlim_at_top_ge[THEN iffD2] allI impI)  | 
|
852  | 
fix z assume "x \<le> z"  | 
|
853  | 
with x have "P z" by auto  | 
|
854  | 
have "eventually (\<lambda>x. g z \<le> x) (at_left a)"  | 
|
| 60758 | 855  | 
using bound[OF bij(2)[OF \<open>P z\<close>]]  | 
856  | 
unfolding eventually_at_left[OF bound[OF bij(2)[OF \<open>P z\<close>]]] by (auto intro!: exI[of _ "g z"])  | 
|
| 51471 | 857  | 
with Q show "eventually (\<lambda>x. z \<le> f x) (at_left a)"  | 
| 60758 | 858  | 
by eventually_elim (metis bij \<open>P z\<close> mono)  | 
| 51471 | 859  | 
qed  | 
860  | 
qed  | 
|
861  | 
||
862  | 
lemma filterlim_split_at:  | 
|
863  | 
"filterlim f F (at_left x) \<Longrightarrow> filterlim f F (at_right x) \<Longrightarrow> filterlim f F (at (x::'a::linorder_topology))"  | 
|
864  | 
by (subst at_eq_sup_left_right) (rule filterlim_sup)  | 
|
865  | 
||
866  | 
lemma filterlim_at_split:  | 
|
867  | 
"filterlim f F (at (x::'a::linorder_topology)) \<longleftrightarrow> filterlim f F (at_left x) \<and> filterlim f F (at_right x)"  | 
|
868  | 
by (subst at_eq_sup_left_right) (simp add: filterlim_def filtermap_sup)  | 
|
869  | 
||
| 57025 | 870  | 
lemma eventually_nhds_top:  | 
871  | 
  fixes P :: "'a :: {order_top, linorder_topology} \<Rightarrow> bool"
 | 
|
872  | 
assumes "(b::'a) < top"  | 
|
873  | 
shows "eventually P (nhds top) \<longleftrightarrow> (\<exists>b<top. (\<forall>z. b < z \<longrightarrow> P z))"  | 
|
874  | 
unfolding eventually_nhds  | 
|
875  | 
proof safe  | 
|
876  | 
fix S :: "'a set" assume "open S" "top \<in> S"  | 
|
| 60758 | 877  | 
note open_left[OF this \<open>b < top\<close>]  | 
| 57025 | 878  | 
moreover assume "\<forall>s\<in>S. P s"  | 
879  | 
ultimately show "\<exists>b<top. \<forall>z>b. P z"  | 
|
880  | 
by (auto simp: subset_eq Ball_def)  | 
|
881  | 
next  | 
|
882  | 
fix b assume "b < top" "\<forall>z>b. P z"  | 
|
883  | 
then show "\<exists>S. open S \<and> top \<in> S \<and> (\<forall>xa\<in>S. P xa)"  | 
|
884  | 
    by (intro exI[of _ "{b <..}"]) auto
 | 
|
885  | 
qed  | 
|
| 51471 | 886  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
887  | 
lemma tendsto_at_within_iff_tendsto_nhds:  | 
| 61973 | 888  | 
"(g \<longlongrightarrow> g l) (at l within S) \<longleftrightarrow> (g \<longlongrightarrow> g l) (inf (nhds l) (principal S))"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
889  | 
unfolding tendsto_def eventually_at_filter eventually_inf_principal  | 
| 61810 | 890  | 
by (intro ext all_cong imp_cong) (auto elim!: eventually_mono)  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
891  | 
|
| 60758 | 892  | 
subsection \<open>Limits on sequences\<close>  | 
| 51471 | 893  | 
|
894  | 
abbreviation (in topological_space)  | 
|
895  | 
LIMSEQ :: "[nat \<Rightarrow> 'a, 'a] \<Rightarrow> bool"  | 
|
| 61969 | 896  | 
    ("((_)/ \<longlonglongrightarrow> (_))" [60, 60] 60) where
 | 
| 61973 | 897  | 
"X \<longlonglongrightarrow> L \<equiv> (X \<longlongrightarrow> L) sequentially"  | 
| 51471 | 898  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
899  | 
abbreviation (in t2_space) lim :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a" where  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
900  | 
"lim X \<equiv> Lim sequentially X"  | 
| 51471 | 901  | 
|
902  | 
definition (in topological_space) convergent :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool" where  | 
|
| 61969 | 903  | 
"convergent X = (\<exists>L. X \<longlonglongrightarrow> L)"  | 
| 51471 | 904  | 
|
| 61969 | 905  | 
lemma lim_def: "lim X = (THE L. X \<longlonglongrightarrow> L)"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
906  | 
unfolding Lim_def ..  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
907  | 
|
| 60758 | 908  | 
subsubsection \<open>Monotone sequences and subsequences\<close>  | 
| 51471 | 909  | 
|
910  | 
definition  | 
|
911  | 
monoseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool" where  | 
|
| 61799 | 912  | 
\<comment>\<open>Definition of monotonicity.  | 
| 51471 | 913  | 
The use of disjunction here complicates proofs considerably.  | 
914  | 
One alternative is to add a Boolean argument to indicate the direction.  | 
|
| 60758 | 915  | 
Another is to develop the notions of increasing and decreasing first.\<close>  | 
| 
56020
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
916  | 
"monoseq X = ((\<forall>m. \<forall>n\<ge>m. X m \<le> X n) \<or> (\<forall>m. \<forall>n\<ge>m. X n \<le> X m))"  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
917  | 
|
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
918  | 
abbreviation incseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool" where  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
919  | 
"incseq X \<equiv> mono X"  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
920  | 
|
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
921  | 
lemma incseq_def: "incseq X \<longleftrightarrow> (\<forall>m. \<forall>n\<ge>m. X n \<ge> X m)"  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
922  | 
unfolding mono_def ..  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
923  | 
|
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
924  | 
abbreviation decseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool" where  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
925  | 
"decseq X \<equiv> antimono X"  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
926  | 
|
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
927  | 
lemma decseq_def: "decseq X \<longleftrightarrow> (\<forall>m. \<forall>n\<ge>m. X n \<le> X m)"  | 
| 
 
f92479477c52
introduced antimono; incseq, decseq are now abbreviations for mono and antimono; renamed Library/Continuity to Library/Order_Continuity; removed up_cont; renamed down_cont to down_continuity and generalized to complete_lattices
 
hoelzl 
parents: 
55945 
diff
changeset
 | 
928  | 
unfolding antimono_def ..  | 
| 51471 | 929  | 
|
930  | 
definition  | 
|
931  | 
subseq :: "(nat \<Rightarrow> nat) \<Rightarrow> bool" where  | 
|
| 61799 | 932  | 
\<comment>\<open>Definition of subsequence\<close>  | 
| 51471 | 933  | 
"subseq f \<longleftrightarrow> (\<forall>m. \<forall>n>m. f m < f n)"  | 
934  | 
||
935  | 
lemma incseq_SucI:  | 
|
936  | 
"(\<And>n. X n \<le> X (Suc n)) \<Longrightarrow> incseq X"  | 
|
937  | 
using lift_Suc_mono_le[of X]  | 
|
938  | 
by (auto simp: incseq_def)  | 
|
939  | 
||
940  | 
lemma incseqD: "\<And>i j. incseq f \<Longrightarrow> i \<le> j \<Longrightarrow> f i \<le> f j"  | 
|
941  | 
by (auto simp: incseq_def)  | 
|
942  | 
||
943  | 
lemma incseq_SucD: "incseq A \<Longrightarrow> A i \<le> A (Suc i)"  | 
|
944  | 
using incseqD[of A i "Suc i"] by auto  | 
|
945  | 
||
946  | 
lemma incseq_Suc_iff: "incseq f \<longleftrightarrow> (\<forall>n. f n \<le> f (Suc n))"  | 
|
947  | 
by (auto intro: incseq_SucI dest: incseq_SucD)  | 
|
948  | 
||
949  | 
lemma incseq_const[simp, intro]: "incseq (\<lambda>x. k)"  | 
|
950  | 
unfolding incseq_def by auto  | 
|
951  | 
||
952  | 
lemma decseq_SucI:  | 
|
953  | 
"(\<And>n. X (Suc n) \<le> X n) \<Longrightarrow> decseq X"  | 
|
954  | 
using order.lift_Suc_mono_le[OF dual_order, of X]  | 
|
955  | 
by (auto simp: decseq_def)  | 
|
956  | 
||
957  | 
lemma decseqD: "\<And>i j. decseq f \<Longrightarrow> i \<le> j \<Longrightarrow> f j \<le> f i"  | 
|
958  | 
by (auto simp: decseq_def)  | 
|
959  | 
||
960  | 
lemma decseq_SucD: "decseq A \<Longrightarrow> A (Suc i) \<le> A i"  | 
|
961  | 
using decseqD[of A i "Suc i"] by auto  | 
|
962  | 
||
963  | 
lemma decseq_Suc_iff: "decseq f \<longleftrightarrow> (\<forall>n. f (Suc n) \<le> f n)"  | 
|
964  | 
by (auto intro: decseq_SucI dest: decseq_SucD)  | 
|
965  | 
||
966  | 
lemma decseq_const[simp, intro]: "decseq (\<lambda>x. k)"  | 
|
967  | 
unfolding decseq_def by auto  | 
|
968  | 
||
969  | 
lemma monoseq_iff: "monoseq X \<longleftrightarrow> incseq X \<or> decseq X"  | 
|
970  | 
unfolding monoseq_def incseq_def decseq_def ..  | 
|
971  | 
||
972  | 
lemma monoseq_Suc:  | 
|
973  | 
"monoseq X \<longleftrightarrow> (\<forall>n. X n \<le> X (Suc n)) \<or> (\<forall>n. X (Suc n) \<le> X n)"  | 
|
974  | 
unfolding monoseq_iff incseq_Suc_iff decseq_Suc_iff ..  | 
|
975  | 
||
976  | 
lemma monoI1: "\<forall>m. \<forall> n \<ge> m. X m \<le> X n ==> monoseq X"  | 
|
977  | 
by (simp add: monoseq_def)  | 
|
978  | 
||
979  | 
lemma monoI2: "\<forall>m. \<forall> n \<ge> m. X n \<le> X m ==> monoseq X"  | 
|
980  | 
by (simp add: monoseq_def)  | 
|
981  | 
||
982  | 
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) ==> monoseq X"  | 
|
983  | 
by (simp add: monoseq_Suc)  | 
|
984  | 
||
985  | 
lemma mono_SucI2: "\<forall>n. X (Suc n) \<le> X n ==> monoseq X"  | 
|
986  | 
by (simp add: monoseq_Suc)  | 
|
987  | 
||
988  | 
lemma monoseq_minus:  | 
|
989  | 
fixes a :: "nat \<Rightarrow> 'a::ordered_ab_group_add"  | 
|
990  | 
assumes "monoseq a"  | 
|
991  | 
shows "monoseq (\<lambda> n. - a n)"  | 
|
992  | 
proof (cases "\<forall> m. \<forall> n \<ge> m. a m \<le> a n")  | 
|
993  | 
case True  | 
|
994  | 
hence "\<forall> m. \<forall> n \<ge> m. - a n \<le> - a m" by auto  | 
|
995  | 
thus ?thesis by (rule monoI2)  | 
|
996  | 
next  | 
|
997  | 
case False  | 
|
| 60758 | 998  | 
hence "\<forall> m. \<forall> n \<ge> m. - a m \<le> - a n" using \<open>monoseq a\<close>[unfolded monoseq_def] by auto  | 
| 51471 | 999  | 
thus ?thesis by (rule monoI1)  | 
1000  | 
qed  | 
|
1001  | 
||
| 60758 | 1002  | 
text\<open>Subsequence (alternative definition, (e.g. Hoskins)\<close>  | 
| 51471 | 1003  | 
|
1004  | 
lemma subseq_Suc_iff: "subseq f = (\<forall>n. (f n) < (f (Suc n)))"  | 
|
1005  | 
apply (simp add: subseq_def)  | 
|
1006  | 
apply (auto dest!: less_imp_Suc_add)  | 
|
1007  | 
apply (induct_tac k)  | 
|
1008  | 
apply (auto intro: less_trans)  | 
|
1009  | 
done  | 
|
1010  | 
||
| 
63317
 
ca187a9f66da
Various additions to polynomials, FPSs, Gamma function
 
eberlm 
parents: 
63301 
diff
changeset
 | 
1011  | 
lemma subseq_add: "subseq (\<lambda>n. n + k)"  | 
| 
 
ca187a9f66da
Various additions to polynomials, FPSs, Gamma function
 
eberlm 
parents: 
63301 
diff
changeset
 | 
1012  | 
by (auto simp: subseq_Suc_iff)  | 
| 
 
ca187a9f66da
Various additions to polynomials, FPSs, Gamma function
 
eberlm 
parents: 
63301 
diff
changeset
 | 
1013  | 
|
| 60758 | 1014  | 
text\<open>for any sequence, there is a monotonic subsequence\<close>  | 
| 51471 | 1015  | 
lemma seq_monosub:  | 
1016  | 
fixes s :: "nat => 'a::linorder"  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1017  | 
shows "\<exists>f. subseq f \<and> monoseq (\<lambda>n. (s (f n)))"  | 
| 51471 | 1018  | 
proof cases  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1019  | 
assume "\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1020  | 
then have "\<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1021  | 
by (intro dependent_nat_choice) (auto simp: conj_commute)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1022  | 
then obtain f where "subseq f" and mono: "\<And>n m. f n \<le> m \<Longrightarrow> s m \<le> s (f n)"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1023  | 
by (auto simp: subseq_Suc_iff)  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1024  | 
moreover  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1025  | 
then have "incseq f"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1026  | 
unfolding subseq_Suc_iff incseq_Suc_iff by (auto intro: less_imp_le)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1027  | 
then have "monoseq (\<lambda>n. s (f n))"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1028  | 
by (auto simp add: incseq_def intro!: mono monoI2)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1029  | 
ultimately show ?thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1030  | 
by auto  | 
| 51471 | 1031  | 
next  | 
1032  | 
assume "\<not> (\<forall>n. \<exists>p>n. (\<forall>m\<ge>p. s m \<le> s p))"  | 
|
1033  | 
then obtain N where N: "\<And>p. p > N \<Longrightarrow> \<exists>m>p. s p < s m" by (force simp: not_le le_less)  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1034  | 
have "\<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1035  | 
proof (intro dependent_nat_choice)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1036  | 
fix x assume "N < x" with N[of x] show "\<exists>y>N. x < y \<and> s x \<le> s y"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1037  | 
by (auto intro: less_trans)  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1038  | 
qed auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1039  | 
then show ?thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1040  | 
by (auto simp: monoseq_iff incseq_Suc_iff subseq_Suc_iff)  | 
| 51471 | 1041  | 
qed  | 
1042  | 
||
1043  | 
lemma seq_suble: assumes sf: "subseq f" shows "n \<le> f n"  | 
|
1044  | 
proof(induct n)  | 
|
1045  | 
case 0 thus ?case by simp  | 
|
1046  | 
next  | 
|
1047  | 
case (Suc n)  | 
|
1048  | 
from sf[unfolded subseq_Suc_iff, rule_format, of n] Suc.hyps  | 
|
1049  | 
have "n < f (Suc n)" by arith  | 
|
1050  | 
thus ?case by arith  | 
|
1051  | 
qed  | 
|
1052  | 
||
1053  | 
lemma eventually_subseq:  | 
|
1054  | 
"subseq r \<Longrightarrow> eventually P sequentially \<Longrightarrow> eventually (\<lambda>n. P (r n)) sequentially"  | 
|
1055  | 
unfolding eventually_sequentially by (metis seq_suble le_trans)  | 
|
1056  | 
||
| 51473 | 1057  | 
lemma not_eventually_sequentiallyD:  | 
1058  | 
assumes P: "\<not> eventually P sequentially"  | 
|
1059  | 
shows "\<exists>r. subseq r \<and> (\<forall>n. \<not> P (r n))"  | 
|
1060  | 
proof -  | 
|
1061  | 
from P have "\<forall>n. \<exists>m\<ge>n. \<not> P m"  | 
|
1062  | 
unfolding eventually_sequentially by (simp add: not_less)  | 
|
1063  | 
then obtain r where "\<And>n. r n \<ge> n" "\<And>n. \<not> P (r n)"  | 
|
1064  | 
by (auto simp: choice_iff)  | 
|
1065  | 
then show ?thesis  | 
|
1066  | 
by (auto intro!: exI[of _ "\<lambda>n. r (((Suc \<circ> r) ^^ Suc n) 0)"]  | 
|
1067  | 
simp: less_eq_Suc_le subseq_Suc_iff)  | 
|
1068  | 
qed  | 
|
1069  | 
||
| 51471 | 1070  | 
lemma filterlim_subseq: "subseq f \<Longrightarrow> filterlim f sequentially sequentially"  | 
1071  | 
unfolding filterlim_iff by (metis eventually_subseq)  | 
|
1072  | 
||
1073  | 
lemma subseq_o: "subseq r \<Longrightarrow> subseq s \<Longrightarrow> subseq (r \<circ> s)"  | 
|
1074  | 
unfolding subseq_def by simp  | 
|
1075  | 
||
1076  | 
lemma subseq_mono: assumes "subseq r" "m < n" shows "r m < r n"  | 
|
1077  | 
using assms by (auto simp: subseq_def)  | 
|
1078  | 
||
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1079  | 
lemma subseq_imp_inj_on: "subseq g \<Longrightarrow> inj_on g A"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1080  | 
proof (rule inj_onI)  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1081  | 
assume g: "subseq g"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1082  | 
fix x y assume "g x = g y"  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1083  | 
with subseq_mono[OF g, of x y] subseq_mono[OF g, of y x] show "x = y"  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1084  | 
by (cases x y rule: linorder_cases) simp_all  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1085  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1086  | 
|
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1087  | 
lemma subseq_strict_mono: "subseq g \<Longrightarrow> strict_mono g"  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1088  | 
by (intro strict_monoI subseq_mono[of g])  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1089  | 
|
| 51471 | 1090  | 
lemma incseq_imp_monoseq: "incseq X \<Longrightarrow> monoseq X"  | 
1091  | 
by (simp add: incseq_def monoseq_def)  | 
|
1092  | 
||
1093  | 
lemma decseq_imp_monoseq: "decseq X \<Longrightarrow> monoseq X"  | 
|
1094  | 
by (simp add: decseq_def monoseq_def)  | 
|
1095  | 
||
1096  | 
lemma decseq_eq_incseq:  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1097  | 
fixes X :: "nat \<Rightarrow> 'a::ordered_ab_group_add" shows "decseq X = incseq (\<lambda>n. - X n)"  | 
| 51471 | 1098  | 
by (simp add: decseq_def incseq_def)  | 
1099  | 
||
1100  | 
lemma INT_decseq_offset:  | 
|
1101  | 
assumes "decseq F"  | 
|
1102  | 
  shows "(\<Inter>i. F i) = (\<Inter>i\<in>{n..}. F i)"
 | 
|
1103  | 
proof safe  | 
|
1104  | 
  fix x i assume x: "x \<in> (\<Inter>i\<in>{n..}. F i)"
 | 
|
1105  | 
show "x \<in> F i"  | 
|
1106  | 
proof cases  | 
|
1107  | 
from x have "x \<in> F n" by auto  | 
|
| 60758 | 1108  | 
also assume "i \<le> n" with \<open>decseq F\<close> have "F n \<subseteq> F i"  | 
| 51471 | 1109  | 
unfolding decseq_def by simp  | 
1110  | 
finally show ?thesis .  | 
|
1111  | 
qed (insert x, simp)  | 
|
1112  | 
qed auto  | 
|
1113  | 
||
1114  | 
lemma LIMSEQ_const_iff:  | 
|
1115  | 
fixes k l :: "'a::t2_space"  | 
|
| 61969 | 1116  | 
shows "(\<lambda>n. k) \<longlonglongrightarrow> l \<longleftrightarrow> k = l"  | 
| 51471 | 1117  | 
using trivial_limit_sequentially by (rule tendsto_const_iff)  | 
1118  | 
||
1119  | 
lemma LIMSEQ_SUP:  | 
|
| 61969 | 1120  | 
  "incseq X \<Longrightarrow> X \<longlonglongrightarrow> (SUP i. X i :: 'a :: {complete_linorder, linorder_topology})"
 | 
| 51471 | 1121  | 
by (intro increasing_tendsto)  | 
1122  | 
(auto simp: SUP_upper less_SUP_iff incseq_def eventually_sequentially intro: less_le_trans)  | 
|
1123  | 
||
1124  | 
lemma LIMSEQ_INF:  | 
|
| 61969 | 1125  | 
  "decseq X \<Longrightarrow> X \<longlonglongrightarrow> (INF i. X i :: 'a :: {complete_linorder, linorder_topology})"
 | 
| 51471 | 1126  | 
by (intro decreasing_tendsto)  | 
1127  | 
(auto simp: INF_lower INF_less_iff decseq_def eventually_sequentially intro: le_less_trans)  | 
|
1128  | 
||
1129  | 
lemma LIMSEQ_ignore_initial_segment:  | 
|
| 61969 | 1130  | 
"f \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. f (n + k)) \<longlonglongrightarrow> a"  | 
| 
51474
 
1e9e68247ad1
generalize Bfun and Bseq to metric spaces; Bseq is an abbreviation for Bfun
 
hoelzl 
parents: 
51473 
diff
changeset
 | 
1131  | 
unfolding tendsto_def  | 
| 
 
1e9e68247ad1
generalize Bfun and Bseq to metric spaces; Bseq is an abbreviation for Bfun
 
hoelzl 
parents: 
51473 
diff
changeset
 | 
1132  | 
by (subst eventually_sequentially_seg[where k=k])  | 
| 51471 | 1133  | 
|
1134  | 
lemma LIMSEQ_offset:  | 
|
| 61969 | 1135  | 
"(\<lambda>n. f (n + k)) \<longlonglongrightarrow> a \<Longrightarrow> f \<longlonglongrightarrow> a"  | 
| 
51474
 
1e9e68247ad1
generalize Bfun and Bseq to metric spaces; Bseq is an abbreviation for Bfun
 
hoelzl 
parents: 
51473 
diff
changeset
 | 
1136  | 
unfolding tendsto_def  | 
| 
 
1e9e68247ad1
generalize Bfun and Bseq to metric spaces; Bseq is an abbreviation for Bfun
 
hoelzl 
parents: 
51473 
diff
changeset
 | 
1137  | 
by (subst (asm) eventually_sequentially_seg[where k=k])  | 
| 51471 | 1138  | 
|
| 61969 | 1139  | 
lemma LIMSEQ_Suc: "f \<longlonglongrightarrow> l \<Longrightarrow> (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l"  | 
| 51471 | 1140  | 
by (drule_tac k="Suc 0" in LIMSEQ_ignore_initial_segment, simp)  | 
1141  | 
||
| 61969 | 1142  | 
lemma LIMSEQ_imp_Suc: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l"  | 
| 51471 | 1143  | 
by (rule_tac k="Suc 0" in LIMSEQ_offset, simp)  | 
1144  | 
||
| 61969 | 1145  | 
lemma LIMSEQ_Suc_iff: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l = f \<longlonglongrightarrow> l"  | 
| 51471 | 1146  | 
by (blast intro: LIMSEQ_imp_Suc LIMSEQ_Suc)  | 
1147  | 
||
1148  | 
lemma LIMSEQ_unique:  | 
|
1149  | 
fixes a b :: "'a::t2_space"  | 
|
| 61969 | 1150  | 
shows "\<lbrakk>X \<longlonglongrightarrow> a; X \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> a = b"  | 
| 51471 | 1151  | 
using trivial_limit_sequentially by (rule tendsto_unique)  | 
1152  | 
||
1153  | 
lemma LIMSEQ_le_const:  | 
|
| 61969 | 1154  | 
"\<lbrakk>X \<longlonglongrightarrow> (x::'a::linorder_topology); \<exists>N. \<forall>n\<ge>N. a \<le> X n\<rbrakk> \<Longrightarrow> a \<le> x"  | 
| 51471 | 1155  | 
using tendsto_le_const[of sequentially X x a] by (simp add: eventually_sequentially)  | 
1156  | 
||
1157  | 
lemma LIMSEQ_le:  | 
|
| 61969 | 1158  | 
"\<lbrakk>X \<longlonglongrightarrow> x; Y \<longlonglongrightarrow> y; \<exists>N. \<forall>n\<ge>N. X n \<le> Y n\<rbrakk> \<Longrightarrow> x \<le> (y::'a::linorder_topology)"  | 
| 51471 | 1159  | 
using tendsto_le[of sequentially Y y X x] by (simp add: eventually_sequentially)  | 
1160  | 
||
1161  | 
lemma LIMSEQ_le_const2:  | 
|
| 61969 | 1162  | 
"\<lbrakk>X \<longlonglongrightarrow> (x::'a::linorder_topology); \<exists>N. \<forall>n\<ge>N. X n \<le> a\<rbrakk> \<Longrightarrow> x \<le> a"  | 
| 
58729
 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 
hoelzl 
parents: 
57953 
diff
changeset
 | 
1163  | 
by (rule LIMSEQ_le[of X x "\<lambda>n. a"]) auto  | 
| 51471 | 1164  | 
|
| 61969 | 1165  | 
lemma convergentD: "convergent X ==> \<exists>L. (X \<longlonglongrightarrow> L)"  | 
| 51471 | 1166  | 
by (simp add: convergent_def)  | 
1167  | 
||
| 61969 | 1168  | 
lemma convergentI: "(X \<longlonglongrightarrow> L) ==> convergent X"  | 
| 51471 | 1169  | 
by (auto simp add: convergent_def)  | 
1170  | 
||
| 61969 | 1171  | 
lemma convergent_LIMSEQ_iff: "convergent X = (X \<longlonglongrightarrow> lim X)"  | 
| 51471 | 1172  | 
by (auto intro: theI LIMSEQ_unique simp add: convergent_def lim_def)  | 
1173  | 
||
1174  | 
lemma convergent_const: "convergent (\<lambda>n. c)"  | 
|
1175  | 
by (rule convergentI, rule tendsto_const)  | 
|
1176  | 
||
1177  | 
lemma monoseq_le:  | 
|
| 61969 | 1178  | 
"monoseq a \<Longrightarrow> a \<longlonglongrightarrow> (x::'a::linorder_topology) \<Longrightarrow>  | 
| 51471 | 1179  | 
((\<forall> n. a n \<le> x) \<and> (\<forall>m. \<forall>n\<ge>m. a m \<le> a n)) \<or> ((\<forall> n. x \<le> a n) \<and> (\<forall>m. \<forall>n\<ge>m. a n \<le> a m))"  | 
1180  | 
by (metis LIMSEQ_le_const LIMSEQ_le_const2 decseq_def incseq_def monoseq_iff)  | 
|
1181  | 
||
1182  | 
lemma LIMSEQ_subseq_LIMSEQ:  | 
|
| 61969 | 1183  | 
"\<lbrakk> X \<longlonglongrightarrow> L; subseq f \<rbrakk> \<Longrightarrow> (X o f) \<longlonglongrightarrow> L"  | 
| 51471 | 1184  | 
unfolding comp_def by (rule filterlim_compose[of X, OF _ filterlim_subseq])  | 
1185  | 
||
1186  | 
lemma convergent_subseq_convergent:  | 
|
1187  | 
"\<lbrakk>convergent X; subseq f\<rbrakk> \<Longrightarrow> convergent (X o f)"  | 
|
1188  | 
unfolding convergent_def by (auto intro: LIMSEQ_subseq_LIMSEQ)  | 
|
1189  | 
||
| 61969 | 1190  | 
lemma limI: "X \<longlonglongrightarrow> L ==> lim X = L"  | 
| 57276 | 1191  | 
by (rule tendsto_Lim) (rule trivial_limit_sequentially)  | 
| 51471 | 1192  | 
|
1193  | 
lemma lim_le: "convergent f \<Longrightarrow> (\<And>n. f n \<le> (x::'a::linorder_topology)) \<Longrightarrow> lim f \<le> x"  | 
|
1194  | 
using LIMSEQ_le_const2[of f "lim f" x] by (simp add: convergent_LIMSEQ_iff)  | 
|
1195  | 
||
| 62217 | 1196  | 
lemma lim_const [simp]: "lim (\<lambda>m. a) = a"  | 
1197  | 
by (simp add: limI)  | 
|
1198  | 
||
| 60758 | 1199  | 
subsubsection\<open>Increasing and Decreasing Series\<close>  | 
| 51471 | 1200  | 
|
| 61969 | 1201  | 
lemma incseq_le: "incseq X \<Longrightarrow> X \<longlonglongrightarrow> L \<Longrightarrow> X n \<le> (L::'a::linorder_topology)"  | 
| 51471 | 1202  | 
by (metis incseq_def LIMSEQ_le_const)  | 
1203  | 
||
| 61969 | 1204  | 
lemma decseq_le: "decseq X \<Longrightarrow> X \<longlonglongrightarrow> L \<Longrightarrow> (L::'a::linorder_topology) \<le> X n"  | 
| 51471 | 1205  | 
by (metis decseq_def LIMSEQ_le_const2)  | 
1206  | 
||
| 60758 | 1207  | 
subsection \<open>First countable topologies\<close>  | 
| 51473 | 1208  | 
|
1209  | 
class first_countable_topology = topological_space +  | 
|
1210  | 
assumes first_countable_basis:  | 
|
1211  | 
"\<exists>A::nat \<Rightarrow> 'a set. (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))"  | 
|
1212  | 
||
1213  | 
lemma (in first_countable_topology) countable_basis_at_decseq:  | 
|
1214  | 
obtains A :: "nat \<Rightarrow> 'a set" where  | 
|
1215  | 
"\<And>i. open (A i)" "\<And>i. x \<in> (A i)"  | 
|
1216  | 
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"  | 
|
1217  | 
proof atomize_elim  | 
|
1218  | 
from first_countable_basis[of x] obtain A :: "nat \<Rightarrow> 'a set" where  | 
|
1219  | 
nhds: "\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
|
1220  | 
and incl: "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>i. A i \<subseteq> S" by auto  | 
|
| 63040 | 1221  | 
define F where "F n = (\<Inter>i\<le>n. A i)" for n  | 
| 51473 | 1222  | 
show "\<exists>A. (\<forall>i. open (A i)) \<and> (\<forall>i. x \<in> A i) \<and>  | 
1223  | 
(\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially)"  | 
|
1224  | 
proof (safe intro!: exI[of _ F])  | 
|
1225  | 
fix i  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
1226  | 
show "open (F i)" using nhds(1) by (auto simp: F_def)  | 
| 51473 | 1227  | 
show "x \<in> F i" using nhds(2) by (auto simp: F_def)  | 
1228  | 
next  | 
|
1229  | 
fix S assume "open S" "x \<in> S"  | 
|
1230  | 
from incl[OF this] obtain i where "F i \<subseteq> S" unfolding F_def by auto  | 
|
1231  | 
moreover have "\<And>j. i \<le> j \<Longrightarrow> F j \<subseteq> F i"  | 
|
| 63171 | 1232  | 
by (simp add: Inf_superset_mono F_def image_mono)  | 
| 51473 | 1233  | 
ultimately show "eventually (\<lambda>i. F i \<subseteq> S) sequentially"  | 
1234  | 
by (auto simp: eventually_sequentially)  | 
|
1235  | 
qed  | 
|
1236  | 
qed  | 
|
1237  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1238  | 
lemma (in first_countable_topology) nhds_countable:  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1239  | 
obtains X :: "nat \<Rightarrow> 'a set"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1240  | 
where "decseq X" "\<And>n. open (X n)" "\<And>n. x \<in> X n" "nhds x = (INF n. principal (X n))"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1241  | 
proof -  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1242  | 
from first_countable_basis obtain A :: "nat \<Rightarrow> 'a set"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1243  | 
where A: "\<And>n. x \<in> A n" "\<And>n. open (A n)" "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>i. A i \<subseteq> S"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1244  | 
by metis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1245  | 
show thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1246  | 
proof  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1247  | 
show "decseq (\<lambda>n. \<Inter>i\<le>n. A i)"  | 
| 63171 | 1248  | 
by (simp add: antimono_iff_le_Suc atMost_Suc)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1249  | 
show "\<And>n. x \<in> (\<Inter>i\<le>n. A i)" "\<And>n. open (\<Inter>i\<le>n. A i)"  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1250  | 
using A by auto  | 
| 60585 | 1251  | 
show "nhds x = (INF n. principal (\<Inter>i\<le>n. A i))"  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1252  | 
using A unfolding nhds_def  | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1253  | 
apply -  | 
| 
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1254  | 
apply (rule INF_eq)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1255  | 
apply simp_all  | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1256  | 
apply fastforce  | 
| 
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1257  | 
apply (intro exI [of _ "\<Inter>i\<le>n. A i" for n] conjI open_INT)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1258  | 
apply auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1259  | 
done  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1260  | 
qed  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1261  | 
qed  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1262  | 
|
| 51473 | 1263  | 
lemma (in first_countable_topology) countable_basis:  | 
1264  | 
obtains A :: "nat \<Rightarrow> 'a set" where  | 
|
1265  | 
"\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
|
| 61969 | 1266  | 
"\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"  | 
| 51473 | 1267  | 
proof atomize_elim  | 
| 53381 | 1268  | 
obtain A :: "nat \<Rightarrow> 'a set" where A:  | 
1269  | 
"\<And>i. open (A i)"  | 
|
1270  | 
"\<And>i. x \<in> A i"  | 
|
1271  | 
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"  | 
|
1272  | 
by (rule countable_basis_at_decseq) blast  | 
|
1273  | 
  {
 | 
|
1274  | 
fix F S assume "\<forall>n. F n \<in> A n" "open S" "x \<in> S"  | 
|
| 51473 | 1275  | 
with A(3)[of S] have "eventually (\<lambda>n. F n \<in> S) sequentially"  | 
| 61810 | 1276  | 
by (auto elim: eventually_mono simp: subset_eq)  | 
| 53381 | 1277  | 
}  | 
| 61969 | 1278  | 
with A show "\<exists>A. (\<forall>i. open (A i)) \<and> (\<forall>i. x \<in> A i) \<and> (\<forall>F. (\<forall>n. F n \<in> A n) \<longrightarrow> F \<longlonglongrightarrow> x)"  | 
| 51473 | 1279  | 
by (intro exI[of _ A]) (auto simp: tendsto_def)  | 
1280  | 
qed  | 
|
1281  | 
||
1282  | 
lemma (in first_countable_topology) sequentially_imp_eventually_nhds_within:  | 
|
| 61969 | 1283  | 
assumes "\<forall>f. (\<forall>n. f n \<in> s) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1284  | 
shows "eventually P (inf (nhds a) (principal s))"  | 
| 51473 | 1285  | 
proof (rule ccontr)  | 
| 53381 | 1286  | 
obtain A :: "nat \<Rightarrow> 'a set" where A:  | 
1287  | 
"\<And>i. open (A i)"  | 
|
1288  | 
"\<And>i. a \<in> A i"  | 
|
| 61969 | 1289  | 
"\<And>F. \<forall>n. F n \<in> A n \<Longrightarrow> F \<longlonglongrightarrow> a"  | 
| 53381 | 1290  | 
by (rule countable_basis) blast  | 
1291  | 
assume "\<not> ?thesis"  | 
|
| 51473 | 1292  | 
with A have P: "\<exists>F. \<forall>n. F n \<in> s \<and> F n \<in> A n \<and> \<not> P (F n)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1293  | 
unfolding eventually_inf_principal eventually_nhds by (intro choice) fastforce  | 
| 53381 | 1294  | 
then obtain F where F0: "\<forall>n. F n \<in> s" and F2: "\<forall>n. F n \<in> A n" and F3: "\<forall>n. \<not> P (F n)"  | 
1295  | 
by blast  | 
|
| 61969 | 1296  | 
with A have "F \<longlonglongrightarrow> a" by auto  | 
| 51473 | 1297  | 
hence "eventually (\<lambda>n. P (F n)) sequentially"  | 
1298  | 
using assms F0 by simp  | 
|
1299  | 
thus "False" by (simp add: F3)  | 
|
1300  | 
qed  | 
|
1301  | 
||
1302  | 
lemma (in first_countable_topology) eventually_nhds_within_iff_sequentially:  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1303  | 
"eventually P (inf (nhds a) (principal s)) \<longleftrightarrow>  | 
| 61969 | 1304  | 
(\<forall>f. (\<forall>n. f n \<in> s) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially)"  | 
| 51473 | 1305  | 
proof (safe intro!: sequentially_imp_eventually_nhds_within)  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1306  | 
assume "eventually P (inf (nhds a) (principal s))"  | 
| 51473 | 1307  | 
then obtain S where "open S" "a \<in> S" "\<forall>x\<in>S. x \<in> s \<longrightarrow> P x"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1308  | 
by (auto simp: eventually_inf_principal eventually_nhds)  | 
| 61969 | 1309  | 
moreover fix f assume "\<forall>n. f n \<in> s" "f \<longlonglongrightarrow> a"  | 
| 51473 | 1310  | 
ultimately show "eventually (\<lambda>n. P (f n)) sequentially"  | 
| 61810 | 1311  | 
by (auto dest!: topological_tendstoD elim: eventually_mono)  | 
| 51473 | 1312  | 
qed  | 
1313  | 
||
1314  | 
lemma (in first_countable_topology) eventually_nhds_iff_sequentially:  | 
|
| 61969 | 1315  | 
"eventually P (nhds a) \<longleftrightarrow> (\<forall>f. f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially)"  | 
| 51473 | 1316  | 
using eventually_nhds_within_iff_sequentially[of P a UNIV] by simp  | 
1317  | 
||
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1318  | 
lemma tendsto_at_iff_sequentially:  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1319  | 
fixes f :: "'a :: first_countable_topology \<Rightarrow> _"  | 
| 61973 | 1320  | 
  shows "(f \<longlongrightarrow> a) (at x within s) \<longleftrightarrow> (\<forall>X. (\<forall>i. X i \<in> s - {x}) \<longrightarrow> X \<longlonglongrightarrow> x \<longrightarrow> ((f \<circ> X) \<longlonglongrightarrow> a))"
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1321  | 
unfolding filterlim_def[of _ "nhds a"] le_filter_def eventually_filtermap at_within_def eventually_nhds_within_iff_sequentially comp_def  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1322  | 
by metis  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1323  | 
|
| 60758 | 1324  | 
subsection \<open>Function limit at a point\<close>  | 
| 51471 | 1325  | 
|
1326  | 
abbreviation  | 
|
1327  | 
  LIM :: "('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool"
 | 
|
| 61976 | 1328  | 
        ("((_)/ \<midarrow>(_)/\<rightarrow> (_))" [60, 0, 60] 60) where
 | 
1329  | 
"f \<midarrow>a\<rightarrow> L \<equiv> (f \<longlongrightarrow> L) (at a)"  | 
|
| 51471 | 1330  | 
|
| 61976 | 1331  | 
lemma tendsto_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> (f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow> (f \<midarrow>a\<rightarrow> l)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1332  | 
unfolding tendsto_def by (simp add: at_within_open[where S=S])  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1333  | 
|
| 
62397
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1334  | 
lemma tendsto_within_open_NO_MATCH:  | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1335  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"  | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1336  | 
shows "a \<in> S \<Longrightarrow> NO_MATCH UNIV S \<Longrightarrow> open S \<Longrightarrow> (f \<longlongrightarrow> l)(at a within S) \<longleftrightarrow> (f \<longlongrightarrow> l)(at a)"  | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1337  | 
using tendsto_within_open by blast  | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1338  | 
|
| 51471 | 1339  | 
lemma LIM_const_not_eq[tendsto_intros]:  | 
1340  | 
fixes a :: "'a::perfect_space"  | 
|
1341  | 
fixes k L :: "'b::t2_space"  | 
|
| 61976 | 1342  | 
shows "k \<noteq> L \<Longrightarrow> \<not> (\<lambda>x. k) \<midarrow>a\<rightarrow> L"  | 
| 51471 | 1343  | 
by (simp add: tendsto_const_iff)  | 
1344  | 
||
1345  | 
lemmas LIM_not_zero = LIM_const_not_eq [where L = 0]  | 
|
1346  | 
||
1347  | 
lemma LIM_const_eq:  | 
|
1348  | 
fixes a :: "'a::perfect_space"  | 
|
1349  | 
fixes k L :: "'b::t2_space"  | 
|
| 61976 | 1350  | 
shows "(\<lambda>x. k) \<midarrow>a\<rightarrow> L \<Longrightarrow> k = L"  | 
| 51471 | 1351  | 
by (simp add: tendsto_const_iff)  | 
1352  | 
||
1353  | 
lemma LIM_unique:  | 
|
1354  | 
fixes a :: "'a::perfect_space" and L M :: "'b::t2_space"  | 
|
| 61976 | 1355  | 
shows "f \<midarrow>a\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> M \<Longrightarrow> L = M"  | 
| 51471 | 1356  | 
using at_neq_bot by (rule tendsto_unique)  | 
1357  | 
||
| 60758 | 1358  | 
text \<open>Limits are equal for functions equal except at limit point\<close>  | 
| 51471 | 1359  | 
|
| 61976 | 1360  | 
lemma LIM_equal: "\<forall>x. x \<noteq> a --> (f x = g x) \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>a\<rightarrow> l)"  | 
| 51471 | 1361  | 
unfolding tendsto_def eventually_at_topological by simp  | 
1362  | 
||
| 61976 | 1363  | 
lemma LIM_cong: "a = b \<Longrightarrow> (\<And>x. x \<noteq> b \<Longrightarrow> f x = g x) \<Longrightarrow> l = m \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>b\<rightarrow> m)"  | 
| 51471 | 1364  | 
by (simp add: LIM_equal)  | 
1365  | 
||
| 61976 | 1366  | 
lemma LIM_cong_limit: "f \<midarrow>x\<rightarrow> L \<Longrightarrow> K = L \<Longrightarrow> f \<midarrow>x\<rightarrow> K"  | 
| 51471 | 1367  | 
by simp  | 
1368  | 
||
1369  | 
lemma tendsto_at_iff_tendsto_nhds:  | 
|
| 61976 | 1370  | 
"g \<midarrow>l\<rightarrow> g l \<longleftrightarrow> (g \<longlongrightarrow> g l) (nhds l)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1371  | 
unfolding tendsto_def eventually_at_filter  | 
| 61810 | 1372  | 
by (intro ext all_cong imp_cong) (auto elim!: eventually_mono)  | 
| 51471 | 1373  | 
|
1374  | 
lemma tendsto_compose:  | 
|
| 61976 | 1375  | 
"g \<midarrow>l\<rightarrow> g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"  | 
| 51471 | 1376  | 
unfolding tendsto_at_iff_tendsto_nhds by (rule filterlim_compose[of g])  | 
1377  | 
||
| 61976 | 1378  | 
lemma LIM_o: "\<lbrakk>g \<midarrow>l\<rightarrow> g l; f \<midarrow>a\<rightarrow> l\<rbrakk> \<Longrightarrow> (g \<circ> f) \<midarrow>a\<rightarrow> g l"  | 
| 51471 | 1379  | 
unfolding o_def by (rule tendsto_compose)  | 
1380  | 
||
1381  | 
lemma tendsto_compose_eventually:  | 
|
| 61976 | 1382  | 
"g \<midarrow>l\<rightarrow> m \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> eventually (\<lambda>x. f x \<noteq> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> m) F"  | 
| 51471 | 1383  | 
by (rule filterlim_compose[of g _ "at l"]) (auto simp add: filterlim_at)  | 
1384  | 
||
1385  | 
lemma LIM_compose_eventually:  | 
|
| 61976 | 1386  | 
assumes f: "f \<midarrow>a\<rightarrow> b"  | 
1387  | 
assumes g: "g \<midarrow>b\<rightarrow> c"  | 
|
| 51471 | 1388  | 
assumes inj: "eventually (\<lambda>x. f x \<noteq> b) (at a)"  | 
| 61976 | 1389  | 
shows "(\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c"  | 
| 51471 | 1390  | 
using g f inj by (rule tendsto_compose_eventually)  | 
1391  | 
||
| 61973 | 1392  | 
lemma tendsto_compose_filtermap: "((g \<circ> f) \<longlongrightarrow> T) F \<longleftrightarrow> (g \<longlongrightarrow> T) (filtermap f F)"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1393  | 
by (simp add: filterlim_def filtermap_filtermap comp_def)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1394  | 
|
| 60758 | 1395  | 
subsubsection \<open>Relation of LIM and LIMSEQ\<close>  | 
| 51473 | 1396  | 
|
1397  | 
lemma (in first_countable_topology) sequentially_imp_eventually_within:  | 
|
| 61969 | 1398  | 
"(\<forall>f. (\<forall>n. f n \<in> s \<and> f n \<noteq> a) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially) \<Longrightarrow>  | 
| 51473 | 1399  | 
eventually P (at a within s)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1400  | 
unfolding at_within_def  | 
| 51473 | 1401  | 
by (intro sequentially_imp_eventually_nhds_within) auto  | 
1402  | 
||
1403  | 
lemma (in first_countable_topology) sequentially_imp_eventually_at:  | 
|
| 61969 | 1404  | 
"(\<forall>f. (\<forall>n. f n \<noteq> a) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially) \<Longrightarrow> eventually P (at a)"  | 
| 63092 | 1405  | 
using sequentially_imp_eventually_within [where s=UNIV] by simp  | 
| 51473 | 1406  | 
|
1407  | 
lemma LIMSEQ_SEQ_conv1:  | 
|
1408  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"  | 
|
| 61976 | 1409  | 
assumes f: "f \<midarrow>a\<rightarrow> l"  | 
| 61969 | 1410  | 
shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. f (S n)) \<longlonglongrightarrow> l"  | 
| 51473 | 1411  | 
using tendsto_compose_eventually [OF f, where F=sequentially] by simp  | 
1412  | 
||
1413  | 
lemma LIMSEQ_SEQ_conv2:  | 
|
1414  | 
fixes f :: "'a::first_countable_topology \<Rightarrow> 'b::topological_space"  | 
|
| 61969 | 1415  | 
assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. f (S n)) \<longlonglongrightarrow> l"  | 
| 61976 | 1416  | 
shows "f \<midarrow>a\<rightarrow> l"  | 
| 51473 | 1417  | 
using assms unfolding tendsto_def [where l=l] by (simp add: sequentially_imp_eventually_at)  | 
1418  | 
||
1419  | 
lemma LIMSEQ_SEQ_conv:  | 
|
| 61969 | 1420  | 
"(\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> (a::'a::first_countable_topology) \<longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L) =  | 
| 61976 | 1421  | 
(X \<midarrow>a\<rightarrow> (L::'b::topological_space))"  | 
| 51473 | 1422  | 
using LIMSEQ_SEQ_conv2 LIMSEQ_SEQ_conv1 ..  | 
1423  | 
||
| 57025 | 1424  | 
lemma sequentially_imp_eventually_at_left:  | 
| 
60172
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
60150 
diff
changeset
 | 
1425  | 
  fixes a :: "'a :: {linorder_topology, first_countable_topology}"
 | 
| 57025 | 1426  | 
assumes b[simp]: "b < a"  | 
| 61969 | 1427  | 
assumes *: "\<And>f. (\<And>n. b < f n) \<Longrightarrow> (\<And>n. f n < a) \<Longrightarrow> incseq f \<Longrightarrow> f \<longlonglongrightarrow> a \<Longrightarrow> eventually (\<lambda>n. P (f n)) sequentially"  | 
| 57025 | 1428  | 
shows "eventually P (at_left a)"  | 
1429  | 
proof (safe intro!: sequentially_imp_eventually_within)  | 
|
| 61969 | 1430  | 
  fix X assume X: "\<forall>n. X n \<in> {..< a} \<and> X n \<noteq> a" "X \<longlonglongrightarrow> a"
 | 
| 57025 | 1431  | 
show "eventually (\<lambda>n. P (X n)) sequentially"  | 
1432  | 
proof (rule ccontr)  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1433  | 
assume neg: "\<not> eventually (\<lambda>n. P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1434  | 
have "\<exists>s. \<forall>n. (\<not> P (X (s n)) \<and> b < X (s n)) \<and> (X (s n) \<le> X (s (Suc n)) \<and> Suc (s n) \<le> s (Suc n))"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1435  | 
proof (rule dependent_nat_choice)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1436  | 
have "\<not> eventually (\<lambda>n. b < X n \<longrightarrow> P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1437  | 
by (intro not_eventually_impI neg order_tendstoD(1) [OF X(2) b])  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1438  | 
then show "\<exists>x. \<not> P (X x) \<and> b < X x"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1439  | 
by (auto dest!: not_eventuallyD)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1440  | 
next  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1441  | 
fix x n  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1442  | 
have "\<not> eventually (\<lambda>n. Suc x \<le> n \<longrightarrow> b < X n \<longrightarrow> X x < X n \<longrightarrow> P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1443  | 
using X by (intro not_eventually_impI order_tendstoD(1)[OF X(2)] eventually_ge_at_top neg) auto  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1444  | 
then show "\<exists>n. (\<not> P (X n) \<and> b < X n) \<and> (X x \<le> X n \<and> Suc x \<le> n)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1445  | 
by (auto dest!: not_eventuallyD)  | 
| 57025 | 1446  | 
qed  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1447  | 
then guess s ..  | 
| 61969 | 1448  | 
then have "\<And>n. b < X (s n)" "\<And>n. X (s n) < a" "incseq (\<lambda>n. X (s n))" "(\<lambda>n. X (s n)) \<longlonglongrightarrow> a" "\<And>n. \<not> P (X (s n))"  | 
1449  | 
using X by (auto simp: subseq_Suc_iff Suc_le_eq incseq_Suc_iff intro!: LIMSEQ_subseq_LIMSEQ[OF \<open>X \<longlonglongrightarrow> a\<close>, unfolded comp_def])  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1450  | 
from *[OF this(1,2,3,4)] this(5) show False by auto  | 
| 57025 | 1451  | 
qed  | 
1452  | 
qed  | 
|
1453  | 
||
1454  | 
lemma tendsto_at_left_sequentially:  | 
|
| 
60172
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
60150 
diff
changeset
 | 
1455  | 
  fixes a :: "_ :: {linorder_topology, first_countable_topology}"
 | 
| 57025 | 1456  | 
assumes "b < a"  | 
| 61969 | 1457  | 
assumes *: "\<And>S. (\<And>n. S n < a) \<Longrightarrow> (\<And>n. b < S n) \<Longrightarrow> incseq S \<Longrightarrow> S \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L"  | 
| 61973 | 1458  | 
shows "(X \<longlongrightarrow> L) (at_left a)"  | 
| 57025 | 1459  | 
using assms unfolding tendsto_def [where l=L]  | 
1460  | 
by (simp add: sequentially_imp_eventually_at_left)  | 
|
1461  | 
||
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1462  | 
lemma sequentially_imp_eventually_at_right:  | 
| 
60172
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
60150 
diff
changeset
 | 
1463  | 
  fixes a :: "'a :: {linorder_topology, first_countable_topology}"
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1464  | 
assumes b[simp]: "a < b"  | 
| 61969 | 1465  | 
assumes *: "\<And>f. (\<And>n. a < f n) \<Longrightarrow> (\<And>n. f n < b) \<Longrightarrow> decseq f \<Longrightarrow> f \<longlonglongrightarrow> a \<Longrightarrow> eventually (\<lambda>n. P (f n)) sequentially"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1466  | 
shows "eventually P (at_right a)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1467  | 
proof (safe intro!: sequentially_imp_eventually_within)  | 
| 61969 | 1468  | 
  fix X assume X: "\<forall>n. X n \<in> {a <..} \<and> X n \<noteq> a" "X \<longlonglongrightarrow> a"
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1469  | 
show "eventually (\<lambda>n. P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1470  | 
proof (rule ccontr)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1471  | 
assume neg: "\<not> eventually (\<lambda>n. P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1472  | 
have "\<exists>s. \<forall>n. (\<not> P (X (s n)) \<and> X (s n) < b) \<and> (X (s (Suc n)) \<le> X (s n) \<and> Suc (s n) \<le> s (Suc n))"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1473  | 
proof (rule dependent_nat_choice)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1474  | 
have "\<not> eventually (\<lambda>n. X n < b \<longrightarrow> P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1475  | 
by (intro not_eventually_impI neg order_tendstoD(2) [OF X(2) b])  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1476  | 
then show "\<exists>x. \<not> P (X x) \<and> X x < b"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1477  | 
by (auto dest!: not_eventuallyD)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1478  | 
next  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1479  | 
fix x n  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1480  | 
have "\<not> eventually (\<lambda>n. Suc x \<le> n \<longrightarrow> X n < b \<longrightarrow> X n < X x \<longrightarrow> P (X n)) sequentially"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1481  | 
using X by (intro not_eventually_impI order_tendstoD(2)[OF X(2)] eventually_ge_at_top neg) auto  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1482  | 
then show "\<exists>n. (\<not> P (X n) \<and> X n < b) \<and> (X n \<le> X x \<and> Suc x \<le> n)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1483  | 
by (auto dest!: not_eventuallyD)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1484  | 
qed  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1485  | 
then guess s ..  | 
| 61969 | 1486  | 
then have "\<And>n. a < X (s n)" "\<And>n. X (s n) < b" "decseq (\<lambda>n. X (s n))" "(\<lambda>n. X (s n)) \<longlonglongrightarrow> a" "\<And>n. \<not> P (X (s n))"  | 
1487  | 
using X by (auto simp: subseq_Suc_iff Suc_le_eq decseq_Suc_iff intro!: LIMSEQ_subseq_LIMSEQ[OF \<open>X \<longlonglongrightarrow> a\<close>, unfolded comp_def])  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1488  | 
from *[OF this(1,2,3,4)] this(5) show False by auto  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1489  | 
qed  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1490  | 
qed  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1491  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1492  | 
lemma tendsto_at_right_sequentially:  | 
| 
60172
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
60150 
diff
changeset
 | 
1493  | 
  fixes a :: "_ :: {linorder_topology, first_countable_topology}"
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1494  | 
assumes "a < b"  | 
| 61969 | 1495  | 
assumes *: "\<And>S. (\<And>n. a < S n) \<Longrightarrow> (\<And>n. S n < b) \<Longrightarrow> decseq S \<Longrightarrow> S \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L"  | 
| 61973 | 1496  | 
shows "(X \<longlongrightarrow> L) (at_right a)"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1497  | 
using assms unfolding tendsto_def [where l=L]  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1498  | 
by (simp add: sequentially_imp_eventually_at_right)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1499  | 
|
| 60758 | 1500  | 
subsection \<open>Continuity\<close>  | 
| 51471 | 1501  | 
|
| 60758 | 1502  | 
subsubsection \<open>Continuity on a set\<close>  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1503  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1504  | 
definition continuous_on :: "'a set \<Rightarrow> ('a :: topological_space \<Rightarrow> 'b :: topological_space) \<Rightarrow> bool" where
 | 
| 61973 | 1505  | 
"continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1506  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1507  | 
lemma continuous_on_cong [cong]:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1508  | 
"s = t \<Longrightarrow> (\<And>x. x \<in> t \<Longrightarrow> f x = g x) \<Longrightarrow> continuous_on s f \<longleftrightarrow> continuous_on t g"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1509  | 
unfolding continuous_on_def by (intro ball_cong filterlim_cong) (auto simp: eventually_at_filter)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1510  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1511  | 
lemma continuous_on_topological:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1512  | 
"continuous_on s f \<longleftrightarrow>  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1513  | 
(\<forall>x\<in>s. \<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1514  | 
unfolding continuous_on_def tendsto_def eventually_at_topological by metis  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1515  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1516  | 
lemma continuous_on_open_invariant:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1517  | 
"continuous_on s f \<longleftrightarrow> (\<forall>B. open B \<longrightarrow> (\<exists>A. open A \<and> A \<inter> s = f -` B \<inter> s))"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1518  | 
proof safe  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1519  | 
fix B :: "'b set" assume "continuous_on s f" "open B"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1520  | 
then have "\<forall>x\<in>f -` B \<inter> s. (\<exists>A. open A \<and> x \<in> A \<and> s \<inter> A \<subseteq> f -` B)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1521  | 
by (auto simp: continuous_on_topological subset_eq Ball_def imp_conjL)  | 
| 53381 | 1522  | 
then obtain A where "\<forall>x\<in>f -` B \<inter> s. open (A x) \<and> x \<in> A x \<and> s \<inter> A x \<subseteq> f -` B"  | 
1523  | 
unfolding bchoice_iff ..  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1524  | 
then show "\<exists>A. open A \<and> A \<inter> s = f -` B \<inter> s"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1525  | 
by (intro exI[of _ "\<Union>x\<in>f -` B \<inter> s. A x"]) auto  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1526  | 
next  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1527  | 
assume B: "\<forall>B. open B \<longrightarrow> (\<exists>A. open A \<and> A \<inter> s = f -` B \<inter> s)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1528  | 
show "continuous_on s f"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1529  | 
unfolding continuous_on_topological  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1530  | 
proof safe  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1531  | 
fix x B assume "x \<in> s" "open B" "f x \<in> B"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1532  | 
with B obtain A where A: "open A" "A \<inter> s = f -` B \<inter> s" by auto  | 
| 60758 | 1533  | 
with \<open>x \<in> s\<close> \<open>f x \<in> B\<close> show "\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1534  | 
by (intro exI[of _ A]) auto  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1535  | 
qed  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1536  | 
qed  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1537  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1538  | 
lemma continuous_on_open_vimage:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1539  | 
"open s \<Longrightarrow> continuous_on s f \<longleftrightarrow> (\<forall>B. open B \<longrightarrow> open (f -` B \<inter> s))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1540  | 
unfolding continuous_on_open_invariant  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1541  | 
by (metis open_Int Int_absorb Int_commute[of s] Int_assoc[of _ _ s])  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1542  | 
|
| 55734 | 1543  | 
corollary continuous_imp_open_vimage:  | 
1544  | 
assumes "continuous_on s f" "open s" "open B" "f -` B \<subseteq> s"  | 
|
1545  | 
shows "open (f -` B)"  | 
|
1546  | 
by (metis assms continuous_on_open_vimage le_iff_inf)  | 
|
1547  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1548  | 
corollary open_vimage[continuous_intros]:  | 
| 55775 | 1549  | 
assumes "open s" and "continuous_on UNIV f"  | 
1550  | 
shows "open (f -` s)"  | 
|
1551  | 
using assms unfolding continuous_on_open_vimage [OF open_UNIV]  | 
|
1552  | 
by simp  | 
|
1553  | 
||
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1554  | 
lemma continuous_on_closed_invariant:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1555  | 
"continuous_on s f \<longleftrightarrow> (\<forall>B. closed B \<longrightarrow> (\<exists>A. closed A \<and> A \<inter> s = f -` B \<inter> s))"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1556  | 
proof -  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1557  | 
have *: "\<And>P Q::'b set\<Rightarrow>bool. (\<And>A. P A \<longleftrightarrow> Q (- A)) \<Longrightarrow> (\<forall>A. P A) \<longleftrightarrow> (\<forall>A. Q A)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1558  | 
by (metis double_compl)  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1559  | 
show ?thesis  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1560  | 
unfolding continuous_on_open_invariant by (intro *) (auto simp: open_closed[symmetric])  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1561  | 
qed  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1562  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1563  | 
lemma continuous_on_closed_vimage:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1564  | 
"closed s \<Longrightarrow> continuous_on s f \<longleftrightarrow> (\<forall>B. closed B \<longrightarrow> closed (f -` B \<inter> s))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1565  | 
unfolding continuous_on_closed_invariant  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1566  | 
by (metis closed_Int Int_absorb Int_commute[of s] Int_assoc[of _ _ s])  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1567  | 
|
| 
61426
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1568  | 
corollary closed_vimage_Int[continuous_intros]:  | 
| 
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1569  | 
assumes "closed s" and "continuous_on t f" and t: "closed t"  | 
| 
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1570  | 
shows "closed (f -` s \<inter> t)"  | 
| 
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1571  | 
using assms unfolding continuous_on_closed_vimage [OF t] by simp  | 
| 
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1572  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1573  | 
corollary closed_vimage[continuous_intros]:  | 
| 
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1574  | 
assumes "closed s" and "continuous_on UNIV f"  | 
| 
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1575  | 
shows "closed (f -` s)"  | 
| 
61426
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1576  | 
using closed_vimage_Int [OF assms] by simp  | 
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1577  | 
|
| 
62843
 
313d3b697c9a
Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
 
paulson <lp15@cam.ac.uk> 
parents: 
62533 
diff
changeset
 | 
1578  | 
lemma continuous_on_empty [simp]: "continuous_on {} f"
 | 
| 
61907
 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 
paulson <lp15@cam.ac.uk> 
parents: 
61810 
diff
changeset
 | 
1579  | 
by (simp add: continuous_on_def)  | 
| 
 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 
paulson <lp15@cam.ac.uk> 
parents: 
61810 
diff
changeset
 | 
1580  | 
|
| 
62843
 
313d3b697c9a
Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
 
paulson <lp15@cam.ac.uk> 
parents: 
62533 
diff
changeset
 | 
1581  | 
lemma continuous_on_sing [simp]: "continuous_on {x} f"
 | 
| 
61907
 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 
paulson <lp15@cam.ac.uk> 
parents: 
61810 
diff
changeset
 | 
1582  | 
by (simp add: continuous_on_def at_within_def)  | 
| 
 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 
paulson <lp15@cam.ac.uk> 
parents: 
61810 
diff
changeset
 | 
1583  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1584  | 
lemma continuous_on_open_Union:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1585  | 
"(\<And>s. s \<in> S \<Longrightarrow> open s) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on s f) \<Longrightarrow> continuous_on (\<Union>S) f"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1586  | 
unfolding continuous_on_def by safe (metis open_Union at_within_open UnionI)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1587  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1588  | 
lemma continuous_on_open_UN:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1589  | 
"(\<And>s. s \<in> S \<Longrightarrow> open (A s)) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on (A s) f) \<Longrightarrow> continuous_on (\<Union>s\<in>S. A s) f"  | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1590  | 
by (rule continuous_on_open_Union) auto  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1591  | 
|
| 61204 | 1592  | 
lemma continuous_on_open_Un:  | 
1593  | 
"open s \<Longrightarrow> open t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"  | 
|
1594  | 
  using continuous_on_open_Union [of "{s,t}"] by auto
 | 
|
1595  | 
||
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1596  | 
lemma continuous_on_closed_Un:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1597  | 
"closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1598  | 
by (auto simp add: continuous_on_closed_vimage closed_Un Int_Un_distrib)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1599  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1600  | 
lemma continuous_on_If:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1601  | 
assumes closed: "closed s" "closed t" and cont: "continuous_on s f" "continuous_on t g"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1602  | 
and P: "\<And>x. x \<in> s \<Longrightarrow> \<not> P x \<Longrightarrow> f x = g x" "\<And>x. x \<in> t \<Longrightarrow> P x \<Longrightarrow> f x = g x"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1603  | 
shows "continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)" (is "continuous_on _ ?h")  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1604  | 
proof-  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1605  | 
from P have "\<forall>x\<in>s. f x = ?h x" "\<forall>x\<in>t. g x = ?h x"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1606  | 
by auto  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1607  | 
with cont have "continuous_on s ?h" "continuous_on t ?h"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1608  | 
by simp_all  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1609  | 
with closed show ?thesis  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1610  | 
by (rule continuous_on_closed_Un)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1611  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1612  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1613  | 
lemma continuous_on_id[continuous_intros]: "continuous_on s (\<lambda>x. x)"  | 
| 
58729
 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 
hoelzl 
parents: 
57953 
diff
changeset
 | 
1614  | 
unfolding continuous_on_def by fast  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1615  | 
|
| 63301 | 1616  | 
lemma continuous_on_id'[continuous_intros]: "continuous_on s id"  | 
1617  | 
unfolding continuous_on_def id_def by fast  | 
|
1618  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1619  | 
lemma continuous_on_const[continuous_intros]: "continuous_on s (\<lambda>x. c)"  | 
| 
58729
 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 
hoelzl 
parents: 
57953 
diff
changeset
 | 
1620  | 
unfolding continuous_on_def by auto  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1621  | 
|
| 
61738
 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 
paulson <lp15@cam.ac.uk> 
parents: 
61531 
diff
changeset
 | 
1622  | 
lemma continuous_on_subset: "continuous_on s f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous_on t f"  | 
| 
 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 
paulson <lp15@cam.ac.uk> 
parents: 
61531 
diff
changeset
 | 
1623  | 
unfolding continuous_on_def by (metis subset_eq tendsto_within_subset)  | 
| 
 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 
paulson <lp15@cam.ac.uk> 
parents: 
61531 
diff
changeset
 | 
1624  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1625  | 
lemma continuous_on_compose[continuous_intros]:  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1626  | 
"continuous_on s f \<Longrightarrow> continuous_on (f ` s) g \<Longrightarrow> continuous_on s (g o f)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1627  | 
unfolding continuous_on_topological by simp metis  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1628  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1629  | 
lemma continuous_on_compose2:  | 
| 
61738
 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 
paulson <lp15@cam.ac.uk> 
parents: 
61531 
diff
changeset
 | 
1630  | 
"continuous_on t g \<Longrightarrow> continuous_on s f \<Longrightarrow> f ` s \<subseteq> t \<Longrightarrow> continuous_on s (\<lambda>x. g (f x))"  | 
| 
 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 
paulson <lp15@cam.ac.uk> 
parents: 
61531 
diff
changeset
 | 
1631  | 
using continuous_on_compose[of s f g] continuous_on_subset by (force simp add: comp_def)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1632  | 
|
| 60720 | 1633  | 
lemma continuous_on_generate_topology:  | 
1634  | 
assumes *: "open = generate_topology X"  | 
|
1635  | 
assumes **: "\<And>B. B \<in> X \<Longrightarrow> \<exists>C. open C \<and> C \<inter> A = f -` B \<inter> A"  | 
|
1636  | 
shows "continuous_on A f"  | 
|
1637  | 
unfolding continuous_on_open_invariant  | 
|
1638  | 
proof safe  | 
|
1639  | 
fix B :: "'a set" assume "open B" then show "\<exists>C. open C \<and> C \<inter> A = f -` B \<inter> A"  | 
|
1640  | 
unfolding *  | 
|
1641  | 
proof induction  | 
|
1642  | 
case (UN K)  | 
|
1643  | 
then obtain C where "\<And>k. k \<in> K \<Longrightarrow> open (C k)" "\<And>k. k \<in> K \<Longrightarrow> C k \<inter> A = f -` k \<inter> A"  | 
|
1644  | 
by metis  | 
|
1645  | 
then show ?case  | 
|
1646  | 
by (intro exI[of _ "\<Union>k\<in>K. C k"]) blast  | 
|
1647  | 
qed (auto intro: **)  | 
|
1648  | 
qed  | 
|
1649  | 
||
1650  | 
lemma continuous_onI_mono:  | 
|
1651  | 
  fixes f :: "'a::linorder_topology \<Rightarrow> 'b::{dense_order, linorder_topology}"
 | 
|
1652  | 
assumes "open (f`A)"  | 
|
1653  | 
assumes mono: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
|
1654  | 
shows "continuous_on A f"  | 
|
1655  | 
proof (rule continuous_on_generate_topology[OF open_generated_order], safe)  | 
|
1656  | 
have monoD: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> f x < f y \<Longrightarrow> x < y"  | 
|
1657  | 
by (auto simp: not_le[symmetric] mono)  | 
|
1658  | 
||
1659  | 
  { fix a b assume "a \<in> A" "f a < b"
 | 
|
1660  | 
moreover  | 
|
1661  | 
    with open_right[OF \<open>open (f`A)\<close>, of "f a" b] obtain y where "f a < y" "{f a ..< y} \<subseteq> f`A"
 | 
|
1662  | 
by auto  | 
|
1663  | 
moreover then obtain z where "f a < z" "z < min b y"  | 
|
1664  | 
using dense[of "f a" "min b y"] \<open>f a < y\<close> \<open>f a < b\<close> by auto  | 
|
1665  | 
moreover then obtain c where "z = f c" "c \<in> A"  | 
|
1666  | 
      using \<open>{f a ..< y} \<subseteq> f`A\<close>[THEN subsetD, of z] by (auto simp: less_imp_le)
 | 
|
1667  | 
ultimately have "\<exists>x. x \<in> A \<and> f x < b \<and> a < x"  | 
|
1668  | 
by (auto intro!: exI[of _ c] simp: monoD) }  | 
|
1669  | 
  then show "\<exists>C. open C \<and> C \<inter> A = f -` {..<b} \<inter> A" for b
 | 
|
1670  | 
    by (intro exI[of _ "(\<Union>x\<in>{x\<in>A. f x < b}. {..< x})"])
 | 
|
1671  | 
(auto intro: le_less_trans[OF mono] less_imp_le)  | 
|
1672  | 
||
1673  | 
  { fix a b assume "a \<in> A" "b < f a"
 | 
|
1674  | 
moreover  | 
|
1675  | 
    with open_left[OF \<open>open (f`A)\<close>, of "f a" b] obtain y where "y < f a" "{y <.. f a} \<subseteq> f`A"
 | 
|
1676  | 
by auto  | 
|
1677  | 
moreover then obtain z where "max b y < z" "z < f a"  | 
|
1678  | 
using dense[of "max b y" "f a"] \<open>y < f a\<close> \<open>b < f a\<close> by auto  | 
|
1679  | 
moreover then obtain c where "z = f c" "c \<in> A"  | 
|
1680  | 
      using \<open>{y <.. f a} \<subseteq> f`A\<close>[THEN subsetD, of z] by (auto simp: less_imp_le)
 | 
|
1681  | 
ultimately have "\<exists>x. x \<in> A \<and> b < f x \<and> x < a"  | 
|
1682  | 
by (auto intro!: exI[of _ c] simp: monoD) }  | 
|
1683  | 
  then show "\<exists>C. open C \<and> C \<inter> A = f -` {b <..} \<inter> A" for b
 | 
|
1684  | 
    by (intro exI[of _ "(\<Union>x\<in>{x\<in>A. b < f x}. {x <..})"])
 | 
|
1685  | 
(auto intro: less_le_trans[OF _ mono] less_imp_le)  | 
|
1686  | 
qed  | 
|
1687  | 
||
| 60758 | 1688  | 
subsubsection \<open>Continuity at a point\<close>  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1689  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1690  | 
definition continuous :: "'a::t2_space filter \<Rightarrow> ('a \<Rightarrow> 'b::topological_space) \<Rightarrow> bool" where
 | 
| 61973 | 1691  | 
"continuous F f \<longleftrightarrow> (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1692  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1693  | 
lemma continuous_bot[continuous_intros, simp]: "continuous bot f"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1694  | 
unfolding continuous_def by auto  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1695  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1696  | 
lemma continuous_trivial_limit: "trivial_limit net \<Longrightarrow> continuous net f"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1697  | 
by simp  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1698  | 
|
| 61973 | 1699  | 
lemma continuous_within: "continuous (at x within s) f \<longleftrightarrow> (f \<longlongrightarrow> f x) (at x within s)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1700  | 
by (cases "trivial_limit (at x within s)") (auto simp add: Lim_ident_at continuous_def)  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1701  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1702  | 
lemma continuous_within_topological:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1703  | 
"continuous (at x within s) f \<longleftrightarrow>  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1704  | 
(\<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1705  | 
unfolding continuous_within tendsto_def eventually_at_topological by metis  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1706  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1707  | 
lemma continuous_within_compose[continuous_intros]:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1708  | 
"continuous (at x within s) f \<Longrightarrow> continuous (at (f x) within f ` s) g \<Longrightarrow>  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1709  | 
continuous (at x within s) (g o f)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1710  | 
by (simp add: continuous_within_topological) metis  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1711  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1712  | 
lemma continuous_within_compose2:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1713  | 
"continuous (at x within s) f \<Longrightarrow> continuous (at (f x) within f ` s) g \<Longrightarrow>  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1714  | 
continuous (at x within s) (\<lambda>x. g (f x))"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1715  | 
using continuous_within_compose[of x s f g] by (simp add: comp_def)  | 
| 51471 | 1716  | 
|
| 61976 | 1717  | 
lemma continuous_at: "continuous (at x) f \<longleftrightarrow> f \<midarrow>x\<rightarrow> f x"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1718  | 
using continuous_within[of x UNIV f] by simp  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1719  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1720  | 
lemma continuous_ident[continuous_intros, simp]: "continuous (at x within S) (\<lambda>x. x)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1721  | 
unfolding continuous_within by (rule tendsto_ident_at)  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1722  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1723  | 
lemma continuous_const[continuous_intros, simp]: "continuous F (\<lambda>x. c)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1724  | 
unfolding continuous_def by (rule tendsto_const)  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1725  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1726  | 
lemma continuous_on_eq_continuous_within:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1727  | 
"continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. continuous (at x within s) f)"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1728  | 
unfolding continuous_on_def continuous_within ..  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1729  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1730  | 
abbreviation isCont :: "('a::t2_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> bool" where
 | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1731  | 
"isCont f a \<equiv> continuous (at a) f"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1732  | 
|
| 61976 | 1733  | 
lemma isCont_def: "isCont f a \<longleftrightarrow> f \<midarrow>a\<rightarrow> f a"  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1734  | 
by (rule continuous_at)  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1735  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1736  | 
lemma isCont_cong:  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1737  | 
assumes "eventually (\<lambda>x. f x = g x) (nhds x)"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1738  | 
shows "isCont f x \<longleftrightarrow> isCont g x"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1739  | 
proof -  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1740  | 
from assms have [simp]: "f x = g x" by (rule eventually_nhds_x_imp_x)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1741  | 
from assms have "eventually (\<lambda>x. f x = g x) (at x)"  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1742  | 
by (auto simp: eventually_at_filter elim!: eventually_mono)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1743  | 
with assms have "isCont f x \<longleftrightarrow> isCont g x" unfolding isCont_def  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1744  | 
by (intro filterlim_cong) (auto elim!: eventually_mono)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1745  | 
with assms show ?thesis by simp  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1746  | 
qed  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
1747  | 
|
| 60762 | 1748  | 
lemma continuous_at_imp_continuous_at_within: "isCont f x \<Longrightarrow> continuous (at x within s) f"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1749  | 
by (auto intro: tendsto_mono at_le simp: continuous_at continuous_within)  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1750  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1751  | 
lemma continuous_on_eq_continuous_at: "open s \<Longrightarrow> continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. isCont f x)"  | 
| 
51641
 
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
 
hoelzl 
parents: 
51518 
diff
changeset
 | 
1752  | 
by (simp add: continuous_on_def continuous_at at_within_open[of _ s])  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1753  | 
|
| 62083 | 1754  | 
lemma continuous_within_open: "a \<in> A \<Longrightarrow> open A \<Longrightarrow> continuous (at a within A) f \<longleftrightarrow> isCont f a"  | 
1755  | 
by (simp add: at_within_open_NO_MATCH)  | 
|
1756  | 
||
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1757  | 
lemma continuous_at_imp_continuous_on: "\<forall>x\<in>s. isCont f x \<Longrightarrow> continuous_on s f"  | 
| 60762 | 1758  | 
by (auto intro: continuous_at_imp_continuous_at_within simp: continuous_on_eq_continuous_within)  | 
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1759  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1760  | 
lemma isCont_o2: "isCont f a \<Longrightarrow> isCont g (f a) \<Longrightarrow> isCont (\<lambda>x. g (f x)) a"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1761  | 
unfolding isCont_def by (rule tendsto_compose)  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1762  | 
|
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1763  | 
lemma isCont_o[continuous_intros]: "isCont f a \<Longrightarrow> isCont g (f a) \<Longrightarrow> isCont (g \<circ> f) a"  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1764  | 
unfolding o_def by (rule isCont_o2)  | 
| 51471 | 1765  | 
|
| 61973 | 1766  | 
lemma isCont_tendsto_compose: "isCont g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"  | 
| 51471 | 1767  | 
unfolding isCont_def by (rule tendsto_compose)  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1768  | 
|
| 
62049
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1769  | 
lemma continuous_on_tendsto_compose:  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1770  | 
assumes f_cont: "continuous_on s f"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1771  | 
assumes g: "(g \<longlongrightarrow> l) F"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1772  | 
assumes l: "l \<in> s"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1773  | 
assumes ev: "\<forall>\<^sub>F x in F. g x \<in> s"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1774  | 
shows "((\<lambda>x. f (g x)) \<longlongrightarrow> f l) F"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1775  | 
proof -  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1776  | 
from f_cont l have f: "(f \<longlongrightarrow> f l) (at l within s)"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1777  | 
by (simp add: continuous_on_def)  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1778  | 
have i: "((\<lambda>x. if g x = l then f l else f (g x)) \<longlongrightarrow> f l) F"  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1779  | 
by (rule filterlim_If)  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1780  | 
(auto intro!: filterlim_compose[OF f] eventually_conj tendsto_mono[OF _ g]  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1781  | 
simp: filterlim_at eventually_inf_principal eventually_mono[OF ev])  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1782  | 
show ?thesis  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1783  | 
by (rule filterlim_cong[THEN iffD1[OF _ i]]) auto  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
1784  | 
qed  | 
| 51471 | 1785  | 
|
| 
51478
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1786  | 
lemma continuous_within_compose3:  | 
| 
 
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
 
hoelzl 
parents: 
51474 
diff
changeset
 | 
1787  | 
"isCont g (f x) \<Longrightarrow> continuous (at x within s) f \<Longrightarrow> continuous (at x within s) (\<lambda>x. g (f x))"  | 
| 63171 | 1788  | 
using continuous_at_imp_continuous_at_within continuous_within_compose2 by blast  | 
| 51471 | 1789  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1790  | 
lemma filtermap_nhds_open_map:  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1791  | 
assumes cont: "isCont f a" and open_map: "\<And>S. open S \<Longrightarrow> open (f`S)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1792  | 
shows "filtermap f (nhds a) = nhds (f a)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1793  | 
unfolding filter_eq_iff  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1794  | 
proof safe  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1795  | 
fix P assume "eventually P (filtermap f (nhds a))"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1796  | 
then guess S unfolding eventually_filtermap eventually_nhds ..  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1797  | 
then show "eventually P (nhds (f a))"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1798  | 
unfolding eventually_nhds by (intro exI[of _ "f`S"]) (auto intro!: open_map)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1799  | 
qed (metis filterlim_iff tendsto_at_iff_tendsto_nhds isCont_def eventually_filtermap cont)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1800  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
1801  | 
lemma continuous_at_split:  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1802  | 
"continuous (at (x::'a::linorder_topology)) f = (continuous (at_left x) f \<and> continuous (at_right x) f)"  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1803  | 
by (simp add: continuous_within filterlim_at_split)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1804  | 
|
| 61245 | 1805  | 
subsubsection \<open>Open-cover compactness\<close>  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1806  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1807  | 
context topological_space  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1808  | 
begin  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1809  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1810  | 
definition compact :: "'a set \<Rightarrow> bool" where  | 
| 61799 | 1811  | 
compact_eq_heine_borel: \<comment> "This name is used for backwards compatibility"  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1812  | 
"compact S \<longleftrightarrow> (\<forall>C. (\<forall>c\<in>C. open c) \<and> S \<subseteq> \<Union>C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1813  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1814  | 
lemma compactI:  | 
| 60585 | 1815  | 
assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> \<exists>C'. C' \<subseteq> C \<and> finite C' \<and> s \<subseteq> \<Union>C'"  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1816  | 
shows "compact s"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1817  | 
unfolding compact_eq_heine_borel using assms by metis  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1818  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1819  | 
lemma compact_empty[simp]: "compact {}"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1820  | 
by (auto intro!: compactI)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1821  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1822  | 
lemma compactE:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1823  | 
assumes "compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1824  | 
obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1825  | 
using assms unfolding compact_eq_heine_borel by metis  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1826  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1827  | 
lemma compactE_image:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1828  | 
assumes "compact s" and "\<forall>t\<in>C. open (f t)" and "s \<subseteq> (\<Union>c\<in>C. f c)"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1829  | 
obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> (\<Union>c\<in>C'. f c)"  | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1830  | 
using assms unfolding ball_simps [symmetric]  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1831  | 
by (metis (lifting) finite_subset_image compact_eq_heine_borel[of s])  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1832  | 
|
| 
62843
 
313d3b697c9a
Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
 
paulson <lp15@cam.ac.uk> 
parents: 
62533 
diff
changeset
 | 
1833  | 
lemma compact_Int_closed [intro]:  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1834  | 
assumes "compact s" and "closed t"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1835  | 
shows "compact (s \<inter> t)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1836  | 
proof (rule compactI)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1837  | 
fix C assume C: "\<forall>c\<in>C. open c" and cover: "s \<inter> t \<subseteq> \<Union>C"  | 
| 60758 | 1838  | 
  from C \<open>closed t\<close> have "\<forall>c\<in>C \<union> {-t}. open c" by auto
 | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1839  | 
  moreover from cover have "s \<subseteq> \<Union>(C \<union> {-t})" by auto
 | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1840  | 
  ultimately have "\<exists>D\<subseteq>C \<union> {-t}. finite D \<and> s \<subseteq> \<Union>D"
 | 
| 60758 | 1841  | 
using \<open>compact s\<close> unfolding compact_eq_heine_borel by auto  | 
| 53381 | 1842  | 
  then obtain D where "D \<subseteq> C \<union> {- t} \<and> finite D \<and> s \<subseteq> \<Union>D" ..
 | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1843  | 
then show "\<exists>D\<subseteq>C. finite D \<and> s \<inter> t \<subseteq> \<Union>D"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1844  | 
    by (intro exI[of _ "D - {-t}"]) auto
 | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1845  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1846  | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1847  | 
lemma inj_setminus: "inj_on uminus (A::'a set set)"  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1848  | 
by (auto simp: inj_on_def)  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1849  | 
|
| 63301 | 1850  | 
subsection\<open> Finite intersection property\<close>  | 
1851  | 
||
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1852  | 
lemma compact_fip:  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1853  | 
"compact U \<longleftrightarrow>  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1854  | 
    (\<forall>A. (\<forall>a\<in>A. closed a) \<longrightarrow> (\<forall>B \<subseteq> A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}) \<longrightarrow> U \<inter> \<Inter>A \<noteq> {})"
 | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1855  | 
(is "_ \<longleftrightarrow> ?R")  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1856  | 
proof (safe intro!: compact_eq_heine_borel[THEN iffD2])  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1857  | 
fix A  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1858  | 
assume "compact U"  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1859  | 
    and A: "\<forall>a\<in>A. closed a" "U \<inter> \<Inter>A = {}"
 | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1860  | 
    and fi: "\<forall>B \<subseteq> A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}"
 | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1861  | 
from A have "(\<forall>a\<in>uminus`A. open a) \<and> U \<subseteq> \<Union>(uminus`A)"  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1862  | 
by auto  | 
| 60758 | 1863  | 
with \<open>compact U\<close> obtain B where "B \<subseteq> A" "finite (uminus`B)" "U \<subseteq> \<Union>(uminus`B)"  | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1864  | 
unfolding compact_eq_heine_borel by (metis subset_image_iff)  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1865  | 
with fi[THEN spec, of B] show False  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1866  | 
by (auto dest: finite_imageD intro: inj_setminus)  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1867  | 
next  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1868  | 
fix A  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1869  | 
assume ?R  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1870  | 
assume "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A"  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1871  | 
  then have "U \<inter> \<Inter>(uminus`A) = {}" "\<forall>a\<in>uminus`A. closed a"
 | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1872  | 
by auto  | 
| 60758 | 1873  | 
  with \<open>?R\<close> obtain B where "B \<subseteq> A" "finite (uminus`B)" "U \<inter> \<Inter>(uminus`B) = {}"
 | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1874  | 
by (metis subset_image_iff)  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1875  | 
then show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1876  | 
by (auto intro!: exI[of _ B] inj_setminus dest: finite_imageD)  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1877  | 
qed  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1878  | 
|
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1879  | 
lemma compact_imp_fip:  | 
| 
63007
 
aa894a49f77d
new theorems about convex hulls, etc.; also, renamed some theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
62843 
diff
changeset
 | 
1880  | 
"\<lbrakk>compact S;  | 
| 
 
aa894a49f77d
new theorems about convex hulls, etc.; also, renamed some theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
62843 
diff
changeset
 | 
1881  | 
\<And>T. T \<in> F \<Longrightarrow> closed T;  | 
| 
 
aa894a49f77d
new theorems about convex hulls, etc.; also, renamed some theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
62843 
diff
changeset
 | 
1882  | 
      \<And>F'. \<lbrakk>finite F'; F' \<subseteq> F\<rbrakk> \<Longrightarrow> S \<inter> (\<Inter>F') \<noteq> {}\<rbrakk>
 | 
| 
 
aa894a49f77d
new theorems about convex hulls, etc.; also, renamed some theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
62843 
diff
changeset
 | 
1883  | 
     \<Longrightarrow> S \<inter> (\<Inter>F) \<noteq> {}"
 | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1884  | 
unfolding compact_fip by auto  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1885  | 
|
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1886  | 
lemma compact_imp_fip_image:  | 
| 56166 | 1887  | 
assumes "compact s"  | 
1888  | 
and P: "\<And>i. i \<in> I \<Longrightarrow> closed (f i)"  | 
|
1889  | 
    and Q: "\<And>I'. finite I' \<Longrightarrow> I' \<subseteq> I \<Longrightarrow> (s \<inter> (\<Inter>i\<in>I'. f i) \<noteq> {})"
 | 
|
1890  | 
  shows "s \<inter> (\<Inter>i\<in>I. f i) \<noteq> {}"
 | 
|
1891  | 
proof -  | 
|
| 60758 | 1892  | 
note \<open>compact s\<close>  | 
| 56166 | 1893  | 
moreover from P have "\<forall>i \<in> f ` I. closed i" by blast  | 
1894  | 
  moreover have "\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> (s \<inter> (\<Inter>A) \<noteq> {})"
 | 
|
1895  | 
proof (rule, rule, erule conjE)  | 
|
1896  | 
fix A :: "'a set set"  | 
|
1897  | 
assume "finite A"  | 
|
1898  | 
moreover assume "A \<subseteq> f ` I"  | 
|
1899  | 
ultimately obtain B where "B \<subseteq> I" and "finite B" and "A = f ` B"  | 
|
1900  | 
using finite_subset_image [of A f I] by blast  | 
|
1901  | 
    with Q [of B] show "s \<inter> \<Inter>A \<noteq> {}" by simp
 | 
|
1902  | 
qed  | 
|
| 
63007
 
aa894a49f77d
new theorems about convex hulls, etc.; also, renamed some theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
62843 
diff
changeset
 | 
1903  | 
  ultimately have "s \<inter> (\<Inter>(f ` I)) \<noteq> {}" by (metis compact_imp_fip)
 | 
| 56166 | 1904  | 
then show ?thesis by simp  | 
1905  | 
qed  | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
1906  | 
|
| 51471 | 1907  | 
end  | 
1908  | 
||
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1909  | 
lemma (in t2_space) compact_imp_closed:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1910  | 
assumes "compact s" shows "closed s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1911  | 
unfolding closed_def  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1912  | 
proof (rule openI)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1913  | 
fix y assume "y \<in> - s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1914  | 
  let ?C = "\<Union>x\<in>s. {u. open u \<and> x \<in> u \<and> eventually (\<lambda>y. y \<notin> u) (nhds y)}"
 | 
| 60758 | 1915  | 
note \<open>compact s\<close>  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1916  | 
moreover have "\<forall>u\<in>?C. open u" by simp  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1917  | 
moreover have "s \<subseteq> \<Union>?C"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1918  | 
proof  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1919  | 
fix x assume "x \<in> s"  | 
| 60758 | 1920  | 
with \<open>y \<in> - s\<close> have "x \<noteq> y" by clarsimp  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1921  | 
    hence "\<exists>u v. open u \<and> open v \<and> x \<in> u \<and> y \<in> v \<and> u \<inter> v = {}"
 | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1922  | 
by (rule hausdorff)  | 
| 60758 | 1923  | 
with \<open>x \<in> s\<close> show "x \<in> \<Union>?C"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1924  | 
unfolding eventually_nhds by auto  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1925  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1926  | 
ultimately obtain D where "D \<subseteq> ?C" and "finite D" and "s \<subseteq> \<Union>D"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1927  | 
by (rule compactE)  | 
| 60758 | 1928  | 
from \<open>D \<subseteq> ?C\<close> have "\<forall>x\<in>D. eventually (\<lambda>y. y \<notin> x) (nhds y)" by auto  | 
1929  | 
with \<open>finite D\<close> have "eventually (\<lambda>y. y \<notin> \<Union>D) (nhds y)"  | 
|
| 
60040
 
1fa1023b13b9
move MOST and INFM in Infinite_Set to Filter; change them to abbreviations over the cofinite filter
 
hoelzl 
parents: 
60036 
diff
changeset
 | 
1930  | 
by (simp add: eventually_ball_finite)  | 
| 60758 | 1931  | 
with \<open>s \<subseteq> \<Union>D\<close> have "eventually (\<lambda>y. y \<notin> s) (nhds y)"  | 
| 61810 | 1932  | 
by (auto elim!: eventually_mono)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1933  | 
thus "\<exists>t. open t \<and> y \<in> t \<and> t \<subseteq> - s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1934  | 
by (simp add: eventually_nhds subset_eq)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1935  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1936  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1937  | 
lemma compact_continuous_image:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1938  | 
assumes f: "continuous_on s f" and s: "compact s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1939  | 
shows "compact (f ` s)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1940  | 
proof (rule compactI)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1941  | 
fix C assume "\<forall>c\<in>C. open c" and cover: "f`s \<subseteq> \<Union>C"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1942  | 
with f have "\<forall>c\<in>C. \<exists>A. open A \<and> A \<inter> s = f -` c \<inter> s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1943  | 
unfolding continuous_on_open_invariant by blast  | 
| 53381 | 1944  | 
then obtain A where A: "\<forall>c\<in>C. open (A c) \<and> A c \<inter> s = f -` c \<inter> s"  | 
1945  | 
unfolding bchoice_iff ..  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1946  | 
with cover have "\<forall>c\<in>C. open (A c)" "s \<subseteq> (\<Union>c\<in>C. A c)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1947  | 
by (fastforce simp add: subset_eq set_eq_iff)+  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1948  | 
from compactE_image[OF s this] obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> (\<Union>c\<in>D. A c)" .  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1949  | 
with A show "\<exists>D \<subseteq> C. finite D \<and> f`s \<subseteq> \<Union>D"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1950  | 
by (intro exI[of _ D]) (fastforce simp add: subset_eq set_eq_iff)+  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1951  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1952  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1953  | 
lemma continuous_on_inv:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1954  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1955  | 
assumes "continuous_on s f" "compact s" "\<forall>x\<in>s. g (f x) = x"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1956  | 
shows "continuous_on (f ` s) g"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1957  | 
unfolding continuous_on_topological  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1958  | 
proof (clarsimp simp add: assms(3))  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1959  | 
fix x :: 'a and B :: "'a set"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1960  | 
assume "x \<in> s" and "open B" and "x \<in> B"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1961  | 
have 1: "\<forall>x\<in>s. f x \<in> f ` (s - B) \<longleftrightarrow> x \<in> s - B"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1962  | 
using assms(3) by (auto, metis)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1963  | 
have "continuous_on (s - B) f"  | 
| 60758 | 1964  | 
using \<open>continuous_on s f\<close> Diff_subset  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1965  | 
by (rule continuous_on_subset)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1966  | 
moreover have "compact (s - B)"  | 
| 60758 | 1967  | 
using \<open>open B\<close> and \<open>compact s\<close>  | 
| 
62843
 
313d3b697c9a
Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
 
paulson <lp15@cam.ac.uk> 
parents: 
62533 
diff
changeset
 | 
1968  | 
unfolding Diff_eq by (intro compact_Int_closed closed_Compl)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1969  | 
ultimately have "compact (f ` (s - B))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1970  | 
by (rule compact_continuous_image)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1971  | 
hence "closed (f ` (s - B))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1972  | 
by (rule compact_imp_closed)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1973  | 
hence "open (- f ` (s - B))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1974  | 
by (rule open_Compl)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1975  | 
moreover have "f x \<in> - f ` (s - B)"  | 
| 60758 | 1976  | 
using \<open>x \<in> s\<close> and \<open>x \<in> B\<close> by (simp add: 1)  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1977  | 
moreover have "\<forall>y\<in>s. f y \<in> - f ` (s - B) \<longrightarrow> y \<in> B"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1978  | 
by (simp add: 1)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1979  | 
ultimately show "\<exists>A. open A \<and> f x \<in> A \<and> (\<forall>y\<in>s. f y \<in> A \<longrightarrow> y \<in> B)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1980  | 
by fast  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1981  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1982  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1983  | 
lemma continuous_on_inv_into:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1984  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1985  | 
assumes s: "continuous_on s f" "compact s" and f: "inj_on f s"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1986  | 
shows "continuous_on (f ` s) (the_inv_into s f)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1987  | 
by (rule continuous_on_inv[OF s]) (auto simp: the_inv_into_f_f[OF f])  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1988  | 
|
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1989  | 
lemma (in linorder_topology) compact_attains_sup:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1990  | 
  assumes "compact S" "S \<noteq> {}"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1991  | 
shows "\<exists>s\<in>S. \<forall>t\<in>S. t \<le> s"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1992  | 
proof (rule classical)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1993  | 
assume "\<not> (\<exists>s\<in>S. \<forall>t\<in>S. t \<le> s)"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1994  | 
then obtain t where t: "\<forall>s\<in>S. t s \<in> S" and "\<forall>s\<in>S. s < t s"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1995  | 
by (metis not_le)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1996  | 
  then have "\<forall>s\<in>S. open {..< t s}" "S \<subseteq> (\<Union>s\<in>S. {..< t s})"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1997  | 
by auto  | 
| 60758 | 1998  | 
  with \<open>compact S\<close> obtain C where "C \<subseteq> S" "finite C" and C: "S \<subseteq> (\<Union>s\<in>C. {..< t s})"
 | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
1999  | 
by (erule compactE_image)  | 
| 60758 | 2000  | 
  with \<open>S \<noteq> {}\<close> have Max: "Max (t`C) \<in> t`C" and "\<forall>s\<in>t`C. s \<le> Max (t`C)"
 | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2001  | 
by (auto intro!: Max_in)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2002  | 
  with C have "S \<subseteq> {..< Max (t`C)}"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2003  | 
by (auto intro: less_le_trans simp: subset_eq)  | 
| 60758 | 2004  | 
with t Max \<open>C \<subseteq> S\<close> show ?thesis  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2005  | 
by fastforce  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2006  | 
qed  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2007  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2008  | 
lemma (in linorder_topology) compact_attains_inf:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2009  | 
  assumes "compact S" "S \<noteq> {}"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2010  | 
shows "\<exists>s\<in>S. \<forall>t\<in>S. s \<le> t"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2011  | 
proof (rule classical)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2012  | 
assume "\<not> (\<exists>s\<in>S. \<forall>t\<in>S. s \<le> t)"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2013  | 
then obtain t where t: "\<forall>s\<in>S. t s \<in> S" and "\<forall>s\<in>S. t s < s"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2014  | 
by (metis not_le)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2015  | 
  then have "\<forall>s\<in>S. open {t s <..}" "S \<subseteq> (\<Union>s\<in>S. {t s <..})"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2016  | 
by auto  | 
| 60758 | 2017  | 
  with \<open>compact S\<close> obtain C where "C \<subseteq> S" "finite C" and C: "S \<subseteq> (\<Union>s\<in>C. {t s <..})"
 | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2018  | 
by (erule compactE_image)  | 
| 60758 | 2019  | 
  with \<open>S \<noteq> {}\<close> have Min: "Min (t`C) \<in> t`C" and "\<forall>s\<in>t`C. Min (t`C) \<le> s"
 | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2020  | 
by (auto intro!: Min_in)  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2021  | 
  with C have "S \<subseteq> {Min (t`C) <..}"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2022  | 
by (auto intro: le_less_trans simp: subset_eq)  | 
| 60758 | 2023  | 
with t Min \<open>C \<subseteq> S\<close> show ?thesis  | 
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2024  | 
by fastforce  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2025  | 
qed  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2026  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2027  | 
lemma continuous_attains_sup:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2028  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2029  | 
  shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f \<Longrightarrow> (\<exists>x\<in>s. \<forall>y\<in>s.  f y \<le> f x)"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2030  | 
using compact_attains_sup[of "f ` s"] compact_continuous_image[of s f] by auto  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2031  | 
|
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2032  | 
lemma continuous_attains_inf:  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2033  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2034  | 
  shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f \<Longrightarrow> (\<exists>x\<in>s. \<forall>y\<in>s. f x \<le> f y)"
 | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2035  | 
using compact_attains_inf[of "f ` s"] compact_continuous_image[of s f] by auto  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2036  | 
|
| 60758 | 2037  | 
subsection \<open>Connectedness\<close>  | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2038  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2039  | 
context topological_space  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2040  | 
begin  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2041  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2042  | 
definition "connected S \<longleftrightarrow>  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2043  | 
  \<not> (\<exists>A B. open A \<and> open B \<and> S \<subseteq> A \<union> B \<and> A \<inter> B \<inter> S = {} \<and> A \<inter> S \<noteq> {} \<and> B \<inter> S \<noteq> {})"
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2044  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2045  | 
lemma connectedI:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2046  | 
  "(\<And>A B. open A \<Longrightarrow> open B \<Longrightarrow> A \<inter> U \<noteq> {} \<Longrightarrow> B \<inter> U \<noteq> {} \<Longrightarrow> A \<inter> B \<inter> U = {} \<Longrightarrow> U \<subseteq> A \<union> B \<Longrightarrow> False)
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2047  | 
\<Longrightarrow> connected U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2048  | 
by (auto simp: connected_def)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2049  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2050  | 
lemma connected_empty [simp]: "connected {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2051  | 
by (auto intro!: connectedI)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2052  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2053  | 
lemma connected_sing [simp]: "connected {x}"
 | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2054  | 
by (auto intro!: connectedI)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2055  | 
|
| 56329 | 2056  | 
lemma connectedD:  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2057  | 
  "connected A \<Longrightarrow> open U \<Longrightarrow> open V \<Longrightarrow> U \<inter> V \<inter> A = {} \<Longrightarrow> A \<subseteq> U \<union> V \<Longrightarrow> U \<inter> A = {} \<or> V \<inter> A = {}"
 | 
| 56329 | 2058  | 
by (auto simp: connected_def)  | 
2059  | 
||
| 
51479
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2060  | 
end  | 
| 
 
33db4b7189af
move compact to the HOL image; prove compactness of real closed intervals; show that continuous functions attain supremum and infimum on compact sets
 
hoelzl 
parents: 
51478 
diff
changeset
 | 
2061  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2062  | 
lemma connected_closed:  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2063  | 
"connected s \<longleftrightarrow>  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2064  | 
     ~ (\<exists>A B. closed A \<and> closed B \<and> s \<subseteq> A \<union> B \<and> A \<inter> B \<inter> s = {} \<and> A \<inter> s \<noteq> {} \<and> B \<inter> s \<noteq> {})"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2065  | 
apply (simp add: connected_def del: ex_simps, safe)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2066  | 
apply (drule_tac x="-A" in spec)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2067  | 
apply (drule_tac x="-B" in spec)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2068  | 
apply (fastforce simp add: closed_def [symmetric])  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2069  | 
apply (drule_tac x="-A" in spec)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2070  | 
apply (drule_tac x="-B" in spec)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2071  | 
apply (fastforce simp add: open_closed [symmetric])  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2072  | 
done  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2073  | 
|
| 
62397
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
2074  | 
lemma connected_closedD:  | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
2075  | 
    "\<lbrakk>connected s; A \<inter> B \<inter> s = {}; s \<subseteq> A \<union> B; closed A; closed B\<rbrakk> \<Longrightarrow> A \<inter> s = {} \<or> B \<inter> s = {}"
 | 
| 
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
2076  | 
by (simp add: connected_closed)  | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2077  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2078  | 
lemma connected_Union:  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2079  | 
  assumes cs: "\<And>s. s \<in> S \<Longrightarrow> connected s" and ne: "\<Inter>S \<noteq> {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2080  | 
shows "connected(\<Union>S)"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2081  | 
proof (rule connectedI)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2082  | 
fix A B  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2083  | 
  assume A: "open A" and B: "open B" and Alap: "A \<inter> \<Union>S \<noteq> {}" and Blap: "B \<inter> \<Union>S \<noteq> {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2084  | 
     and disj: "A \<inter> B \<inter> \<Union>S = {}" and cover: "\<Union>S \<subseteq> A \<union> B"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2085  | 
  have disjs:"\<And>s. s \<in> S \<Longrightarrow> A \<inter> B \<inter> s = {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2086  | 
using disj by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2087  | 
  obtain sa where sa: "sa \<in> S" "A \<inter> sa \<noteq> {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2088  | 
using Alap by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2089  | 
  obtain sb where sb: "sb \<in> S" "B \<inter> sb \<noteq> {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2090  | 
using Blap by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2091  | 
obtain x where x: "\<And>s. s \<in> S \<Longrightarrow> x \<in> s"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2092  | 
using ne by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2093  | 
then have "x \<in> \<Union>S"  | 
| 61342 | 2094  | 
using \<open>sa \<in> S\<close> by blast  | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2095  | 
then have "x \<in> A \<or> x \<in> B"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2096  | 
using cover by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2097  | 
then show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2098  | 
using cs [unfolded connected_def]  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2099  | 
by (metis A B IntI Sup_upper sa sb disjs x cover empty_iff subset_trans)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2100  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2101  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2102  | 
lemma connected_Un: "\<lbrakk>connected s; connected t; s \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> connected (s \<union> t)"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2103  | 
  using connected_Union [of "{s,t}"] by auto
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2104  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2105  | 
lemma connected_diff_open_from_closed:  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2106  | 
assumes st: "s \<subseteq> t" and tu: "t \<subseteq> u" and s: "open s"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2107  | 
and t: "closed t" and u: "connected u" and ts: "connected (t - s)"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2108  | 
shows "connected(u - s)"  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2109  | 
proof (rule connectedI)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2110  | 
fix A B  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2111  | 
  assume AB: "open A" "open B" "A \<inter> (u - s) \<noteq> {}" "B \<inter> (u - s) \<noteq> {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2112  | 
     and disj: "A \<inter> B \<inter> (u - s) = {}" and cover: "u - s \<subseteq> A \<union> B"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2113  | 
  then consider "A \<inter> (t - s) = {}" | "B \<inter> (t - s) = {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2114  | 
using st ts tu connectedD [of "t-s" "A" "B"]  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2115  | 
by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2116  | 
then show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2117  | 
proof cases  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2118  | 
case 1  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2119  | 
    then have "(A - t) \<inter> (B \<union> s) \<inter> u = {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2120  | 
using disj st by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2121  | 
moreover have "u \<subseteq> (A - t) \<union> (B \<union> s)" using 1 cover by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2122  | 
ultimately show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2123  | 
using connectedD [of u "A - t" "B \<union> s"] AB s t 1 u  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2124  | 
by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2125  | 
next  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2126  | 
case 2  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2127  | 
    then have "(A \<union> s) \<inter> (B - t) \<inter> u = {}"
 | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2128  | 
using disj st  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2129  | 
by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2130  | 
moreover have "u \<subseteq> (A \<union> s) \<union> (B - t)" using 2 cover by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2131  | 
ultimately show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2132  | 
using connectedD [of u "A \<union> s" "B - t"] AB s t 2 u  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2133  | 
by auto  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2134  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2135  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2136  | 
|
| 59106 | 2137  | 
lemma connected_iff_const:  | 
2138  | 
fixes S :: "'a::topological_space set"  | 
|
2139  | 
shows "connected S \<longleftrightarrow> (\<forall>P::'a \<Rightarrow> bool. continuous_on S P \<longrightarrow> (\<exists>c. \<forall>s\<in>S. P s = c))"  | 
|
2140  | 
proof safe  | 
|
2141  | 
fix P :: "'a \<Rightarrow> bool" assume "connected S" "continuous_on S P"  | 
|
2142  | 
  then have "\<And>b. \<exists>A. open A \<and> A \<inter> S = P -` {b} \<inter> S"
 | 
|
| 62369 | 2143  | 
unfolding continuous_on_open_invariant by (simp add: open_discrete)  | 
| 59106 | 2144  | 
from this[of True] this[of False]  | 
2145  | 
  obtain t f where "open t" "open f" and *: "f \<inter> S = P -` {False} \<inter> S" "t \<inter> S = P -` {True} \<inter> S"
 | 
|
| 63171 | 2146  | 
by meson  | 
| 59106 | 2147  | 
  then have "t \<inter> S = {} \<or> f \<inter> S = {}"
 | 
| 60758 | 2148  | 
by (intro connectedD[OF \<open>connected S\<close>]) auto  | 
| 59106 | 2149  | 
then show "\<exists>c. \<forall>s\<in>S. P s = c"  | 
2150  | 
proof (rule disjE)  | 
|
2151  | 
    assume "t \<inter> S = {}" then show ?thesis
 | 
|
2152  | 
unfolding * by (intro exI[of _ False]) auto  | 
|
2153  | 
next  | 
|
2154  | 
    assume "f \<inter> S = {}" then show ?thesis
 | 
|
2155  | 
unfolding * by (intro exI[of _ True]) auto  | 
|
2156  | 
qed  | 
|
2157  | 
next  | 
|
2158  | 
assume P: "\<forall>P::'a \<Rightarrow> bool. continuous_on S P \<longrightarrow> (\<exists>c. \<forall>s\<in>S. P s = c)"  | 
|
2159  | 
show "connected S"  | 
|
2160  | 
proof (rule connectedI)  | 
|
2161  | 
    fix A B assume *: "open A" "open B" "A \<inter> S \<noteq> {}" "B \<inter> S \<noteq> {}" "A \<inter> B \<inter> S = {}" "S \<subseteq> A \<union> B"
 | 
|
2162  | 
have "continuous_on S (\<lambda>x. x \<in> A)"  | 
|
2163  | 
unfolding continuous_on_open_invariant  | 
|
2164  | 
proof safe  | 
|
2165  | 
fix C :: "bool set"  | 
|
2166  | 
      have "C = UNIV \<or> C = {True} \<or> C = {False} \<or> C = {}"
 | 
|
2167  | 
using subset_UNIV[of C] unfolding UNIV_bool by auto  | 
|
2168  | 
with * show "\<exists>T. open T \<and> T \<inter> S = (\<lambda>x. x \<in> A) -` C \<inter> S"  | 
|
2169  | 
        by (intro exI[of _ "(if True \<in> C then A else {}) \<union> (if False \<in> C then B else {})"]) auto
 | 
|
2170  | 
qed  | 
|
2171  | 
from P[rule_format, OF this] obtain c where "\<And>s. s \<in> S \<Longrightarrow> (s \<in> A) = c" by blast  | 
|
2172  | 
with * show False  | 
|
2173  | 
by (cases c) auto  | 
|
2174  | 
qed  | 
|
2175  | 
qed  | 
|
2176  | 
||
2177  | 
lemma connectedD_const:  | 
|
2178  | 
fixes P :: "'a::topological_space \<Rightarrow> bool"  | 
|
2179  | 
shows "connected S \<Longrightarrow> continuous_on S P \<Longrightarrow> \<exists>c. \<forall>s\<in>S. P s = c"  | 
|
2180  | 
unfolding connected_iff_const by auto  | 
|
2181  | 
||
2182  | 
lemma connectedI_const:  | 
|
2183  | 
"(\<And>P::'a::topological_space \<Rightarrow> bool. continuous_on S P \<Longrightarrow> \<exists>c. \<forall>s\<in>S. P s = c) \<Longrightarrow> connected S"  | 
|
2184  | 
unfolding connected_iff_const by auto  | 
|
2185  | 
||
| 56329 | 2186  | 
lemma connected_local_const:  | 
2187  | 
assumes "connected A" "a \<in> A" "b \<in> A"  | 
|
2188  | 
assumes *: "\<forall>a\<in>A. eventually (\<lambda>b. f a = f b) (at a within A)"  | 
|
2189  | 
shows "f a = f b"  | 
|
2190  | 
proof -  | 
|
2191  | 
obtain S where S: "\<And>a. a \<in> A \<Longrightarrow> a \<in> S a" "\<And>a. a \<in> A \<Longrightarrow> open (S a)"  | 
|
2192  | 
"\<And>a x. a \<in> A \<Longrightarrow> x \<in> S a \<Longrightarrow> x \<in> A \<Longrightarrow> f a = f x"  | 
|
2193  | 
using * unfolding eventually_at_topological by metis  | 
|
2194  | 
||
2195  | 
  let ?P = "\<Union>b\<in>{b\<in>A. f a = f b}. S b" and ?N = "\<Union>b\<in>{b\<in>A. f a \<noteq> f b}. S b"
 | 
|
2196  | 
  have "?P \<inter> A = {} \<or> ?N \<inter> A = {}"
 | 
|
| 60758 | 2197  | 
using \<open>connected A\<close> S \<open>a\<in>A\<close>  | 
| 56329 | 2198  | 
by (intro connectedD) (auto, metis)  | 
2199  | 
then show "f a = f b"  | 
|
2200  | 
proof  | 
|
2201  | 
    assume "?N \<inter> A = {}"
 | 
|
2202  | 
then have "\<forall>x\<in>A. f a = f x"  | 
|
2203  | 
using S(1) by auto  | 
|
| 60758 | 2204  | 
with \<open>b\<in>A\<close> show ?thesis by auto  | 
| 56329 | 2205  | 
next  | 
2206  | 
    assume "?P \<inter> A = {}" then show ?thesis
 | 
|
| 60758 | 2207  | 
using \<open>a \<in> A\<close> S(1)[of a] by auto  | 
| 56329 | 2208  | 
qed  | 
2209  | 
qed  | 
|
2210  | 
||
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2211  | 
lemma (in linorder_topology) connectedD_interval:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2212  | 
assumes "connected U" and xy: "x \<in> U" "y \<in> U" and "x \<le> z" "z \<le> y"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2213  | 
shows "z \<in> U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2214  | 
proof -  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2215  | 
  have eq: "{..<z} \<union> {z<..} = - {z}"
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2216  | 
by auto  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2217  | 
  { assume "z \<notin> U" "x < z" "z < y"
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2218  | 
with xy have "\<not> connected U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2219  | 
unfolding connected_def simp_thms  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2220  | 
      apply (rule_tac exI[of _ "{..< z}"])
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2221  | 
      apply (rule_tac exI[of _ "{z <..}"])
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2222  | 
apply (auto simp add: eq)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2223  | 
done }  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2224  | 
with assms show "z \<in> U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2225  | 
by (metis less_le)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2226  | 
qed  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2227  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2228  | 
lemma connected_continuous_image:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2229  | 
assumes *: "continuous_on s f"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2230  | 
assumes "connected s"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2231  | 
shows "connected (f ` s)"  | 
| 59106 | 2232  | 
proof (rule connectedI_const)  | 
2233  | 
fix P :: "'b \<Rightarrow> bool" assume "continuous_on (f ` s) P"  | 
|
2234  | 
then have "continuous_on s (P \<circ> f)"  | 
|
2235  | 
by (rule continuous_on_compose[OF *])  | 
|
| 60758 | 2236  | 
from connectedD_const[OF \<open>connected s\<close> this] show "\<exists>c. \<forall>s\<in>f ` s. P s = c"  | 
| 59106 | 2237  | 
by auto  | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2238  | 
qed  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2239  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2240  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2241  | 
section \<open>Linear Continuum Topologies\<close>  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2242  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2243  | 
class linear_continuum_topology = linorder_topology + linear_continuum  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2244  | 
begin  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2245  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2246  | 
lemma Inf_notin_open:  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2247  | 
assumes A: "open A" and bnd: "\<forall>a\<in>A. x < a"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2248  | 
shows "Inf A \<notin> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2249  | 
proof  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2250  | 
assume "Inf A \<in> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2251  | 
  then obtain b where "b < Inf A" "{b <.. Inf A} \<subseteq> A"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2252  | 
using open_left[of A "Inf A" x] assms by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2253  | 
with dense[of b "Inf A"] obtain c where "c < Inf A" "c \<in> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2254  | 
by (auto simp: subset_eq)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2255  | 
then show False  | 
| 60758 | 2256  | 
using cInf_lower[OF \<open>c \<in> A\<close>] bnd by (metis not_le less_imp_le bdd_belowI)  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2257  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2258  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2259  | 
lemma Sup_notin_open:  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2260  | 
assumes A: "open A" and bnd: "\<forall>a\<in>A. a < x"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2261  | 
shows "Sup A \<notin> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2262  | 
proof  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2263  | 
assume "Sup A \<in> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2264  | 
  then obtain b where "Sup A < b" "{Sup A ..< b} \<subseteq> A"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2265  | 
using open_right[of A "Sup A" x] assms by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2266  | 
with dense[of "Sup A" b] obtain c where "Sup A < c" "c \<in> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2267  | 
by (auto simp: subset_eq)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2268  | 
then show False  | 
| 60758 | 2269  | 
using cSup_upper[OF \<open>c \<in> A\<close>] bnd by (metis less_imp_le not_le bdd_aboveI)  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2270  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2271  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2272  | 
end  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2273  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2274  | 
instance linear_continuum_topology \<subseteq> perfect_space  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2275  | 
proof  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2276  | 
fix x :: 'a  | 
| 53381 | 2277  | 
obtain y where "x < y \<or> y < x"  | 
2278  | 
using ex_gt_or_lt [of x] ..  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2279  | 
  with Inf_notin_open[of "{x}" y] Sup_notin_open[of "{x}" y]
 | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2280  | 
  show "\<not> open {x}"
 | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2281  | 
by auto  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2282  | 
qed  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2283  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2284  | 
lemma connectedI_interval:  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2285  | 
fixes U :: "'a :: linear_continuum_topology set"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2286  | 
assumes *: "\<And>x y z. x \<in> U \<Longrightarrow> y \<in> U \<Longrightarrow> x \<le> z \<Longrightarrow> z \<le> y \<Longrightarrow> z \<in> U"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2287  | 
shows "connected U"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2288  | 
proof (rule connectedI)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2289  | 
  { fix A B assume "open A" "open B" "A \<inter> B \<inter> U = {}" "U \<subseteq> A \<union> B"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2290  | 
fix x y assume "x < y" "x \<in> A" "y \<in> B" "x \<in> U" "y \<in> U"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2291  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2292  | 
    let ?z = "Inf (B \<inter> {x <..})"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2293  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2294  | 
have "x \<le> ?z" "?z \<le> y"  | 
| 60758 | 2295  | 
using \<open>y \<in> B\<close> \<open>x < y\<close> by (auto intro: cInf_lower cInf_greatest)  | 
2296  | 
with \<open>x \<in> U\<close> \<open>y \<in> U\<close> have "?z \<in> U"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2297  | 
by (rule *)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2298  | 
    moreover have "?z \<notin> B \<inter> {x <..}"
 | 
| 60758 | 2299  | 
using \<open>open B\<close> by (intro Inf_notin_open) auto  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2300  | 
ultimately have "?z \<in> A"  | 
| 60758 | 2301  | 
      using \<open>x \<le> ?z\<close> \<open>A \<inter> B \<inter> U = {}\<close> \<open>x \<in> A\<close> \<open>U \<subseteq> A \<union> B\<close> by auto
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2302  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2303  | 
    { assume "?z < y"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2304  | 
      obtain a where "?z < a" "{?z ..< a} \<subseteq> A"
 | 
| 60758 | 2305  | 
using open_right[OF \<open>open A\<close> \<open>?z \<in> A\<close> \<open>?z < y\<close>] by auto  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2306  | 
moreover obtain b where "b \<in> B" "x < b" "b < min a y"  | 
| 60758 | 2307  | 
        using cInf_less_iff[of "B \<inter> {x <..}" "min a y"] \<open>?z < a\<close> \<open>?z < y\<close> \<open>x < y\<close> \<open>y \<in> B\<close>
 | 
| 63171 | 2308  | 
by auto  | 
| 
53374
 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 
wenzelm 
parents: 
53215 
diff
changeset
 | 
2309  | 
moreover have "?z \<le> b"  | 
| 60758 | 2310  | 
using \<open>b \<in> B\<close> \<open>x < b\<close>  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
53946 
diff
changeset
 | 
2311  | 
by (intro cInf_lower) auto  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2312  | 
moreover have "b \<in> U"  | 
| 60758 | 2313  | 
using \<open>x \<le> ?z\<close> \<open>?z \<le> b\<close> \<open>b < min a y\<close>  | 
2314  | 
by (intro *[OF \<open>x \<in> U\<close> \<open>y \<in> U\<close>]) (auto simp: less_imp_le)  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2315  | 
ultimately have "\<exists>b\<in>B. b \<in> A \<and> b \<in> U"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2316  | 
by (intro bexI[of _ b]) auto }  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2317  | 
then have False  | 
| 60758 | 2318  | 
      using \<open>?z \<le> y\<close> \<open>?z \<in> A\<close> \<open>y \<in> B\<close> \<open>y \<in> U\<close> \<open>A \<inter> B \<inter> U = {}\<close> unfolding le_less by blast }
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2319  | 
note not_disjoint = this  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2320  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2321  | 
  fix A B assume AB: "open A" "open B" "U \<subseteq> A \<union> B" "A \<inter> B \<inter> U = {}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2322  | 
  moreover assume "A \<inter> U \<noteq> {}" then obtain x where x: "x \<in> U" "x \<in> A" by auto
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2323  | 
  moreover assume "B \<inter> U \<noteq> {}" then obtain y where y: "y \<in> U" "y \<in> B" by auto
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2324  | 
moreover note not_disjoint[of B A y x] not_disjoint[of A B x y]  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2325  | 
ultimately show False by (cases x y rule: linorder_cases) auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2326  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2327  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2328  | 
lemma connected_iff_interval:  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2329  | 
fixes U :: "'a :: linear_continuum_topology set"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2330  | 
shows "connected U \<longleftrightarrow> (\<forall>x\<in>U. \<forall>y\<in>U. \<forall>z. x \<le> z \<longrightarrow> z \<le> y \<longrightarrow> z \<in> U)"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2331  | 
by (auto intro: connectedI_interval dest: connectedD_interval)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2332  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2333  | 
lemma connected_UNIV[simp]: "connected (UNIV::'a::linear_continuum_topology set)"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2334  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2335  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2336  | 
lemma connected_Ioi[simp]: "connected {a::'a::linear_continuum_topology <..}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2337  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2338  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2339  | 
lemma connected_Ici[simp]: "connected {a::'a::linear_continuum_topology ..}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2340  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2341  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2342  | 
lemma connected_Iio[simp]: "connected {..< a::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2343  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2344  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2345  | 
lemma connected_Iic[simp]: "connected {.. a::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2346  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2347  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2348  | 
lemma connected_Ioo[simp]: "connected {a <..< b::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2349  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2350  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2351  | 
lemma connected_Ioc[simp]: "connected {a <.. b::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2352  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2353  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2354  | 
lemma connected_Ico[simp]: "connected {a ..< b::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2355  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2356  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2357  | 
lemma connected_Icc[simp]: "connected {a .. b::'a::linear_continuum_topology}"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2358  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2359  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2360  | 
lemma connected_contains_Ioo:  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2361  | 
fixes A :: "'a :: linorder_topology set"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2362  | 
  assumes A: "connected A" "a \<in> A" "b \<in> A" shows "{a <..< b} \<subseteq> A"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2363  | 
using connectedD_interval[OF A] by (simp add: subset_eq Ball_def less_imp_le)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2364  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2365  | 
lemma connected_contains_Icc:  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2366  | 
  assumes "connected (A :: ('a :: {linorder_topology}) set)" "a \<in> A" "b \<in> A"
 | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2367  | 
  shows   "{a..b} \<subseteq> A"
 | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2368  | 
proof  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2369  | 
  fix x assume "x \<in> {a..b}"
 | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2370  | 
  hence "x = a \<or> x = b \<or> x \<in> {a<..<b}" by auto
 | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2371  | 
thus "x \<in> A" using assms connected_contains_Ioo[of A a b] by auto  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2372  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
2373  | 
|
| 60758 | 2374  | 
subsection \<open>Intermediate Value Theorem\<close>  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2375  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2376  | 
lemma IVT':  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2377  | 
fixes f :: "'a :: linear_continuum_topology \<Rightarrow> 'b :: linorder_topology"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2378  | 
assumes y: "f a \<le> y" "y \<le> f b" "a \<le> b"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2379  | 
  assumes *: "continuous_on {a .. b} f"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2380  | 
shows "\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2381  | 
proof -  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2382  | 
  have "connected {a..b}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2383  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2384  | 
from connected_continuous_image[OF * this, THEN connectedD_interval, of "f a" "f b" y] y  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2385  | 
show ?thesis  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2386  | 
by (auto simp add: atLeastAtMost_def atLeast_def atMost_def)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2387  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2388  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2389  | 
lemma IVT2':  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2390  | 
fixes f :: "'a :: linear_continuum_topology \<Rightarrow> 'b :: linorder_topology"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2391  | 
assumes y: "f b \<le> y" "y \<le> f a" "a \<le> b"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2392  | 
  assumes *: "continuous_on {a .. b} f"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2393  | 
shows "\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2394  | 
proof -  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2395  | 
  have "connected {a..b}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2396  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2397  | 
from connected_continuous_image[OF * this, THEN connectedD_interval, of "f b" "f a" y] y  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2398  | 
show ?thesis  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2399  | 
by (auto simp add: atLeastAtMost_def atLeast_def atMost_def)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2400  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2401  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2402  | 
lemma IVT:  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2403  | 
fixes f :: "'a :: linear_continuum_topology \<Rightarrow> 'b :: linorder_topology"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2404  | 
shows "f a \<le> y \<Longrightarrow> y \<le> f b \<Longrightarrow> a \<le> b \<Longrightarrow> (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x) \<Longrightarrow> \<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2405  | 
by (rule IVT') (auto intro: continuous_at_imp_continuous_on)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2406  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2407  | 
lemma IVT2:  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2408  | 
fixes f :: "'a :: linear_continuum_topology \<Rightarrow> 'b :: linorder_topology"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2409  | 
shows "f b \<le> y \<Longrightarrow> y \<le> f a \<Longrightarrow> a \<le> b \<Longrightarrow> (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x) \<Longrightarrow> \<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2410  | 
by (rule IVT2') (auto intro: continuous_at_imp_continuous_on)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2411  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2412  | 
lemma continuous_inj_imp_mono:  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2413  | 
fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b :: linorder_topology"  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2414  | 
assumes x: "a < x" "x < b"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2415  | 
  assumes cont: "continuous_on {a..b} f"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2416  | 
  assumes inj: "inj_on f {a..b}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2417  | 
shows "(f a < f x \<and> f x < f b) \<or> (f b < f x \<and> f x < f a)"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2418  | 
proof -  | 
| 
61520
 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 
paulson <lp15@cam.ac.uk> 
parents: 
61426 
diff
changeset
 | 
2419  | 
note I = inj_on_eq_iff[OF inj]  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2420  | 
  { assume "f x < f a" "f x < f b"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2421  | 
then obtain s t where "x \<le> s" "s \<le> b" "a \<le> t" "t \<le> x" "f s = f t" "f x < f s"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2422  | 
using IVT'[of f x "min (f a) (f b)" b] IVT2'[of f x "min (f a) (f b)" a] x  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2423  | 
by (auto simp: continuous_on_subset[OF cont] less_imp_le)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2424  | 
with x I have False by auto }  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2425  | 
moreover  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2426  | 
  { assume "f a < f x" "f b < f x"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2427  | 
then obtain s t where "x \<le> s" "s \<le> b" "a \<le> t" "t \<le> x" "f s = f t" "f s < f x"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2428  | 
using IVT'[of f a "max (f a) (f b)" x] IVT2'[of f b "max (f a) (f b)" x] x  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2429  | 
by (auto simp: continuous_on_subset[OF cont] less_imp_le)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2430  | 
with x I have False by auto }  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2431  | 
ultimately show ?thesis  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2432  | 
using I[of a x] I[of x b] x less_trans[OF x] by (auto simp add: le_less less_imp_neq neq_iff)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2433  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2434  | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2435  | 
lemma continuous_at_Sup_mono:  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2436  | 
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder} \<Rightarrow> 'b :: {linorder_topology, conditionally_complete_linorder}"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2437  | 
assumes "mono f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2438  | 
assumes cont: "continuous (at_left (Sup S)) f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2439  | 
  assumes S: "S \<noteq> {}" "bdd_above S"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2440  | 
shows "f (Sup S) = (SUP s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2441  | 
proof (rule antisym)  | 
| 61973 | 2442  | 
have f: "(f \<longlongrightarrow> f (Sup S)) (at_left (Sup S))"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2443  | 
using cont unfolding continuous_within .  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2444  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2445  | 
show "f (Sup S) \<le> (SUP s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2446  | 
proof cases  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2447  | 
assume "Sup S \<in> S" then show ?thesis  | 
| 60758 | 2448  | 
by (rule cSUP_upper) (auto intro: bdd_above_image_mono S \<open>mono f\<close>)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2449  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2450  | 
assume "Sup S \<notin> S"  | 
| 60758 | 2451  | 
    from \<open>S \<noteq> {}\<close> obtain s where "s \<in> S"
 | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2452  | 
by auto  | 
| 60758 | 2453  | 
with \<open>Sup S \<notin> S\<close> S have "s < Sup S"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2454  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2455  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2456  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2457  | 
assume "\<not> ?thesis"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2458  | 
with order_tendstoD(1)[OF f, of "SUP s:S. f s"] obtain b where "b < Sup S"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2459  | 
and *: "\<And>y. b < y \<Longrightarrow> y < Sup S \<Longrightarrow> (SUP s:S. f s) < f y"  | 
| 60758 | 2460  | 
by (auto simp: not_le eventually_at_left[OF \<open>s < Sup S\<close>])  | 
2461  | 
      with \<open>S \<noteq> {}\<close> obtain c where "c \<in> S" "b < c"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2462  | 
using less_cSupD[of S b] by auto  | 
| 60758 | 2463  | 
with \<open>Sup S \<notin> S\<close> S have "c < Sup S"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2464  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 60758 | 2465  | 
from *[OF \<open>b < c\<close> \<open>c < Sup S\<close>] cSUP_upper[OF \<open>c \<in> S\<close> bdd_above_image_mono[of f]]  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2466  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2467  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2468  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2469  | 
qed  | 
| 60758 | 2470  | 
qed (intro cSUP_least \<open>mono f\<close>[THEN monoD] cSup_upper S)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2471  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2472  | 
lemma continuous_at_Sup_antimono:  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2473  | 
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder} \<Rightarrow> 'b :: {linorder_topology, conditionally_complete_linorder}"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2474  | 
assumes "antimono f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2475  | 
assumes cont: "continuous (at_left (Sup S)) f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2476  | 
  assumes S: "S \<noteq> {}" "bdd_above S"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2477  | 
shows "f (Sup S) = (INF s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2478  | 
proof (rule antisym)  | 
| 61973 | 2479  | 
have f: "(f \<longlongrightarrow> f (Sup S)) (at_left (Sup S))"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2480  | 
using cont unfolding continuous_within .  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2481  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2482  | 
show "(INF s:S. f s) \<le> f (Sup S)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2483  | 
proof cases  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2484  | 
assume "Sup S \<in> S" then show ?thesis  | 
| 60758 | 2485  | 
by (intro cINF_lower) (auto intro: bdd_below_image_antimono S \<open>antimono f\<close>)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2486  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2487  | 
assume "Sup S \<notin> S"  | 
| 60758 | 2488  | 
    from \<open>S \<noteq> {}\<close> obtain s where "s \<in> S"
 | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2489  | 
by auto  | 
| 60758 | 2490  | 
with \<open>Sup S \<notin> S\<close> S have "s < Sup S"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2491  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2492  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2493  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2494  | 
assume "\<not> ?thesis"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2495  | 
with order_tendstoD(2)[OF f, of "INF s:S. f s"] obtain b where "b < Sup S"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2496  | 
and *: "\<And>y. b < y \<Longrightarrow> y < Sup S \<Longrightarrow> f y < (INF s:S. f s)"  | 
| 60758 | 2497  | 
by (auto simp: not_le eventually_at_left[OF \<open>s < Sup S\<close>])  | 
2498  | 
      with \<open>S \<noteq> {}\<close> obtain c where "c \<in> S" "b < c"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2499  | 
using less_cSupD[of S b] by auto  | 
| 60758 | 2500  | 
with \<open>Sup S \<notin> S\<close> S have "c < Sup S"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2501  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 60758 | 2502  | 
from *[OF \<open>b < c\<close> \<open>c < Sup S\<close>] cINF_lower[OF bdd_below_image_antimono, of f S c] \<open>c \<in> S\<close>  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2503  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2504  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2505  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2506  | 
qed  | 
| 60758 | 2507  | 
qed (intro cINF_greatest \<open>antimono f\<close>[THEN antimonoD] cSup_upper S)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2508  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2509  | 
lemma continuous_at_Inf_mono:  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2510  | 
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder} \<Rightarrow> 'b :: {linorder_topology, conditionally_complete_linorder}"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2511  | 
assumes "mono f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2512  | 
assumes cont: "continuous (at_right (Inf S)) f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2513  | 
  assumes S: "S \<noteq> {}" "bdd_below S"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2514  | 
shows "f (Inf S) = (INF s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2515  | 
proof (rule antisym)  | 
| 61973 | 2516  | 
have f: "(f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2517  | 
using cont unfolding continuous_within .  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2518  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2519  | 
show "(INF s:S. f s) \<le> f (Inf S)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2520  | 
proof cases  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2521  | 
assume "Inf S \<in> S" then show ?thesis  | 
| 60758 | 2522  | 
by (rule cINF_lower[rotated]) (auto intro: bdd_below_image_mono S \<open>mono f\<close>)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2523  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2524  | 
assume "Inf S \<notin> S"  | 
| 60758 | 2525  | 
    from \<open>S \<noteq> {}\<close> obtain s where "s \<in> S"
 | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2526  | 
by auto  | 
| 60758 | 2527  | 
with \<open>Inf S \<notin> S\<close> S have "Inf S < s"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2528  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2529  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2530  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2531  | 
assume "\<not> ?thesis"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2532  | 
with order_tendstoD(2)[OF f, of "INF s:S. f s"] obtain b where "Inf S < b"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2533  | 
and *: "\<And>y. Inf S < y \<Longrightarrow> y < b \<Longrightarrow> f y < (INF s:S. f s)"  | 
| 60758 | 2534  | 
by (auto simp: not_le eventually_at_right[OF \<open>Inf S < s\<close>])  | 
2535  | 
      with \<open>S \<noteq> {}\<close> obtain c where "c \<in> S" "c < b"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2536  | 
using cInf_lessD[of S b] by auto  | 
| 60758 | 2537  | 
with \<open>Inf S \<notin> S\<close> S have "Inf S < c"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2538  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 60758 | 2539  | 
from *[OF \<open>Inf S < c\<close> \<open>c < b\<close>] cINF_lower[OF bdd_below_image_mono[of f] \<open>c \<in> S\<close>]  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2540  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2541  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2542  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2543  | 
qed  | 
| 60758 | 2544  | 
qed (intro cINF_greatest \<open>mono f\<close>[THEN monoD] cInf_lower \<open>bdd_below S\<close> \<open>S \<noteq> {}\<close>)
 | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2545  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2546  | 
lemma continuous_at_Inf_antimono:  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2547  | 
  fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder} \<Rightarrow> 'b :: {linorder_topology, conditionally_complete_linorder}"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2548  | 
assumes "antimono f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2549  | 
assumes cont: "continuous (at_right (Inf S)) f"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2550  | 
  assumes S: "S \<noteq> {}" "bdd_below S"
 | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2551  | 
shows "f (Inf S) = (SUP s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2552  | 
proof (rule antisym)  | 
| 61973 | 2553  | 
have f: "(f \<longlongrightarrow> f (Inf S)) (at_right (Inf S))"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2554  | 
using cont unfolding continuous_within .  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2555  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2556  | 
show "f (Inf S) \<le> (SUP s:S. f s)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2557  | 
proof cases  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2558  | 
assume "Inf S \<in> S" then show ?thesis  | 
| 60758 | 2559  | 
by (rule cSUP_upper) (auto intro: bdd_above_image_antimono S \<open>antimono f\<close>)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2560  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2561  | 
assume "Inf S \<notin> S"  | 
| 60758 | 2562  | 
    from \<open>S \<noteq> {}\<close> obtain s where "s \<in> S"
 | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2563  | 
by auto  | 
| 60758 | 2564  | 
with \<open>Inf S \<notin> S\<close> S have "Inf S < s"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2565  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2566  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2567  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2568  | 
assume "\<not> ?thesis"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2569  | 
with order_tendstoD(1)[OF f, of "SUP s:S. f s"] obtain b where "Inf S < b"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2570  | 
and *: "\<And>y. Inf S < y \<Longrightarrow> y < b \<Longrightarrow> (SUP s:S. f s) < f y"  | 
| 60758 | 2571  | 
by (auto simp: not_le eventually_at_right[OF \<open>Inf S < s\<close>])  | 
2572  | 
      with \<open>S \<noteq> {}\<close> obtain c where "c \<in> S" "c < b"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2573  | 
using cInf_lessD[of S b] by auto  | 
| 60758 | 2574  | 
with \<open>Inf S \<notin> S\<close> S have "Inf S < c"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2575  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 60758 | 2576  | 
from *[OF \<open>Inf S < c\<close> \<open>c < b\<close>] cSUP_upper[OF \<open>c \<in> S\<close> bdd_above_image_antimono[of f]]  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2577  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2578  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2579  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2580  | 
qed  | 
| 60758 | 2581  | 
qed (intro cSUP_least \<open>antimono f\<close>[THEN antimonoD] cInf_lower S)  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
2582  | 
|
| 62101 | 2583  | 
subsection \<open>Uniform spaces\<close>  | 
2584  | 
||
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2585  | 
class uniformity =  | 
| 62101 | 2586  | 
  fixes uniformity :: "('a \<times> 'a) filter"
 | 
2587  | 
begin  | 
|
2588  | 
||
2589  | 
abbreviation uniformity_on :: "'a set \<Rightarrow> ('a \<times> 'a) filter" where
 | 
|
2590  | 
"uniformity_on s \<equiv> inf uniformity (principal (s\<times>s))"  | 
|
2591  | 
||
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2592  | 
end  | 
| 62101 | 2593  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2594  | 
lemma uniformity_Abort:  | 
| 
62123
 
df65f5c27c15
setup code generation for filters as suggested by Florian
 
hoelzl 
parents: 
62102 
diff
changeset
 | 
2595  | 
"uniformity =  | 
| 
 
df65f5c27c15
setup code generation for filters as suggested by Florian
 
hoelzl 
parents: 
62102 
diff
changeset
 | 
2596  | 
Filter.abstract_filter (\<lambda>u. Code.abort (STR ''uniformity is not executable'') (\<lambda>u. uniformity))"  | 
| 
 
df65f5c27c15
setup code generation for filters as suggested by Florian
 
hoelzl 
parents: 
62102 
diff
changeset
 | 
2597  | 
by simp  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2598  | 
|
| 62101 | 2599  | 
class open_uniformity = "open" + uniformity +  | 
2600  | 
assumes open_uniformity: "\<And>U. open U \<longleftrightarrow> (\<forall>x\<in>U. eventually (\<lambda>(x', y). x' = x \<longrightarrow> y \<in> U) uniformity)"  | 
|
2601  | 
||
2602  | 
class uniform_space = open_uniformity +  | 
|
2603  | 
assumes uniformity_refl: "eventually E uniformity \<Longrightarrow> E (x, x)"  | 
|
2604  | 
assumes uniformity_sym: "eventually E uniformity \<Longrightarrow> eventually (\<lambda>(x, y). E (y, x)) uniformity"  | 
|
2605  | 
assumes uniformity_trans: "eventually E uniformity \<Longrightarrow> \<exists>D. eventually D uniformity \<and> (\<forall>x y z. D (x, y) \<longrightarrow> D (y, z) \<longrightarrow> E (x, z))"  | 
|
2606  | 
begin  | 
|
2607  | 
||
2608  | 
subclass topological_space  | 
|
2609  | 
proof qed (force elim: eventually_mono eventually_elim2 simp: split_beta' open_uniformity)+  | 
|
2610  | 
||
2611  | 
lemma uniformity_bot: "uniformity \<noteq> bot"  | 
|
2612  | 
using uniformity_refl by auto  | 
|
2613  | 
||
2614  | 
lemma uniformity_trans':  | 
|
2615  | 
"eventually E uniformity \<Longrightarrow> eventually (\<lambda>((x, y), (y', z)). y = y' \<longrightarrow> E (x, z)) (uniformity \<times>\<^sub>F uniformity)"  | 
|
2616  | 
by (drule uniformity_trans) (auto simp add: eventually_prod_same)  | 
|
2617  | 
||
2618  | 
lemma uniformity_transE:  | 
|
2619  | 
assumes E: "eventually E uniformity"  | 
|
2620  | 
obtains D where "eventually D uniformity" "\<And>x y z. D (x, y) \<Longrightarrow> D (y, z) \<Longrightarrow> E (x, z)"  | 
|
2621  | 
using uniformity_trans[OF E] by auto  | 
|
2622  | 
||
2623  | 
lemma eventually_nhds_uniformity:  | 
|
2624  | 
"eventually P (nhds x) \<longleftrightarrow> eventually (\<lambda>(x', y). x' = x \<longrightarrow> P y) uniformity" (is "_ \<longleftrightarrow> ?N P x")  | 
|
2625  | 
unfolding eventually_nhds  | 
|
2626  | 
proof safe  | 
|
2627  | 
assume *: "?N P x"  | 
|
2628  | 
  { fix x assume "?N P x"
 | 
|
2629  | 
then guess D by (rule uniformity_transE) note D = this  | 
|
2630  | 
from D(1) have "?N (?N P) x"  | 
|
2631  | 
by eventually_elim (insert D, force elim: eventually_mono split: prod.split) }  | 
|
2632  | 
  then have "open {x. ?N P x}"
 | 
|
2633  | 
by (simp add: open_uniformity)  | 
|
2634  | 
then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>x\<in>S. P x)"  | 
|
2635  | 
    by (intro exI[of _ "{x. ?N P x}"]) (auto dest: uniformity_refl simp: *)
 | 
|
2636  | 
qed (force simp add: open_uniformity elim: eventually_mono)  | 
|
2637  | 
||
2638  | 
subsubsection \<open>Totally bounded sets\<close>  | 
|
2639  | 
||
2640  | 
definition totally_bounded :: "'a set \<Rightarrow> bool" where  | 
|
2641  | 
"totally_bounded S \<longleftrightarrow>  | 
|
2642  | 
(\<forall>E. eventually E uniformity \<longrightarrow> (\<exists>X. finite X \<and> (\<forall>s\<in>S. \<exists>x\<in>X. E (x, s))))"  | 
|
2643  | 
||
2644  | 
lemma totally_bounded_empty[iff]: "totally_bounded {}"
 | 
|
2645  | 
by (auto simp add: totally_bounded_def)  | 
|
2646  | 
||
2647  | 
lemma totally_bounded_subset: "totally_bounded S \<Longrightarrow> T \<subseteq> S \<Longrightarrow> totally_bounded T"  | 
|
| 63171 | 2648  | 
by (fastforce simp add: totally_bounded_def)  | 
| 62101 | 2649  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2650  | 
lemma totally_bounded_Union[intro]:  | 
| 62101 | 2651  | 
assumes M: "finite M" "\<And>S. S \<in> M \<Longrightarrow> totally_bounded S" shows "totally_bounded (\<Union>M)"  | 
2652  | 
unfolding totally_bounded_def  | 
|
2653  | 
proof safe  | 
|
2654  | 
fix E assume "eventually E uniformity"  | 
|
2655  | 
with M obtain X where "\<forall>S\<in>M. finite (X S) \<and> (\<forall>s\<in>S. \<exists>x\<in>X S. E (x, s))"  | 
|
2656  | 
by (metis totally_bounded_def)  | 
|
| 62175 | 2657  | 
with \<open>finite M\<close> show "\<exists>X. finite X \<and> (\<forall>s\<in>\<Union>M. \<exists>x\<in>X. E (x, s))"  | 
| 62101 | 2658  | 
by (intro exI[of _ "\<Union>S\<in>M. X S"]) force  | 
2659  | 
qed  | 
|
2660  | 
||
2661  | 
subsubsection \<open>Cauchy filter\<close>  | 
|
2662  | 
||
2663  | 
definition cauchy_filter :: "'a filter \<Rightarrow> bool" where  | 
|
2664  | 
"cauchy_filter F \<longleftrightarrow> F \<times>\<^sub>F F \<le> uniformity"  | 
|
2665  | 
||
2666  | 
definition Cauchy :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool" where  | 
|
2667  | 
Cauchy_uniform: "Cauchy X = cauchy_filter (filtermap X sequentially)"  | 
|
2668  | 
||
2669  | 
lemma Cauchy_uniform_iff:  | 
|
2670  | 
"Cauchy X \<longleftrightarrow> (\<forall>P. eventually P uniformity \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. P (X n, X m)))"  | 
|
2671  | 
unfolding Cauchy_uniform cauchy_filter_def le_filter_def eventually_prod_same  | 
|
2672  | 
eventually_filtermap eventually_sequentially  | 
|
2673  | 
proof safe  | 
|
2674  | 
let ?U = "\<lambda>P. eventually P uniformity"  | 
|
2675  | 
  { fix P assume "?U P" "\<forall>P. ?U P \<longrightarrow> (\<exists>Q. (\<exists>N. \<forall>n\<ge>N. Q (X n)) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> P (x, y)))"
 | 
|
2676  | 
then obtain Q N where "\<And>n. n \<ge> N \<Longrightarrow> Q (X n)" "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> P (x, y)"  | 
|
2677  | 
by metis  | 
|
2678  | 
then show "\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. P (X n, X m)"  | 
|
2679  | 
by blast }  | 
|
2680  | 
  { fix P assume "?U P" and P: "\<forall>P. ?U P \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. P (X n, X m))"
 | 
|
2681  | 
then obtain Q where "?U Q" and Q: "\<And>x y z. Q (x, y) \<Longrightarrow> Q (y, z) \<Longrightarrow> P (x, z)"  | 
|
2682  | 
by (auto elim: uniformity_transE)  | 
|
2683  | 
then have "?U (\<lambda>x. Q x \<and> (\<lambda>(x, y). Q (y, x)) x)"  | 
|
2684  | 
unfolding eventually_conj_iff by (simp add: uniformity_sym)  | 
|
2685  | 
from P[rule_format, OF this]  | 
|
2686  | 
obtain N where N: "\<And>n m. n \<ge> N \<Longrightarrow> m \<ge> N \<Longrightarrow> Q (X n, X m) \<and> Q (X m, X n)"  | 
|
2687  | 
by auto  | 
|
2688  | 
show "\<exists>Q. (\<exists>N. \<forall>n\<ge>N. Q (X n)) \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> P (x, y))"  | 
|
2689  | 
proof (safe intro!: exI[of _ "\<lambda>x. \<forall>n\<ge>N. Q (x, X n) \<and> Q (X n, x)"] exI[of _ N] N)  | 
|
2690  | 
fix x y assume "\<forall>n\<ge>N. Q (x, X n) \<and> Q (X n, x)" "\<forall>n\<ge>N. Q (y, X n) \<and> Q (X n, y)"  | 
|
2691  | 
then have "Q (x, X N)" "Q (X N, y)" by auto  | 
|
2692  | 
then show "P (x, y)"  | 
|
2693  | 
by (rule Q)  | 
|
2694  | 
qed }  | 
|
2695  | 
qed  | 
|
2696  | 
||
2697  | 
lemma nhds_imp_cauchy_filter:  | 
|
2698  | 
assumes *: "F \<le> nhds x" shows "cauchy_filter F"  | 
|
2699  | 
proof -  | 
|
2700  | 
have "F \<times>\<^sub>F F \<le> nhds x \<times>\<^sub>F nhds x"  | 
|
2701  | 
by (intro prod_filter_mono *)  | 
|
2702  | 
also have "\<dots> \<le> uniformity"  | 
|
2703  | 
unfolding le_filter_def eventually_nhds_uniformity eventually_prod_same  | 
|
2704  | 
proof safe  | 
|
2705  | 
fix P assume "eventually P uniformity"  | 
|
2706  | 
then guess Ql by (rule uniformity_transE) note Ql = this  | 
|
2707  | 
moreover note Ql(1)[THEN uniformity_sym]  | 
|
2708  | 
ultimately show "\<exists>Q. eventually (\<lambda>(x', y). x' = x \<longrightarrow> Q y) uniformity \<and> (\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> P (x, y))"  | 
|
2709  | 
by (rule_tac exI[of _ "\<lambda>y. Ql (y, x) \<and> Ql (x, y)"]) (fastforce elim: eventually_elim2)  | 
|
2710  | 
qed  | 
|
2711  | 
finally show ?thesis  | 
|
2712  | 
by (simp add: cauchy_filter_def)  | 
|
2713  | 
qed  | 
|
2714  | 
||
2715  | 
lemma LIMSEQ_imp_Cauchy: "X \<longlonglongrightarrow> x \<Longrightarrow> Cauchy X"  | 
|
2716  | 
unfolding Cauchy_uniform filterlim_def by (intro nhds_imp_cauchy_filter)  | 
|
2717  | 
||
2718  | 
lemma Cauchy_subseq_Cauchy: assumes "Cauchy X" "subseq f" shows "Cauchy (X \<circ> f)"  | 
|
2719  | 
unfolding Cauchy_uniform comp_def filtermap_filtermap[symmetric] cauchy_filter_def  | 
|
2720  | 
by (rule order_trans[OF _ \<open>Cauchy X\<close>[unfolded Cauchy_uniform cauchy_filter_def]])  | 
|
2721  | 
(intro prod_filter_mono filtermap_mono filterlim_subseq[OF \<open>subseq f\<close>, unfolded filterlim_def])  | 
|
2722  | 
||
2723  | 
lemma convergent_Cauchy: "convergent X \<Longrightarrow> Cauchy X"  | 
|
2724  | 
unfolding convergent_def by (erule exE, erule LIMSEQ_imp_Cauchy)  | 
|
2725  | 
||
2726  | 
definition complete :: "'a set \<Rightarrow> bool" where  | 
|
2727  | 
complete_uniform: "complete S \<longleftrightarrow> (\<forall>F \<le> principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x))"  | 
|
2728  | 
||
2729  | 
end  | 
|
2730  | 
||
2731  | 
subsubsection \<open>Uniformly continuous functions\<close>  | 
|
2732  | 
||
2733  | 
definition uniformly_continuous_on :: "'a set \<Rightarrow> ('a::uniform_space \<Rightarrow> 'b::uniform_space) \<Rightarrow> bool" where
 | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2734  | 
uniformly_continuous_on_uniformity: "uniformly_continuous_on s f \<longleftrightarrow>  | 
| 62101 | 2735  | 
(LIM (x, y) (uniformity_on s). (f x, f y) :> uniformity)"  | 
2736  | 
||
2737  | 
lemma uniformly_continuous_onD:  | 
|
2738  | 
"uniformly_continuous_on s f \<Longrightarrow> eventually E uniformity  | 
|
2739  | 
\<Longrightarrow> eventually (\<lambda>(x, y). x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)) uniformity"  | 
|
2740  | 
by (simp add: uniformly_continuous_on_uniformity filterlim_iff eventually_inf_principal split_beta' mem_Times_iff imp_conjL)  | 
|
2741  | 
||
2742  | 
lemma uniformly_continuous_on_const[continuous_intros]: "uniformly_continuous_on s (\<lambda>x. c)"  | 
|
2743  | 
by (auto simp: uniformly_continuous_on_uniformity filterlim_iff uniformity_refl)  | 
|
2744  | 
||
2745  | 
lemma uniformly_continuous_on_id[continuous_intros]: "uniformly_continuous_on s (\<lambda>x. x)"  | 
|
2746  | 
by (auto simp: uniformly_continuous_on_uniformity filterlim_def)  | 
|
2747  | 
||
2748  | 
lemma uniformly_continuous_on_compose[continuous_intros]:  | 
|
2749  | 
"uniformly_continuous_on s g \<Longrightarrow> uniformly_continuous_on (g`s) f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. f (g x))"  | 
|
2750  | 
using filterlim_compose[of "\<lambda>(x, y). (f x, f y)" uniformity "uniformity_on (g`s)" "\<lambda>(x, y). (g x, g y)" "uniformity_on s"]  | 
|
2751  | 
by (simp add: split_beta' uniformly_continuous_on_uniformity filterlim_inf filterlim_principal eventually_inf_principal mem_Times_iff)  | 
|
2752  | 
||
2753  | 
lemma uniformly_continuous_imp_continuous: assumes f: "uniformly_continuous_on s f" shows "continuous_on s f"  | 
|
2754  | 
by (auto simp: filterlim_iff eventually_at_filter eventually_nhds_uniformity continuous_on_def  | 
|
2755  | 
elim: eventually_mono dest!: uniformly_continuous_onD[OF f])  | 
|
2756  | 
||
| 62367 | 2757  | 
section \<open>Product Topology\<close>  | 
2758  | 
||
2759  | 
||
2760  | 
subsection \<open>Product is a topological space\<close>  | 
|
2761  | 
||
2762  | 
instantiation prod :: (topological_space, topological_space) topological_space  | 
|
2763  | 
begin  | 
|
2764  | 
||
2765  | 
definition open_prod_def[code del]:  | 
|
2766  | 
  "open (S :: ('a \<times> 'b) set) \<longleftrightarrow>
 | 
|
2767  | 
(\<forall>x\<in>S. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S)"  | 
|
2768  | 
||
2769  | 
lemma open_prod_elim:  | 
|
2770  | 
assumes "open S" and "x \<in> S"  | 
|
2771  | 
obtains A B where "open A" and "open B" and "x \<in> A \<times> B" and "A \<times> B \<subseteq> S"  | 
|
2772  | 
using assms unfolding open_prod_def by fast  | 
|
2773  | 
||
2774  | 
lemma open_prod_intro:  | 
|
2775  | 
assumes "\<And>x. x \<in> S \<Longrightarrow> \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S"  | 
|
2776  | 
shows "open S"  | 
|
2777  | 
using assms unfolding open_prod_def by fast  | 
|
2778  | 
||
2779  | 
instance  | 
|
2780  | 
proof  | 
|
2781  | 
  show "open (UNIV :: ('a \<times> 'b) set)"
 | 
|
2782  | 
unfolding open_prod_def by auto  | 
|
2783  | 
next  | 
|
2784  | 
  fix S T :: "('a \<times> 'b) set"
 | 
|
2785  | 
assume "open S" "open T"  | 
|
2786  | 
show "open (S \<inter> T)"  | 
|
2787  | 
proof (rule open_prod_intro)  | 
|
2788  | 
fix x assume x: "x \<in> S \<inter> T"  | 
|
2789  | 
from x have "x \<in> S" by simp  | 
|
2790  | 
obtain Sa Sb where A: "open Sa" "open Sb" "x \<in> Sa \<times> Sb" "Sa \<times> Sb \<subseteq> S"  | 
|
2791  | 
using \<open>open S\<close> and \<open>x \<in> S\<close> by (rule open_prod_elim)  | 
|
2792  | 
from x have "x \<in> T" by simp  | 
|
2793  | 
obtain Ta Tb where B: "open Ta" "open Tb" "x \<in> Ta \<times> Tb" "Ta \<times> Tb \<subseteq> T"  | 
|
2794  | 
using \<open>open T\<close> and \<open>x \<in> T\<close> by (rule open_prod_elim)  | 
|
2795  | 
let ?A = "Sa \<inter> Ta" and ?B = "Sb \<inter> Tb"  | 
|
2796  | 
have "open ?A \<and> open ?B \<and> x \<in> ?A \<times> ?B \<and> ?A \<times> ?B \<subseteq> S \<inter> T"  | 
|
2797  | 
using A B by (auto simp add: open_Int)  | 
|
2798  | 
thus "\<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S \<inter> T"  | 
|
2799  | 
by fast  | 
|
2800  | 
qed  | 
|
2801  | 
next  | 
|
2802  | 
  fix K :: "('a \<times> 'b) set set"
 | 
|
2803  | 
assume "\<forall>S\<in>K. open S" thus "open (\<Union>K)"  | 
|
2804  | 
unfolding open_prod_def by fast  | 
|
2805  | 
qed  | 
|
2806  | 
||
| 62101 | 2807  | 
end  | 
| 62367 | 2808  | 
|
2809  | 
declare [[code abort: "open::('a::topological_space*'b::topological_space) set \<Rightarrow> bool"]]
 | 
|
2810  | 
||
2811  | 
lemma open_Times: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<times> T)"  | 
|
2812  | 
unfolding open_prod_def by auto  | 
|
2813  | 
||
2814  | 
lemma fst_vimage_eq_Times: "fst -` S = S \<times> UNIV"  | 
|
2815  | 
by auto  | 
|
2816  | 
||
2817  | 
lemma snd_vimage_eq_Times: "snd -` S = UNIV \<times> S"  | 
|
2818  | 
by auto  | 
|
2819  | 
||
2820  | 
lemma open_vimage_fst: "open S \<Longrightarrow> open (fst -` S)"  | 
|
2821  | 
by (simp add: fst_vimage_eq_Times open_Times)  | 
|
2822  | 
||
2823  | 
lemma open_vimage_snd: "open S \<Longrightarrow> open (snd -` S)"  | 
|
2824  | 
by (simp add: snd_vimage_eq_Times open_Times)  | 
|
2825  | 
||
2826  | 
lemma closed_vimage_fst: "closed S \<Longrightarrow> closed (fst -` S)"  | 
|
2827  | 
unfolding closed_open vimage_Compl [symmetric]  | 
|
2828  | 
by (rule open_vimage_fst)  | 
|
2829  | 
||
2830  | 
lemma closed_vimage_snd: "closed S \<Longrightarrow> closed (snd -` S)"  | 
|
2831  | 
unfolding closed_open vimage_Compl [symmetric]  | 
|
2832  | 
by (rule open_vimage_snd)  | 
|
2833  | 
||
2834  | 
lemma closed_Times: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"  | 
|
2835  | 
proof -  | 
|
2836  | 
have "S \<times> T = (fst -` S) \<inter> (snd -` T)" by auto  | 
|
2837  | 
thus "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"  | 
|
2838  | 
by (simp add: closed_vimage_fst closed_vimage_snd closed_Int)  | 
|
2839  | 
qed  | 
|
2840  | 
||
2841  | 
lemma subset_fst_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> y \<in> B \<Longrightarrow> A \<subseteq> fst ` S"  | 
|
2842  | 
unfolding image_def subset_eq by force  | 
|
2843  | 
||
2844  | 
lemma subset_snd_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> x \<in> A \<Longrightarrow> B \<subseteq> snd ` S"  | 
|
2845  | 
unfolding image_def subset_eq by force  | 
|
2846  | 
||
2847  | 
lemma open_image_fst: assumes "open S" shows "open (fst ` S)"  | 
|
2848  | 
proof (rule openI)  | 
|
2849  | 
fix x assume "x \<in> fst ` S"  | 
|
2850  | 
then obtain y where "(x, y) \<in> S" by auto  | 
|
2851  | 
then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"  | 
|
2852  | 
using \<open>open S\<close> unfolding open_prod_def by auto  | 
|
2853  | 
from \<open>A \<times> B \<subseteq> S\<close> \<open>y \<in> B\<close> have "A \<subseteq> fst ` S" by (rule subset_fst_imageI)  | 
|
2854  | 
with \<open>open A\<close> \<open>x \<in> A\<close> have "open A \<and> x \<in> A \<and> A \<subseteq> fst ` S" by simp  | 
|
2855  | 
then show "\<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> fst ` S" by - (rule exI)  | 
|
2856  | 
qed  | 
|
2857  | 
||
2858  | 
lemma open_image_snd: assumes "open S" shows "open (snd ` S)"  | 
|
2859  | 
proof (rule openI)  | 
|
2860  | 
fix y assume "y \<in> snd ` S"  | 
|
2861  | 
then obtain x where "(x, y) \<in> S" by auto  | 
|
2862  | 
then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"  | 
|
2863  | 
using \<open>open S\<close> unfolding open_prod_def by auto  | 
|
2864  | 
from \<open>A \<times> B \<subseteq> S\<close> \<open>x \<in> A\<close> have "B \<subseteq> snd ` S" by (rule subset_snd_imageI)  | 
|
2865  | 
with \<open>open B\<close> \<open>y \<in> B\<close> have "open B \<and> y \<in> B \<and> B \<subseteq> snd ` S" by simp  | 
|
2866  | 
then show "\<exists>T. open T \<and> y \<in> T \<and> T \<subseteq> snd ` S" by - (rule exI)  | 
|
2867  | 
qed  | 
|
2868  | 
||
2869  | 
lemma nhds_prod: "nhds (a, b) = nhds a \<times>\<^sub>F nhds b"  | 
|
2870  | 
unfolding nhds_def  | 
|
2871  | 
proof (subst prod_filter_INF, auto intro!: antisym INF_greatest simp: principal_prod_principal)  | 
|
2872  | 
fix S T assume "open S" "a \<in> S" "open T" "b \<in> T"  | 
|
2873  | 
  then show "(INF x : {S. open S \<and> (a, b) \<in> S}. principal x) \<le> principal (S \<times> T)"
 | 
|
2874  | 
by (intro INF_lower) (auto intro!: open_Times)  | 
|
2875  | 
next  | 
|
2876  | 
fix S' assume "open S'" "(a, b) \<in> S'"  | 
|
2877  | 
then obtain S T where "open S" "a \<in> S" "open T" "b \<in> T" "S \<times> T \<subseteq> S'"  | 
|
2878  | 
by (auto elim: open_prod_elim)  | 
|
2879  | 
  then show "(INF x : {S. open S \<and> a \<in> S}. INF y : {S. open S \<and> b \<in> S}. principal (x \<times> y)) \<le> principal S'"
 | 
|
2880  | 
by (auto intro!: INF_lower2)  | 
|
2881  | 
qed  | 
|
2882  | 
||
2883  | 
subsubsection \<open>Continuity of operations\<close>  | 
|
2884  | 
||
2885  | 
lemma tendsto_fst [tendsto_intros]:  | 
|
2886  | 
assumes "(f \<longlongrightarrow> a) F"  | 
|
2887  | 
shows "((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F"  | 
|
2888  | 
proof (rule topological_tendstoI)  | 
|
2889  | 
fix S assume "open S" and "fst a \<in> S"  | 
|
2890  | 
then have "open (fst -` S)" and "a \<in> fst -` S"  | 
|
2891  | 
by (simp_all add: open_vimage_fst)  | 
|
2892  | 
with assms have "eventually (\<lambda>x. f x \<in> fst -` S) F"  | 
|
2893  | 
by (rule topological_tendstoD)  | 
|
2894  | 
then show "eventually (\<lambda>x. fst (f x) \<in> S) F"  | 
|
2895  | 
by simp  | 
|
2896  | 
qed  | 
|
2897  | 
||
2898  | 
lemma tendsto_snd [tendsto_intros]:  | 
|
2899  | 
assumes "(f \<longlongrightarrow> a) F"  | 
|
2900  | 
shows "((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F"  | 
|
2901  | 
proof (rule topological_tendstoI)  | 
|
2902  | 
fix S assume "open S" and "snd a \<in> S"  | 
|
2903  | 
then have "open (snd -` S)" and "a \<in> snd -` S"  | 
|
2904  | 
by (simp_all add: open_vimage_snd)  | 
|
2905  | 
with assms have "eventually (\<lambda>x. f x \<in> snd -` S) F"  | 
|
2906  | 
by (rule topological_tendstoD)  | 
|
2907  | 
then show "eventually (\<lambda>x. snd (f x) \<in> S) F"  | 
|
2908  | 
by simp  | 
|
2909  | 
qed  | 
|
2910  | 
||
2911  | 
lemma tendsto_Pair [tendsto_intros]:  | 
|
2912  | 
assumes "(f \<longlongrightarrow> a) F" and "(g \<longlongrightarrow> b) F"  | 
|
2913  | 
shows "((\<lambda>x. (f x, g x)) \<longlongrightarrow> (a, b)) F"  | 
|
2914  | 
proof (rule topological_tendstoI)  | 
|
2915  | 
fix S assume "open S" and "(a, b) \<in> S"  | 
|
2916  | 
then obtain A B where "open A" "open B" "a \<in> A" "b \<in> B" "A \<times> B \<subseteq> S"  | 
|
2917  | 
unfolding open_prod_def by fast  | 
|
2918  | 
have "eventually (\<lambda>x. f x \<in> A) F"  | 
|
2919  | 
using \<open>(f \<longlongrightarrow> a) F\<close> \<open>open A\<close> \<open>a \<in> A\<close>  | 
|
2920  | 
by (rule topological_tendstoD)  | 
|
2921  | 
moreover  | 
|
2922  | 
have "eventually (\<lambda>x. g x \<in> B) F"  | 
|
2923  | 
using \<open>(g \<longlongrightarrow> b) F\<close> \<open>open B\<close> \<open>b \<in> B\<close>  | 
|
2924  | 
by (rule topological_tendstoD)  | 
|
2925  | 
ultimately  | 
|
2926  | 
show "eventually (\<lambda>x. (f x, g x) \<in> S) F"  | 
|
2927  | 
by (rule eventually_elim2)  | 
|
2928  | 
(simp add: subsetD [OF \<open>A \<times> B \<subseteq> S\<close>])  | 
|
2929  | 
qed  | 
|
2930  | 
||
2931  | 
lemma continuous_fst[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. fst (f x))"  | 
|
2932  | 
unfolding continuous_def by (rule tendsto_fst)  | 
|
2933  | 
||
2934  | 
lemma continuous_snd[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. snd (f x))"  | 
|
2935  | 
unfolding continuous_def by (rule tendsto_snd)  | 
|
2936  | 
||
2937  | 
lemma continuous_Pair[continuous_intros]: "continuous F f \<Longrightarrow> continuous F g \<Longrightarrow> continuous F (\<lambda>x. (f x, g x))"  | 
|
2938  | 
unfolding continuous_def by (rule tendsto_Pair)  | 
|
2939  | 
||
2940  | 
lemma continuous_on_fst[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. fst (f x))"  | 
|
2941  | 
unfolding continuous_on_def by (auto intro: tendsto_fst)  | 
|
2942  | 
||
2943  | 
lemma continuous_on_snd[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. snd (f x))"  | 
|
2944  | 
unfolding continuous_on_def by (auto intro: tendsto_snd)  | 
|
2945  | 
||
2946  | 
lemma continuous_on_Pair[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> continuous_on s (\<lambda>x. (f x, g x))"  | 
|
2947  | 
unfolding continuous_on_def by (auto intro: tendsto_Pair)  | 
|
2948  | 
||
2949  | 
lemma continuous_on_swap[continuous_intros]: "continuous_on A prod.swap"  | 
|
2950  | 
by (simp add: prod.swap_def continuous_on_fst continuous_on_snd continuous_on_Pair continuous_on_id)  | 
|
2951  | 
||
2952  | 
lemma continuous_on_swap_args:  | 
|
2953  | 
assumes "continuous_on (A\<times>B) (\<lambda>(x,y). d x y)"  | 
|
2954  | 
shows "continuous_on (B\<times>A) (\<lambda>(x,y). d y x)"  | 
|
2955  | 
proof -  | 
|
2956  | 
have "(\<lambda>(x,y). d y x) = (\<lambda>(x,y). d x y) o prod.swap"  | 
|
2957  | 
by force  | 
|
2958  | 
then show ?thesis  | 
|
2959  | 
apply (rule ssubst)  | 
|
2960  | 
apply (rule continuous_on_compose)  | 
|
2961  | 
apply (force intro: continuous_on_subset [OF continuous_on_swap])  | 
|
2962  | 
apply (force intro: continuous_on_subset [OF assms])  | 
|
2963  | 
done  | 
|
2964  | 
qed  | 
|
2965  | 
||
2966  | 
lemma isCont_fst [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. fst (f x)) a"  | 
|
2967  | 
by (fact continuous_fst)  | 
|
2968  | 
||
2969  | 
lemma isCont_snd [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. snd (f x)) a"  | 
|
2970  | 
by (fact continuous_snd)  | 
|
2971  | 
||
2972  | 
lemma isCont_Pair [simp]: "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. (f x, g x)) a"  | 
|
2973  | 
by (fact continuous_Pair)  | 
|
2974  | 
||
2975  | 
subsubsection \<open>Separation axioms\<close>  | 
|
2976  | 
||
2977  | 
instance prod :: (t0_space, t0_space) t0_space  | 
|
2978  | 
proof  | 
|
2979  | 
fix x y :: "'a \<times> 'b" assume "x \<noteq> y"  | 
|
2980  | 
hence "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
2981  | 
by (simp add: prod_eq_iff)  | 
|
2982  | 
thus "\<exists>U. open U \<and> (x \<in> U) \<noteq> (y \<in> U)"  | 
|
2983  | 
by (fast dest: t0_space elim: open_vimage_fst open_vimage_snd)  | 
|
2984  | 
qed  | 
|
2985  | 
||
2986  | 
instance prod :: (t1_space, t1_space) t1_space  | 
|
2987  | 
proof  | 
|
2988  | 
fix x y :: "'a \<times> 'b" assume "x \<noteq> y"  | 
|
2989  | 
hence "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
2990  | 
by (simp add: prod_eq_iff)  | 
|
2991  | 
thus "\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"  | 
|
2992  | 
by (fast dest: t1_space elim: open_vimage_fst open_vimage_snd)  | 
|
2993  | 
qed  | 
|
2994  | 
||
2995  | 
instance prod :: (t2_space, t2_space) t2_space  | 
|
2996  | 
proof  | 
|
2997  | 
fix x y :: "'a \<times> 'b" assume "x \<noteq> y"  | 
|
2998  | 
hence "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
2999  | 
by (simp add: prod_eq_iff)  | 
|
3000  | 
  thus "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
|
3001  | 
by (fast dest: hausdorff elim: open_vimage_fst open_vimage_snd)  | 
|
3002  | 
qed  | 
|
3003  | 
||
3004  | 
lemma isCont_swap[continuous_intros]: "isCont prod.swap a"  | 
|
3005  | 
using continuous_on_eq_continuous_within continuous_on_swap by blast  | 
|
3006  | 
||
3007  | 
end  |