| author | wenzelm | 
| Fri, 01 Nov 2019 18:41:52 +0100 | |
| changeset 70986 | d8a7df9fdd03 | 
| parent 70749 | 5d06b7bb9d22 | 
| child 71063 | d628bbdce79a | 
| 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  | 
|
| 63494 | 9  | 
imports Main  | 
| 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  | 
||
| 63494 | 25  | 
definition closed :: "'a set \<Rightarrow> bool"  | 
26  | 
where "closed S \<longleftrightarrow> open (- S)"  | 
|
| 51471 | 27  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
28  | 
lemma open_empty [continuous_intros, intro, simp]: "open {}"
 | 
| 51471 | 29  | 
  using open_Union [of "{}"] by simp
 | 
30  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
31  | 
lemma open_Un [continuous_intros, intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<union> T)"  | 
| 51471 | 32  | 
  using open_Union [of "{S, T}"] by simp
 | 
33  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
34  | 
lemma open_UN [continuous_intros, intro]: "\<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union>x\<in>A. B x)"  | 
| 56166 | 35  | 
using open_Union [of "B ` A"] by simp  | 
| 51471 | 36  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
37  | 
lemma open_Inter [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)"  | 
| 51471 | 38  | 
by (induct set: finite) auto  | 
39  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
40  | 
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 | 41  | 
using open_Inter [of "B ` A"] by simp  | 
| 51471 | 42  | 
|
| 
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
 | 
43  | 
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
 | 
44  | 
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
 | 
45  | 
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
 | 
46  | 
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
 | 
47  | 
  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
 | 
48  | 
  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
 | 
49  | 
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
 | 
50  | 
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
 | 
51  | 
|
| 63494 | 52  | 
lemma closed_empty [continuous_intros, intro, simp]: "closed {}"
 | 
| 51471 | 53  | 
unfolding closed_def by simp  | 
54  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
55  | 
lemma closed_Un [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)"  | 
| 51471 | 56  | 
unfolding closed_def by auto  | 
57  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
58  | 
lemma closed_UNIV [continuous_intros, intro, simp]: "closed UNIV"  | 
| 51471 | 59  | 
unfolding closed_def by simp  | 
60  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
61  | 
lemma closed_Int [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<inter> T)"  | 
| 51471 | 62  | 
unfolding closed_def by auto  | 
63  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
64  | 
lemma closed_INT [continuous_intros, intro]: "\<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Inter>x\<in>A. B x)"  | 
| 51471 | 65  | 
unfolding closed_def by auto  | 
66  | 
||
| 60585 | 67  | 
lemma closed_Inter [continuous_intros, intro]: "\<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter>K)"  | 
| 51471 | 68  | 
unfolding closed_def uminus_Inf by auto  | 
69  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
70  | 
lemma closed_Union [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. closed T \<Longrightarrow> closed (\<Union>S)"  | 
| 51471 | 71  | 
by (induct set: finite) auto  | 
72  | 
||
| 63494 | 73  | 
lemma closed_UN [continuous_intros, intro]:  | 
74  | 
"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  | 
|
| 63494 | 98  | 
lemma open_Collect_conj:  | 
99  | 
  assumes "open {x. P x}" "open {x. Q x}"
 | 
|
100  | 
  shows "open {x. P x \<and> Q x}"
 | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
101  | 
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
 | 
102  | 
|
| 63494 | 103  | 
lemma open_Collect_disj:  | 
104  | 
  assumes "open {x. P x}" "open {x. Q x}"
 | 
|
105  | 
  shows "open {x. P x \<or> Q x}"
 | 
|
| 
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  | 
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
 | 
107  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
108  | 
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
 | 
109  | 
  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
 | 
110  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
111  | 
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
 | 
112  | 
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
 | 
113  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
114  | 
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
 | 
115  | 
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
 | 
116  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
117  | 
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
 | 
118  | 
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
 | 
119  | 
|
| 63494 | 120  | 
lemma closed_Collect_conj:  | 
121  | 
  assumes "closed {x. P x}" "closed {x. Q x}"
 | 
|
122  | 
  shows "closed {x. P x \<and> Q x}"
 | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
123  | 
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
 | 
124  | 
|
| 63494 | 125  | 
lemma closed_Collect_disj:  | 
126  | 
  assumes "closed {x. P x}" "closed {x. Q x}"
 | 
|
127  | 
  shows "closed {x. P x \<or> Q x}"
 | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
128  | 
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
 | 
129  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
130  | 
lemma closed_Collect_all: "(\<And>i. closed {x. P i x}) \<Longrightarrow> closed {x. \<forall>i. P i x}"
 | 
| 63494 | 131  | 
  using closed_INT[of UNIV "\<lambda>i. {x. P i x}"] by (simp add: Collect_all_eq)
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
132  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
133  | 
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
 | 
134  | 
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
 | 
135  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
136  | 
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
 | 
137  | 
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
 | 
138  | 
|
| 51471 | 139  | 
end  | 
140  | 
||
| 63494 | 141  | 
|
142  | 
subsection \<open>Hausdorff and other separation properties\<close>  | 
|
| 51471 | 143  | 
|
144  | 
class t0_space = topological_space +  | 
|
145  | 
assumes t0_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> \<not> (x \<in> U \<longleftrightarrow> y \<in> U)"  | 
|
146  | 
||
147  | 
class t1_space = topological_space +  | 
|
148  | 
assumes t1_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"  | 
|
149  | 
||
150  | 
instance t1_space \<subseteq> t0_space  | 
|
| 63494 | 151  | 
by standard (fast dest: t1_space)  | 
152  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
153  | 
context t1_space begin  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
154  | 
|
| 63494 | 155  | 
lemma separation_t1: "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)"  | 
| 51471 | 156  | 
using t1_space[of x y] by blast  | 
157  | 
||
| 63494 | 158  | 
lemma closed_singleton [iff]: "closed {a}"
 | 
| 51471 | 159  | 
proof -  | 
160  | 
  let ?T = "\<Union>{S. open S \<and> a \<notin> S}"
 | 
|
| 63494 | 161  | 
have "open ?T"  | 
162  | 
by (simp add: open_Union)  | 
|
| 51471 | 163  | 
  also have "?T = - {a}"
 | 
| 63494 | 164  | 
by (auto simp add: set_eq_iff separation_t1)  | 
165  | 
  finally show "closed {a}"
 | 
|
166  | 
by (simp only: closed_def)  | 
|
| 51471 | 167  | 
qed  | 
168  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
169  | 
lemma closed_insert [continuous_intros, simp]:  | 
| 63494 | 170  | 
assumes "closed S"  | 
171  | 
shows "closed (insert a S)"  | 
|
| 51471 | 172  | 
proof -  | 
| 63494 | 173  | 
  from closed_singleton assms have "closed ({a} \<union> S)"
 | 
174  | 
by (rule closed_Un)  | 
|
175  | 
then show "closed (insert a S)"  | 
|
176  | 
by simp  | 
|
| 51471 | 177  | 
qed  | 
178  | 
||
| 63494 | 179  | 
lemma finite_imp_closed: "finite S \<Longrightarrow> closed S"  | 
180  | 
by (induct pred: finite) simp_all  | 
|
181  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
182  | 
end  | 
| 51471 | 183  | 
|
| 60758 | 184  | 
text \<open>T2 spaces are also known as Hausdorff spaces.\<close>  | 
| 51471 | 185  | 
|
186  | 
class t2_space = topological_space +  | 
|
187  | 
  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 = {}"
 | 
|
188  | 
||
189  | 
instance t2_space \<subseteq> t1_space  | 
|
| 63494 | 190  | 
by standard (fast dest: hausdorff)  | 
191  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
192  | 
lemma (in t2_space) separation_t2: "x \<noteq> y \<longleftrightarrow> (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})"
 | 
| 63494 | 193  | 
using hausdorff [of x y] by blast  | 
194  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
195  | 
lemma (in t0_space) separation_t0: "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> \<not> (x \<in> U \<longleftrightarrow> y \<in> U))"  | 
| 63494 | 196  | 
using t0_space [of x y] by blast  | 
197  | 
||
| 51471 | 198  | 
|
| 67454 | 199  | 
text \<open>A classical separation axiom for topological space, the T3 axiom -- also called regularity:  | 
200  | 
if a point is not in a closed set, then there are open sets separating them.\<close>  | 
|
201  | 
||
202  | 
class t3_space = t2_space +  | 
|
203  | 
  assumes t3_space: "closed S \<Longrightarrow> y \<notin> S \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> y \<in> U \<and> S \<subseteq> V \<and> U \<inter> V = {}"
 | 
|
204  | 
||
205  | 
text \<open>A classical separation axiom for topological space, the T4 axiom -- also called normality:  | 
|
206  | 
if two closed sets are disjoint, then there are open sets separating them.\<close>  | 
|
207  | 
||
208  | 
class t4_space = t2_space +  | 
|
209  | 
  assumes t4_space: "closed S \<Longrightarrow> closed T \<Longrightarrow> S \<inter> T = {} \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> S \<subseteq> U \<and> T \<subseteq> V \<and> U \<inter> V = {}"
 | 
|
210  | 
||
211  | 
text \<open>T4 is stronger than T3, and weaker than metric.\<close>  | 
|
212  | 
||
213  | 
instance t4_space \<subseteq> t3_space  | 
|
214  | 
proof  | 
|
215  | 
fix S and y::'a assume "closed S" "y \<notin> S"  | 
|
216  | 
  then show "\<exists>U V. open U \<and> open V \<and> y \<in> U \<and> S \<subseteq> V \<and> U \<inter> V = {}"
 | 
|
217  | 
    using t4_space[of "{y}" S] by auto
 | 
|
218  | 
qed  | 
|
219  | 
||
| 60758 | 220  | 
text \<open>A perfect space is a topological space with no isolated points.\<close>  | 
| 51471 | 221  | 
|
222  | 
class perfect_space = topological_space +  | 
|
223  | 
  assumes not_open_singleton: "\<not> open {x}"
 | 
|
224  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
225  | 
lemma (in perfect_space) UNIV_not_singleton: "UNIV \<noteq> {x}"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
226  | 
for x::'a  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
227  | 
by (metis (no_types) open_UNIV not_open_singleton)  | 
| 
62381
 
a6479cb85944
New and revised material for (multivariate) analysis
 
paulson <lp15@cam.ac.uk> 
parents: 
62369 
diff
changeset
 | 
228  | 
|
| 51471 | 229  | 
|
| 60758 | 230  | 
subsection \<open>Generators for toplogies\<close>  | 
| 51471 | 231  | 
|
| 63494 | 232  | 
inductive generate_topology :: "'a set set \<Rightarrow> 'a set \<Rightarrow> bool" for S :: "'a set set"  | 
233  | 
where  | 
|
234  | 
UNIV: "generate_topology S UNIV"  | 
|
235  | 
| Int: "generate_topology S (a \<inter> b)" if "generate_topology S a" and "generate_topology S b"  | 
|
236  | 
| UN: "generate_topology S (\<Union>K)" if "(\<And>k. k \<in> K \<Longrightarrow> generate_topology S k)"  | 
|
237  | 
| Basis: "generate_topology S s" if "s \<in> S"  | 
|
| 51471 | 238  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
239  | 
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
 | 
240  | 
|
| 
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
241  | 
lemma generate_topology_Union:  | 
| 51471 | 242  | 
"(\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union>k\<in>I. K k)"  | 
| 56166 | 243  | 
using generate_topology.UN [of "K ` I"] by auto  | 
| 51471 | 244  | 
|
| 63494 | 245  | 
lemma topological_space_generate_topology: "class.topological_space (generate_topology S)"  | 
| 61169 | 246  | 
by standard (auto intro: generate_topology.intros)  | 
| 51471 | 247  | 
|
| 63494 | 248  | 
|
| 60758 | 249  | 
subsection \<open>Order topologies\<close>  | 
| 51471 | 250  | 
|
251  | 
class order_topology = order + "open" +  | 
|
252  | 
  assumes open_generated_order: "open = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
253  | 
begin  | 
|
254  | 
||
255  | 
subclass topological_space  | 
|
256  | 
unfolding open_generated_order  | 
|
257  | 
by (rule topological_space_generate_topology)  | 
|
258  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
259  | 
lemma open_greaterThan [continuous_intros, simp]: "open {a <..}"
 | 
| 51471 | 260  | 
unfolding open_generated_order by (auto intro: generate_topology.Basis)  | 
261  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
262  | 
lemma open_lessThan [continuous_intros, simp]: "open {..< a}"
 | 
| 51471 | 263  | 
unfolding open_generated_order by (auto intro: generate_topology.Basis)  | 
264  | 
||
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
265  | 
lemma open_greaterThanLessThan [continuous_intros, simp]: "open {a <..< b}"
 | 
| 51471 | 266  | 
unfolding greaterThanLessThan_eq by (simp add: open_Int)  | 
267  | 
||
268  | 
end  | 
|
269  | 
||
270  | 
class linorder_topology = linorder + order_topology  | 
|
271  | 
||
| 63494 | 272  | 
lemma closed_atMost [continuous_intros, simp]: "closed {..a}"
 | 
273  | 
for a :: "'a::linorder_topology"  | 
|
| 51471 | 274  | 
by (simp add: closed_open)  | 
275  | 
||
| 63494 | 276  | 
lemma closed_atLeast [continuous_intros, simp]: "closed {a..}"
 | 
277  | 
for a :: "'a::linorder_topology"  | 
|
| 51471 | 278  | 
by (simp add: closed_open)  | 
279  | 
||
| 63494 | 280  | 
lemma closed_atLeastAtMost [continuous_intros, simp]: "closed {a..b}"
 | 
281  | 
for a b :: "'a::linorder_topology"  | 
|
| 51471 | 282  | 
proof -  | 
283  | 
  have "{a .. b} = {a ..} \<inter> {.. b}"
 | 
|
284  | 
by auto  | 
|
285  | 
then show ?thesis  | 
|
286  | 
by (simp add: closed_Int)  | 
|
287  | 
qed  | 
|
288  | 
||
| 
70749
 
5d06b7bb9d22
More type class generalisations. Note that linorder_antisym_conv1 and linorder_antisym_conv2 no longer exist.
 
paulson <lp15@cam.ac.uk> 
parents: 
70723 
diff
changeset
 | 
289  | 
lemma (in order) less_separate:  | 
| 51471 | 290  | 
assumes "x < y"  | 
291  | 
  shows "\<exists>a b. x \<in> {..< a} \<and> y \<in> {b <..} \<and> {..< a} \<inter> {b <..} = {}"
 | 
|
| 53381 | 292  | 
proof (cases "\<exists>z. x < z \<and> z < y")  | 
293  | 
case True  | 
|
294  | 
then obtain z where "x < z \<and> z < y" ..  | 
|
| 51471 | 295  | 
  then have "x \<in> {..< z} \<and> y \<in> {z <..} \<and> {z <..} \<inter> {..< z} = {}"
 | 
296  | 
by auto  | 
|
297  | 
then show ?thesis by blast  | 
|
298  | 
next  | 
|
| 53381 | 299  | 
case False  | 
| 63494 | 300  | 
  with \<open>x < y\<close> have "x \<in> {..< y}" "y \<in> {x <..}" "{x <..} \<inter> {..< y} = {}"
 | 
| 51471 | 301  | 
by auto  | 
302  | 
then show ?thesis by blast  | 
|
303  | 
qed  | 
|
304  | 
||
305  | 
instance linorder_topology \<subseteq> t2_space  | 
|
306  | 
proof  | 
|
307  | 
fix x y :: 'a  | 
|
308  | 
  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 = {}"
 | 
|
| 63494 | 309  | 
using less_separate [of x y] less_separate [of y x]  | 
310  | 
by (elim neqE; metis open_lessThan open_greaterThan Int_commute)  | 
|
| 51471 | 311  | 
qed  | 
312  | 
||
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
313  | 
lemma (in linorder_topology) open_right:  | 
| 63494 | 314  | 
assumes "open S" "x \<in> S"  | 
315  | 
and gt_ex: "x < y"  | 
|
316  | 
  shows "\<exists>b>x. {x ..< b} \<subseteq> S"
 | 
|
317  | 
using assms unfolding open_generated_order  | 
|
318  | 
proof induct  | 
|
319  | 
case UNIV  | 
|
320  | 
then show ?case by blast  | 
|
321  | 
next  | 
|
322  | 
case (Int A B)  | 
|
323  | 
  then obtain a b where "a > x" "{x ..< a} \<subseteq> A"  "b > x" "{x ..< b} \<subseteq> B"
 | 
|
324  | 
by auto  | 
|
325  | 
then show ?case  | 
|
326  | 
by (auto intro!: exI[of _ "min a b"])  | 
|
327  | 
next  | 
|
328  | 
case UN  | 
|
329  | 
then show ?case by blast  | 
|
330  | 
next  | 
|
331  | 
case Basis  | 
|
332  | 
then show ?case  | 
|
333  | 
by (fastforce intro: exI[of _ y] gt_ex)  | 
|
334  | 
qed  | 
|
335  | 
||
336  | 
lemma (in linorder_topology) open_left:  | 
|
337  | 
assumes "open S" "x \<in> S"  | 
|
338  | 
and lt_ex: "y < x"  | 
|
339  | 
  shows "\<exists>b<x. {b <.. x} \<subseteq> S"
 | 
|
| 51471 | 340  | 
using assms unfolding open_generated_order  | 
341  | 
proof induction  | 
|
| 63494 | 342  | 
case UNIV  | 
343  | 
then show ?case by blast  | 
|
344  | 
next  | 
|
| 51471 | 345  | 
case (Int A B)  | 
| 63494 | 346  | 
  then obtain a b where "a < x" "{a <.. x} \<subseteq> A"  "b < x" "{b <.. x} \<subseteq> B"
 | 
347  | 
by auto  | 
|
348  | 
then show ?case  | 
|
349  | 
by (auto intro!: exI[of _ "max a b"])  | 
|
| 51471 | 350  | 
next  | 
| 63494 | 351  | 
case UN  | 
352  | 
then show ?case by blast  | 
|
| 51471 | 353  | 
next  | 
| 63494 | 354  | 
case Basis  | 
355  | 
then show ?case  | 
|
356  | 
by (fastforce intro: exI[of _ y] lt_ex)  | 
|
357  | 
qed  | 
|
358  | 
||
| 51471 | 359  | 
|
| 62369 | 360  | 
subsection \<open>Setup some topologies\<close>  | 
361  | 
||
| 60758 | 362  | 
subsubsection \<open>Boolean is an order topology\<close>  | 
| 59106 | 363  | 
|
| 62369 | 364  | 
class discrete_topology = topological_space +  | 
365  | 
assumes open_discrete: "\<And>A. open A"  | 
|
366  | 
||
367  | 
instance discrete_topology < t2_space  | 
|
368  | 
proof  | 
|
| 63494 | 369  | 
fix x y :: 'a  | 
370  | 
assume "x \<noteq> y"  | 
|
371  | 
  then show "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
|
| 62369 | 372  | 
    by (intro exI[of _ "{_}"]) (auto intro!: open_discrete)
 | 
373  | 
qed  | 
|
374  | 
||
375  | 
instantiation bool :: linorder_topology  | 
|
| 59106 | 376  | 
begin  | 
377  | 
||
| 63494 | 378  | 
definition open_bool :: "bool set \<Rightarrow> bool"  | 
379  | 
  where "open_bool = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
| 59106 | 380  | 
|
381  | 
instance  | 
|
| 63494 | 382  | 
by standard (rule open_bool_def)  | 
| 59106 | 383  | 
|
384  | 
end  | 
|
385  | 
||
| 62369 | 386  | 
instance bool :: discrete_topology  | 
387  | 
proof  | 
|
388  | 
fix A :: "bool set"  | 
|
| 59106 | 389  | 
  have *: "{False <..} = {True}" "{..< True} = {False}"
 | 
390  | 
by auto  | 
|
391  | 
  have "A = UNIV \<or> A = {} \<or> A = {False <..} \<or> A = {..< True}"
 | 
|
| 63171 | 392  | 
using subset_UNIV[of A] unfolding UNIV_bool * by blast  | 
| 59106 | 393  | 
then show "open A"  | 
394  | 
by auto  | 
|
395  | 
qed  | 
|
396  | 
||
| 62369 | 397  | 
instantiation nat :: linorder_topology  | 
398  | 
begin  | 
|
399  | 
||
| 63494 | 400  | 
definition open_nat :: "nat set \<Rightarrow> bool"  | 
401  | 
  where "open_nat = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
| 62369 | 402  | 
|
403  | 
instance  | 
|
| 63494 | 404  | 
by standard (rule open_nat_def)  | 
| 62369 | 405  | 
|
406  | 
end  | 
|
407  | 
||
408  | 
instance nat :: discrete_topology  | 
|
409  | 
proof  | 
|
410  | 
fix A :: "nat set"  | 
|
411  | 
  have "open {n}" for n :: nat
 | 
|
412  | 
proof (cases n)  | 
|
413  | 
case 0  | 
|
414  | 
    moreover have "{0} = {..<1::nat}"
 | 
|
415  | 
by auto  | 
|
416  | 
ultimately show ?thesis  | 
|
417  | 
by auto  | 
|
418  | 
next  | 
|
419  | 
case (Suc n')  | 
|
| 63494 | 420  | 
    then have "{n} = {..<Suc n} \<inter> {n' <..}"
 | 
| 62369 | 421  | 
by auto  | 
| 63494 | 422  | 
with Suc show ?thesis  | 
| 62369 | 423  | 
by (auto intro: open_lessThan open_greaterThan)  | 
424  | 
qed  | 
|
425  | 
  then have "open (\<Union>a\<in>A. {a})"
 | 
|
426  | 
by (intro open_UN) auto  | 
|
427  | 
then show "open A"  | 
|
428  | 
by simp  | 
|
429  | 
qed  | 
|
430  | 
||
431  | 
instantiation int :: linorder_topology  | 
|
432  | 
begin  | 
|
433  | 
||
| 63494 | 434  | 
definition open_int :: "int set \<Rightarrow> bool"  | 
435  | 
  where "open_int = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))"
 | 
|
| 62369 | 436  | 
|
437  | 
instance  | 
|
| 63494 | 438  | 
by standard (rule open_int_def)  | 
| 62369 | 439  | 
|
440  | 
end  | 
|
441  | 
||
442  | 
instance int :: discrete_topology  | 
|
443  | 
proof  | 
|
444  | 
fix A :: "int set"  | 
|
445  | 
  have "{..<i + 1} \<inter> {i-1 <..} = {i}" for i :: int
 | 
|
446  | 
by auto  | 
|
447  | 
  then have "open {i}" for i :: int
 | 
|
448  | 
using open_Int[OF open_lessThan[of "i + 1"] open_greaterThan[of "i - 1"]] by auto  | 
|
449  | 
  then have "open (\<Union>a\<in>A. {a})"
 | 
|
450  | 
by (intro open_UN) auto  | 
|
451  | 
then show "open A"  | 
|
452  | 
by simp  | 
|
453  | 
qed  | 
|
454  | 
||
| 63494 | 455  | 
|
| 60758 | 456  | 
subsubsection \<open>Topological filters\<close>  | 
| 51471 | 457  | 
|
458  | 
definition (in topological_space) nhds :: "'a \<Rightarrow> 'a filter"  | 
|
| 68802 | 459  | 
  where "nhds a = (INF S\<in>{S. open S \<and> a \<in> S}. principal S)"
 | 
| 51471 | 460  | 
|
| 63494 | 461  | 
definition (in topological_space) at_within :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a filter"  | 
462  | 
    ("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
 | 
463  | 
  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
 | 
464  | 
|
| 63494 | 465  | 
abbreviation (in topological_space) at :: "'a \<Rightarrow> 'a filter"  ("at")
 | 
466  | 
where "at x \<equiv> at x within (CONST UNIV)"  | 
|
467  | 
||
468  | 
abbreviation (in order_topology) at_right :: "'a \<Rightarrow> 'a filter"  | 
|
469  | 
  where "at_right x \<equiv> at x within {x <..}"
 | 
|
470  | 
||
471  | 
abbreviation (in order_topology) at_left :: "'a \<Rightarrow> 'a filter"  | 
|
472  | 
  where "at_left x \<equiv> at x within {..< x}"
 | 
|
| 51471 | 473  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
474  | 
lemma (in topological_space) nhds_generated_topology:  | 
| 68802 | 475  | 
  "open = generate_topology T \<Longrightarrow> nhds x = (INF S\<in>{S\<in>T. x \<in> S}. principal S)"
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
476  | 
unfolding nhds_def  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
477  | 
proof (safe intro!: antisym INF_greatest)  | 
| 63494 | 478  | 
fix S  | 
479  | 
assume "generate_topology T S" "x \<in> S"  | 
|
| 68802 | 480  | 
  then show "(INF S\<in>{S \<in> T. x \<in> S}. principal S) \<le> principal S"
 | 
| 63494 | 481  | 
by induct  | 
482  | 
(auto intro: INF_lower order_trans simp: inf_principal[symmetric] simp del: inf_principal)  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
483  | 
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
 | 
484  | 
|
| 51473 | 485  | 
lemma (in topological_space) eventually_nhds:  | 
| 51471 | 486  | 
"eventually P (nhds a) \<longleftrightarrow> (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))"  | 
| 57276 | 487  | 
unfolding nhds_def by (subst eventually_INF_base) (auto simp: eventually_principal)  | 
| 51471 | 488  | 
|
| 
65036
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
489  | 
lemma eventually_eventually:  | 
| 64969 | 490  | 
"eventually (\<lambda>y. eventually P (nhds y)) (nhds x) = eventually P (nhds x)"  | 
| 
65036
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
491  | 
by (auto simp: eventually_nhds)  | 
| 64969 | 492  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
493  | 
lemma (in topological_space) eventually_nhds_in_open:  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
494  | 
"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
 | 
495  | 
by (subst eventually_nhds) blast  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
496  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
497  | 
lemma (in topological_space) eventually_nhds_x_imp_x: "eventually P (nhds x) \<Longrightarrow> P x"  | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
498  | 
by (subst (asm) eventually_nhds) blast  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
499  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
500  | 
lemma (in topological_space) nhds_neq_bot [simp]: "nhds a \<noteq> bot"  | 
| 63494 | 501  | 
by (simp add: trivial_limit_def eventually_nhds)  | 
502  | 
||
503  | 
lemma (in t1_space) t1_space_nhds: "x \<noteq> y \<Longrightarrow> (\<forall>\<^sub>F x in nhds x. x \<noteq> y)"  | 
|
| 
60182
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
504  | 
by (drule t1_space) (auto simp: eventually_nhds)  | 
| 
 
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
 
hoelzl 
parents: 
60172 
diff
changeset
 | 
505  | 
|
| 62369 | 506  | 
lemma (in topological_space) nhds_discrete_open: "open {x} \<Longrightarrow> nhds x = principal {x}"
 | 
507  | 
  by (auto simp: nhds_def intro!: antisym INF_greatest INF_lower2[of "{x}"])
 | 
|
508  | 
||
509  | 
lemma (in discrete_topology) nhds_discrete: "nhds x = principal {x}"
 | 
|
510  | 
by (simp add: nhds_discrete_open open_discrete)  | 
|
511  | 
||
512  | 
lemma (in discrete_topology) at_discrete: "at x within S = bot"  | 
|
513  | 
unfolding at_within_def nhds_discrete by simp  | 
|
514  | 
||
| 
68860
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
515  | 
lemma (in discrete_topology) tendsto_discrete:  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
516  | 
"filterlim (f :: 'b \<Rightarrow> 'a) (nhds y) F \<longleftrightarrow> eventually (\<lambda>x. f x = y) F"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
517  | 
by (auto simp: nhds_discrete filterlim_principal)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
518  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
519  | 
lemma (in topological_space) at_within_eq:  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
520  | 
  "at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
 | 
| 63494 | 521  | 
unfolding nhds_def at_within_def  | 
522  | 
by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib)  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
523  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
524  | 
lemma (in topological_space) eventually_at_filter:  | 
| 
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
 | 
525  | 
"eventually P (at a within s) \<longleftrightarrow> eventually (\<lambda>x. x \<noteq> a \<longrightarrow> x \<in> s \<longrightarrow> P x) (nhds a)"  | 
| 63494 | 526  | 
by (simp add: at_within_def eventually_inf_principal imp_conjL[symmetric] conj_commute)  | 
| 
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
 | 
527  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
528  | 
lemma (in topological_space) at_le: "s \<subseteq> t \<Longrightarrow> at x within s \<le> 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
 | 
529  | 
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
 | 
530  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
531  | 
lemma (in topological_space) 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
 | 
532  | 
"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))"  | 
| 63494 | 533  | 
by (simp add: eventually_nhds eventually_at_filter)  | 
| 51471 | 534  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
535  | 
lemma (in topological_space) 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
 | 
536  | 
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
 | 
537  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
538  | 
lemma (in topological_space) at_within_open_NO_MATCH:  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
539  | 
"a \<in> s \<Longrightarrow> open s \<Longrightarrow> NO_MATCH UNIV s \<Longrightarrow> at a within s = at a"  | 
| 61234 | 540  | 
by (simp only: at_within_open)  | 
541  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
542  | 
lemma (in topological_space) at_within_open_subset:  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
543  | 
"a \<in> S \<Longrightarrow> open S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> at a within T = at a"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
544  | 
by (metis at_le at_within_open dual_order.antisym subset_UNIV)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
545  | 
|
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
546  | 
lemma (in topological_space) at_within_nhd:  | 
| 61245 | 547  | 
  assumes "x \<in> S" "open S" "T \<inter> S - {x} = U \<inter> S - {x}"
 | 
548  | 
shows "at x within T = at x within U"  | 
|
549  | 
unfolding filter_eq_iff eventually_at_filter  | 
|
550  | 
proof (intro allI eventually_subst)  | 
|
551  | 
have "eventually (\<lambda>x. x \<in> S) (nhds x)"  | 
|
552  | 
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
 | 
553  | 
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 | 554  | 
    by eventually_elim (insert \<open>T \<inter> S - {x} = U \<inter> S - {x}\<close>, blast)
 | 
555  | 
qed  | 
|
556  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
557  | 
lemma (in topological_space) at_within_empty [simp]: "at a within {} = bot"
 | 
| 53859 | 558  | 
unfolding at_within_def by simp  | 
559  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
560  | 
lemma (in topological_space) at_within_union:  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
561  | 
"at x within (S \<union> T) = sup (at x within S) (at x within T)"  | 
| 53860 | 562  | 
unfolding filter_eq_iff eventually_sup eventually_at_filter  | 
563  | 
by (auto elim!: eventually_rev_mp)  | 
|
564  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
565  | 
lemma (in topological_space) at_eq_bot_iff: "at a = bot \<longleftrightarrow> open {a}"
 | 
| 51471 | 566  | 
unfolding trivial_limit_def eventually_at_topological  | 
| 63494 | 567  | 
apply safe  | 
568  | 
   apply (case_tac "S = {a}")
 | 
|
569  | 
apply simp  | 
|
570  | 
apply fast  | 
|
571  | 
apply fast  | 
|
572  | 
done  | 
|
573  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
574  | 
lemma (in perfect_space) at_neq_bot [simp]: "at a \<noteq> bot"  | 
| 51471 | 575  | 
by (simp add: at_eq_bot_iff not_open_singleton)  | 
576  | 
||
| 63494 | 577  | 
lemma (in order_topology) nhds_order:  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
578  | 
  "nhds x = inf (INF a\<in>{x <..}. principal {..< a}) (INF a\<in>{..< x}. principal {a <..})"
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
579  | 
proof -  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
580  | 
  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
 | 
581  | 
      (\<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
 | 
582  | 
by auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
583  | 
show ?thesis  | 
| 63494 | 584  | 
by (simp only: nhds_generated_topology[OF open_generated_order] INF_union 1 INF_image comp_def)  | 
| 51471 | 585  | 
qed  | 
586  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
587  | 
lemma (in topological_space) filterlim_at_within_If:  | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
588  | 
  assumes "filterlim f G (at x within (A \<inter> {x. P x}))"
 | 
| 63494 | 589  | 
    and "filterlim g G (at x within (A \<inter> {x. \<not>P x}))"
 | 
590  | 
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x within A)"  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
591  | 
proof (rule filterlim_If)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
592  | 
note assms(1)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
593  | 
  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
 | 
594  | 
by (simp add: at_within_def)  | 
| 63494 | 595  | 
  also have "A \<inter> Collect P - {x} = (A - {x}) \<inter> Collect P"
 | 
596  | 
by blast  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
597  | 
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
 | 
598  | 
by (simp add: at_within_def inf_assoc)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
599  | 
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
 | 
600  | 
next  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
601  | 
note assms(2)  | 
| 63494 | 602  | 
  also have "at x within (A \<inter> {x. \<not> P x}) = inf (nhds x) (principal (A \<inter> {x. \<not> P x} - {x}))"
 | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
603  | 
by (simp add: at_within_def)  | 
| 63494 | 604  | 
  also have "A \<inter> {x. \<not> P x} - {x} = (A - {x}) \<inter> {x. \<not> P x}"
 | 
605  | 
by blast  | 
|
606  | 
  also have "inf (nhds x) (principal \<dots>) = inf (at x within A) (principal {x. \<not> P x})"
 | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
607  | 
by (simp add: at_within_def inf_assoc)  | 
| 63494 | 608  | 
  finally show "filterlim g G (inf (at x within A) (principal {x. \<not> P x}))" .
 | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
609  | 
qed  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
610  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
611  | 
lemma (in topological_space) filterlim_at_If:  | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
612  | 
  assumes "filterlim f G (at x within {x. P x})"
 | 
| 63494 | 613  | 
    and "filterlim g G (at x within {x. \<not>P x})"
 | 
614  | 
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x)"  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
615  | 
using assms by (intro filterlim_at_within_If) simp_all  | 
| 63494 | 616  | 
lemma (in linorder_topology) at_within_order:  | 
617  | 
  assumes "UNIV \<noteq> {x}"
 | 
|
618  | 
shows "at x within s =  | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
619  | 
    inf (INF a\<in>{x <..}. principal ({..< a} \<inter> s - {x}))
 | 
| 
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
620  | 
        (INF a\<in>{..< x}. principal ({a <..} \<inter> s - {x}))"
 | 
| 63494 | 621  | 
proof (cases "{x <..} = {}" "{..< x} = {}" rule: case_split [case_product case_split])
 | 
622  | 
case True_True  | 
|
623  | 
  have "UNIV = {..< x} \<union> {x} \<union> {x <..}"
 | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
624  | 
by auto  | 
| 63494 | 625  | 
with assms True_True show ?thesis  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
626  | 
by auto  | 
| 63494 | 627  | 
qed (auto simp del: inf_principal simp: at_within_def nhds_order Int_Diff  | 
628  | 
inf_principal[symmetric] INF_inf_const2 inf_sup_aci[where 'a="'a filter"])  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
629  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
630  | 
lemma (in linorder_topology) at_left_eq:  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
631  | 
  "y < x \<Longrightarrow> at_left x = (INF a\<in>{..< x}. principal {a <..< x})"
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
632  | 
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
 | 
633  | 
(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
 | 
634  | 
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
 | 
635  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
636  | 
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
 | 
637  | 
"y < x \<Longrightarrow> eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"  | 
| 63494 | 638  | 
unfolding at_left_eq  | 
639  | 
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
640  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
641  | 
lemma (in linorder_topology) at_right_eq:  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
642  | 
  "x < y \<Longrightarrow> at_right x = (INF a\<in>{x <..}. principal {x <..< a})"
 | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
643  | 
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
 | 
644  | 
(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
 | 
645  | 
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
 | 
646  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
647  | 
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
 | 
648  | 
"x < y \<Longrightarrow> eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"  | 
| 63494 | 649  | 
unfolding at_right_eq  | 
650  | 
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)  | 
|
| 51471 | 651  | 
|
| 62083 | 652  | 
lemma eventually_at_right_less: "\<forall>\<^sub>F y in at_right (x::'a::{linorder_topology, no_top}). x < y"
 | 
653  | 
using gt_ex[of x] eventually_at_right[of x] by auto  | 
|
654  | 
||
| 63494 | 655  | 
lemma trivial_limit_at_right_top: "at_right (top::_::{order_top,linorder_topology}) = bot"
 | 
656  | 
by (auto simp: filter_eq_iff eventually_at_topological)  | 
|
657  | 
||
658  | 
lemma trivial_limit_at_left_bot: "at_left (bot::_::{order_bot,linorder_topology}) = bot"
 | 
|
659  | 
by (auto simp: filter_eq_iff eventually_at_topological)  | 
|
660  | 
||
661  | 
lemma trivial_limit_at_left_real [simp]: "\<not> trivial_limit (at_left x)"  | 
|
662  | 
  for x :: "'a::{no_bot,dense_order,linorder_topology}"
 | 
|
663  | 
using lt_ex [of x]  | 
|
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
664  | 
by safe (auto simp add: trivial_limit_def eventually_at_left dest: dense)  | 
| 51471 | 665  | 
|
| 63494 | 666  | 
lemma trivial_limit_at_right_real [simp]: "\<not> trivial_limit (at_right x)"  | 
667  | 
  for x :: "'a::{no_top,dense_order,linorder_topology}"
 | 
|
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
57025 
diff
changeset
 | 
668  | 
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
 | 
669  | 
by safe (auto simp add: trivial_limit_def eventually_at_right dest: dense)  | 
| 51471 | 670  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
671  | 
lemma (in linorder_topology) at_eq_sup_left_right: "at x = 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
 | 
672  | 
by (auto simp: eventually_at_filter filter_eq_iff eventually_sup  | 
| 63494 | 673  | 
elim: eventually_elim2 eventually_mono)  | 
| 51471 | 674  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
675  | 
lemma (in linorder_topology) eventually_at_split:  | 
| 63494 | 676  | 
"eventually P (at x) \<longleftrightarrow> eventually P (at_left x) \<and> eventually P (at_right x)"  | 
| 51471 | 677  | 
by (subst at_eq_sup_left_right) (simp add: eventually_sup)  | 
678  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
679  | 
lemma (in order_topology) eventually_at_leftI:  | 
| 63713 | 680  | 
  assumes "\<And>x. x \<in> {a<..<b} \<Longrightarrow> P x" "a < b"
 | 
681  | 
shows "eventually P (at_left b)"  | 
|
682  | 
  using assms unfolding eventually_at_topological by (intro exI[of _ "{a<..}"]) auto
 | 
|
683  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
684  | 
lemma (in order_topology) eventually_at_rightI:  | 
| 63713 | 685  | 
  assumes "\<And>x. x \<in> {a<..<b} \<Longrightarrow> P x" "a < b"
 | 
686  | 
shows "eventually P (at_right a)"  | 
|
687  | 
  using assms unfolding eventually_at_topological by (intro exI[of _ "{..<b}"]) auto
 | 
|
688  | 
||
| 66162 | 689  | 
lemma eventually_filtercomap_nhds:  | 
690  | 
"eventually P (filtercomap f (nhds x)) \<longleftrightarrow> (\<exists>S. open S \<and> x \<in> S \<and> (\<forall>x. f x \<in> S \<longrightarrow> P x))"  | 
|
691  | 
unfolding eventually_filtercomap eventually_nhds by auto  | 
|
692  | 
||
693  | 
lemma eventually_filtercomap_at_topological:  | 
|
694  | 
"eventually P (filtercomap f (at A within B)) \<longleftrightarrow>  | 
|
695  | 
     (\<exists>S. open S \<and> A \<in> S \<and> (\<forall>x. f x \<in> S \<inter> B - {A} \<longrightarrow> P x))" (is "?lhs = ?rhs")
 | 
|
696  | 
unfolding at_within_def filtercomap_inf eventually_inf_principal filtercomap_principal  | 
|
697  | 
eventually_filtercomap_nhds eventually_principal by blast  | 
|
| 
67685
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
698  | 
|
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
699  | 
lemma eventually_at_right_field:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
700  | 
"eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
701  | 
  for x :: "'a::{linordered_field, linorder_topology}"
 | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
702  | 
using linordered_field_no_ub[rule_format, of x]  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
703  | 
by (auto simp: eventually_at_right)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
704  | 
|
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
705  | 
lemma eventually_at_left_field:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
706  | 
"eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
707  | 
  for x :: "'a::{linordered_field, linorder_topology}"
 | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
708  | 
using linordered_field_no_lb[rule_format, of x]  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
709  | 
by (auto simp: eventually_at_left)  | 
| 66162 | 710  | 
|
| 63494 | 711  | 
|
| 60758 | 712  | 
subsubsection \<open>Tendsto\<close>  | 
| 51471 | 713  | 
|
714  | 
abbreviation (in topological_space)  | 
|
| 63494 | 715  | 
  tendsto :: "('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b filter \<Rightarrow> bool"  (infixr "\<longlongrightarrow>" 55)
 | 
716  | 
where "(f \<longlongrightarrow> l) F \<equiv> filterlim f (nhds l) F"  | 
|
717  | 
||
718  | 
definition (in t2_space) Lim :: "'f filter \<Rightarrow> ('f \<Rightarrow> 'a) \<Rightarrow> 'a"
 | 
|
719  | 
where "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
 | 
720  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
721  | 
lemma (in topological_space) tendsto_eq_rhs: "(f \<longlongrightarrow> x) F \<Longrightarrow> x = y \<Longrightarrow> (f \<longlongrightarrow> y) F"  | 
| 51471 | 722  | 
by simp  | 
723  | 
||
| 57953 | 724  | 
named_theorems tendsto_intros "introduction rules for tendsto"  | 
| 60758 | 725  | 
setup \<open>  | 
| 67149 | 726  | 
Global_Theory.add_thms_dynamic (\<^binding>\<open>tendsto_eq_intros\<close>,  | 
| 57953 | 727  | 
fn context =>  | 
| 69593 | 728  | 
Named_Theorems.get (Context.proof_of context) \<^named_theorems>\<open>tendsto_intros\<close>  | 
| 57953 | 729  | 
      |> map_filter (try (fn thm => @{thm tendsto_eq_rhs} OF [thm])))
 | 
| 60758 | 730  | 
\<close>  | 
| 51471 | 731  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
732  | 
context topological_space begin  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
733  | 
|
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
734  | 
lemma tendsto_def:  | 
| 61973 | 735  | 
"(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) F)"  | 
| 57276 | 736  | 
unfolding nhds_def filterlim_INF filterlim_principal by auto  | 
| 51471 | 737  | 
|
| 63494 | 738  | 
lemma tendsto_cong: "(f \<longlongrightarrow> c) F \<longleftrightarrow> (g \<longlongrightarrow> c) F" if "eventually (\<lambda>x. f x = g x) F"  | 
739  | 
by (rule filterlim_cong [OF refl refl that])  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
740  | 
|
| 61973 | 741  | 
lemma tendsto_mono: "F \<le> F' \<Longrightarrow> (f \<longlongrightarrow> l) F' \<Longrightarrow> (f \<longlongrightarrow> l) F"  | 
| 51471 | 742  | 
unfolding tendsto_def le_filter_def by fast  | 
743  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
744  | 
lemma tendsto_ident_at [tendsto_intros, simp, intro]: "((\<lambda>x. x) \<longlongrightarrow> a) (at a within s)"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
745  | 
by (auto simp: tendsto_def eventually_at_topological)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
746  | 
|
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
747  | 
lemma tendsto_const [tendsto_intros, simp, intro]: "((\<lambda>x. k) \<longlongrightarrow> k) F"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
748  | 
by (simp add: tendsto_def)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
749  | 
|
| 
67950
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
750  | 
lemma filterlim_at:  | 
| 63494 | 751  | 
"(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
 | 
752  | 
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
 | 
753  | 
|
| 
67950
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
754  | 
lemma (in -)  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
755  | 
assumes "filterlim f (nhds L) F"  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
756  | 
shows tendsto_imp_filterlim_at_right:  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
757  | 
"eventually (\<lambda>x. f x > L) F \<Longrightarrow> filterlim f (at_right L) F"  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
758  | 
and tendsto_imp_filterlim_at_left:  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
759  | 
"eventually (\<lambda>x. f x < L) F \<Longrightarrow> filterlim f (at_left L) F"  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
760  | 
using assms by (auto simp: filterlim_at elim: eventually_mono)  | 
| 
 
99eaa5cedbb7
Added some simple facts about limits
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
67727 
diff
changeset
 | 
761  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
762  | 
lemma filterlim_at_withinI:  | 
| 63713 | 763  | 
assumes "filterlim f (nhds c) F"  | 
764  | 
  assumes "eventually (\<lambda>x. f x \<in> A - {c}) F"
 | 
|
765  | 
shows "filterlim f (at c within A) F"  | 
|
| 
64008
 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 
hoelzl 
parents: 
63952 
diff
changeset
 | 
766  | 
using assms by (simp add: filterlim_at)  | 
| 63713 | 767  | 
|
768  | 
lemma filterlim_atI:  | 
|
769  | 
assumes "filterlim f (nhds c) F"  | 
|
770  | 
assumes "eventually (\<lambda>x. f x \<noteq> c) F"  | 
|
771  | 
shows "filterlim f (at c) F"  | 
|
772  | 
using assms by (intro filterlim_at_withinI) simp_all  | 
|
773  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
774  | 
lemma topological_tendstoI:  | 
| 61973 | 775  | 
"(\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F) \<Longrightarrow> (f \<longlongrightarrow> l) F"  | 
| 63494 | 776  | 
by (auto simp: tendsto_def)  | 
| 51471 | 777  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
778  | 
lemma topological_tendstoD:  | 
| 61973 | 779  | 
"(f \<longlongrightarrow> l) F \<Longrightarrow> open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F"  | 
| 63494 | 780  | 
by (auto simp: tendsto_def)  | 
| 51471 | 781  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
782  | 
lemma tendsto_bot [simp]: "(f \<longlongrightarrow> a) bot"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
783  | 
by (simp add: tendsto_def)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
784  | 
|
| 
70365
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
785  | 
lemma tendsto_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> ((\<lambda>x. f x) \<longlongrightarrow> l) net"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
786  | 
by (rule topological_tendstoI) (auto elim: eventually_mono)  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
787  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
788  | 
end  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
789  | 
|
| 
67685
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
790  | 
lemma (in topological_space) filterlim_within_subset:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
791  | 
"filterlim f l (at x within S) \<Longrightarrow> T \<subseteq> S \<Longrightarrow> filterlim f l (at x within T)"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
792  | 
by (blast intro: filterlim_mono at_le)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
793  | 
|
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
794  | 
lemmas tendsto_within_subset = filterlim_within_subset  | 
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
795  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
796  | 
lemma (in order_topology) order_tendsto_iff:  | 
| 61973 | 797  | 
"(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)"  | 
| 63494 | 798  | 
by (auto simp: nhds_order filterlim_inf filterlim_INF filterlim_principal)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
799  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
800  | 
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
 | 
801  | 
"(\<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 | 802  | 
(f \<longlongrightarrow> y) F"  | 
| 63494 | 803  | 
by (auto simp: order_tendsto_iff)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
804  | 
|
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
805  | 
lemma (in order_topology) order_tendstoD:  | 
| 61973 | 806  | 
assumes "(f \<longlongrightarrow> y) F"  | 
| 51471 | 807  | 
shows "a < y \<Longrightarrow> eventually (\<lambda>x. a < f x) F"  | 
808  | 
and "y < a \<Longrightarrow> eventually (\<lambda>x. f x < a) F"  | 
|
| 63494 | 809  | 
using assms by (auto simp: order_tendsto_iff)  | 
| 51471 | 810  | 
|
| 67453 | 811  | 
lemma (in linorder_topology) tendsto_max[tendsto_intros]:  | 
| 61973 | 812  | 
assumes X: "(X \<longlongrightarrow> x) net"  | 
| 63494 | 813  | 
and Y: "(Y \<longlongrightarrow> y) net"  | 
| 61973 | 814  | 
shows "((\<lambda>x. max (X x) (Y x)) \<longlongrightarrow> max x y) net"  | 
| 56949 | 815  | 
proof (rule order_tendstoI)  | 
| 63494 | 816  | 
fix a  | 
817  | 
assume "a < max x y"  | 
|
| 56949 | 818  | 
then show "eventually (\<lambda>x. a < max (X x) (Y x)) net"  | 
819  | 
using order_tendstoD(1)[OF X, of a] order_tendstoD(1)[OF Y, of a]  | 
|
| 61810 | 820  | 
by (auto simp: less_max_iff_disj elim: eventually_mono)  | 
| 56949 | 821  | 
next  | 
| 63494 | 822  | 
fix a  | 
823  | 
assume "max x y < a"  | 
|
| 56949 | 824  | 
then show "eventually (\<lambda>x. max (X x) (Y x) < a) net"  | 
825  | 
using order_tendstoD(2)[OF X, of a] order_tendstoD(2)[OF Y, of a]  | 
|
826  | 
by (auto simp: eventually_conj_iff)  | 
|
827  | 
qed  | 
|
828  | 
||
| 67453 | 829  | 
lemma (in linorder_topology) tendsto_min[tendsto_intros]:  | 
| 61973 | 830  | 
assumes X: "(X \<longlongrightarrow> x) net"  | 
| 63494 | 831  | 
and Y: "(Y \<longlongrightarrow> y) net"  | 
| 61973 | 832  | 
shows "((\<lambda>x. min (X x) (Y x)) \<longlongrightarrow> min x y) net"  | 
| 56949 | 833  | 
proof (rule order_tendstoI)  | 
| 63494 | 834  | 
fix a  | 
835  | 
assume "a < min x y"  | 
|
| 56949 | 836  | 
then show "eventually (\<lambda>x. a < min (X x) (Y x)) net"  | 
837  | 
using order_tendstoD(1)[OF X, of a] order_tendstoD(1)[OF Y, of a]  | 
|
838  | 
by (auto simp: eventually_conj_iff)  | 
|
839  | 
next  | 
|
| 63494 | 840  | 
fix a  | 
841  | 
assume "min x y < a"  | 
|
| 56949 | 842  | 
then show "eventually (\<lambda>x. min (X x) (Y x) < a) net"  | 
843  | 
using order_tendstoD(2)[OF X, of a] order_tendstoD(2)[OF Y, of a]  | 
|
| 61810 | 844  | 
by (auto simp: min_less_iff_disj elim: eventually_mono)  | 
| 56949 | 845  | 
qed  | 
846  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
847  | 
lemma (in order_topology)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
848  | 
assumes "a < b"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
849  | 
  shows at_within_Icc_at_right: "at a within {a..b} = at_right a"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
850  | 
    and at_within_Icc_at_left:  "at b within {a..b} = at_left b"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
851  | 
  using order_tendstoD(2)[OF tendsto_ident_at assms, of "{a<..}"]
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
852  | 
  using order_tendstoD(1)[OF tendsto_ident_at assms, of "{..<b}"]
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
853  | 
by (auto intro!: order_class.antisym filter_leI  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
854  | 
simp: eventually_at_filter less_le  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
855  | 
elim: eventually_elim2)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
856  | 
|
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
857  | 
lemma (in order_topology) at_within_Icc_at: "a < x \<Longrightarrow> x < b \<Longrightarrow> at x within {a..b} = at x"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
858  | 
  by (rule at_within_open_subset[where S="{a<..<b}"]) auto
 | 
| 51471 | 859  | 
|
| 
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
 | 
860  | 
lemma (in t2_space) tendsto_unique:  | 
| 63494 | 861  | 
assumes "F \<noteq> bot"  | 
862  | 
and "(f \<longlongrightarrow> a) F"  | 
|
863  | 
and "(f \<longlongrightarrow> b) F"  | 
|
| 51471 | 864  | 
shows "a = b"  | 
865  | 
proof (rule ccontr)  | 
|
866  | 
assume "a \<noteq> b"  | 
|
867  | 
  obtain U V where "open U" "open V" "a \<in> U" "b \<in> V" "U \<inter> V = {}"
 | 
|
| 60758 | 868  | 
using hausdorff [OF \<open>a \<noteq> b\<close>] by fast  | 
| 51471 | 869  | 
have "eventually (\<lambda>x. f x \<in> U) F"  | 
| 61973 | 870  | 
using \<open>(f \<longlongrightarrow> a) F\<close> \<open>open U\<close> \<open>a \<in> U\<close> by (rule topological_tendstoD)  | 
| 51471 | 871  | 
moreover  | 
872  | 
have "eventually (\<lambda>x. f x \<in> V) F"  | 
|
| 61973 | 873  | 
using \<open>(f \<longlongrightarrow> b) F\<close> \<open>open V\<close> \<open>b \<in> V\<close> by (rule topological_tendstoD)  | 
| 51471 | 874  | 
ultimately  | 
875  | 
have "eventually (\<lambda>x. False) F"  | 
|
876  | 
proof eventually_elim  | 
|
877  | 
case (elim x)  | 
|
| 63494 | 878  | 
then have "f x \<in> U \<inter> V" by simp  | 
| 60758 | 879  | 
    with \<open>U \<inter> V = {}\<close> show ?case by simp
 | 
| 51471 | 880  | 
qed  | 
| 60758 | 881  | 
with \<open>\<not> trivial_limit F\<close> show "False"  | 
| 51471 | 882  | 
by (simp add: trivial_limit_def)  | 
883  | 
qed  | 
|
884  | 
||
| 
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
 | 
885  | 
lemma (in t2_space) tendsto_const_iff:  | 
| 63494 | 886  | 
fixes a b :: 'a  | 
887  | 
assumes "\<not> trivial_limit F"  | 
|
888  | 
shows "((\<lambda>x. 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
 | 
889  | 
by (auto intro!: tendsto_unique [OF assms tendsto_const])  | 
| 51471 | 890  | 
|
| 
68860
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
891  | 
lemma Lim_in_closed_set:  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
892  | 
assumes "closed S" "eventually (\<lambda>x. f(x) \<in> S) F" "F \<noteq> bot" "(f \<longlongrightarrow> l) F"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
893  | 
shows "l \<in> S"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
894  | 
proof (rule ccontr)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
895  | 
assume "l \<notin> S"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
896  | 
with \<open>closed S\<close> have "open (- S)" "l \<in> - S"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
897  | 
by (simp_all add: open_Compl)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
898  | 
with assms(4) have "eventually (\<lambda>x. f x \<in> - S) F"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
899  | 
by (rule topological_tendstoD)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
900  | 
with assms(2) have "eventually (\<lambda>x. False) F"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
901  | 
by (rule eventually_elim2) simp  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
902  | 
with assms(3) show "False"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
903  | 
by (simp add: eventually_False)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
904  | 
qed  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
905  | 
|
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
906  | 
lemma (in t3_space) nhds_closed:  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
907  | 
assumes "x \<in> A" and "open A"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
908  | 
shows "\<exists>A'. x \<in> A' \<and> closed A' \<and> A' \<subseteq> A \<and> eventually (\<lambda>y. y \<in> A') (nhds x)"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
909  | 
proof -  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
910  | 
  from assms have "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> - A \<subseteq> V \<and> U \<inter> V = {}"
 | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
911  | 
by (intro t3_space) auto  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
912  | 
  then obtain U V where UV: "open U" "open V" "x \<in> U" "-A \<subseteq> V" "U \<inter> V = {}"
 | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
913  | 
by auto  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
914  | 
have "eventually (\<lambda>y. y \<in> U) (nhds x)"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
915  | 
using \<open>open U\<close> and \<open>x \<in> U\<close> by (intro eventually_nhds_in_open)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
916  | 
hence "eventually (\<lambda>y. y \<in> -V) (nhds x)"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
917  | 
by eventually_elim (use UV in auto)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
918  | 
with UV show ?thesis by (intro exI[of _ "-V"]) auto  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
919  | 
qed  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
920  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
921  | 
lemma (in order_topology) increasing_tendsto:  | 
| 51471 | 922  | 
assumes bdd: "eventually (\<lambda>n. f n \<le> l) F"  | 
| 63494 | 923  | 
and en: "\<And>x. x < l \<Longrightarrow> eventually (\<lambda>n. x < f n) F"  | 
| 61973 | 924  | 
shows "(f \<longlongrightarrow> l) F"  | 
| 61810 | 925  | 
using assms by (intro order_tendstoI) (auto elim!: eventually_mono)  | 
| 51471 | 926  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
927  | 
lemma (in order_topology) decreasing_tendsto:  | 
| 51471 | 928  | 
assumes bdd: "eventually (\<lambda>n. l \<le> f n) F"  | 
| 63494 | 929  | 
and en: "\<And>x. l < x \<Longrightarrow> eventually (\<lambda>n. f n < x) F"  | 
| 61973 | 930  | 
shows "(f \<longlongrightarrow> l) F"  | 
| 61810 | 931  | 
using assms by (intro order_tendstoI) (auto elim!: eventually_mono)  | 
| 51471 | 932  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
933  | 
lemma (in order_topology) tendsto_sandwich:  | 
| 51471 | 934  | 
assumes ev: "eventually (\<lambda>n. f n \<le> g n) net" "eventually (\<lambda>n. g n \<le> h n) net"  | 
| 61973 | 935  | 
assumes lim: "(f \<longlongrightarrow> c) net" "(h \<longlongrightarrow> c) net"  | 
936  | 
shows "(g \<longlongrightarrow> c) net"  | 
|
| 51471 | 937  | 
proof (rule order_tendstoI)  | 
| 63494 | 938  | 
fix a  | 
939  | 
show "a < c \<Longrightarrow> eventually (\<lambda>x. a < g x) net"  | 
|
| 51471 | 940  | 
using order_tendstoD[OF lim(1), of a] ev by (auto elim: eventually_elim2)  | 
941  | 
next  | 
|
| 63494 | 942  | 
fix a  | 
943  | 
show "c < a \<Longrightarrow> eventually (\<lambda>x. g x < a) net"  | 
|
| 51471 | 944  | 
using order_tendstoD[OF lim(2), of a] ev by (auto elim: eventually_elim2)  | 
945  | 
qed  | 
|
946  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
947  | 
lemma (in t1_space) limit_frequently_eq:  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
948  | 
assumes "F \<noteq> bot"  | 
| 63494 | 949  | 
and "frequently (\<lambda>x. f x = c) F"  | 
950  | 
and "(f \<longlongrightarrow> d) F"  | 
|
951  | 
shows "d = c"  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
952  | 
proof (rule ccontr)  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
953  | 
assume "d \<noteq> c"  | 
| 63494 | 954  | 
from t1_space[OF this] obtain U where "open U" "d \<in> U" "c \<notin> U"  | 
955  | 
by blast  | 
|
956  | 
with assms have "eventually (\<lambda>x. f x \<in> U) F"  | 
|
957  | 
unfolding tendsto_def by blast  | 
|
958  | 
then have "eventually (\<lambda>x. f x \<noteq> c) F"  | 
|
959  | 
by eventually_elim (insert \<open>c \<notin> U\<close>, blast)  | 
|
960  | 
with assms(2) show False  | 
|
961  | 
unfolding frequently_def by contradiction  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
962  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
963  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
964  | 
lemma (in t1_space) tendsto_imp_eventually_ne:  | 
| 64394 | 965  | 
assumes "(f \<longlongrightarrow> c) F" "c \<noteq> c'"  | 
| 63494 | 966  | 
shows "eventually (\<lambda>z. f z \<noteq> c') F"  | 
| 64394 | 967  | 
proof (cases "F=bot")  | 
968  | 
case True  | 
|
969  | 
thus ?thesis by auto  | 
|
970  | 
next  | 
|
971  | 
case False  | 
|
972  | 
show ?thesis  | 
|
973  | 
proof (rule ccontr)  | 
|
974  | 
assume "\<not> eventually (\<lambda>z. f z \<noteq> c') F"  | 
|
975  | 
then have "frequently (\<lambda>z. f z = c') F"  | 
|
976  | 
by (simp add: frequently_def)  | 
|
977  | 
from limit_frequently_eq[OF False this \<open>(f \<longlongrightarrow> c) F\<close>] and \<open>c \<noteq> c'\<close> show False  | 
|
978  | 
by contradiction  | 
|
979  | 
qed  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
980  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
981  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
982  | 
lemma (in linorder_topology) tendsto_le:  | 
| 51471 | 983  | 
assumes F: "\<not> trivial_limit F"  | 
| 63494 | 984  | 
and x: "(f \<longlongrightarrow> x) F"  | 
985  | 
and y: "(g \<longlongrightarrow> y) F"  | 
|
986  | 
and ev: "eventually (\<lambda>x. g x \<le> f x) F"  | 
|
| 51471 | 987  | 
shows "y \<le> x"  | 
988  | 
proof (rule ccontr)  | 
|
989  | 
assume "\<not> y \<le> x"  | 
|
990  | 
  with less_separate[of x y] obtain a b where xy: "x < a" "b < y" "{..<a} \<inter> {b<..} = {}"
 | 
|
991  | 
by (auto simp: not_le)  | 
|
992  | 
then have "eventually (\<lambda>x. f x < a) F" "eventually (\<lambda>x. b < g x) F"  | 
|
993  | 
using x y by (auto intro: order_tendstoD)  | 
|
994  | 
with ev have "eventually (\<lambda>x. False) F"  | 
|
995  | 
by eventually_elim (insert xy, fastforce)  | 
|
996  | 
with F show False  | 
|
997  | 
by (simp add: eventually_False)  | 
|
998  | 
qed  | 
|
999  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
1000  | 
lemma (in linorder_topology) tendsto_lowerbound:  | 
| 
63952
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1001  | 
assumes x: "(f \<longlongrightarrow> x) F"  | 
| 
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1002  | 
and ev: "eventually (\<lambda>i. a \<le> f i) F"  | 
| 
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1003  | 
and F: "\<not> trivial_limit F"  | 
| 51471 | 1004  | 
shows "a \<le> x"  | 
| 63494 | 1005  | 
using F x tendsto_const ev by (rule tendsto_le)  | 
| 51471 | 1006  | 
|
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
1007  | 
lemma (in linorder_topology) tendsto_upperbound:  | 
| 
63952
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1008  | 
assumes x: "(f \<longlongrightarrow> x) F"  | 
| 
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1009  | 
and ev: "eventually (\<lambda>i. a \<ge> f i) F"  | 
| 
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1010  | 
and F: "\<not> trivial_limit F"  | 
| 56289 | 1011  | 
shows "a \<ge> x"  | 
| 63494 | 1012  | 
by (rule tendsto_le [OF F tendsto_const x ev])  | 
| 56289 | 1013  | 
|
| 
67706
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1014  | 
lemma filterlim_at_within_not_equal:  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1015  | 
fixes f::"'a \<Rightarrow> 'b::t2_space"  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1016  | 
assumes "filterlim f (at a within s) F"  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1017  | 
shows "eventually (\<lambda>w. f w\<in>s \<and> f w \<noteq>b) F"  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1018  | 
proof (cases "a=b")  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1019  | 
case True  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1020  | 
then show ?thesis using assms by (simp add: filterlim_at)  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1021  | 
next  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1022  | 
case False  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1023  | 
  from hausdorff[OF this] obtain U V where UV:"open U" "open V" "a \<in> U" "b \<in> V" "U \<inter> V = {}"
 | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1024  | 
by auto  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1025  | 
have "(f \<longlongrightarrow> a) F" using assms filterlim_at by auto  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1026  | 
then have "\<forall>\<^sub>F x in F. f x \<in> U" using UV unfolding tendsto_def by auto  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1027  | 
moreover have "\<forall>\<^sub>F x in F. f x \<in> s \<and> f x\<noteq>a" using assms filterlim_at by auto  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1028  | 
ultimately show ?thesis  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1029  | 
apply eventually_elim  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1030  | 
using UV by auto  | 
| 
 
4ddc49205f5d
Unified the order of zeros and poles; improved reasoning around non-essential singularites
 
Wenda Li <wl302@cam.ac.uk> 
parents: 
67577 
diff
changeset
 | 
1031  | 
qed  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1032  | 
|
| 69593 | 1033  | 
subsubsection \<open>Rules about \<^const>\<open>Lim\<close>\<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
 | 
1034  | 
|
| 63494 | 1035  | 
lemma tendsto_Lim: "\<not> trivial_limit net \<Longrightarrow> (f \<longlongrightarrow> l) net \<Longrightarrow> Lim net f = l"  | 
1036  | 
unfolding Lim_def using tendsto_unique [of net f] 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
 | 
1037  | 
|
| 
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
 | 
1038  | 
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
 | 
1039  | 
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
 | 
1040  | 
|
| 
67685
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
1041  | 
lemma eventually_Lim_ident_at:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
1042  | 
"(\<forall>\<^sub>F y in at x within X. P (Lim (at x within X) (\<lambda>x. x)) y) \<longleftrightarrow>  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
1043  | 
(\<forall>\<^sub>F y in at x within X. P x y)" for x::"'a::t2_space"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
1044  | 
by (cases "at x within X = bot") (auto simp: Lim_ident_at)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
1045  | 
|
| 51471 | 1046  | 
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
 | 
1047  | 
fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"  | 
| 51471 | 1048  | 
assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
| 63494 | 1049  | 
and bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"  | 
1050  | 
and Q: "eventually Q (at_right a)"  | 
|
1051  | 
and bound: "\<And>b. Q b \<Longrightarrow> a < b"  | 
|
1052  | 
and P: "eventually P at_bot"  | 
|
| 51471 | 1053  | 
shows "filterlim f at_bot (at_right a)"  | 
1054  | 
proof -  | 
|
1055  | 
from P obtain x where x: "\<And>y. y \<le> x \<Longrightarrow> P y"  | 
|
1056  | 
unfolding eventually_at_bot_linorder by auto  | 
|
1057  | 
show ?thesis  | 
|
1058  | 
proof (intro filterlim_at_bot_le[THEN iffD2] allI impI)  | 
|
| 63494 | 1059  | 
fix z  | 
1060  | 
assume "z \<le> x"  | 
|
| 51471 | 1061  | 
with x have "P z" by auto  | 
1062  | 
have "eventually (\<lambda>x. x \<le> g z) (at_right a)"  | 
|
| 60758 | 1063  | 
using bound[OF bij(2)[OF \<open>P z\<close>]]  | 
| 63494 | 1064  | 
unfolding eventually_at_right[OF bound[OF bij(2)[OF \<open>P z\<close>]]]  | 
1065  | 
by (auto intro!: exI[of _ "g z"])  | 
|
| 51471 | 1066  | 
with Q show "eventually (\<lambda>x. f x \<le> z) (at_right a)"  | 
| 60758 | 1067  | 
by eventually_elim (metis bij \<open>P z\<close> mono)  | 
| 51471 | 1068  | 
qed  | 
1069  | 
qed  | 
|
1070  | 
||
1071  | 
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
 | 
1072  | 
fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"  | 
| 51471 | 1073  | 
assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
| 63494 | 1074  | 
and bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"  | 
1075  | 
and Q: "eventually Q (at_left a)"  | 
|
1076  | 
and bound: "\<And>b. Q b \<Longrightarrow> b < a"  | 
|
1077  | 
and P: "eventually P at_top"  | 
|
| 51471 | 1078  | 
shows "filterlim f at_top (at_left a)"  | 
1079  | 
proof -  | 
|
1080  | 
from P obtain x where x: "\<And>y. x \<le> y \<Longrightarrow> P y"  | 
|
1081  | 
unfolding eventually_at_top_linorder by auto  | 
|
1082  | 
show ?thesis  | 
|
1083  | 
proof (intro filterlim_at_top_ge[THEN iffD2] allI impI)  | 
|
| 63494 | 1084  | 
fix z  | 
1085  | 
assume "x \<le> z"  | 
|
| 51471 | 1086  | 
with x have "P z" by auto  | 
1087  | 
have "eventually (\<lambda>x. g z \<le> x) (at_left a)"  | 
|
| 60758 | 1088  | 
using bound[OF bij(2)[OF \<open>P z\<close>]]  | 
| 63494 | 1089  | 
unfolding eventually_at_left[OF bound[OF bij(2)[OF \<open>P z\<close>]]]  | 
1090  | 
by (auto intro!: exI[of _ "g z"])  | 
|
| 51471 | 1091  | 
with Q show "eventually (\<lambda>x. z \<le> f x) (at_left a)"  | 
| 60758 | 1092  | 
by eventually_elim (metis bij \<open>P z\<close> mono)  | 
| 51471 | 1093  | 
qed  | 
1094  | 
qed  | 
|
1095  | 
||
1096  | 
lemma filterlim_split_at:  | 
|
| 63494 | 1097  | 
"filterlim f F (at_left x) \<Longrightarrow> filterlim f F (at_right x) \<Longrightarrow>  | 
1098  | 
filterlim f F (at x)"  | 
|
1099  | 
for x :: "'a::linorder_topology"  | 
|
| 51471 | 1100  | 
by (subst at_eq_sup_left_right) (rule filterlim_sup)  | 
1101  | 
||
1102  | 
lemma filterlim_at_split:  | 
|
| 63494 | 1103  | 
"filterlim f F (at x) \<longleftrightarrow> filterlim f F (at_left x) \<and> filterlim f F (at_right x)"  | 
1104  | 
for x :: "'a::linorder_topology"  | 
|
| 51471 | 1105  | 
by (subst at_eq_sup_left_right) (simp add: filterlim_def filtermap_sup)  | 
1106  | 
||
| 57025 | 1107  | 
lemma eventually_nhds_top:  | 
| 63494 | 1108  | 
  fixes P :: "'a :: {order_top,linorder_topology} \<Rightarrow> bool"
 | 
1109  | 
and b :: 'a  | 
|
1110  | 
assumes "b < top"  | 
|
| 57025 | 1111  | 
shows "eventually P (nhds top) \<longleftrightarrow> (\<exists>b<top. (\<forall>z. b < z \<longrightarrow> P z))"  | 
1112  | 
unfolding eventually_nhds  | 
|
1113  | 
proof safe  | 
|
| 63494 | 1114  | 
fix S :: "'a set"  | 
1115  | 
assume "open S" "top \<in> S"  | 
|
| 60758 | 1116  | 
note open_left[OF this \<open>b < top\<close>]  | 
| 57025 | 1117  | 
moreover assume "\<forall>s\<in>S. P s"  | 
1118  | 
ultimately show "\<exists>b<top. \<forall>z>b. P z"  | 
|
1119  | 
by (auto simp: subset_eq Ball_def)  | 
|
1120  | 
next  | 
|
| 63494 | 1121  | 
fix b  | 
1122  | 
assume "b < top" "\<forall>z>b. P z"  | 
|
| 57025 | 1123  | 
then show "\<exists>S. open S \<and> top \<in> S \<and> (\<forall>xa\<in>S. P xa)"  | 
1124  | 
    by (intro exI[of _ "{b <..}"]) auto
 | 
|
1125  | 
qed  | 
|
| 51471 | 1126  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1127  | 
lemma tendsto_at_within_iff_tendsto_nhds:  | 
| 61973 | 1128  | 
"(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
 | 
1129  | 
unfolding tendsto_def eventually_at_filter eventually_inf_principal  | 
| 61810 | 1130  | 
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
 | 
1131  | 
|
| 63494 | 1132  | 
|
| 60758 | 1133  | 
subsection \<open>Limits on sequences\<close>  | 
| 51471 | 1134  | 
|
1135  | 
abbreviation (in topological_space)  | 
|
| 63494 | 1136  | 
  LIMSEQ :: "[nat \<Rightarrow> 'a, 'a] \<Rightarrow> bool"  ("((_)/ \<longlonglongrightarrow> (_))" [60, 60] 60)
 | 
1137  | 
where "X \<longlonglongrightarrow> L \<equiv> (X \<longlongrightarrow> L) sequentially"  | 
|
1138  | 
||
1139  | 
abbreviation (in t2_space) lim :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a"  | 
|
1140  | 
where "lim X \<equiv> Lim sequentially X"  | 
|
1141  | 
||
1142  | 
definition (in topological_space) convergent :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool"  | 
|
1143  | 
where "convergent X = (\<exists>L. X \<longlonglongrightarrow> L)"  | 
|
| 51471 | 1144  | 
|
| 61969 | 1145  | 
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
 | 
1146  | 
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
 | 
1147  | 
|
| 70367 | 1148  | 
lemma lim_explicit:  | 
| 
70365
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
1149  | 
"f \<longlonglongrightarrow> f0 \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> f0 \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. f n \<in> S))"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
1150  | 
unfolding tendsto_def eventually_sequentially by auto  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
1151  | 
|
| 63494 | 1152  | 
|
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1153  | 
subsection \<open>Monotone sequences and subsequences\<close>  | 
| 51471 | 1154  | 
|
| 63494 | 1155  | 
text \<open>  | 
1156  | 
Definition of monotonicity.  | 
|
1157  | 
The use of disjunction here complicates proofs considerably.  | 
|
1158  | 
One alternative is to add a Boolean argument to indicate the direction.  | 
|
1159  | 
Another is to develop the notions of increasing and decreasing first.  | 
|
1160  | 
\<close>  | 
|
1161  | 
definition monoseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool"  | 
|
1162  | 
where "monoseq X \<longleftrightarrow> (\<forall>m. \<forall>n\<ge>m. X m \<le> X n) \<or> (\<forall>m. \<forall>n\<ge>m. X n \<le> X m)"  | 
|
1163  | 
||
1164  | 
abbreviation incseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool"  | 
|
1165  | 
where "incseq X \<equiv> mono X"  | 
|
| 
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
 | 
1166  | 
|
| 
 
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
 | 
1167  | 
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
 | 
1168  | 
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
 | 
1169  | 
|
| 63494 | 1170  | 
abbreviation decseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool"  | 
1171  | 
where "decseq X \<equiv> antimono X"  | 
|
| 
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
 | 
1172  | 
|
| 
 
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
 | 
1173  | 
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
 | 
1174  | 
unfolding antimono_def ..  | 
| 51471 | 1175  | 
|
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1176  | 
subsubsection \<open>Definition of subsequence.\<close>  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1177  | 
|
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1178  | 
(* For compatibility with the old "subseq" *)  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1179  | 
lemma strict_mono_leD: "strict_mono r \<Longrightarrow> m \<le> n \<Longrightarrow> r m \<le> r n"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1180  | 
by (erule (1) monoD [OF strict_mono_mono])  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1181  | 
|
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1182  | 
lemma strict_mono_id: "strict_mono id"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1183  | 
by (simp add: strict_mono_def)  | 
| 
65036
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
1184  | 
|
| 63494 | 1185  | 
lemma incseq_SucI: "(\<And>n. X n \<le> X (Suc n)) \<Longrightarrow> incseq X"  | 
1186  | 
using lift_Suc_mono_le[of X] by (auto simp: incseq_def)  | 
|
1187  | 
||
1188  | 
lemma incseqD: "incseq f \<Longrightarrow> i \<le> j \<Longrightarrow> f i \<le> f j"  | 
|
| 51471 | 1189  | 
by (auto simp: incseq_def)  | 
1190  | 
||
1191  | 
lemma incseq_SucD: "incseq A \<Longrightarrow> A i \<le> A (Suc i)"  | 
|
1192  | 
using incseqD[of A i "Suc i"] by auto  | 
|
1193  | 
||
1194  | 
lemma incseq_Suc_iff: "incseq f \<longleftrightarrow> (\<forall>n. f n \<le> f (Suc n))"  | 
|
1195  | 
by (auto intro: incseq_SucI dest: incseq_SucD)  | 
|
1196  | 
||
1197  | 
lemma incseq_const[simp, intro]: "incseq (\<lambda>x. k)"  | 
|
1198  | 
unfolding incseq_def by auto  | 
|
1199  | 
||
| 63494 | 1200  | 
lemma decseq_SucI: "(\<And>n. X (Suc n) \<le> X n) \<Longrightarrow> decseq X"  | 
1201  | 
using order.lift_Suc_mono_le[OF dual_order, of X] by (auto simp: decseq_def)  | 
|
1202  | 
||
1203  | 
lemma decseqD: "decseq f \<Longrightarrow> i \<le> j \<Longrightarrow> f j \<le> f i"  | 
|
| 51471 | 1204  | 
by (auto simp: decseq_def)  | 
1205  | 
||
1206  | 
lemma decseq_SucD: "decseq A \<Longrightarrow> A (Suc i) \<le> A i"  | 
|
1207  | 
using decseqD[of A i "Suc i"] by auto  | 
|
1208  | 
||
1209  | 
lemma decseq_Suc_iff: "decseq f \<longleftrightarrow> (\<forall>n. f (Suc n) \<le> f n)"  | 
|
1210  | 
by (auto intro: decseq_SucI dest: decseq_SucD)  | 
|
1211  | 
||
1212  | 
lemma decseq_const[simp, intro]: "decseq (\<lambda>x. k)"  | 
|
1213  | 
unfolding decseq_def by auto  | 
|
1214  | 
||
1215  | 
lemma monoseq_iff: "monoseq X \<longleftrightarrow> incseq X \<or> decseq X"  | 
|
1216  | 
unfolding monoseq_def incseq_def decseq_def ..  | 
|
1217  | 
||
| 63494 | 1218  | 
lemma monoseq_Suc: "monoseq X \<longleftrightarrow> (\<forall>n. X n \<le> X (Suc n)) \<or> (\<forall>n. X (Suc n) \<le> X n)"  | 
| 51471 | 1219  | 
unfolding monoseq_iff incseq_Suc_iff decseq_Suc_iff ..  | 
1220  | 
||
| 63494 | 1221  | 
lemma monoI1: "\<forall>m. \<forall>n \<ge> m. X m \<le> X n \<Longrightarrow> monoseq X"  | 
1222  | 
by (simp add: monoseq_def)  | 
|
1223  | 
||
1224  | 
lemma monoI2: "\<forall>m. \<forall>n \<ge> m. X n \<le> X m \<Longrightarrow> monoseq X"  | 
|
1225  | 
by (simp add: monoseq_def)  | 
|
1226  | 
||
1227  | 
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) \<Longrightarrow> monoseq X"  | 
|
1228  | 
by (simp add: monoseq_Suc)  | 
|
1229  | 
||
1230  | 
lemma mono_SucI2: "\<forall>n. X (Suc n) \<le> X n \<Longrightarrow> monoseq X"  | 
|
1231  | 
by (simp add: monoseq_Suc)  | 
|
| 51471 | 1232  | 
|
1233  | 
lemma monoseq_minus:  | 
|
1234  | 
fixes a :: "nat \<Rightarrow> 'a::ordered_ab_group_add"  | 
|
1235  | 
assumes "monoseq a"  | 
|
1236  | 
shows "monoseq (\<lambda> n. - a n)"  | 
|
| 63494 | 1237  | 
proof (cases "\<forall>m. \<forall>n \<ge> m. a m \<le> a n")  | 
| 51471 | 1238  | 
case True  | 
| 63494 | 1239  | 
then have "\<forall>m. \<forall>n \<ge> m. - a n \<le> - a m" by auto  | 
1240  | 
then show ?thesis by (rule monoI2)  | 
|
| 51471 | 1241  | 
next  | 
1242  | 
case False  | 
|
| 63494 | 1243  | 
then have "\<forall>m. \<forall>n \<ge> m. - a m \<le> - a n"  | 
1244  | 
using \<open>monoseq a\<close>[unfolded monoseq_def] by auto  | 
|
1245  | 
then show ?thesis by (rule monoI1)  | 
|
| 51471 | 1246  | 
qed  | 
1247  | 
||
| 63494 | 1248  | 
|
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1249  | 
subsubsection \<open>Subsequence (alternative definition, (e.g. Hoskins)\<close>  | 
| 63494 | 1250  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1251  | 
lemma strict_mono_Suc_iff: "strict_mono f \<longleftrightarrow> (\<forall>n. f n < f (Suc n))"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1252  | 
proof (intro iffI strict_monoI)  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1253  | 
assume *: "\<forall>n. f n < f (Suc n)"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1254  | 
fix m n :: nat assume "m < n"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1255  | 
thus "f m < f n"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1256  | 
by (induction rule: less_Suc_induct) (use * in auto)  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1257  | 
qed (auto simp: strict_mono_def)  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1258  | 
|
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1259  | 
lemma strict_mono_add: "strict_mono (\<lambda>n::'a::linordered_semidom. n + k)"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1260  | 
by (auto simp: strict_mono_def)  | 
| 
63317
 
ca187a9f66da
Various additions to polynomials, FPSs, Gamma function
 
eberlm 
parents: 
63301 
diff
changeset
 | 
1261  | 
|
| 63494 | 1262  | 
text \<open>For any sequence, there is a monotonic subsequence.\<close>  | 
| 51471 | 1263  | 
lemma seq_monosub:  | 
| 63494 | 1264  | 
fixes s :: "nat \<Rightarrow> 'a::linorder"  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1265  | 
shows "\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. (s (f n)))"  | 
| 63494 | 1266  | 
proof (cases "\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p")  | 
1267  | 
case True  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1268  | 
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
 | 
1269  | 
by (intro dependent_nat_choice) (auto simp: conj_commute)  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1270  | 
then obtain f :: "nat \<Rightarrow> nat"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1271  | 
where f: "strict_mono f" and mono: "\<And>n m. f n \<le> m \<Longrightarrow> s m \<le> s (f n)"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1272  | 
by (auto simp: strict_mono_Suc_iff)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1273  | 
then have "incseq f"  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1274  | 
unfolding strict_mono_Suc_iff incseq_Suc_iff by (auto intro: less_imp_le)  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1275  | 
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
 | 
1276  | 
by (auto simp add: incseq_def intro!: mono monoI2)  | 
| 63494 | 1277  | 
with f show ?thesis  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1278  | 
by auto  | 
| 51471 | 1279  | 
next  | 
| 63494 | 1280  | 
case False  | 
1281  | 
then obtain N where N: "p > N \<Longrightarrow> \<exists>m>p. s p < s m" for p  | 
|
1282  | 
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
 | 
1283  | 
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
 | 
1284  | 
proof (intro dependent_nat_choice)  | 
| 63494 | 1285  | 
fix x  | 
1286  | 
assume "N < x" with N[of x]  | 
|
1287  | 
show "\<exists>y>N. x < y \<and> s x \<le> s y"  | 
|
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1288  | 
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
 | 
1289  | 
qed auto  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1290  | 
then show ?thesis  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1291  | 
by (auto simp: monoseq_iff incseq_Suc_iff strict_mono_Suc_iff)  | 
| 51471 | 1292  | 
qed  | 
1293  | 
||
| 63494 | 1294  | 
lemma seq_suble:  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1295  | 
assumes sf: "strict_mono (f :: nat \<Rightarrow> nat)"  | 
| 63494 | 1296  | 
shows "n \<le> f n"  | 
1297  | 
proof (induct n)  | 
|
1298  | 
case 0  | 
|
1299  | 
show ?case by simp  | 
|
| 51471 | 1300  | 
next  | 
1301  | 
case (Suc n)  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1302  | 
with sf [unfolded strict_mono_Suc_iff, rule_format, of n] have "n < f (Suc n)"  | 
| 63494 | 1303  | 
by arith  | 
1304  | 
then show ?case by arith  | 
|
| 51471 | 1305  | 
qed  | 
1306  | 
||
1307  | 
lemma eventually_subseq:  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1308  | 
"strict_mono r \<Longrightarrow> eventually P sequentially \<Longrightarrow> eventually (\<lambda>n. P (r n)) sequentially"  | 
| 51471 | 1309  | 
unfolding eventually_sequentially by (metis seq_suble le_trans)  | 
1310  | 
||
| 51473 | 1311  | 
lemma not_eventually_sequentiallyD:  | 
| 63494 | 1312  | 
assumes "\<not> eventually P sequentially"  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1313  | 
shows "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (\<forall>n. \<not> P (r n))"  | 
| 51473 | 1314  | 
proof -  | 
| 63494 | 1315  | 
from assms have "\<forall>n. \<exists>m\<ge>n. \<not> P m"  | 
| 51473 | 1316  | 
unfolding eventually_sequentially by (simp add: not_less)  | 
1317  | 
then obtain r where "\<And>n. r n \<ge> n" "\<And>n. \<not> P (r n)"  | 
|
1318  | 
by (auto simp: choice_iff)  | 
|
1319  | 
then show ?thesis  | 
|
1320  | 
by (auto intro!: exI[of _ "\<lambda>n. r (((Suc \<circ> r) ^^ Suc n) 0)"]  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1321  | 
simp: less_eq_Suc_le strict_mono_Suc_iff)  | 
| 51473 | 1322  | 
qed  | 
1323  | 
||
| 
66827
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1324  | 
lemma sequentially_offset:  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1325  | 
assumes "eventually (\<lambda>i. P i) sequentially"  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1326  | 
shows "eventually (\<lambda>i. P (i + k)) sequentially"  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1327  | 
using assms by (rule eventually_sequentially_seg [THEN iffD2])  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1328  | 
|
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1329  | 
lemma seq_offset_neg:  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1330  | 
"(f \<longlongrightarrow> l) sequentially \<Longrightarrow> ((\<lambda>i. f(i - k)) \<longlongrightarrow> l) sequentially"  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1331  | 
apply (erule filterlim_compose)  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1332  | 
apply (simp add: filterlim_def le_sequentially eventually_filtermap eventually_sequentially, arith)  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1333  | 
done  | 
| 
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
1334  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1335  | 
lemma filterlim_subseq: "strict_mono f \<Longrightarrow> filterlim f sequentially sequentially"  | 
| 51471 | 1336  | 
unfolding filterlim_iff by (metis eventually_subseq)  | 
1337  | 
||
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1338  | 
lemma strict_mono_o: "strict_mono r \<Longrightarrow> strict_mono s \<Longrightarrow> strict_mono (r \<circ> s)"  | 
| 
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1339  | 
unfolding strict_mono_def by simp  | 
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
1340  | 
|
| 
67727
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
1341  | 
lemma strict_mono_compose: "strict_mono r \<Longrightarrow> strict_mono s \<Longrightarrow> strict_mono (\<lambda>x. r (s x))"  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
1342  | 
using strict_mono_o[of r s] by (simp add: o_def)  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
1343  | 
|
| 51471 | 1344  | 
lemma incseq_imp_monoseq: "incseq X \<Longrightarrow> monoseq X"  | 
1345  | 
by (simp add: incseq_def monoseq_def)  | 
|
1346  | 
||
1347  | 
lemma decseq_imp_monoseq: "decseq X \<Longrightarrow> monoseq X"  | 
|
1348  | 
by (simp add: decseq_def monoseq_def)  | 
|
1349  | 
||
| 63494 | 1350  | 
lemma decseq_eq_incseq: "decseq X = incseq (\<lambda>n. - X n)"  | 
1351  | 
for X :: "nat \<Rightarrow> 'a::ordered_ab_group_add"  | 
|
| 51471 | 1352  | 
by (simp add: decseq_def incseq_def)  | 
1353  | 
||
1354  | 
lemma INT_decseq_offset:  | 
|
1355  | 
assumes "decseq F"  | 
|
1356  | 
  shows "(\<Inter>i. F i) = (\<Inter>i\<in>{n..}. F i)"
 | 
|
1357  | 
proof safe  | 
|
| 63494 | 1358  | 
fix x i  | 
1359  | 
  assume x: "x \<in> (\<Inter>i\<in>{n..}. F i)"
 | 
|
| 51471 | 1360  | 
show "x \<in> F i"  | 
1361  | 
proof cases  | 
|
1362  | 
from x have "x \<in> F n" by auto  | 
|
| 60758 | 1363  | 
also assume "i \<le> n" with \<open>decseq F\<close> have "F n \<subseteq> F i"  | 
| 51471 | 1364  | 
unfolding decseq_def by simp  | 
1365  | 
finally show ?thesis .  | 
|
1366  | 
qed (insert x, simp)  | 
|
1367  | 
qed auto  | 
|
1368  | 
||
| 63494 | 1369  | 
lemma LIMSEQ_const_iff: "(\<lambda>n. k) \<longlonglongrightarrow> l \<longleftrightarrow> k = l"  | 
1370  | 
for k l :: "'a::t2_space"  | 
|
| 51471 | 1371  | 
using trivial_limit_sequentially by (rule tendsto_const_iff)  | 
1372  | 
||
| 63494 | 1373  | 
lemma LIMSEQ_SUP: "incseq X \<Longrightarrow> X \<longlonglongrightarrow> (SUP i. X i :: 'a::{complete_linorder,linorder_topology})"
 | 
| 51471 | 1374  | 
by (intro increasing_tendsto)  | 
| 63494 | 1375  | 
(auto simp: SUP_upper less_SUP_iff incseq_def eventually_sequentially intro: less_le_trans)  | 
1376  | 
||
1377  | 
lemma LIMSEQ_INF: "decseq X \<Longrightarrow> X \<longlonglongrightarrow> (INF i. X i :: 'a::{complete_linorder,linorder_topology})"
 | 
|
| 51471 | 1378  | 
by (intro decreasing_tendsto)  | 
| 63494 | 1379  | 
(auto simp: INF_lower INF_less_iff decseq_def eventually_sequentially intro: le_less_trans)  | 
1380  | 
||
1381  | 
lemma LIMSEQ_ignore_initial_segment: "f \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. f (n + k)) \<longlonglongrightarrow> a"  | 
|
1382  | 
unfolding tendsto_def by (subst eventually_sequentially_seg[where k=k])  | 
|
1383  | 
||
1384  | 
lemma LIMSEQ_offset: "(\<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
 | 
1385  | 
unfolding tendsto_def  | 
| 
 
1e9e68247ad1
generalize Bfun and Bseq to metric spaces; Bseq is an abbreviation for Bfun
 
hoelzl 
parents: 
51473 
diff
changeset
 | 
1386  | 
by (subst (asm) eventually_sequentially_seg[where k=k])  | 
| 51471 | 1387  | 
|
| 61969 | 1388  | 
lemma LIMSEQ_Suc: "f \<longlonglongrightarrow> l \<Longrightarrow> (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l"  | 
| 63494 | 1389  | 
by (drule LIMSEQ_ignore_initial_segment [where k="Suc 0"]) simp  | 
| 51471 | 1390  | 
|
| 61969 | 1391  | 
lemma LIMSEQ_imp_Suc: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l"  | 
| 63494 | 1392  | 
by (rule LIMSEQ_offset [where k="Suc 0"]) simp  | 
| 51471 | 1393  | 
|
| 61969 | 1394  | 
lemma LIMSEQ_Suc_iff: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l = f \<longlonglongrightarrow> l"  | 
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1395  | 
by (rule filterlim_sequentially_Suc)  | 
| 63494 | 1396  | 
|
| 68361 | 1397  | 
lemma LIMSEQ_lessThan_iff_atMost:  | 
1398  | 
  shows "(\<lambda>n. f {..<n}) \<longlonglongrightarrow> x \<longleftrightarrow> (\<lambda>n. f {..n}) \<longlonglongrightarrow> x"
 | 
|
1399  | 
apply (subst LIMSEQ_Suc_iff [symmetric])  | 
|
1400  | 
apply (simp only: lessThan_Suc_atMost)  | 
|
1401  | 
done  | 
|
1402  | 
||
| 63494 | 1403  | 
lemma LIMSEQ_unique: "X \<longlonglongrightarrow> a \<Longrightarrow> X \<longlonglongrightarrow> b \<Longrightarrow> a = b"  | 
1404  | 
for a b :: "'a::t2_space"  | 
|
| 51471 | 1405  | 
using trivial_limit_sequentially by (rule tendsto_unique)  | 
1406  | 
||
| 63494 | 1407  | 
lemma LIMSEQ_le_const: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. a \<le> X n \<Longrightarrow> a \<le> x"  | 
1408  | 
for a x :: "'a::linorder_topology"  | 
|
| 
63952
 
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
 
paulson <lp15@cam.ac.uk> 
parents: 
63713 
diff
changeset
 | 
1409  | 
by (simp add: eventually_at_top_linorder tendsto_lowerbound)  | 
| 51471 | 1410  | 
|
| 63494 | 1411  | 
lemma LIMSEQ_le: "X \<longlonglongrightarrow> x \<Longrightarrow> Y \<longlonglongrightarrow> y \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. X n \<le> Y n \<Longrightarrow> x \<le> y"  | 
1412  | 
for x y :: "'a::linorder_topology"  | 
|
| 51471 | 1413  | 
using tendsto_le[of sequentially Y y X x] by (simp add: eventually_sequentially)  | 
1414  | 
||
| 63494 | 1415  | 
lemma LIMSEQ_le_const2: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. X n \<le> a \<Longrightarrow> x \<le> a"  | 
1416  | 
for a x :: "'a::linorder_topology"  | 
|
| 
58729
 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 
hoelzl 
parents: 
57953 
diff
changeset
 | 
1417  | 
by (rule LIMSEQ_le[of X x "\<lambda>n. a"]) auto  | 
| 51471 | 1418  | 
|
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1419  | 
lemma Lim_bounded: "f \<longlonglongrightarrow> l \<Longrightarrow> \<forall>n\<ge>M. f n \<le> C \<Longrightarrow> l \<le> C"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1420  | 
for l :: "'a::linorder_topology"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1421  | 
by (intro LIMSEQ_le_const2) auto  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1422  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1423  | 
lemma Lim_bounded2:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1424  | 
fixes f :: "nat \<Rightarrow> 'a::linorder_topology"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1425  | 
assumes lim:"f \<longlonglongrightarrow> l" and ge: "\<forall>n\<ge>N. f n \<ge> C"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1426  | 
shows "l \<ge> C"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1427  | 
using ge  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1428  | 
by (intro tendsto_le[OF trivial_limit_sequentially lim tendsto_const])  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1429  | 
(auto simp: eventually_sequentially)  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1430  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1431  | 
lemma lim_mono:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1432  | 
fixes X Y :: "nat \<Rightarrow> 'a::linorder_topology"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1433  | 
assumes "\<And>n. N \<le> n \<Longrightarrow> X n \<le> Y n"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1434  | 
and "X \<longlonglongrightarrow> x"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1435  | 
and "Y \<longlonglongrightarrow> y"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1436  | 
shows "x \<le> y"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1437  | 
using assms(1) by (intro LIMSEQ_le[OF assms(2,3)]) auto  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1438  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1439  | 
lemma Sup_lim:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1440  | 
  fixes a :: "'a::{complete_linorder,linorder_topology}"
 | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1441  | 
assumes "\<And>n. b n \<in> s"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1442  | 
and "b \<longlonglongrightarrow> a"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1443  | 
shows "a \<le> Sup s"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1444  | 
by (metis Lim_bounded assms complete_lattice_class.Sup_upper)  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1445  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1446  | 
lemma Inf_lim:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1447  | 
  fixes a :: "'a::{complete_linorder,linorder_topology}"
 | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1448  | 
assumes "\<And>n. b n \<in> s"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1449  | 
and "b \<longlonglongrightarrow> a"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1450  | 
shows "Inf s \<le> a"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1451  | 
by (metis Lim_bounded2 assms complete_lattice_class.Inf_lower)  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1452  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1453  | 
lemma SUP_Lim:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1454  | 
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
 | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1455  | 
assumes inc: "incseq X"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1456  | 
and l: "X \<longlonglongrightarrow> l"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1457  | 
shows "(SUP n. X n) = l"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1458  | 
using LIMSEQ_SUP[OF inc] tendsto_unique[OF trivial_limit_sequentially l]  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1459  | 
by simp  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1460  | 
|
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1461  | 
lemma INF_Lim:  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1462  | 
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
 | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1463  | 
assumes dec: "decseq X"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1464  | 
and l: "X \<longlonglongrightarrow> l"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1465  | 
shows "(INF n. X n) = l"  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1466  | 
using LIMSEQ_INF[OF dec] tendsto_unique[OF trivial_limit_sequentially l]  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1467  | 
by simp  | 
| 
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1468  | 
|
| 63494 | 1469  | 
lemma convergentD: "convergent X \<Longrightarrow> \<exists>L. X \<longlonglongrightarrow> L"  | 
1470  | 
by (simp add: convergent_def)  | 
|
1471  | 
||
1472  | 
lemma convergentI: "X \<longlonglongrightarrow> L \<Longrightarrow> convergent X"  | 
|
1473  | 
by (auto simp add: convergent_def)  | 
|
1474  | 
||
1475  | 
lemma convergent_LIMSEQ_iff: "convergent X \<longleftrightarrow> X \<longlonglongrightarrow> lim X"  | 
|
1476  | 
by (auto intro: theI LIMSEQ_unique simp add: convergent_def lim_def)  | 
|
| 51471 | 1477  | 
|
1478  | 
lemma convergent_const: "convergent (\<lambda>n. c)"  | 
|
| 63494 | 1479  | 
by (rule convergentI) (rule tendsto_const)  | 
| 51471 | 1480  | 
|
1481  | 
lemma monoseq_le:  | 
|
| 63494 | 1482  | 
"monoseq a \<Longrightarrow> a \<longlonglongrightarrow> x \<Longrightarrow>  | 
1483  | 
(\<forall>n. a n \<le> x) \<and> (\<forall>m. \<forall>n\<ge>m. a m \<le> a n) \<or>  | 
|
1484  | 
(\<forall>n. x \<le> a n) \<and> (\<forall>m. \<forall>n\<ge>m. a n \<le> a m)"  | 
|
1485  | 
for x :: "'a::linorder_topology"  | 
|
| 51471 | 1486  | 
by (metis LIMSEQ_le_const LIMSEQ_le_const2 decseq_def incseq_def monoseq_iff)  | 
1487  | 
||
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1488  | 
lemma LIMSEQ_subseq_LIMSEQ: "X \<longlonglongrightarrow> L \<Longrightarrow> strict_mono f \<Longrightarrow> (X \<circ> f) \<longlonglongrightarrow> L"  | 
| 63494 | 1489  | 
unfolding comp_def by (rule filterlim_compose [of X, OF _ filterlim_subseq])  | 
1490  | 
||
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1491  | 
lemma convergent_subseq_convergent: "convergent X \<Longrightarrow> strict_mono f \<Longrightarrow> convergent (X \<circ> f)"  | 
| 63494 | 1492  | 
by (auto simp: convergent_def intro: LIMSEQ_subseq_LIMSEQ)  | 
1493  | 
||
1494  | 
lemma limI: "X \<longlonglongrightarrow> L \<Longrightarrow> lim X = L"  | 
|
| 57276 | 1495  | 
by (rule tendsto_Lim) (rule trivial_limit_sequentially)  | 
| 51471 | 1496  | 
|
| 63494 | 1497  | 
lemma lim_le: "convergent f \<Longrightarrow> (\<And>n. f n \<le> x) \<Longrightarrow> lim f \<le> x"  | 
1498  | 
for x :: "'a::linorder_topology"  | 
|
| 51471 | 1499  | 
using LIMSEQ_le_const2[of f "lim f" x] by (simp add: convergent_LIMSEQ_iff)  | 
1500  | 
||
| 62217 | 1501  | 
lemma lim_const [simp]: "lim (\<lambda>m. a) = a"  | 
1502  | 
by (simp add: limI)  | 
|
1503  | 
||
| 63494 | 1504  | 
|
1505  | 
subsubsection \<open>Increasing and Decreasing Series\<close>  | 
|
1506  | 
||
1507  | 
lemma incseq_le: "incseq X \<Longrightarrow> X \<longlonglongrightarrow> L \<Longrightarrow> X n \<le> L"  | 
|
1508  | 
for L :: "'a::linorder_topology"  | 
|
| 51471 | 1509  | 
by (metis incseq_def LIMSEQ_le_const)  | 
1510  | 
||
| 
68532
 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 
paulson <lp15@cam.ac.uk> 
parents: 
68361 
diff
changeset
 | 
1511  | 
lemma decseq_ge: "decseq X \<Longrightarrow> X \<longlonglongrightarrow> L \<Longrightarrow> L \<le> X n"  | 
| 63494 | 1512  | 
for L :: "'a::linorder_topology"  | 
| 51471 | 1513  | 
by (metis decseq_def LIMSEQ_le_const2)  | 
1514  | 
||
| 63494 | 1515  | 
|
| 60758 | 1516  | 
subsection \<open>First countable topologies\<close>  | 
| 51473 | 1517  | 
|
1518  | 
class first_countable_topology = topological_space +  | 
|
1519  | 
assumes first_countable_basis:  | 
|
1520  | 
"\<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))"  | 
|
1521  | 
||
1522  | 
lemma (in first_countable_topology) countable_basis_at_decseq:  | 
|
1523  | 
obtains A :: "nat \<Rightarrow> 'a set" where  | 
|
1524  | 
"\<And>i. open (A i)" "\<And>i. x \<in> (A i)"  | 
|
1525  | 
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"  | 
|
1526  | 
proof atomize_elim  | 
|
| 63494 | 1527  | 
from first_countable_basis[of x] obtain A :: "nat \<Rightarrow> 'a set"  | 
1528  | 
where nhds: "\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
|
1529  | 
and incl: "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>i. A i \<subseteq> S"  | 
|
1530  | 
by auto  | 
|
| 63040 | 1531  | 
define F where "F n = (\<Inter>i\<le>n. A i)" for n  | 
| 51473 | 1532  | 
show "\<exists>A. (\<forall>i. open (A i)) \<and> (\<forall>i. x \<in> A i) \<and>  | 
| 63494 | 1533  | 
(\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially)"  | 
| 51473 | 1534  | 
proof (safe intro!: exI[of _ F])  | 
1535  | 
fix i  | 
|
| 63494 | 1536  | 
show "open (F i)"  | 
1537  | 
using nhds(1) by (auto simp: F_def)  | 
|
1538  | 
show "x \<in> F i"  | 
|
1539  | 
using nhds(2) by (auto simp: F_def)  | 
|
| 51473 | 1540  | 
next  | 
| 63494 | 1541  | 
fix S  | 
1542  | 
assume "open S" "x \<in> S"  | 
|
1543  | 
from incl[OF this] obtain i where "F i \<subseteq> S"  | 
|
1544  | 
unfolding F_def by auto  | 
|
| 51473 | 1545  | 
moreover have "\<And>j. i \<le> j \<Longrightarrow> F j \<subseteq> F i"  | 
| 63171 | 1546  | 
by (simp add: Inf_superset_mono F_def image_mono)  | 
| 51473 | 1547  | 
ultimately show "eventually (\<lambda>i. F i \<subseteq> S) sequentially"  | 
1548  | 
by (auto simp: eventually_sequentially)  | 
|
1549  | 
qed  | 
|
1550  | 
qed  | 
|
1551  | 
||
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1552  | 
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
 | 
1553  | 
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
 | 
1554  | 
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
 | 
1555  | 
proof -  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1556  | 
from first_countable_basis obtain A :: "nat \<Rightarrow> 'a set"  | 
| 63494 | 1557  | 
where *: "\<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"  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1558  | 
by metis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1559  | 
show thesis  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1560  | 
proof  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1561  | 
show "decseq (\<lambda>n. \<Inter>i\<le>n. A i)"  | 
| 63171 | 1562  | 
by (simp add: antimono_iff_le_Suc atMost_Suc)  | 
| 63494 | 1563  | 
show "x \<in> (\<Inter>i\<le>n. A i)" "\<And>n. open (\<Inter>i\<le>n. A i)" for n  | 
1564  | 
using * by auto  | 
|
| 60585 | 1565  | 
show "nhds x = (INF n. principal (\<Inter>i\<le>n. A i))"  | 
| 63494 | 1566  | 
using *  | 
1567  | 
unfolding nhds_def  | 
|
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1568  | 
apply -  | 
| 
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1569  | 
apply (rule INF_eq)  | 
| 63494 | 1570  | 
apply simp_all  | 
1571  | 
apply fastforce  | 
|
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
1572  | 
apply (intro exI [of _ "\<Inter>i\<le>n. A i" for n] conjI open_INT)  | 
| 63494 | 1573  | 
apply auto  | 
| 
57448
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1574  | 
done  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1575  | 
qed  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1576  | 
qed  | 
| 
 
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
 
hoelzl 
parents: 
57447 
diff
changeset
 | 
1577  | 
|
| 51473 | 1578  | 
lemma (in first_countable_topology) countable_basis:  | 
1579  | 
obtains A :: "nat \<Rightarrow> 'a set" where  | 
|
1580  | 
"\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
|
| 61969 | 1581  | 
"\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"  | 
| 51473 | 1582  | 
proof atomize_elim  | 
| 63494 | 1583  | 
obtain A :: "nat \<Rightarrow> 'a set" where *:  | 
| 53381 | 1584  | 
"\<And>i. open (A i)"  | 
1585  | 
"\<And>i. x \<in> A i"  | 
|
1586  | 
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"  | 
|
1587  | 
by (rule countable_basis_at_decseq) blast  | 
|
| 63494 | 1588  | 
have "eventually (\<lambda>n. F n \<in> S) sequentially"  | 
1589  | 
if "\<forall>n. F n \<in> A n" "open S" "x \<in> S" for F S  | 
|
1590  | 
using *(3)[of S] that by (auto elim: eventually_mono simp: subset_eq)  | 
|
1591  | 
with * 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 | 1592  | 
by (intro exI[of _ A]) (auto simp: tendsto_def)  | 
1593  | 
qed  | 
|
1594  | 
||
1595  | 
lemma (in first_countable_topology) sequentially_imp_eventually_nhds_within:  | 
|
| 61969 | 1596  | 
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
 | 
1597  | 
shows "eventually P (inf (nhds a) (principal s))"  | 
| 51473 | 1598  | 
proof (rule ccontr)  | 
| 63494 | 1599  | 
obtain A :: "nat \<Rightarrow> 'a set" where *:  | 
| 53381 | 1600  | 
"\<And>i. open (A i)"  | 
1601  | 
"\<And>i. a \<in> A i"  | 
|
| 61969 | 1602  | 
"\<And>F. \<forall>n. F n \<in> A n \<Longrightarrow> F \<longlonglongrightarrow> a"  | 
| 53381 | 1603  | 
by (rule countable_basis) blast  | 
1604  | 
assume "\<not> ?thesis"  | 
|
| 63494 | 1605  | 
with * have "\<exists>F. \<forall>n. F n \<in> s \<and> F n \<in> A n \<and> \<not> P (F n)"  | 
1606  | 
unfolding eventually_inf_principal eventually_nhds  | 
|
1607  | 
by (intro choice) fastforce  | 
|
1608  | 
then obtain F where F: "\<forall>n. F n \<in> s" and "\<forall>n. F n \<in> A n" and F': "\<forall>n. \<not> P (F n)"  | 
|
| 53381 | 1609  | 
by blast  | 
| 63494 | 1610  | 
with * have "F \<longlonglongrightarrow> a"  | 
1611  | 
by auto  | 
|
1612  | 
then have "eventually (\<lambda>n. P (F n)) sequentially"  | 
|
1613  | 
using assms F by simp  | 
|
1614  | 
then show False  | 
|
1615  | 
by (simp add: F')  | 
|
| 51473 | 1616  | 
qed  | 
1617  | 
||
1618  | 
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
 | 
1619  | 
"eventually P (inf (nhds a) (principal s)) \<longleftrightarrow>  | 
| 61969 | 1620  | 
(\<forall>f. (\<forall>n. f n \<in> s) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially)"  | 
| 51473 | 1621  | 
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
 | 
1622  | 
assume "eventually P (inf (nhds a) (principal s))"  | 
| 51473 | 1623  | 
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
 | 
1624  | 
by (auto simp: eventually_inf_principal eventually_nhds)  | 
| 63494 | 1625  | 
moreover  | 
1626  | 
fix f  | 
|
1627  | 
assume "\<forall>n. f n \<in> s" "f \<longlonglongrightarrow> a"  | 
|
| 51473 | 1628  | 
ultimately show "eventually (\<lambda>n. P (f n)) sequentially"  | 
| 61810 | 1629  | 
by (auto dest!: topological_tendstoD elim: eventually_mono)  | 
| 51473 | 1630  | 
qed  | 
1631  | 
||
1632  | 
lemma (in first_countable_topology) eventually_nhds_iff_sequentially:  | 
|
| 61969 | 1633  | 
"eventually P (nhds a) \<longleftrightarrow> (\<forall>f. f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially)"  | 
| 51473 | 1634  | 
using eventually_nhds_within_iff_sequentially[of P a UNIV] by simp  | 
1635  | 
||
| 
70723
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1636  | 
(*Thanks to Sébastien Gouëzel*)  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1637  | 
lemma Inf_as_limit:  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1638  | 
  fixes A::"'a::{linorder_topology, first_countable_topology, complete_linorder} set"
 | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1639  | 
  assumes "A \<noteq> {}"
 | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1640  | 
shows "\<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A"  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1641  | 
proof (cases "Inf A \<in> A")  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1642  | 
case True  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1643  | 
show ?thesis  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1644  | 
by (rule exI[of _ "\<lambda>n. Inf A"], auto simp add: True)  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1645  | 
next  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1646  | 
case False  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1647  | 
obtain y where "y \<in> A" using assms by auto  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1648  | 
then have "Inf A < y" using False Inf_lower less_le by auto  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1649  | 
obtain F :: "nat \<Rightarrow> 'a set" where F: "\<And>i. open (F i)" "\<And>i. Inf A \<in> F i"  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1650  | 
"\<And>u. (\<forall>n. u n \<in> F n) \<Longrightarrow> u \<longlonglongrightarrow> Inf A"  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1651  | 
by (metis first_countable_topology_class.countable_basis)  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1652  | 
define u where "u = (\<lambda>n. SOME z. z \<in> F n \<and> z \<in> A)"  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1653  | 
have "\<exists>z. z \<in> U \<and> z \<in> A" if "Inf A \<in> U" "open U" for U  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1654  | 
proof -  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1655  | 
    obtain b where "b > Inf A" "{Inf A ..<b} \<subseteq> U"
 | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1656  | 
using open_right[OF \<open>open U\<close> \<open>Inf A \<in> U\<close> \<open>Inf A < y\<close>] by auto  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1657  | 
obtain z where "z < b" "z \<in> A"  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1658  | 
using \<open>Inf A < b\<close> Inf_less_iff by auto  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1659  | 
    then have "z \<in> {Inf A ..<b}"
 | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1660  | 
by (simp add: Inf_lower)  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1661  | 
    then show ?thesis using \<open>z \<in> A\<close> \<open>{Inf A ..<b} \<subseteq> U\<close> by auto
 | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1662  | 
qed  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1663  | 
then have *: "u n \<in> F n \<and> u n \<in> A" for n  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1664  | 
using \<open>Inf A \<in> F n\<close> \<open>open (F n)\<close> unfolding u_def by (metis (no_types, lifting) someI_ex)  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1665  | 
then have "u \<longlonglongrightarrow> Inf A" using F(3) by simp  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1666  | 
then show ?thesis using * by auto  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1667  | 
qed  | 
| 
 
4e39d87c9737
imported new material mostly due to Sébastien Gouëzel
 
paulson <lp15@cam.ac.uk> 
parents: 
70707 
diff
changeset
 | 
1668  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1669  | 
lemma tendsto_at_iff_sequentially:  | 
| 63494 | 1670  | 
  "(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))"
 | 
1671  | 
for f :: "'a::first_countable_topology \<Rightarrow> _"  | 
|
1672  | 
unfolding filterlim_def[of _ "nhds a"] le_filter_def eventually_filtermap  | 
|
1673  | 
at_within_def eventually_nhds_within_iff_sequentially 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
 | 
1674  | 
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
 | 
1675  | 
|
| 
64283
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1676  | 
lemma approx_from_above_dense_linorder:  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1677  | 
  fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}"
 | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1678  | 
assumes "x < y"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1679  | 
shows "\<exists>u. (\<forall>n. u n > x) \<and> (u \<longlonglongrightarrow> x)"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1680  | 
proof -  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1681  | 
obtain A :: "nat \<Rightarrow> 'a set" where A: "\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1682  | 
"\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1683  | 
by (metis first_countable_topology_class.countable_basis)  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1684  | 
define u where "u = (\<lambda>n. SOME z. z \<in> A n \<and> z > x)"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1685  | 
have "\<exists>z. z \<in> U \<and> x < z" if "x \<in> U" "open U" for U  | 
| 67226 | 1686  | 
using open_right[OF \<open>open U\<close> \<open>x \<in> U\<close> \<open>x < y\<close>]  | 
| 
64283
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1687  | 
by (meson atLeastLessThan_iff dense less_imp_le subset_eq)  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1688  | 
then have *: "u n \<in> A n \<and> x < u n" for n  | 
| 67226 | 1689  | 
using \<open>x \<in> A n\<close> \<open>open (A n)\<close> unfolding u_def by (metis (no_types, lifting) someI_ex)  | 
| 
64283
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1690  | 
then have "u \<longlonglongrightarrow> x" using A(3) by simp  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1691  | 
then show ?thesis using * by auto  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1692  | 
qed  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1693  | 
|
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1694  | 
lemma approx_from_below_dense_linorder:  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1695  | 
  fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}"
 | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1696  | 
assumes "x > y"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1697  | 
shows "\<exists>u. (\<forall>n. u n < x) \<and> (u \<longlonglongrightarrow> x)"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1698  | 
proof -  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1699  | 
obtain A :: "nat \<Rightarrow> 'a set" where A: "\<And>i. open (A i)" "\<And>i. x \<in> A i"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1700  | 
"\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1701  | 
by (metis first_countable_topology_class.countable_basis)  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1702  | 
define u where "u = (\<lambda>n. SOME z. z \<in> A n \<and> z < x)"  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1703  | 
have "\<exists>z. z \<in> U \<and> z < x" if "x \<in> U" "open U" for U  | 
| 67226 | 1704  | 
using open_left[OF \<open>open U\<close> \<open>x \<in> U\<close> \<open>x > y\<close>]  | 
| 
64283
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1705  | 
by (meson dense greaterThanAtMost_iff less_imp_le subset_eq)  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1706  | 
then have *: "u n \<in> A n \<and> u n < x" for n  | 
| 67226 | 1707  | 
using \<open>x \<in> A n\<close> \<open>open (A n)\<close> unfolding u_def by (metis (no_types, lifting) someI_ex)  | 
| 
64283
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1708  | 
then have "u \<longlonglongrightarrow> x" using A(3) by simp  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1709  | 
then show ?thesis using * by auto  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1710  | 
qed  | 
| 
 
979cdfdf7a79
HOL-Probability: move conditional expectation from AFP/Ergodic_Theory
 
hoelzl 
parents: 
64008 
diff
changeset
 | 
1711  | 
|
| 63494 | 1712  | 
|
| 60758 | 1713  | 
subsection \<open>Function limit at a point\<close>  | 
| 51471 | 1714  | 
|
| 63494 | 1715  | 
abbreviation LIM :: "('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool"
 | 
1716  | 
    ("((_)/ \<midarrow>(_)/\<rightarrow> (_))" [60, 0, 60] 60)
 | 
|
1717  | 
where "f \<midarrow>a\<rightarrow> L \<equiv> (f \<longlongrightarrow> L) (at a)"  | 
|
| 51471 | 1718  | 
|
| 61976 | 1719  | 
lemma tendsto_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> (f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow> (f \<midarrow>a\<rightarrow> l)"  | 
| 63494 | 1720  | 
by (simp add: tendsto_def at_within_open[where S = S])  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1721  | 
|
| 
62397
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
1722  | 
lemma tendsto_within_open_NO_MATCH:  | 
| 63494 | 1723  | 
"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)"  | 
1724  | 
for f :: "'a::topological_space \<Rightarrow> 'b::topological_space"  | 
|
1725  | 
using tendsto_within_open by blast  | 
|
1726  | 
||
1727  | 
lemma LIM_const_not_eq[tendsto_intros]: "k \<noteq> L \<Longrightarrow> \<not> (\<lambda>x. k) \<midarrow>a\<rightarrow> L"  | 
|
1728  | 
for a :: "'a::perfect_space" and k L :: "'b::t2_space"  | 
|
| 51471 | 1729  | 
by (simp add: tendsto_const_iff)  | 
1730  | 
||
1731  | 
lemmas LIM_not_zero = LIM_const_not_eq [where L = 0]  | 
|
1732  | 
||
| 63494 | 1733  | 
lemma LIM_const_eq: "(\<lambda>x. k) \<midarrow>a\<rightarrow> L \<Longrightarrow> k = L"  | 
1734  | 
for a :: "'a::perfect_space" and k L :: "'b::t2_space"  | 
|
| 51471 | 1735  | 
by (simp add: tendsto_const_iff)  | 
1736  | 
||
| 63494 | 1737  | 
lemma LIM_unique: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> M \<Longrightarrow> L = M"  | 
1738  | 
for a :: "'a::perfect_space" and L M :: "'b::t2_space"  | 
|
| 51471 | 1739  | 
using at_neq_bot by (rule tendsto_unique)  | 
1740  | 
||
| 63494 | 1741  | 
|
1742  | 
text \<open>Limits are equal for functions equal except at limit point.\<close>  | 
|
1743  | 
lemma LIM_equal: "\<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>a\<rightarrow> l)"  | 
|
1744  | 
by (simp add: tendsto_def eventually_at_topological)  | 
|
| 51471 | 1745  | 
|
| 61976 | 1746  | 
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 | 1747  | 
by (simp add: LIM_equal)  | 
1748  | 
||
| 
70365
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
1749  | 
lemma tendsto_cong_limit: "(f \<longlongrightarrow> l) F \<Longrightarrow> k = l \<Longrightarrow> (f \<longlongrightarrow> k) F"  | 
| 51471 | 1750  | 
by simp  | 
1751  | 
||
| 63494 | 1752  | 
lemma tendsto_at_iff_tendsto_nhds: "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
 | 
1753  | 
unfolding tendsto_def eventually_at_filter  | 
| 61810 | 1754  | 
by (intro ext all_cong imp_cong) (auto elim!: eventually_mono)  | 
| 51471 | 1755  | 
|
| 63494 | 1756  | 
lemma tendsto_compose: "g \<midarrow>l\<rightarrow> g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"  | 
| 51471 | 1757  | 
unfolding tendsto_at_iff_tendsto_nhds by (rule filterlim_compose[of g])  | 
1758  | 
||
1759  | 
lemma tendsto_compose_eventually:  | 
|
| 61976 | 1760  | 
"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 | 1761  | 
by (rule filterlim_compose[of g _ "at l"]) (auto simp add: filterlim_at)  | 
1762  | 
||
1763  | 
lemma LIM_compose_eventually:  | 
|
| 63494 | 1764  | 
assumes "f \<midarrow>a\<rightarrow> b"  | 
1765  | 
and "g \<midarrow>b\<rightarrow> c"  | 
|
1766  | 
and "eventually (\<lambda>x. f x \<noteq> b) (at a)"  | 
|
| 61976 | 1767  | 
shows "(\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c"  | 
| 63494 | 1768  | 
using assms(2,1,3) by (rule tendsto_compose_eventually)  | 
| 51471 | 1769  | 
|
| 61973 | 1770  | 
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
 | 
1771  | 
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
 | 
1772  | 
|
| 
64758
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1773  | 
lemma tendsto_compose_at:  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1774  | 
assumes f: "(f \<longlongrightarrow> y) F" and g: "(g \<longlongrightarrow> z) (at y)" and fg: "eventually (\<lambda>w. f w = y \<longrightarrow> g y = z) F"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1775  | 
shows "((g \<circ> f) \<longlongrightarrow> z) F"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1776  | 
proof -  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1777  | 
have "(\<forall>\<^sub>F a in F. f a \<noteq> y) \<or> g y = z"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1778  | 
using fg by force  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1779  | 
moreover have "(g \<longlongrightarrow> z) (filtermap f F) \<or> \<not> (\<forall>\<^sub>F a in F. f a \<noteq> y)"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1780  | 
by (metis (no_types) filterlim_atI filterlim_def tendsto_mono f g)  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1781  | 
ultimately show ?thesis  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1782  | 
by (metis (no_types) f filterlim_compose filterlim_filtermap g tendsto_at_iff_tendsto_nhds tendsto_compose_filtermap)  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1783  | 
qed  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
1784  | 
|
| 63494 | 1785  | 
|
1786  | 
subsubsection \<open>Relation of \<open>LIM\<close> and \<open>LIMSEQ\<close>\<close>  | 
|
| 51473 | 1787  | 
|
1788  | 
lemma (in first_countable_topology) sequentially_imp_eventually_within:  | 
|
| 61969 | 1789  | 
"(\<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 | 1790  | 
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
 | 
1791  | 
unfolding at_within_def  | 
| 51473 | 1792  | 
by (intro sequentially_imp_eventually_nhds_within) auto  | 
1793  | 
||
1794  | 
lemma (in first_countable_topology) sequentially_imp_eventually_at:  | 
|
| 61969 | 1795  | 
"(\<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 | 1796  | 
using sequentially_imp_eventually_within [where s=UNIV] by simp  | 
| 51473 | 1797  | 
|
1798  | 
lemma LIMSEQ_SEQ_conv1:  | 
|
1799  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"  | 
|
| 61976 | 1800  | 
assumes f: "f \<midarrow>a\<rightarrow> l"  | 
| 61969 | 1801  | 
shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. f (S n)) \<longlonglongrightarrow> l"  | 
| 51473 | 1802  | 
using tendsto_compose_eventually [OF f, where F=sequentially] by simp  | 
1803  | 
||
1804  | 
lemma LIMSEQ_SEQ_conv2:  | 
|
1805  | 
fixes f :: "'a::first_countable_topology \<Rightarrow> 'b::topological_space"  | 
|
| 61969 | 1806  | 
assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. f (S n)) \<longlonglongrightarrow> l"  | 
| 61976 | 1807  | 
shows "f \<midarrow>a\<rightarrow> l"  | 
| 51473 | 1808  | 
using assms unfolding tendsto_def [where l=l] by (simp add: sequentially_imp_eventually_at)  | 
1809  | 
||
| 63494 | 1810  | 
lemma LIMSEQ_SEQ_conv: "(\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S \<longlonglongrightarrow> a \<longrightarrow> (\<lambda>n. X (S n)) \<longlonglongrightarrow> L) \<longleftrightarrow> X \<midarrow>a\<rightarrow> L"  | 
1811  | 
for a :: "'a::first_countable_topology" and L :: "'b::topological_space"  | 
|
| 51473 | 1812  | 
using LIMSEQ_SEQ_conv2 LIMSEQ_SEQ_conv1 ..  | 
1813  | 
||
| 57025 | 1814  | 
lemma sequentially_imp_eventually_at_left:  | 
| 63494 | 1815  | 
  fixes a :: "'a::{linorder_topology,first_countable_topology}"
 | 
| 57025 | 1816  | 
assumes b[simp]: "b < a"  | 
| 63494 | 1817  | 
and *: "\<And>f. (\<And>n. b < f n) \<Longrightarrow> (\<And>n. f n < a) \<Longrightarrow> incseq f \<Longrightarrow> f \<longlonglongrightarrow> a \<Longrightarrow>  | 
1818  | 
eventually (\<lambda>n. P (f n)) sequentially"  | 
|
| 57025 | 1819  | 
shows "eventually P (at_left a)"  | 
1820  | 
proof (safe intro!: sequentially_imp_eventually_within)  | 
|
| 63494 | 1821  | 
fix X  | 
1822  | 
  assume X: "\<forall>n. X n \<in> {..< a} \<and> X n \<noteq> a" "X \<longlonglongrightarrow> a"
 | 
|
| 57025 | 1823  | 
show "eventually (\<lambda>n. P (X n)) sequentially"  | 
1824  | 
proof (rule ccontr)  | 
|
| 63494 | 1825  | 
assume neg: "\<not> ?thesis"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1826  | 
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))"  | 
| 63494 | 1827  | 
(is "\<exists>s. ?P 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
 | 
1828  | 
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
 | 
1829  | 
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
 | 
1830  | 
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
 | 
1831  | 
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
 | 
1832  | 
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
 | 
1833  | 
next  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1834  | 
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
 | 
1835  | 
have "\<not> eventually (\<lambda>n. Suc x \<le> n \<longrightarrow> b < X n \<longrightarrow> X x < X n \<longrightarrow> P (X n)) sequentially"  | 
| 63494 | 1836  | 
using X  | 
1837  | 
by (intro not_eventually_impI order_tendstoD(1)[OF X(2)] eventually_ge_at_top neg) auto  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1838  | 
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
 | 
1839  | 
by (auto dest!: not_eventuallyD)  | 
| 57025 | 1840  | 
qed  | 
| 63494 | 1841  | 
then obtain s where "?P s" ..  | 
1842  | 
with X have "b < X (s n)"  | 
|
1843  | 
and "X (s n) < a"  | 
|
1844  | 
and "incseq (\<lambda>n. X (s n))"  | 
|
1845  | 
and "(\<lambda>n. X (s n)) \<longlonglongrightarrow> a"  | 
|
1846  | 
and "\<not> P (X (s n))"  | 
|
1847  | 
for n  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1848  | 
by (auto simp: strict_mono_Suc_iff Suc_le_eq incseq_Suc_iff  | 
| 63494 | 1849  | 
intro!: LIMSEQ_subseq_LIMSEQ[OF \<open>X \<longlonglongrightarrow> a\<close>, unfolded comp_def])  | 
1850  | 
from *[OF this(1,2,3,4)] this(5) show False  | 
|
1851  | 
by auto  | 
|
| 57025 | 1852  | 
qed  | 
1853  | 
qed  | 
|
1854  | 
||
1855  | 
lemma tendsto_at_left_sequentially:  | 
|
| 63494 | 1856  | 
  fixes a b :: "'b::{linorder_topology,first_countable_topology}"
 | 
| 57025 | 1857  | 
assumes "b < a"  | 
| 63494 | 1858  | 
assumes *: "\<And>S. (\<And>n. S n < a) \<Longrightarrow> (\<And>n. b < S n) \<Longrightarrow> incseq S \<Longrightarrow> S \<longlonglongrightarrow> a \<Longrightarrow>  | 
1859  | 
(\<lambda>n. X (S n)) \<longlonglongrightarrow> L"  | 
|
| 61973 | 1860  | 
shows "(X \<longlongrightarrow> L) (at_left a)"  | 
| 63494 | 1861  | 
using assms by (simp add: tendsto_def [where l=L] sequentially_imp_eventually_at_left)  | 
| 57025 | 1862  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1863  | 
lemma sequentially_imp_eventually_at_right:  | 
| 63494 | 1864  | 
  fixes a b :: "'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
 | 
1865  | 
assumes b[simp]: "a < b"  | 
| 63494 | 1866  | 
assumes *: "\<And>f. (\<And>n. a < f n) \<Longrightarrow> (\<And>n. f n < b) \<Longrightarrow> decseq f \<Longrightarrow> f \<longlonglongrightarrow> a \<Longrightarrow>  | 
1867  | 
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
 | 
1868  | 
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
 | 
1869  | 
proof (safe intro!: sequentially_imp_eventually_within)  | 
| 63494 | 1870  | 
fix X  | 
1871  | 
  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
 | 
1872  | 
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
 | 
1873  | 
proof (rule ccontr)  | 
| 63494 | 1874  | 
assume neg: "\<not> ?thesis"  | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1875  | 
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))"  | 
| 63494 | 1876  | 
(is "\<exists>s. ?P 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
 | 
1877  | 
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
 | 
1878  | 
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
 | 
1879  | 
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
 | 
1880  | 
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
 | 
1881  | 
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
 | 
1882  | 
next  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1883  | 
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
 | 
1884  | 
have "\<not> eventually (\<lambda>n. Suc x \<le> n \<longrightarrow> X n < b \<longrightarrow> X n < X x \<longrightarrow> P (X n)) sequentially"  | 
| 63494 | 1885  | 
using X  | 
1886  | 
by (intro not_eventually_impI order_tendstoD(2)[OF X(2)] eventually_ge_at_top neg) auto  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1887  | 
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
 | 
1888  | 
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
 | 
1889  | 
qed  | 
| 63494 | 1890  | 
then obtain s where "?P s" ..  | 
1891  | 
with X have "a < X (s n)"  | 
|
1892  | 
and "X (s n) < b"  | 
|
1893  | 
and "decseq (\<lambda>n. X (s n))"  | 
|
1894  | 
and "(\<lambda>n. X (s n)) \<longlonglongrightarrow> a"  | 
|
1895  | 
and "\<not> P (X (s n))"  | 
|
1896  | 
for n  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
1897  | 
by (auto simp: strict_mono_Suc_iff Suc_le_eq decseq_Suc_iff  | 
| 63494 | 1898  | 
intro!: LIMSEQ_subseq_LIMSEQ[OF \<open>X \<longlonglongrightarrow> a\<close>, unfolded comp_def])  | 
1899  | 
from *[OF this(1,2,3,4)] this(5) show False  | 
|
1900  | 
by auto  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1901  | 
qed  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1902  | 
qed  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1903  | 
|
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1904  | 
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
 | 
1905  | 
  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
 | 
1906  | 
assumes "a < b"  | 
| 63494 | 1907  | 
and *: "\<And>S. (\<And>n. a < S n) \<Longrightarrow> (\<And>n. S n < b) \<Longrightarrow> decseq S \<Longrightarrow> S \<longlonglongrightarrow> a \<Longrightarrow>  | 
1908  | 
(\<lambda>n. X (S n)) \<longlonglongrightarrow> L"  | 
|
| 61973 | 1909  | 
shows "(X \<longlongrightarrow> L) (at_right a)"  | 
| 63494 | 1910  | 
using assms by (simp add: tendsto_def [where l=L] sequentially_imp_eventually_at_right)  | 
1911  | 
||
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
1912  | 
|
| 60758 | 1913  | 
subsection \<open>Continuity\<close>  | 
| 51471 | 1914  | 
|
| 60758 | 1915  | 
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
 | 
1916  | 
|
| 63494 | 1917  | 
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
 | 
1918  | 
where "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
 | 
1919  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1920  | 
lemma continuous_on_cong [cong]:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1921  | 
"s = t \<Longrightarrow> (\<And>x. x \<in> t \<Longrightarrow> f x = g x) \<Longrightarrow> continuous_on s f \<longleftrightarrow> continuous_on t g"  | 
| 63494 | 1922  | 
unfolding continuous_on_def  | 
1923  | 
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
 | 
1924  | 
|
| 
69546
 
27dae626822b
prefer naming convention from datatype package for strong congruence rules
 
haftmann 
parents: 
69529 
diff
changeset
 | 
1925  | 
lemma continuous_on_cong_simp:  | 
| 
64008
 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 
hoelzl 
parents: 
63952 
diff
changeset
 | 
1926  | 
"s = t \<Longrightarrow> (\<And>x. x \<in> t =simp=> f x = g x) \<Longrightarrow> continuous_on s f \<longleftrightarrow> continuous_on t g"  | 
| 
 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 
hoelzl 
parents: 
63952 
diff
changeset
 | 
1927  | 
unfolding simp_implies_def by (rule continuous_on_cong)  | 
| 
 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 
hoelzl 
parents: 
63952 
diff
changeset
 | 
1928  | 
|
| 
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
 | 
1929  | 
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
 | 
1930  | 
"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
 | 
1931  | 
(\<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
 | 
1932  | 
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
 | 
1933  | 
|
| 
 
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
 | 
1934  | 
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
 | 
1935  | 
"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
 | 
1936  | 
proof safe  | 
| 63494 | 1937  | 
fix B :: "'b set"  | 
1938  | 
assume "continuous_on s f" "open 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
 | 
1939  | 
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
 | 
1940  | 
by (auto simp: continuous_on_topological subset_eq Ball_def imp_conjL)  | 
| 53381 | 1941  | 
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"  | 
1942  | 
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
 | 
1943  | 
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
 | 
1944  | 
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
 | 
1945  | 
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
 | 
1946  | 
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
 | 
1947  | 
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
 | 
1948  | 
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
 | 
1949  | 
proof safe  | 
| 63494 | 1950  | 
fix x B  | 
1951  | 
assume "x \<in> s" "open B" "f x \<in> B"  | 
|
1952  | 
with B obtain A where A: "open A" "A \<inter> s = f -` B \<inter> s"  | 
|
1953  | 
by auto  | 
|
| 60758 | 1954  | 
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
 | 
1955  | 
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
 | 
1956  | 
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
 | 
1957  | 
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
 | 
1958  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1959  | 
lemma continuous_on_open_vimage:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1960  | 
"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
 | 
1961  | 
unfolding continuous_on_open_invariant  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1962  | 
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
 | 
1963  | 
|
| 55734 | 1964  | 
corollary continuous_imp_open_vimage:  | 
1965  | 
assumes "continuous_on s f" "open s" "open B" "f -` B \<subseteq> s"  | 
|
| 63494 | 1966  | 
shows "open (f -` B)"  | 
1967  | 
by (metis assms continuous_on_open_vimage le_iff_inf)  | 
|
| 55734 | 1968  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1969  | 
corollary open_vimage[continuous_intros]:  | 
| 63494 | 1970  | 
assumes "open s"  | 
1971  | 
and "continuous_on UNIV f"  | 
|
| 55775 | 1972  | 
shows "open (f -` s)"  | 
| 63494 | 1973  | 
using assms by (simp add: continuous_on_open_vimage [OF open_UNIV])  | 
| 55775 | 1974  | 
|
| 
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
 | 
1975  | 
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
 | 
1976  | 
"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
 | 
1977  | 
proof -  | 
| 63494 | 1978  | 
have *: "(\<And>A. P A \<longleftrightarrow> Q (- A)) \<Longrightarrow> (\<forall>A. P A) \<longleftrightarrow> (\<forall>A. Q A)"  | 
1979  | 
for P Q :: "'b set \<Rightarrow> bool"  | 
|
| 
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
 | 
1980  | 
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
 | 
1981  | 
show ?thesis  | 
| 63494 | 1982  | 
unfolding continuous_on_open_invariant  | 
1983  | 
by (intro *) (auto simp: open_closed[symmetric])  | 
|
| 
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
 | 
1984  | 
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
 | 
1985  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1986  | 
lemma continuous_on_closed_vimage:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1987  | 
"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
 | 
1988  | 
unfolding continuous_on_closed_invariant  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
1989  | 
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
 | 
1990  | 
|
| 
61426
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1991  | 
corollary closed_vimage_Int[continuous_intros]:  | 
| 63494 | 1992  | 
assumes "closed s"  | 
1993  | 
and "continuous_on t f"  | 
|
1994  | 
and t: "closed t"  | 
|
| 
61426
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1995  | 
shows "closed (f -` s \<inter> t)"  | 
| 63494 | 1996  | 
using assms by (simp add: continuous_on_closed_vimage [OF t])  | 
| 
61426
 
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
 
paulson <lp15@cam.ac.uk> 
parents: 
61342 
diff
changeset
 | 
1997  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
1998  | 
corollary closed_vimage[continuous_intros]:  | 
| 63494 | 1999  | 
assumes "closed s"  | 
2000  | 
and "continuous_on UNIV f"  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
2001  | 
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
 | 
2002  | 
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
 | 
2003  | 
|
| 
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
 | 
2004  | 
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
 | 
2005  | 
by (simp add: continuous_on_def)  | 
| 
 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 
paulson <lp15@cam.ac.uk> 
parents: 
61810 
diff
changeset
 | 
2006  | 
|
| 
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
 | 
2007  | 
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
 | 
2008  | 
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
 | 
2009  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2010  | 
lemma continuous_on_open_Union:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2011  | 
"(\<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"  | 
| 63494 | 2012  | 
unfolding continuous_on_def  | 
2013  | 
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
 | 
2014  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2015  | 
lemma continuous_on_open_UN:  | 
| 63494 | 2016  | 
"(\<And>s. s \<in> S \<Longrightarrow> open (A s)) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on (A s) f) \<Longrightarrow>  | 
2017  | 
continuous_on (\<Union>s\<in>S. A s) f"  | 
|
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
62217 
diff
changeset
 | 
2018  | 
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
 | 
2019  | 
|
| 61204 | 2020  | 
lemma continuous_on_open_Un:  | 
2021  | 
"open s \<Longrightarrow> open t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"  | 
|
2022  | 
  using continuous_on_open_Union [of "{s,t}"] by auto
 | 
|
2023  | 
||
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2024  | 
lemma continuous_on_closed_Un:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2025  | 
"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
 | 
2026  | 
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
 | 
2027  | 
|
| 
67727
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2028  | 
lemma continuous_on_closed_Union:  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2029  | 
assumes "finite I"  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2030  | 
"\<And>i. i \<in> I \<Longrightarrow> closed (U i)"  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2031  | 
"\<And>i. i \<in> I \<Longrightarrow> continuous_on (U i) f"  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2032  | 
shows "continuous_on (\<Union> i \<in> I. U i) f"  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2033  | 
using assms  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2034  | 
by (induction I) (auto intro!: continuous_on_closed_Un)  | 
| 
 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 
immler 
parents: 
67707 
diff
changeset
 | 
2035  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2036  | 
lemma continuous_on_If:  | 
| 63494 | 2037  | 
assumes closed: "closed s" "closed t"  | 
2038  | 
and cont: "continuous_on s f" "continuous_on t g"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2039  | 
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"  | 
| 63494 | 2040  | 
shows "continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"  | 
2041  | 
(is "continuous_on _ ?h")  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2042  | 
proof-  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2043  | 
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
 | 
2044  | 
by auto  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2045  | 
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
 | 
2046  | 
by simp_all  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2047  | 
with closed show ?thesis  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2048  | 
by (rule continuous_on_closed_Un)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2049  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2050  | 
|
| 
65036
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2051  | 
lemma continuous_on_cases:  | 
| 
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2052  | 
"closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t g \<Longrightarrow>  | 
| 
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2053  | 
\<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x \<Longrightarrow>  | 
| 
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2054  | 
continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"  | 
| 
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2055  | 
by (rule continuous_on_If) auto  | 
| 
 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 
paulson <lp15@cam.ac.uk> 
parents: 
64969 
diff
changeset
 | 
2056  | 
|
| 
68296
 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 
paulson <lp15@cam.ac.uk> 
parents: 
68064 
diff
changeset
 | 
2057  | 
lemma continuous_on_id[continuous_intros,simp]: "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
 | 
2058  | 
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
 | 
2059  | 
|
| 
68296
 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 
paulson <lp15@cam.ac.uk> 
parents: 
68064 
diff
changeset
 | 
2060  | 
lemma continuous_on_id'[continuous_intros,simp]: "continuous_on s id"  | 
| 63301 | 2061  | 
unfolding continuous_on_def id_def by fast  | 
2062  | 
||
| 
68296
 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 
paulson <lp15@cam.ac.uk> 
parents: 
68064 
diff
changeset
 | 
2063  | 
lemma continuous_on_const[continuous_intros,simp]: "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
 | 
2064  | 
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
 | 
2065  | 
|
| 
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
 | 
2066  | 
lemma continuous_on_subset: "continuous_on s f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous_on t f"  | 
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2067  | 
unfolding continuous_on_def  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2068  | 
by (metis subset_eq tendsto_within_subset)  | 
| 
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
 | 
2069  | 
|
| 
56371
 
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
 
hoelzl 
parents: 
56329 
diff
changeset
 | 
2070  | 
lemma continuous_on_compose[continuous_intros]:  | 
| 63494 | 2071  | 
"continuous_on s f \<Longrightarrow> continuous_on (f ` s) g \<Longrightarrow> continuous_on s (g \<circ> 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
 | 
2072  | 
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
 | 
2073  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2074  | 
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
 | 
2075  | 
"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
 | 
2076  | 
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
 | 
2077  | 
|
| 60720 | 2078  | 
lemma continuous_on_generate_topology:  | 
2079  | 
assumes *: "open = generate_topology X"  | 
|
| 63494 | 2080  | 
and **: "\<And>B. B \<in> X \<Longrightarrow> \<exists>C. open C \<and> C \<inter> A = f -` B \<inter> A"  | 
| 60720 | 2081  | 
shows "continuous_on A f"  | 
2082  | 
unfolding continuous_on_open_invariant  | 
|
2083  | 
proof safe  | 
|
| 63494 | 2084  | 
fix B :: "'a set"  | 
2085  | 
assume "open B"  | 
|
2086  | 
then show "\<exists>C. open C \<and> C \<inter> A = f -` B \<inter> A"  | 
|
| 60720 | 2087  | 
unfolding *  | 
| 63494 | 2088  | 
proof induct  | 
| 60720 | 2089  | 
case (UN K)  | 
2090  | 
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"  | 
|
2091  | 
by metis  | 
|
2092  | 
then show ?case  | 
|
2093  | 
by (intro exI[of _ "\<Union>k\<in>K. C k"]) blast  | 
|
2094  | 
qed (auto intro: **)  | 
|
2095  | 
qed  | 
|
2096  | 
||
2097  | 
lemma continuous_onI_mono:  | 
|
| 63494 | 2098  | 
  fixes f :: "'a::linorder_topology \<Rightarrow> 'b::{dense_order,linorder_topology}"
 | 
| 60720 | 2099  | 
assumes "open (f`A)"  | 
| 63494 | 2100  | 
and mono: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"  | 
| 60720 | 2101  | 
shows "continuous_on A f"  | 
2102  | 
proof (rule continuous_on_generate_topology[OF open_generated_order], safe)  | 
|
2103  | 
have monoD: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> f x < f y \<Longrightarrow> x < y"  | 
|
2104  | 
by (auto simp: not_le[symmetric] mono)  | 
|
| 63494 | 2105  | 
have "\<exists>x. x \<in> A \<and> f x < b \<and> a < x" if a: "a \<in> A" and fa: "f a < b" for a b  | 
2106  | 
proof -  | 
|
2107  | 
    obtain y where "f a < y" "{f a ..< y} \<subseteq> f`A"
 | 
|
2108  | 
using open_right[OF \<open>open (f`A)\<close>, of "f a" b] a fa  | 
|
| 60720 | 2109  | 
by auto  | 
| 63494 | 2110  | 
obtain z where z: "f a < z" "z < min b y"  | 
| 60720 | 2111  | 
using dense[of "f a" "min b y"] \<open>f a < y\<close> \<open>f a < b\<close> by auto  | 
| 63494 | 2112  | 
then obtain c where "z = f c" "c \<in> A"  | 
| 60720 | 2113  | 
      using \<open>{f a ..< y} \<subseteq> f`A\<close>[THEN subsetD, of z] by (auto simp: less_imp_le)
 | 
| 63494 | 2114  | 
with a z show ?thesis  | 
2115  | 
by (auto intro!: exI[of _ c] simp: monoD)  | 
|
2116  | 
qed  | 
|
| 60720 | 2117  | 
  then show "\<exists>C. open C \<and> C \<inter> A = f -` {..<b} \<inter> A" for b
 | 
2118  | 
    by (intro exI[of _ "(\<Union>x\<in>{x\<in>A. f x < b}. {..< x})"])
 | 
|
2119  | 
(auto intro: le_less_trans[OF mono] less_imp_le)  | 
|
2120  | 
||
| 63494 | 2121  | 
have "\<exists>x. x \<in> A \<and> b < f x \<and> x < a" if a: "a \<in> A" and fa: "b < f a" for a b  | 
2122  | 
proof -  | 
|
2123  | 
note a fa  | 
|
| 60720 | 2124  | 
moreover  | 
| 63494 | 2125  | 
    obtain y where "y < f a" "{y <.. f a} \<subseteq> f`A"
 | 
2126  | 
using open_left[OF \<open>open (f`A)\<close>, of "f a" b] a fa  | 
|
| 60720 | 2127  | 
by auto  | 
| 63494 | 2128  | 
then obtain z where z: "max b y < z" "z < f a"  | 
| 60720 | 2129  | 
using dense[of "max b y" "f a"] \<open>y < f a\<close> \<open>b < f a\<close> by auto  | 
| 63494 | 2130  | 
then obtain c where "z = f c" "c \<in> A"  | 
| 60720 | 2131  | 
      using \<open>{y <.. f a} \<subseteq> f`A\<close>[THEN subsetD, of z] by (auto simp: less_imp_le)
 | 
| 63494 | 2132  | 
with a z show ?thesis  | 
2133  | 
by (auto intro!: exI[of _ c] simp: monoD)  | 
|
2134  | 
qed  | 
|
| 60720 | 2135  | 
  then show "\<exists>C. open C \<and> C \<inter> A = f -` {b <..} \<inter> A" for b
 | 
2136  | 
    by (intro exI[of _ "(\<Union>x\<in>{x\<in>A. b < f x}. {x <..})"])
 | 
|
2137  | 
(auto intro: less_le_trans[OF _ mono] less_imp_le)  | 
|
2138  | 
qed  | 
|
2139  | 
||
| 
65204
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2140  | 
lemma continuous_on_IccI:  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2141  | 
"\<lbrakk>(f \<longlongrightarrow> f a) (at_right a);  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2142  | 
(f \<longlongrightarrow> f b) (at_left b);  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2143  | 
(\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> f \<midarrow>x\<rightarrow> f x); a < b\<rbrakk> \<Longrightarrow>  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2144  | 
    continuous_on {a .. b} f"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2145  | 
for a::"'a::linorder_topology"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2146  | 
  using at_within_open[of _ "{a<..<b}"]
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2147  | 
by (auto simp: continuous_on_def at_within_Icc_at_right at_within_Icc_at_left le_less  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2148  | 
at_within_Icc_at)  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2149  | 
|
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2150  | 
lemma  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2151  | 
fixes a b::"'a::linorder_topology"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2152  | 
  assumes "continuous_on {a .. b} f" "a < b"
 | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2153  | 
shows continuous_on_Icc_at_rightD: "(f \<longlongrightarrow> f a) (at_right a)"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2154  | 
and continuous_on_Icc_at_leftD: "(f \<longlongrightarrow> f b) (at_left b)"  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2155  | 
using assms  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2156  | 
by (auto simp: at_within_Icc_at_right at_within_Icc_at_left continuous_on_def  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2157  | 
dest: bspec[where x=a] bspec[where x=b])  | 
| 
 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 
immler 
parents: 
65036 
diff
changeset
 | 
2158  | 
|
| 
68965
 
1254f3e57fed
Removed problematic rules from continuous_intros
 
eberlm <eberlm@in.tum.de> 
parents: 
68860 
diff
changeset
 | 
2159  | 
lemma continuous_on_discrete [simp]:  | 
| 
68860
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
2160  | 
"continuous_on A (f :: 'a :: discrete_topology \<Rightarrow> _)"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
2161  | 
by (auto simp: continuous_on_def at_discrete)  | 
| 63494 | 2162  | 
|
| 60758 | 2163  | 
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
 | 
2164  | 
|
| 63494 | 2165  | 
definition continuous :: "'a::t2_space filter \<Rightarrow> ('a \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
 | 
2166  | 
where "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
 | 
2167  | 
|
| 
 
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
 | 
2168  | 
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
 | 
2169  | 
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
 | 
2170  | 
|
| 
 
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
 | 
2171  | 
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
 | 
2172  | 
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
 | 
2173  | 
|
| 61973 | 2174  | 
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
 | 
2175  | 
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
 | 
2176  | 
|
| 
 
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
 | 
2177  | 
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
 | 
2178  | 
"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
 | 
2179  | 
(\<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
 | 
2180  | 
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
 | 
2181  | 
|
| 
 
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
 | 
2182  | 
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
 | 
2183  | 
"continuous (at x within s) f \<Longrightarrow> continuous (at (f x) within f ` s) g \<Longrightarrow>  | 
| 63494 | 2184  | 
continuous (at x within s) (g \<circ> 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
 | 
2185  | 
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
 | 
2186  | 
|
| 
 
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
 | 
2187  | 
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
 | 
2188  | 
"continuous (at x within s) f \<Longrightarrow> continuous (at (f x) within f ` s) g \<Longrightarrow>  | 
| 63494 | 2189  | 
continuous (at x within s) (\<lambda>x. g (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
 | 
2190  | 
using continuous_within_compose[of x s f g] by (simp add: comp_def)  | 
| 51471 | 2191  | 
|
| 61976 | 2192  | 
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
 | 
2193  | 
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
 | 
2194  | 
|
| 
 
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
 | 
2195  | 
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
 | 
2196  | 
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
 | 
2197  | 
|
| 
70707
 
125705f5965f
A little-known material, and some tidying up
 
paulson <lp15@cam.ac.uk> 
parents: 
70367 
diff
changeset
 | 
2198  | 
lemma continuous_id[continuous_intros, simp]: "continuous (at x within S) id"  | 
| 
 
125705f5965f
A little-known material, and some tidying up
 
paulson <lp15@cam.ac.uk> 
parents: 
70367 
diff
changeset
 | 
2199  | 
by (simp add: id_def)  | 
| 
 
125705f5965f
A little-known material, and some tidying up
 
paulson <lp15@cam.ac.uk> 
parents: 
70367 
diff
changeset
 | 
2200  | 
|
| 
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
 | 
2201  | 
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
 | 
2202  | 
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
 | 
2203  | 
|
| 
 
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
 | 
2204  | 
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
 | 
2205  | 
"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
 | 
2206  | 
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
 | 
2207  | 
|
| 
68965
 
1254f3e57fed
Removed problematic rules from continuous_intros
 
eberlm <eberlm@in.tum.de> 
parents: 
68860 
diff
changeset
 | 
2208  | 
lemma continuous_discrete [simp]:  | 
| 
68860
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
2209  | 
"continuous (at x within A) (f :: 'a :: discrete_topology \<Rightarrow> _)"  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
2210  | 
by (auto simp: continuous_def at_discrete)  | 
| 
 
f443ec10447d
Some basic materials on filters and topology
 
Manuel Eberl <eberlm@in.tum.de> 
parents: 
68802 
diff
changeset
 | 
2211  | 
|
| 63494 | 2212  | 
abbreviation isCont :: "('a::t2_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> bool"
 | 
2213  | 
where "isCont f a \<equiv> continuous (at a) 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
 | 
2214  | 
|
| 61976 | 2215  | 
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
 | 
2216  | 
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
 | 
2217  | 
|
| 68721 | 2218  | 
lemma isContD: "isCont f x \<Longrightarrow> f \<midarrow>x\<rightarrow> f x"  | 
2219  | 
by (simp add: isCont_def)  | 
|
2220  | 
||
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2221  | 
lemma isCont_cong:  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2222  | 
assumes "eventually (\<lambda>x. f x = g x) (nhds x)"  | 
| 63494 | 2223  | 
shows "isCont f x \<longleftrightarrow> isCont g x"  | 
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2224  | 
proof -  | 
| 63494 | 2225  | 
from assms have [simp]: "f x = g x"  | 
2226  | 
by (rule eventually_nhds_x_imp_x)  | 
|
| 
63295
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2227  | 
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
 | 
2228  | 
by (auto simp: eventually_at_filter elim!: eventually_mono)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2229  | 
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
 | 
2230  | 
by (intro filterlim_cong) (auto elim!: eventually_mono)  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2231  | 
with assms show ?thesis by simp  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2232  | 
qed  | 
| 
 
52792bb9126e
Facts about HK integration, complex powers, Gamma function
 
eberlm 
parents: 
63171 
diff
changeset
 | 
2233  | 
|
| 60762 | 2234  | 
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
 | 
2235  | 
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
 | 
2236  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2237  | 
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
 | 
2238  | 
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
 | 
2239  | 
|
| 62083 | 2240  | 
lemma continuous_within_open: "a \<in> A \<Longrightarrow> open A \<Longrightarrow> continuous (at a within A) f \<longleftrightarrow> isCont f a"  | 
2241  | 
by (simp add: at_within_open_NO_MATCH)  | 
|
2242  | 
||
| 
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
 | 
2243  | 
lemma continuous_at_imp_continuous_on: "\<forall>x\<in>s. isCont f x \<Longrightarrow> continuous_on s f"  | 
| 60762 | 2244  | 
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
 | 
2245  | 
|
| 
 
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
 | 
2246  | 
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
 | 
2247  | 
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
 | 
2248  | 
|
| 
66827
 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 
paulson <lp15@cam.ac.uk> 
parents: 
66447 
diff
changeset
 | 
2249  | 
lemma continuous_at_compose[continuous_intros]: "isCont f a \<Longrightarrow> isCont g (f a) \<Longrightarrow> isCont (g \<circ> 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
 | 
2250  | 
unfolding o_def by (rule isCont_o2)  | 
| 51471 | 2251  | 
|
| 61973 | 2252  | 
lemma isCont_tendsto_compose: "isCont g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"  | 
| 51471 | 2253  | 
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
 | 
2254  | 
|
| 
62049
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2255  | 
lemma continuous_on_tendsto_compose:  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2256  | 
assumes f_cont: "continuous_on s f"  | 
| 63494 | 2257  | 
and g: "(g \<longlongrightarrow> l) F"  | 
2258  | 
and l: "l \<in> s"  | 
|
2259  | 
and ev: "\<forall>\<^sub>Fx in F. g x \<in> s"  | 
|
| 
62049
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2260  | 
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
 | 
2261  | 
proof -  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2262  | 
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
 | 
2263  | 
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
 | 
2264  | 
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
 | 
2265  | 
by (rule filterlim_If)  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2266  | 
(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
 | 
2267  | 
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
 | 
2268  | 
show ?thesis  | 
| 
 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 
eberlm 
parents: 
61976 
diff
changeset
 | 
2269  | 
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
 | 
2270  | 
qed  | 
| 51471 | 2271  | 
|
| 
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
 | 
2272  | 
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
 | 
2273  | 
"isCont g (f x) \<Longrightarrow> continuous (at x within s) f \<Longrightarrow> continuous (at x within s) (\<lambda>x. g (f x))"  | 
| 63171 | 2274  | 
using continuous_at_imp_continuous_at_within continuous_within_compose2 by blast  | 
| 51471 | 2275  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
2276  | 
lemma filtermap_nhds_open_map:  | 
| 63494 | 2277  | 
assumes cont: "isCont f a"  | 
2278  | 
and open_map: "\<And>S. open S \<Longrightarrow> open (f`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
 | 
2279  | 
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
 | 
2280  | 
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
 | 
2281  | 
proof safe  | 
| 63494 | 2282  | 
fix P  | 
2283  | 
assume "eventually P (filtermap f (nhds a))"  | 
|
2284  | 
then obtain S where "open S" "a \<in> S" "\<forall>x\<in>S. P (f x)"  | 
|
2285  | 
by (auto simp: eventually_filtermap eventually_nhds)  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57276 
diff
changeset
 | 
2286  | 
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
 | 
2287  | 
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
 | 
2288  | 
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
 | 
2289  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2290  | 
lemma continuous_at_split:  | 
| 63494 | 2291  | 
"continuous (at x) f \<longleftrightarrow> continuous (at_left x) f \<and> continuous (at_right x) f"  | 
2292  | 
for x :: "'a::linorder_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
 | 
2293  | 
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
 | 
2294  | 
|
| 
70365
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2295  | 
lemma continuous_on_max [continuous_intros]:  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2296  | 
fixes f g :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2297  | 
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. max (f x) (g x))"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2298  | 
by (auto simp: continuous_on_def intro!: tendsto_max)  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2299  | 
|
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2300  | 
lemma continuous_on_min [continuous_intros]:  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2301  | 
fixes f g :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2302  | 
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. min (f x) (g x))"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2303  | 
by (auto simp: continuous_on_def intro!: tendsto_min)  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2304  | 
|
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2305  | 
lemma continuous_max [continuous_intros]:  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2306  | 
fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2307  | 
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (max (f x) (g x)))"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2308  | 
by (simp add: tendsto_max continuous_def)  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2309  | 
|
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2310  | 
lemma continuous_min [continuous_intros]:  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2311  | 
fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2312  | 
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (min (f x) (g x)))"  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2313  | 
by (simp add: tendsto_min continuous_def)  | 
| 
 
4df0628e8545
a few new lemmas and a bit of tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
69593 
diff
changeset
 | 
2314  | 
|
| 63494 | 2315  | 
text \<open>  | 
| 63495 | 2316  | 
The following open/closed Collect lemmas are ported from  | 
2317  | 
Sébastien Gouëzel's \<open>Ergodic_Theory\<close>.  | 
|
| 63494 | 2318  | 
\<close>  | 
| 63332 | 2319  | 
lemma open_Collect_neq:  | 
| 63494 | 2320  | 
fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 63332 | 2321  | 
assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"  | 
2322  | 
  shows "open {x. f x \<noteq> g x}"
 | 
|
2323  | 
proof (rule openI)  | 
|
| 63494 | 2324  | 
fix t  | 
2325  | 
  assume "t \<in> {x. f x \<noteq> g x}"
 | 
|
| 63332 | 2326  | 
  then obtain U V where *: "open U" "open V" "f t \<in> U" "g t \<in> V" "U \<inter> V = {}"
 | 
2327  | 
by (auto simp add: separation_t2)  | 
|
2328  | 
with open_vimage[OF \<open>open U\<close> f] open_vimage[OF \<open>open V\<close> g]  | 
|
2329  | 
  show "\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}"
 | 
|
2330  | 
by (intro exI[of _ "f -` U \<inter> g -` V"]) auto  | 
|
2331  | 
qed  | 
|
2332  | 
||
2333  | 
lemma closed_Collect_eq:  | 
|
| 63494 | 2334  | 
fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 63332 | 2335  | 
assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"  | 
2336  | 
  shows "closed {x. f x = g x}"
 | 
|
2337  | 
using open_Collect_neq[OF f g] by (simp add: closed_def Collect_neg_eq)  | 
|
2338  | 
||
2339  | 
lemma open_Collect_less:  | 
|
| 63494 | 2340  | 
fixes f g :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"  | 
| 63332 | 2341  | 
assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"  | 
2342  | 
  shows "open {x. f x < g x}"
 | 
|
2343  | 
proof (rule openI)  | 
|
| 63494 | 2344  | 
fix t  | 
2345  | 
  assume t: "t \<in> {x. f x < g x}"
 | 
|
| 63332 | 2346  | 
  show "\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x < g x}"
 | 
| 63494 | 2347  | 
proof (cases "\<exists>z. f t < z \<and> z < g t")  | 
2348  | 
case True  | 
|
2349  | 
then obtain z where "f t < z \<and> z < g t" by blast  | 
|
| 63332 | 2350  | 
then show ?thesis  | 
2351  | 
      using open_vimage[OF _ f, of "{..< z}"] open_vimage[OF _ g, of "{z <..}"]
 | 
|
2352  | 
      by (intro exI[of _ "f -` {..<z} \<inter> g -` {z<..}"]) auto
 | 
|
2353  | 
next  | 
|
| 63494 | 2354  | 
case False  | 
| 63332 | 2355  | 
    then have *: "{g t ..} = {f t <..}" "{..< g t} = {.. f t}"
 | 
2356  | 
using t by (auto intro: leI)  | 
|
2357  | 
show ?thesis  | 
|
2358  | 
      using open_vimage[OF _ f, of "{..< g t}"] open_vimage[OF _ g, of "{f t <..}"] t
 | 
|
2359  | 
      apply (intro exI[of _ "f -` {..< g t} \<inter> g -` {f t<..}"])
 | 
|
2360  | 
apply (simp add: open_Int)  | 
|
2361  | 
apply (auto simp add: *)  | 
|
2362  | 
done  | 
|
2363  | 
qed  | 
|
2364  | 
qed  | 
|
2365  | 
||
2366  | 
lemma closed_Collect_le:  | 
|
2367  | 
fixes f g :: "'a :: topological_space \<Rightarrow> 'b::linorder_topology"  | 
|
| 63494 | 2368  | 
assumes f: "continuous_on UNIV f"  | 
2369  | 
and g: "continuous_on UNIV g"  | 
|
| 63332 | 2370  | 
  shows "closed {x. f x \<le> g x}"
 | 
| 63494 | 2371  | 
using open_Collect_less [OF g f]  | 
2372  | 
by (simp add: closed_def Collect_neg_eq[symmetric] not_le)  | 
|
2373  | 
||
| 63332 | 2374  | 
|
| 61245 | 2375  | 
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
 | 
2376  | 
|
| 
 
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
 | 
2377  | 
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
 | 
2378  | 
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
 | 
2379  | 
|
| 69529 | 2380  | 
definition compact :: "'a set \<Rightarrow> bool" where  | 
2381  | 
compact_eq_Heine_Borel: (* 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
 | 
2382  | 
"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
 | 
2383  | 
|
| 
 
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
 | 
2384  | 
lemma compactI:  | 
| 60585 | 2385  | 
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
 | 
2386  | 
shows "compact s"  | 
| 69529 | 2387  | 
unfolding compact_eq_Heine_Borel using assms by metis  | 
| 
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
 | 
2388  | 
|
| 
 
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
 | 
2389  | 
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
 | 
2390  | 
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
 | 
2391  | 
|
| 
64758
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2392  | 
lemma compactE: (*related to COMPACT_IMP_HEINE_BOREL in HOL Light*)  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2393  | 
assumes "compact S" "S \<subseteq> \<Union>\<T>" "\<And>B. B \<in> \<T> \<Longrightarrow> open B"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2394  | 
obtains \<T>' where "\<T>' \<subseteq> \<T>" "finite \<T>'" "S \<subseteq> \<Union>\<T>'"  | 
| 69529 | 2395  | 
by (meson assms compact_eq_Heine_Borel)  | 
| 
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
 | 
2396  | 
|
| 
 
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
 | 
2397  | 
lemma compactE_image:  | 
| 64845 | 2398  | 
assumes "compact S"  | 
| 67231 | 2399  | 
and opn: "\<And>T. T \<in> C \<Longrightarrow> open (f T)"  | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2400  | 
and S: "S \<subseteq> (\<Union>c\<in>C. f c)"  | 
| 64845 | 2401  | 
obtains C' where "C' \<subseteq> C" and "finite C'" and "S \<subseteq> (\<Union>c\<in>C'. f c)"  | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2402  | 
apply (rule compactE[OF \<open>compact S\<close> S])  | 
| 67231 | 2403  | 
using opn apply force  | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2404  | 
by (metis finite_subset_image)  | 
| 
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
 | 
2405  | 
|
| 
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
 | 
2406  | 
lemma compact_Int_closed [intro]:  | 
| 64845 | 2407  | 
assumes "compact S"  | 
2408  | 
and "closed T"  | 
|
2409  | 
shows "compact (S \<inter> T)"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2410  | 
proof (rule compactI)  | 
| 63494 | 2411  | 
fix C  | 
2412  | 
assume C: "\<forall>c\<in>C. open c"  | 
|
| 64845 | 2413  | 
assume cover: "S \<inter> T \<subseteq> \<Union>C"  | 
2414  | 
  from C \<open>closed T\<close> have "\<forall>c\<in>C \<union> {- T}. open c"
 | 
|
| 63494 | 2415  | 
by auto  | 
| 64845 | 2416  | 
  moreover from cover have "S \<subseteq> \<Union>(C \<union> {- T})"
 | 
| 63494 | 2417  | 
by auto  | 
| 64845 | 2418  | 
  ultimately have "\<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union>D"
 | 
| 69529 | 2419  | 
using \<open>compact S\<close> unfolding compact_eq_Heine_Borel by auto  | 
| 64845 | 2420  | 
  then obtain D where "D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union>D" ..
 | 
2421  | 
then show "\<exists>D\<subseteq>C. finite D \<and> S \<inter> T \<subseteq> \<Union>D"  | 
|
2422  | 
    by (intro exI[of _ "D - {-T}"]) auto
 | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2423  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2424  | 
|
| 64845 | 2425  | 
lemma compact_diff: "\<lbrakk>compact S; open T\<rbrakk> \<Longrightarrow> compact(S - T)"  | 
2426  | 
by (simp add: Diff_eq compact_Int_closed open_closed)  | 
|
2427  | 
||
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2428  | 
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
 | 
2429  | 
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
 | 
2430  | 
|
| 63494 | 2431  | 
|
2432  | 
subsection \<open>Finite intersection property\<close>  | 
|
| 63301 | 2433  | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2434  | 
lemma compact_fip:  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2435  | 
"compact U \<longleftrightarrow>  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2436  | 
    (\<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
 | 
2437  | 
(is "_ \<longleftrightarrow> ?R")  | 
| 69529 | 2438  | 
proof (safe intro!: compact_eq_Heine_Borel[THEN iffD2])  | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2439  | 
fix A  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2440  | 
assume "compact U"  | 
| 63494 | 2441  | 
  assume A: "\<forall>a\<in>A. closed a" "U \<inter> \<Inter>A = {}"
 | 
2442  | 
  assume fin: "\<forall>B \<subseteq> A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}"
 | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2443  | 
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
 | 
2444  | 
by auto  | 
| 60758 | 2445  | 
with \<open>compact U\<close> obtain B where "B \<subseteq> A" "finite (uminus`B)" "U \<subseteq> \<Union>(uminus`B)"  | 
| 69529 | 2446  | 
unfolding compact_eq_Heine_Borel by (metis subset_image_iff)  | 
| 63494 | 2447  | 
with fin[THEN spec, of B] show False  | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2448  | 
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
 | 
2449  | 
next  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2450  | 
fix A  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2451  | 
assume ?R  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2452  | 
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
 | 
2453  | 
  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
 | 
2454  | 
by auto  | 
| 60758 | 2455  | 
  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
 | 
2456  | 
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
 | 
2457  | 
then show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"  | 
| 63494 | 2458  | 
by (auto intro!: exI[of _ B] inj_setminus dest: finite_imageD)  | 
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2459  | 
qed  | 
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2460  | 
|
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2461  | 
lemma compact_imp_fip:  | 
| 63494 | 2462  | 
assumes "compact S"  | 
2463  | 
and "\<And>T. T \<in> F \<Longrightarrow> closed T"  | 
|
2464  | 
    and "\<And>F'. finite F' \<Longrightarrow> F' \<subseteq> F \<Longrightarrow> S \<inter> (\<Inter>F') \<noteq> {}"
 | 
|
2465  | 
  shows "S \<inter> (\<Inter>F) \<noteq> {}"
 | 
|
2466  | 
using assms unfolding compact_fip by auto  | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2467  | 
|
| 
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2468  | 
lemma compact_imp_fip_image:  | 
| 56166 | 2469  | 
assumes "compact s"  | 
2470  | 
and P: "\<And>i. i \<in> I \<Longrightarrow> closed (f i)"  | 
|
2471  | 
    and Q: "\<And>I'. finite I' \<Longrightarrow> I' \<subseteq> I \<Longrightarrow> (s \<inter> (\<Inter>i\<in>I'. f i) \<noteq> {})"
 | 
|
2472  | 
  shows "s \<inter> (\<Inter>i\<in>I. f i) \<noteq> {}"
 | 
|
2473  | 
proof -  | 
|
| 60758 | 2474  | 
note \<open>compact s\<close>  | 
| 63494 | 2475  | 
moreover from P have "\<forall>i \<in> f ` I. closed i"  | 
2476  | 
by blast  | 
|
| 56166 | 2477  | 
  moreover have "\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> (s \<inter> (\<Inter>A) \<noteq> {})"
 | 
| 63494 | 2478  | 
apply rule  | 
2479  | 
apply rule  | 
|
2480  | 
apply (erule conjE)  | 
|
2481  | 
proof -  | 
|
| 56166 | 2482  | 
fix A :: "'a set set"  | 
| 63494 | 2483  | 
assume "finite A" and "A \<subseteq> f ` I"  | 
2484  | 
then obtain B where "B \<subseteq> I" and "finite B" and "A = f ` B"  | 
|
| 56166 | 2485  | 
using finite_subset_image [of A f I] by blast  | 
| 63494 | 2486  | 
    with Q [of B] show "s \<inter> \<Inter>A \<noteq> {}"
 | 
2487  | 
by simp  | 
|
| 56166 | 2488  | 
qed  | 
| 63494 | 2489  | 
  ultimately have "s \<inter> (\<Inter>(f ` I)) \<noteq> {}"
 | 
2490  | 
by (metis compact_imp_fip)  | 
|
| 56166 | 2491  | 
then show ?thesis by simp  | 
2492  | 
qed  | 
|
| 
54797
 
be020ec8560c
modernized ContNotDenum: use Set_Interval, and finite intersection property to show the nested interval property
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
2493  | 
|
| 51471 | 2494  | 
end  | 
2495  | 
||
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2496  | 
lemma (in t2_space) compact_imp_closed:  | 
| 63494 | 2497  | 
assumes "compact s"  | 
2498  | 
shows "closed s"  | 
|
2499  | 
unfolding closed_def  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2500  | 
proof (rule openI)  | 
| 63494 | 2501  | 
fix y  | 
2502  | 
assume "y \<in> - s"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2503  | 
  let ?C = "\<Union>x\<in>s. {u. open u \<and> x \<in> u \<and> eventually (\<lambda>y. y \<notin> u) (nhds y)}"
 | 
| 
64758
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2504  | 
have "s \<subseteq> \<Union>?C"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2505  | 
proof  | 
| 63494 | 2506  | 
fix x  | 
2507  | 
assume "x \<in> s"  | 
|
| 60758 | 2508  | 
with \<open>y \<in> - s\<close> have "x \<noteq> y" by clarsimp  | 
| 63494 | 2509  | 
    then have "\<exists>u v. open u \<and> open v \<and> x \<in> u \<and> y \<in> v \<and> u \<inter> v = {}"
 | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2510  | 
by (rule hausdorff)  | 
| 60758 | 2511  | 
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
 | 
2512  | 
unfolding eventually_nhds by auto  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2513  | 
qed  | 
| 
64758
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2514  | 
then obtain D where "D \<subseteq> ?C" and "finite D" and "s \<subseteq> \<Union>D"  | 
| 
 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 
paulson <lp15@cam.ac.uk> 
parents: 
64394 
diff
changeset
 | 
2515  | 
by (rule compactE [OF \<open>compact s\<close>]) auto  | 
| 63494 | 2516  | 
from \<open>D \<subseteq> ?C\<close> have "\<forall>x\<in>D. eventually (\<lambda>y. y \<notin> x) (nhds y)"  | 
2517  | 
by auto  | 
|
| 60758 | 2518  | 
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
 | 
2519  | 
by (simp add: eventually_ball_finite)  | 
| 60758 | 2520  | 
with \<open>s \<subseteq> \<Union>D\<close> have "eventually (\<lambda>y. y \<notin> s) (nhds y)"  | 
| 61810 | 2521  | 
by (auto elim!: eventually_mono)  | 
| 63494 | 2522  | 
then show "\<exists>t. open t \<and> y \<in> t \<and> t \<subseteq> - s"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2523  | 
by (simp add: eventually_nhds subset_eq)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2524  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2525  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2526  | 
lemma compact_continuous_image:  | 
| 63494 | 2527  | 
assumes f: "continuous_on s f"  | 
2528  | 
and s: "compact s"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2529  | 
shows "compact (f ` s)"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2530  | 
proof (rule compactI)  | 
| 63494 | 2531  | 
fix C  | 
2532  | 
assume "\<forall>c\<in>C. open c" and cover: "f`s \<subseteq> \<Union>C"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2533  | 
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
 | 
2534  | 
unfolding continuous_on_open_invariant by blast  | 
| 53381 | 2535  | 
then obtain A where A: "\<forall>c\<in>C. open (A c) \<and> A c \<inter> s = f -` c \<inter> s"  | 
2536  | 
unfolding bchoice_iff ..  | 
|
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2537  | 
with cover have "\<And>c. c \<in> C \<Longrightarrow> open (A c)" "s \<subseteq> (\<Union>c\<in>C. A c)"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2538  | 
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
 | 
2539  | 
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
 | 
2540  | 
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
 | 
2541  | 
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
 | 
2542  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2543  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2544  | 
lemma continuous_on_inv:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2545  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 63494 | 2546  | 
assumes "continuous_on s f"  | 
2547  | 
and "compact s"  | 
|
2548  | 
and "\<forall>x\<in>s. g (f x) = x"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2549  | 
shows "continuous_on (f ` s) g"  | 
| 63494 | 2550  | 
unfolding continuous_on_topological  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2551  | 
proof (clarsimp simp add: assms(3))  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2552  | 
fix x :: 'a and B :: "'a set"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2553  | 
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
 | 
2554  | 
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
 | 
2555  | 
using assms(3) by (auto, metis)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2556  | 
have "continuous_on (s - B) f"  | 
| 60758 | 2557  | 
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
 | 
2558  | 
by (rule continuous_on_subset)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2559  | 
moreover have "compact (s - B)"  | 
| 60758 | 2560  | 
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
 | 
2561  | 
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
 | 
2562  | 
ultimately have "compact (f ` (s - B))"  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2563  | 
by (rule compact_continuous_image)  | 
| 63494 | 2564  | 
then have "closed (f ` (s - B))"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2565  | 
by (rule compact_imp_closed)  | 
| 63494 | 2566  | 
then have "open (- f ` (s - B))"  | 
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2567  | 
by (rule open_Compl)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2568  | 
moreover have "f x \<in> - f ` (s - B)"  | 
| 60758 | 2569  | 
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
 | 
2570  | 
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
 | 
2571  | 
by (simp add: 1)  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2572  | 
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
 | 
2573  | 
by fast  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2574  | 
qed  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2575  | 
|
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2576  | 
lemma continuous_on_inv_into:  | 
| 
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2577  | 
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"  | 
| 63494 | 2578  | 
assumes s: "continuous_on s f" "compact s"  | 
2579  | 
and f: "inj_on f s"  | 
|
| 
51481
 
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
 
hoelzl 
parents: 
51480 
diff
changeset
 | 
2580  | 
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
 | 
2581  | 
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
 | 
2582  | 
|
| 
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
 | 
2583  | 
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
 | 
2584  | 
  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
 | 
2585  | 
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
 | 
2586  | 
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
 | 
2587  | 
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
 | 
2588  | 
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
 | 
2589  | 
by (metis not_le)  | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2590  | 
  then have "\<And>s. s\<in>S \<Longrightarrow> open {..< t s}" "S \<subseteq> (\<Union>s\<in>S. {..< 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
 | 
2591  | 
by auto  | 
| 60758 | 2592  | 
  with \<open>compact S\<close> obtain C where "C \<subseteq> S" "finite C" and C: "S \<subseteq> (\<Union>s\<in>C. {..< t s})"
 | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2593  | 
by (metis compactE_image)  | 
| 60758 | 2594  | 
  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
 | 
2595  | 
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
 | 
2596  | 
  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
 | 
2597  | 
by (auto intro: less_le_trans simp: subset_eq)  | 
| 60758 | 2598  | 
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
 | 
2599  | 
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
 | 
2600  | 
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
 | 
2601  | 
|
| 
 
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
 | 
2602  | 
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
 | 
2603  | 
  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
 | 
2604  | 
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
 | 
2605  | 
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
 | 
2606  | 
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
 | 
2607  | 
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
 | 
2608  | 
by (metis not_le)  | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2609  | 
  then have "\<And>s. s\<in>S \<Longrightarrow> open {t s <..}" "S \<subseteq> (\<Union>s\<in>S. {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
 | 
2610  | 
by auto  | 
| 60758 | 2611  | 
  with \<open>compact S\<close> obtain C where "C \<subseteq> S" "finite C" and C: "S \<subseteq> (\<Union>s\<in>C. {t s <..})"
 | 
| 
65583
 
8d53b3bebab4
Further new material. The simprule status of some exp and ln identities was reverted.
 
paulson <lp15@cam.ac.uk> 
parents: 
65204 
diff
changeset
 | 
2612  | 
by (metis compactE_image)  | 
| 60758 | 2613  | 
  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
 | 
2614  | 
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
 | 
2615  | 
  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
 | 
2616  | 
by (auto intro: le_less_trans simp: subset_eq)  | 
| 60758 | 2617  | 
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
 | 
2618  | 
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
 | 
2619  | 
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
 | 
2620  | 
|
| 
 
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
 | 
2621  | 
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
 | 
2622  | 
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
 | 
2623  | 
  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
 | 
2624  | 
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
 | 
2625  | 
|
| 
 
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
 | 
2626  | 
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
 | 
2627  | 
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
 | 
2628  | 
  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
 | 
2629  | 
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
 | 
2630  | 
|
| 63494 | 2631  | 
|
| 60758 | 2632  | 
subsection \<open>Connectedness\<close>  | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2633  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2634  | 
context topological_space  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2635  | 
begin  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2636  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2637  | 
definition "connected S \<longleftrightarrow>  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2638  | 
  \<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
 | 
2639  | 
|
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2640  | 
lemma connectedI:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2641  | 
  "(\<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
 | 
2642  | 
\<Longrightarrow> connected U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2643  | 
by (auto simp: connected_def)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2644  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2645  | 
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
 | 
2646  | 
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
 | 
2647  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2648  | 
lemma connected_sing [simp]: "connected {x}"
 | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2649  | 
by (auto intro!: connectedI)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2650  | 
|
| 56329 | 2651  | 
lemma connectedD:  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
2652  | 
  "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 | 2653  | 
by (auto simp: connected_def)  | 
2654  | 
||
| 
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
 | 
2655  | 
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
 | 
2656  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2657  | 
lemma connected_closed:  | 
| 63494 | 2658  | 
"connected s \<longleftrightarrow>  | 
2659  | 
    \<not> (\<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> {})"
 | 
|
2660  | 
apply (simp add: connected_def del: ex_simps, safe)  | 
|
2661  | 
apply (drule_tac x="-A" in spec)  | 
|
2662  | 
apply (drule_tac x="-B" in spec)  | 
|
2663  | 
apply (fastforce simp add: closed_def [symmetric])  | 
|
2664  | 
apply (drule_tac x="-A" in spec)  | 
|
2665  | 
apply (drule_tac x="-B" in spec)  | 
|
2666  | 
apply (fastforce simp add: open_closed [symmetric])  | 
|
2667  | 
done  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2668  | 
|
| 
62397
 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 
paulson <lp15@cam.ac.uk> 
parents: 
62381 
diff
changeset
 | 
2669  | 
lemma connected_closedD:  | 
| 63494 | 2670  | 
  "\<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 = {}"
 | 
2671  | 
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
 | 
2672  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2673  | 
lemma connected_Union:  | 
| 63494 | 2674  | 
assumes cs: "\<And>s. s \<in> S \<Longrightarrow> connected s"  | 
2675  | 
    and ne: "\<Inter>S \<noteq> {}"
 | 
|
2676  | 
shows "connected(\<Union>S)"  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2677  | 
proof (rule connectedI)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2678  | 
fix A B  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2679  | 
  assume A: "open A" and B: "open B" and Alap: "A \<inter> \<Union>S \<noteq> {}" and Blap: "B \<inter> \<Union>S \<noteq> {}"
 | 
| 63494 | 2680  | 
    and disj: "A \<inter> B \<inter> \<Union>S = {}" and cover: "\<Union>S \<subseteq> A \<union> B"
 | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2681  | 
  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
 | 
2682  | 
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
 | 
2683  | 
  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
 | 
2684  | 
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
 | 
2685  | 
  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
 | 
2686  | 
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
 | 
2687  | 
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
 | 
2688  | 
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
 | 
2689  | 
then have "x \<in> \<Union>S"  | 
| 61342 | 2690  | 
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
 | 
2691  | 
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
 | 
2692  | 
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
 | 
2693  | 
then show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2694  | 
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
 | 
2695  | 
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
 | 
2696  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2697  | 
|
| 63494 | 2698  | 
lemma connected_Un: "connected s \<Longrightarrow> connected t \<Longrightarrow> s \<inter> t \<noteq> {} \<Longrightarrow> connected (s \<union> t)"
 | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2699  | 
  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
 | 
2700  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2701  | 
lemma connected_diff_open_from_closed:  | 
| 63494 | 2702  | 
assumes st: "s \<subseteq> t"  | 
2703  | 
and tu: "t \<subseteq> u"  | 
|
2704  | 
and s: "open s"  | 
|
2705  | 
and t: "closed t"  | 
|
2706  | 
and u: "connected u"  | 
|
2707  | 
and ts: "connected (t - s)"  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2708  | 
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
 | 
2709  | 
proof (rule connectedI)  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2710  | 
fix A B  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2711  | 
  assume AB: "open A" "open B" "A \<inter> (u - s) \<noteq> {}" "B \<inter> (u - s) \<noteq> {}"
 | 
| 63494 | 2712  | 
    and disj: "A \<inter> B \<inter> (u - s) = {}"
 | 
2713  | 
and cover: "u - s \<subseteq> A \<union> B"  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2714  | 
  then consider "A \<inter> (t - s) = {}" | "B \<inter> (t - s) = {}"
 | 
| 63494 | 2715  | 
using st ts tu connectedD [of "t-s" "A" "B"] by auto  | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2716  | 
then show False  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2717  | 
proof cases  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2718  | 
case 1  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2719  | 
    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
 | 
2720  | 
using disj st by auto  | 
| 63494 | 2721  | 
moreover have "u \<subseteq> (A - t) \<union> (B \<union> s)"  | 
2722  | 
using 1 cover by auto  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2723  | 
ultimately show False  | 
| 63494 | 2724  | 
using connectedD [of u "A - t" "B \<union> s"] AB s t 1 u by auto  | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2725  | 
next  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2726  | 
case 2  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2727  | 
    then have "(A \<union> s) \<inter> (B - t) \<inter> u = {}"
 | 
| 63494 | 2728  | 
using disj st by auto  | 
2729  | 
moreover have "u \<subseteq> (A \<union> s) \<union> (B - t)"  | 
|
2730  | 
using 2 cover by auto  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2731  | 
ultimately show False  | 
| 63494 | 2732  | 
using connectedD [of u "A \<union> s" "B - t"] AB s t 2 u by auto  | 
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2733  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2734  | 
qed  | 
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2735  | 
|
| 59106 | 2736  | 
lemma connected_iff_const:  | 
2737  | 
fixes S :: "'a::topological_space set"  | 
|
2738  | 
shows "connected S \<longleftrightarrow> (\<forall>P::'a \<Rightarrow> bool. continuous_on S P \<longrightarrow> (\<exists>c. \<forall>s\<in>S. P s = c))"  | 
|
2739  | 
proof safe  | 
|
| 63494 | 2740  | 
fix P :: "'a \<Rightarrow> bool"  | 
2741  | 
assume "connected S" "continuous_on S P"  | 
|
| 59106 | 2742  | 
  then have "\<And>b. \<exists>A. open A \<and> A \<inter> S = P -` {b} \<inter> S"
 | 
| 62369 | 2743  | 
unfolding continuous_on_open_invariant by (simp add: open_discrete)  | 
| 59106 | 2744  | 
from this[of True] this[of False]  | 
2745  | 
  obtain t f where "open t" "open f" and *: "f \<inter> S = P -` {False} \<inter> S" "t \<inter> S = P -` {True} \<inter> S"
 | 
|
| 63171 | 2746  | 
by meson  | 
| 59106 | 2747  | 
  then have "t \<inter> S = {} \<or> f \<inter> S = {}"
 | 
| 60758 | 2748  | 
by (intro connectedD[OF \<open>connected S\<close>]) auto  | 
| 59106 | 2749  | 
then show "\<exists>c. \<forall>s\<in>S. P s = c"  | 
2750  | 
proof (rule disjE)  | 
|
| 63494 | 2751  | 
    assume "t \<inter> S = {}"
 | 
2752  | 
then show ?thesis  | 
|
| 59106 | 2753  | 
unfolding * by (intro exI[of _ False]) auto  | 
2754  | 
next  | 
|
| 63494 | 2755  | 
    assume "f \<inter> S = {}"
 | 
2756  | 
then show ?thesis  | 
|
| 59106 | 2757  | 
unfolding * by (intro exI[of _ True]) auto  | 
2758  | 
qed  | 
|
2759  | 
next  | 
|
2760  | 
assume P: "\<forall>P::'a \<Rightarrow> bool. continuous_on S P \<longrightarrow> (\<exists>c. \<forall>s\<in>S. P s = c)"  | 
|
2761  | 
show "connected S"  | 
|
2762  | 
proof (rule connectedI)  | 
|
| 63494 | 2763  | 
fix A B  | 
2764  | 
    assume *: "open A" "open B" "A \<inter> S \<noteq> {}" "B \<inter> S \<noteq> {}" "A \<inter> B \<inter> S = {}" "S \<subseteq> A \<union> B"
 | 
|
| 59106 | 2765  | 
have "continuous_on S (\<lambda>x. x \<in> A)"  | 
2766  | 
unfolding continuous_on_open_invariant  | 
|
2767  | 
proof safe  | 
|
2768  | 
fix C :: "bool set"  | 
|
2769  | 
      have "C = UNIV \<or> C = {True} \<or> C = {False} \<or> C = {}"
 | 
|
2770  | 
using subset_UNIV[of C] unfolding UNIV_bool by auto  | 
|
2771  | 
with * show "\<exists>T. open T \<and> T \<inter> S = (\<lambda>x. x \<in> A) -` C \<inter> S"  | 
|
2772  | 
        by (intro exI[of _ "(if True \<in> C then A else {}) \<union> (if False \<in> C then B else {})"]) auto
 | 
|
2773  | 
qed  | 
|
| 63494 | 2774  | 
from P[rule_format, OF this] obtain c where "\<And>s. s \<in> S \<Longrightarrow> (s \<in> A) = c"  | 
2775  | 
by blast  | 
|
| 59106 | 2776  | 
with * show False  | 
2777  | 
by (cases c) auto  | 
|
2778  | 
qed  | 
|
2779  | 
qed  | 
|
2780  | 
||
| 63494 | 2781  | 
lemma connectedD_const: "connected S \<Longrightarrow> continuous_on S P \<Longrightarrow> \<exists>c. \<forall>s\<in>S. P s = c"  | 
2782  | 
for P :: "'a::topological_space \<Rightarrow> bool"  | 
|
2783  | 
by (auto simp: connected_iff_const)  | 
|
| 59106 | 2784  | 
|
2785  | 
lemma connectedI_const:  | 
|
2786  | 
"(\<And>P::'a::topological_space \<Rightarrow> bool. continuous_on S P \<Longrightarrow> \<exists>c. \<forall>s\<in>S. P s = c) \<Longrightarrow> connected S"  | 
|
| 63494 | 2787  | 
by (auto simp: connected_iff_const)  | 
| 59106 | 2788  | 
|
| 56329 | 2789  | 
lemma connected_local_const:  | 
2790  | 
assumes "connected A" "a \<in> A" "b \<in> A"  | 
|
| 63494 | 2791  | 
and *: "\<forall>a\<in>A. eventually (\<lambda>b. f a = f b) (at a within A)"  | 
| 56329 | 2792  | 
shows "f a = f b"  | 
2793  | 
proof -  | 
|
2794  | 
obtain S where S: "\<And>a. a \<in> A \<Longrightarrow> a \<in> S a" "\<And>a. a \<in> A \<Longrightarrow> open (S a)"  | 
|
2795  | 
"\<And>a x. a \<in> A \<Longrightarrow> x \<in> S a \<Longrightarrow> x \<in> A \<Longrightarrow> f a = f x"  | 
|
2796  | 
using * unfolding eventually_at_topological by metis  | 
|
2797  | 
  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"
 | 
|
2798  | 
  have "?P \<inter> A = {} \<or> ?N \<inter> A = {}"
 | 
|
| 60758 | 2799  | 
using \<open>connected A\<close> S \<open>a\<in>A\<close>  | 
| 56329 | 2800  | 
by (intro connectedD) (auto, metis)  | 
2801  | 
then show "f a = f b"  | 
|
2802  | 
proof  | 
|
2803  | 
    assume "?N \<inter> A = {}"
 | 
|
2804  | 
then have "\<forall>x\<in>A. f a = f x"  | 
|
2805  | 
using S(1) by auto  | 
|
| 60758 | 2806  | 
with \<open>b\<in>A\<close> show ?thesis by auto  | 
| 56329 | 2807  | 
next  | 
2808  | 
    assume "?P \<inter> A = {}" then show ?thesis
 | 
|
| 60758 | 2809  | 
using \<open>a \<in> A\<close> S(1)[of a] by auto  | 
| 56329 | 2810  | 
qed  | 
2811  | 
qed  | 
|
2812  | 
||
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2813  | 
lemma (in linorder_topology) connectedD_interval:  | 
| 63494 | 2814  | 
assumes "connected U"  | 
2815  | 
and xy: "x \<in> U" "y \<in> U"  | 
|
2816  | 
and "x \<le> z" "z \<le> y"  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2817  | 
shows "z \<in> U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2818  | 
proof -  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2819  | 
  have eq: "{..<z} \<union> {z<..} = - {z}"
 | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2820  | 
by auto  | 
| 63494 | 2821  | 
have "\<not> connected U" if "z \<notin> U" "x < z" "z < y"  | 
2822  | 
using xy that  | 
|
2823  | 
apply (simp only: connected_def simp_thms)  | 
|
2824  | 
    apply (rule_tac exI[of _ "{..< z}"])
 | 
|
2825  | 
    apply (rule_tac exI[of _ "{z <..}"])
 | 
|
2826  | 
apply (auto simp add: eq)  | 
|
2827  | 
done  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2828  | 
with assms show "z \<in> U"  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2829  | 
by (metis less_le)  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2830  | 
qed  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2831  | 
|
| 
67685
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2832  | 
lemma (in linorder_topology) not_in_connected_cases:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2833  | 
assumes conn: "connected S"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2834  | 
assumes nbdd: "x \<notin> S"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2835  | 
  assumes ne: "S \<noteq> {}"
 | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2836  | 
obtains "bdd_above S" "\<And>y. y \<in> S \<Longrightarrow> x \<ge> y" | "bdd_below S" "\<And>y. y \<in> S \<Longrightarrow> x \<le> y"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2837  | 
proof -  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2838  | 
obtain s where "s \<in> S" using ne by blast  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2839  | 
  {
 | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2840  | 
assume "s \<le> x"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2841  | 
have "False" if "x \<le> y" "y \<in> S" for y  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2842  | 
using connectedD_interval[OF conn \<open>s \<in> S\<close> \<open>y \<in> S\<close> \<open>s \<le> x\<close> \<open>x \<le> y\<close>] \<open>x \<notin> S\<close>  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2843  | 
by simp  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2844  | 
then have wit: "y \<in> S \<Longrightarrow> x \<ge> y" for y  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2845  | 
using le_cases by blast  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2846  | 
then have "bdd_above S"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2847  | 
by (rule local.bdd_aboveI)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2848  | 
note this wit  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2849  | 
  } moreover {
 | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2850  | 
assume "x \<le> s"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2851  | 
have "False" if "x \<ge> y" "y \<in> S" for y  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2852  | 
using connectedD_interval[OF conn \<open>y \<in> S\<close> \<open>s \<in> S\<close> \<open>x \<ge> y\<close> \<open>s \<ge> x\<close> ] \<open>x \<notin> S\<close>  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2853  | 
by simp  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2854  | 
then have wit: "y \<in> S \<Longrightarrow> x \<le> y" for y  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2855  | 
using le_cases by blast  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2856  | 
then have "bdd_below S"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2857  | 
by (rule bdd_belowI)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2858  | 
note this wit  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2859  | 
} ultimately show ?thesis  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2860  | 
by (meson le_cases that)  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2861  | 
qed  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
2862  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2863  | 
lemma connected_continuous_image:  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2864  | 
assumes *: "continuous_on s f"  | 
| 63494 | 2865  | 
and "connected s"  | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2866  | 
shows "connected (f ` s)"  | 
| 59106 | 2867  | 
proof (rule connectedI_const)  | 
| 63494 | 2868  | 
fix P :: "'b \<Rightarrow> bool"  | 
2869  | 
assume "continuous_on (f ` s) P"  | 
|
| 59106 | 2870  | 
then have "continuous_on s (P \<circ> f)"  | 
2871  | 
by (rule continuous_on_compose[OF *])  | 
|
| 60758 | 2872  | 
from connectedD_const[OF \<open>connected s\<close> this] show "\<exists>c. \<forall>s\<in>f ` s. P s = c"  | 
| 59106 | 2873  | 
by auto  | 
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2874  | 
qed  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2875  | 
|
| 
61306
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2876  | 
|
| 
 
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
 
paulson <lp15@cam.ac.uk> 
parents: 
61245 
diff
changeset
 | 
2877  | 
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
 | 
2878  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2879  | 
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
 | 
2880  | 
begin  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2881  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2882  | 
lemma Inf_notin_open:  | 
| 63494 | 2883  | 
assumes A: "open A"  | 
2884  | 
and bnd: "\<forall>a\<in>A. x < a"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2885  | 
shows "Inf A \<notin> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2886  | 
proof  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2887  | 
assume "Inf A \<in> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2888  | 
  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
 | 
2889  | 
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
 | 
2890  | 
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
 | 
2891  | 
by (auto simp: subset_eq)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2892  | 
then show False  | 
| 63494 | 2893  | 
using cInf_lower[OF \<open>c \<in> A\<close>] bnd  | 
2894  | 
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
 | 
2895  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2896  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2897  | 
lemma Sup_notin_open:  | 
| 63494 | 2898  | 
assumes A: "open A"  | 
2899  | 
and bnd: "\<forall>a\<in>A. a < x"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2900  | 
shows "Sup A \<notin> A"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2901  | 
proof  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2902  | 
assume "Sup A \<in> A"  | 
| 63494 | 2903  | 
  with assms obtain b where "Sup A < b" "{Sup A ..< b} \<subseteq> A"
 | 
2904  | 
using open_right[of A "Sup A" x] by auto  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2905  | 
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
 | 
2906  | 
by (auto simp: subset_eq)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2907  | 
then show False  | 
| 63494 | 2908  | 
using cSup_upper[OF \<open>c \<in> A\<close>] bnd  | 
2909  | 
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
 | 
2910  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2911  | 
|
| 
51480
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2912  | 
end  | 
| 
 
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
 
hoelzl 
parents: 
51479 
diff
changeset
 | 
2913  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2914  | 
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
 | 
2915  | 
proof  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2916  | 
fix x :: 'a  | 
| 53381 | 2917  | 
obtain y where "x < y \<or> y < x"  | 
2918  | 
using ex_gt_or_lt [of x] ..  | 
|
| 63494 | 2919  | 
  with Inf_notin_open[of "{x}" y] Sup_notin_open[of "{x}" y] show "\<not> open {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
 | 
2920  | 
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
 | 
2921  | 
qed  | 
| 
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2922  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2923  | 
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
 | 
2924  | 
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
 | 
2925  | 
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
 | 
2926  | 
shows "connected U"  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2927  | 
proof (rule connectedI)  | 
| 63494 | 2928  | 
  {
 | 
2929  | 
fix A B  | 
|
2930  | 
    assume "open A" "open B" "A \<inter> B \<inter> U = {}" "U \<subseteq> A \<union> B"
 | 
|
2931  | 
fix x y  | 
|
2932  | 
assume "x < y" "x \<in> A" "y \<in> B" "x \<in> U" "y \<in> U"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2933  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2934  | 
    let ?z = "Inf (B \<inter> {x <..})"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2935  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2936  | 
have "x \<le> ?z" "?z \<le> y"  | 
| 60758 | 2937  | 
using \<open>y \<in> B\<close> \<open>x < y\<close> by (auto intro: cInf_lower cInf_greatest)  | 
2938  | 
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
 | 
2939  | 
by (rule *)  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2940  | 
    moreover have "?z \<notin> B \<inter> {x <..}"
 | 
| 60758 | 2941  | 
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
 | 
2942  | 
ultimately have "?z \<in> A"  | 
| 60758 | 2943  | 
      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
 | 
| 63494 | 2944  | 
have "\<exists>b\<in>B. b \<in> A \<and> b \<in> U" if "?z < y"  | 
2945  | 
proof -  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2946  | 
      obtain a where "?z < a" "{?z ..< a} \<subseteq> A"
 | 
| 60758 | 2947  | 
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
 | 
2948  | 
moreover obtain b where "b \<in> B" "x < b" "b < min a y"  | 
| 60758 | 2949  | 
        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 | 2950  | 
by auto  | 
| 
53374
 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 
wenzelm 
parents: 
53215 
diff
changeset
 | 
2951  | 
moreover have "?z \<le> b"  | 
| 60758 | 2952  | 
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
 | 
2953  | 
by (intro cInf_lower) auto  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2954  | 
moreover have "b \<in> U"  | 
| 60758 | 2955  | 
using \<open>x \<le> ?z\<close> \<open>?z \<le> b\<close> \<open>b < min a y\<close>  | 
2956  | 
by (intro *[OF \<open>x \<in> U\<close> \<open>y \<in> U\<close>]) (auto simp: less_imp_le)  | 
|
| 63494 | 2957  | 
ultimately show ?thesis  | 
2958  | 
by (intro bexI[of _ b]) auto  | 
|
2959  | 
qed  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2960  | 
then have False  | 
| 63494 | 2961  | 
      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>
 | 
2962  | 
unfolding le_less by blast  | 
|
2963  | 
}  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2964  | 
note not_disjoint = this  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2965  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2966  | 
  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
 | 
2967  | 
  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
 | 
2968  | 
  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
 | 
2969  | 
moreover note not_disjoint[of B A y x] not_disjoint[of A B x y]  | 
| 63494 | 2970  | 
ultimately show False  | 
2971  | 
by (cases x y rule: linorder_cases) auto  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2972  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
2973  | 
|
| 63494 | 2974  | 
lemma connected_iff_interval: "connected U \<longleftrightarrow> (\<forall>x\<in>U. \<forall>y\<in>U. \<forall>z. x \<le> z \<longrightarrow> z \<le> y \<longrightarrow> z \<in> U)"  | 
2975  | 
for 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
 | 
2976  | 
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
 | 
2977  | 
|
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51774 
diff
changeset
 | 
2978  | 
lemma connected_UNIV[simp]: "connected (UNIV::'a::linear_continuum_topology set)"  | 
| 63494 | 2979  | 
by (simp add: connected_iff_interval)  | 
2980  | 
||
2981  | 
lemma connected_Ioi[simp]: "connected {a<..}"
 | 
|
2982  | 
for a :: "'a::linear_continuum_topology"  | 
|
2983  | 
by (auto simp: connected_iff_interval)  | 
|
2984  | 
||
2985  | 
lemma connected_Ici[simp]: "connected {a..}"
 | 
|
2986  | 
for a :: "'a::linear_continuum_topology"  | 
|
2987  | 
by (auto simp: connected_iff_interval)  | 
|
2988  | 
||
2989  | 
lemma connected_Iio[simp]: "connected {..<a}"
 | 
|
2990  | 
for a :: "'a::linear_continuum_topology"  | 
|
2991  | 
by (auto simp: connected_iff_interval)  | 
|
2992  | 
||
2993  | 
lemma connected_Iic[simp]: "connected {..a}"
 | 
|
2994  | 
for a :: "'a::linear_continuum_topology"  | 
|
2995  | 
by (auto simp: connected_iff_interval)  | 
|
2996  | 
||
2997  | 
lemma connected_Ioo[simp]: "connected {a<..<b}"
 | 
|
2998  | 
for 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
 | 
2999  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3000  | 
|
| 63494 | 3001  | 
lemma connected_Ioc[simp]: "connected {a<..b}"
 | 
3002  | 
for a b :: "'a::linear_continuum_topology"  | 
|
3003  | 
by (auto simp: connected_iff_interval)  | 
|
3004  | 
||
3005  | 
lemma connected_Ico[simp]: "connected {a..<b}"
 | 
|
3006  | 
for a b :: "'a::linear_continuum_topology"  | 
|
3007  | 
by (auto simp: connected_iff_interval)  | 
|
3008  | 
||
3009  | 
lemma connected_Icc[simp]: "connected {a..b}"
 | 
|
3010  | 
for a b :: "'a::linear_continuum_topology"  | 
|
3011  | 
by (auto simp: connected_iff_interval)  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3012  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
3013  | 
lemma connected_contains_Ioo:  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3014  | 
fixes A :: "'a :: linorder_topology set"  | 
| 63494 | 3015  | 
  assumes "connected A" "a \<in> A" "b \<in> A" shows "{a <..< b} \<subseteq> A"
 | 
3016  | 
using connectedD_interval[OF assms] by (simp add: subset_eq Ball_def less_imp_le)  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3017  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
3018  | 
lemma connected_contains_Icc:  | 
| 63494 | 3019  | 
fixes A :: "'a::linorder_topology set"  | 
3020  | 
assumes "connected A" "a \<in> A" "b \<in> A"  | 
|
3021  | 
  shows "{a..b} \<subseteq> A"
 | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
3022  | 
proof  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
3023  | 
  fix x assume "x \<in> {a..b}"
 | 
| 63494 | 3024  | 
  then have "x = a \<or> x = b \<or> x \<in> {a<..<b}"
 | 
3025  | 
by auto  | 
|
3026  | 
then show "x \<in> A"  | 
|
3027  | 
using assms connected_contains_Ioo[of A a b] by auto  | 
|
| 
61531
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
3028  | 
qed  | 
| 
 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 
eberlm 
parents: 
61520 
diff
changeset
 | 
3029  | 
|
| 63494 | 3030  | 
|
| 60758 | 3031  | 
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
 | 
3032  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3033  | 
lemma IVT':  | 
| 63494 | 3034  | 
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
 | 
3035  | 
assumes y: "f a \<le> y" "y \<le> f b" "a \<le> b"  | 
| 63494 | 3036  | 
    and *: "continuous_on {a .. b} f"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3037  | 
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
 | 
3038  | 
proof -  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3039  | 
  have "connected {a..b}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3040  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3041  | 
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
 | 
3042  | 
show ?thesis  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3043  | 
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
 | 
3044  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3045  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3046  | 
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
 | 
3047  | 
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
 | 
3048  | 
assumes y: "f b \<le> y" "y \<le> f a" "a \<le> b"  | 
| 63494 | 3049  | 
    and *: "continuous_on {a .. b} f"
 | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3050  | 
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
 | 
3051  | 
proof -  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3052  | 
  have "connected {a..b}"
 | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3053  | 
unfolding connected_iff_interval by auto  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3054  | 
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
 | 
3055  | 
show ?thesis  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3056  | 
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
 | 
3057  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3058  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3059  | 
lemma IVT:  | 
| 63494 | 3060  | 
fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b::linorder_topology"  | 
3061  | 
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>  | 
|
3062  | 
\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3063  | 
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
 | 
3064  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3065  | 
lemma IVT2:  | 
| 63494 | 3066  | 
fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b::linorder_topology"  | 
3067  | 
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>  | 
|
3068  | 
\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3069  | 
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
 | 
3070  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3071  | 
lemma continuous_inj_imp_mono:  | 
| 63494 | 3072  | 
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
 | 
3073  | 
assumes x: "a < x" "x < b"  | 
| 63494 | 3074  | 
    and cont: "continuous_on {a..b} f"
 | 
3075  | 
    and inj: "inj_on f {a..b}"
 | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3076  | 
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
 | 
3077  | 
proof -  | 
| 
61520
 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 
paulson <lp15@cam.ac.uk> 
parents: 
61426 
diff
changeset
 | 
3078  | 
note I = inj_on_eq_iff[OF inj]  | 
| 63494 | 3079  | 
  {
 | 
3080  | 
assume "f x < f a" "f x < f b"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3081  | 
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
 | 
3082  | 
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
 | 
3083  | 
by (auto simp: continuous_on_subset[OF cont] less_imp_le)  | 
| 63494 | 3084  | 
with x I have False by auto  | 
3085  | 
}  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3086  | 
moreover  | 
| 63494 | 3087  | 
  {
 | 
3088  | 
assume "f a < f x" "f b < f x"  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3089  | 
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
 | 
3090  | 
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
 | 
3091  | 
by (auto simp: continuous_on_subset[OF cont] less_imp_le)  | 
| 63494 | 3092  | 
with x I have False by auto  | 
3093  | 
}  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3094  | 
ultimately show ?thesis  | 
| 63494 | 3095  | 
using I[of a x] I[of x b] x less_trans[OF x]  | 
3096  | 
by (auto simp add: le_less less_imp_neq neq_iff)  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3097  | 
qed  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3098  | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3099  | 
lemma continuous_at_Sup_mono:  | 
| 63494 | 3100  | 
  fixes f :: "'a::{linorder_topology,conditionally_complete_linorder} \<Rightarrow>
 | 
3101  | 
    'b::{linorder_topology,conditionally_complete_linorder}"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3102  | 
assumes "mono f"  | 
| 63494 | 3103  | 
and cont: "continuous (at_left (Sup S)) f"  | 
3104  | 
    and S: "S \<noteq> {}" "bdd_above S"
 | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3105  | 
shows "f (Sup S) = (SUP s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3106  | 
proof (rule antisym)  | 
| 61973 | 3107  | 
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
 | 
3108  | 
using cont unfolding continuous_within .  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3109  | 
show "f (Sup S) \<le> (SUP s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3110  | 
proof cases  | 
| 63494 | 3111  | 
assume "Sup S \<in> S"  | 
3112  | 
then show ?thesis  | 
|
| 60758 | 3113  | 
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
 | 
3114  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3115  | 
assume "Sup S \<notin> S"  | 
| 60758 | 3116  | 
    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
 | 
3117  | 
by auto  | 
| 60758 | 3118  | 
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
 | 
3119  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3120  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3121  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3122  | 
assume "\<not> ?thesis"  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3123  | 
with order_tendstoD(1)[OF f, of "SUP s\<in>S. f s"] obtain b where "b < Sup S"  | 
| 
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3124  | 
and *: "\<And>y. b < y \<Longrightarrow> y < Sup S \<Longrightarrow> (SUP s\<in>S. f s) < f y"  | 
| 60758 | 3125  | 
by (auto simp: not_le eventually_at_left[OF \<open>s < Sup S\<close>])  | 
3126  | 
      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
 | 
3127  | 
using less_cSupD[of S b] by auto  | 
| 60758 | 3128  | 
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
 | 
3129  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 60758 | 3130  | 
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
 | 
3131  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3132  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3133  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3134  | 
qed  | 
| 60758 | 3135  | 
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
 | 
3136  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3137  | 
lemma continuous_at_Sup_antimono:  | 
| 63494 | 3138  | 
  fixes f :: "'a::{linorder_topology,conditionally_complete_linorder} \<Rightarrow>
 | 
3139  | 
    'b::{linorder_topology,conditionally_complete_linorder}"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3140  | 
assumes "antimono f"  | 
| 63494 | 3141  | 
and cont: "continuous (at_left (Sup S)) f"  | 
3142  | 
    and S: "S \<noteq> {}" "bdd_above S"
 | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3143  | 
shows "f (Sup S) = (INF s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3144  | 
proof (rule antisym)  | 
| 61973 | 3145  | 
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
 | 
3146  | 
using cont unfolding continuous_within .  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3147  | 
show "(INF s\<in>S. f s) \<le> f (Sup S)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3148  | 
proof cases  | 
| 63494 | 3149  | 
assume "Sup S \<in> S"  | 
3150  | 
then show ?thesis  | 
|
| 60758 | 3151  | 
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
 | 
3152  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3153  | 
assume "Sup S \<notin> S"  | 
| 60758 | 3154  | 
    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
 | 
3155  | 
by auto  | 
| 60758 | 3156  | 
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
 | 
3157  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3158  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3159  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3160  | 
assume "\<not> ?thesis"  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3161  | 
with order_tendstoD(2)[OF f, of "INF s\<in>S. f s"] obtain b where "b < Sup S"  | 
| 
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3162  | 
and *: "\<And>y. b < y \<Longrightarrow> y < Sup S \<Longrightarrow> f y < (INF s\<in>S. f s)"  | 
| 60758 | 3163  | 
by (auto simp: not_le eventually_at_left[OF \<open>s < Sup S\<close>])  | 
3164  | 
      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
 | 
3165  | 
using less_cSupD[of S b] by auto  | 
| 60758 | 3166  | 
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
 | 
3167  | 
unfolding less_le by (blast intro: cSup_upper)  | 
| 60758 | 3168  | 
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
 | 
3169  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3170  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3171  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3172  | 
qed  | 
| 60758 | 3173  | 
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
 | 
3174  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3175  | 
lemma continuous_at_Inf_mono:  | 
| 63494 | 3176  | 
  fixes f :: "'a::{linorder_topology,conditionally_complete_linorder} \<Rightarrow>
 | 
3177  | 
    'b::{linorder_topology,conditionally_complete_linorder}"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3178  | 
assumes "mono f"  | 
| 63494 | 3179  | 
and cont: "continuous (at_right (Inf S)) f"  | 
3180  | 
    and S: "S \<noteq> {}" "bdd_below S"
 | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3181  | 
shows "f (Inf S) = (INF s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3182  | 
proof (rule antisym)  | 
| 61973 | 3183  | 
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
 | 
3184  | 
using cont unfolding continuous_within .  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3185  | 
show "(INF s\<in>S. f s) \<le> f (Inf S)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3186  | 
proof cases  | 
| 63494 | 3187  | 
assume "Inf S \<in> S"  | 
3188  | 
then show ?thesis  | 
|
| 60758 | 3189  | 
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
 | 
3190  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3191  | 
assume "Inf S \<notin> S"  | 
| 60758 | 3192  | 
    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
 | 
3193  | 
by auto  | 
| 60758 | 3194  | 
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
 | 
3195  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3196  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3197  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3198  | 
assume "\<not> ?thesis"  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3199  | 
with order_tendstoD(2)[OF f, of "INF s\<in>S. f s"] obtain b where "Inf S < b"  | 
| 
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3200  | 
and *: "\<And>y. Inf S < y \<Longrightarrow> y < b \<Longrightarrow> f y < (INF s\<in>S. f s)"  | 
| 60758 | 3201  | 
by (auto simp: not_le eventually_at_right[OF \<open>Inf S < s\<close>])  | 
3202  | 
      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
 | 
3203  | 
using cInf_lessD[of S b] by auto  | 
| 60758 | 3204  | 
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
 | 
3205  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 60758 | 3206  | 
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
 | 
3207  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3208  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3209  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3210  | 
qed  | 
| 60758 | 3211  | 
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
 | 
3212  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3213  | 
lemma continuous_at_Inf_antimono:  | 
| 63494 | 3214  | 
  fixes f :: "'a::{linorder_topology,conditionally_complete_linorder} \<Rightarrow>
 | 
3215  | 
    'b::{linorder_topology,conditionally_complete_linorder}"
 | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3216  | 
assumes "antimono f"  | 
| 63494 | 3217  | 
and cont: "continuous (at_right (Inf S)) f"  | 
3218  | 
    and S: "S \<noteq> {}" "bdd_below S"
 | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3219  | 
shows "f (Inf S) = (SUP s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3220  | 
proof (rule antisym)  | 
| 61973 | 3221  | 
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
 | 
3222  | 
using cont unfolding continuous_within .  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3223  | 
show "f (Inf S) \<le> (SUP s\<in>S. f s)"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3224  | 
proof cases  | 
| 63494 | 3225  | 
assume "Inf S \<in> S"  | 
3226  | 
then show ?thesis  | 
|
| 60758 | 3227  | 
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
 | 
3228  | 
next  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3229  | 
assume "Inf S \<notin> S"  | 
| 60758 | 3230  | 
    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
 | 
3231  | 
by auto  | 
| 60758 | 3232  | 
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
 | 
3233  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3234  | 
show ?thesis  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3235  | 
proof (rule ccontr)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3236  | 
assume "\<not> ?thesis"  | 
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3237  | 
with order_tendstoD(1)[OF f, of "SUP s\<in>S. f s"] obtain b where "Inf S < b"  | 
| 
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3238  | 
and *: "\<And>y. Inf S < y \<Longrightarrow> y < b \<Longrightarrow> (SUP s\<in>S. f s) < f y"  | 
| 60758 | 3239  | 
by (auto simp: not_le eventually_at_right[OF \<open>Inf S < s\<close>])  | 
3240  | 
      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
 | 
3241  | 
using cInf_lessD[of S b] by auto  | 
| 60758 | 3242  | 
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
 | 
3243  | 
unfolding less_le by (blast intro: cInf_lower)  | 
| 60758 | 3244  | 
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
 | 
3245  | 
show False  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3246  | 
by (auto simp: assms)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3247  | 
qed  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
59106 
diff
changeset
 | 
3248  | 
qed  | 
| 60758 | 3249  | 
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
 | 
3250  | 
|
| 63494 | 3251  | 
|
| 62101 | 3252  | 
subsection \<open>Uniform spaces\<close>  | 
3253  | 
||
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
3254  | 
class uniformity =  | 
| 62101 | 3255  | 
  fixes uniformity :: "('a \<times> 'a) filter"
 | 
3256  | 
begin  | 
|
3257  | 
||
| 63494 | 3258  | 
abbreviation uniformity_on :: "'a set \<Rightarrow> ('a \<times> 'a) filter"
 | 
3259  | 
where "uniformity_on s \<equiv> inf uniformity (principal (s\<times>s))"  | 
|
| 62101 | 3260  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51481 
diff
changeset
 | 
3261  | 
end  | 
| 62101 | 3262  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
3263  | 
lemma uniformity_Abort:  | 
| 
62123
 
df65f5c27c15
setup code generation for filters as suggested by Florian
 
hoelzl 
parents: 
62102 
diff
changeset
 | 
3264  | 
"uniformity =  | 
| 
 
df65f5c27c15
setup code generation for filters as suggested by Florian
 
hoelzl 
parents: 
62102 
diff
changeset
 | 
3265  | 
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
 | 
3266  | 
by simp  | 
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
3267  | 
|
| 62101 | 3268  | 
class open_uniformity = "open" + uniformity +  | 
| 63494 | 3269  | 
assumes open_uniformity:  | 
3270  | 
"\<And>U. open U \<longleftrightarrow> (\<forall>x\<in>U. eventually (\<lambda>(x', y). x' = x \<longrightarrow> y \<in> U) uniformity)"  | 
|
| 
68064
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3271  | 
begin  | 
| 
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3272  | 
|
| 
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3273  | 
subclass topological_space  | 
| 
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3274  | 
by standard (force elim: eventually_mono eventually_elim2 simp: split_beta' open_uniformity)+  | 
| 
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3275  | 
|
| 
 
b249fab48c76
type class generalisations; some work on infinite products
 
paulson <lp15@cam.ac.uk> 
parents: 
67957 
diff
changeset
 | 
3276  | 
end  | 
| 62101 | 3277  | 
|
3278  | 
class uniform_space = open_uniformity +  | 
|
3279  | 
assumes uniformity_refl: "eventually E uniformity \<Longrightarrow> E (x, x)"  | 
|
| 63494 | 3280  | 
and uniformity_sym: "eventually E uniformity \<Longrightarrow> eventually (\<lambda>(x, y). E (y, x)) uniformity"  | 
3281  | 
and uniformity_trans:  | 
|
3282  | 
"eventually E uniformity \<Longrightarrow>  | 
|
3283  | 
\<exists>D. eventually D uniformity \<and> (\<forall>x y z. D (x, y) \<longrightarrow> D (y, z) \<longrightarrow> E (x, z))"  | 
|
| 62101 | 3284  | 
begin  | 
3285  | 
||
3286  | 
lemma uniformity_bot: "uniformity \<noteq> bot"  | 
|
3287  | 
using uniformity_refl by auto  | 
|
3288  | 
||
3289  | 
lemma uniformity_trans':  | 
|
| 63494 | 3290  | 
"eventually E uniformity \<Longrightarrow>  | 
3291  | 
eventually (\<lambda>((x, y), (y', z)). y = y' \<longrightarrow> E (x, z)) (uniformity \<times>\<^sub>F uniformity)"  | 
|
| 62101 | 3292  | 
by (drule uniformity_trans) (auto simp add: eventually_prod_same)  | 
3293  | 
||
3294  | 
lemma uniformity_transE:  | 
|
| 63494 | 3295  | 
assumes "eventually E uniformity"  | 
| 62101 | 3296  | 
obtains D where "eventually D uniformity" "\<And>x y z. D (x, y) \<Longrightarrow> D (y, z) \<Longrightarrow> E (x, z)"  | 
| 63494 | 3297  | 
using uniformity_trans [OF assms] by auto  | 
| 62101 | 3298  | 
|
3299  | 
lemma eventually_nhds_uniformity:  | 
|
| 63494 | 3300  | 
"eventually P (nhds x) \<longleftrightarrow> eventually (\<lambda>(x', y). x' = x \<longrightarrow> P y) uniformity"  | 
3301  | 
(is "_ \<longleftrightarrow> ?N P x")  | 
|
| 62101 | 3302  | 
unfolding eventually_nhds  | 
3303  | 
proof safe  | 
|
3304  | 
assume *: "?N P x"  | 
|
| 63494 | 3305  | 
have "?N (?N P) x" if "?N P x" for x  | 
3306  | 
proof -  | 
|
3307  | 
from that obtain D where ev: "eventually D uniformity"  | 
|
3308  | 
and D: "D (a, b) \<Longrightarrow> D (b, c) \<Longrightarrow> case (a, c) of (x', y) \<Rightarrow> x' = x \<longrightarrow> P y" for a b c  | 
|
3309  | 
by (rule uniformity_transE) simp  | 
|
3310  | 
from ev show ?thesis  | 
|
3311  | 
by eventually_elim (insert ev D, force elim: eventually_mono split: prod.split)  | 
|
3312  | 
qed  | 
|
| 62101 | 3313  | 
  then have "open {x. ?N P x}"
 | 
3314  | 
by (simp add: open_uniformity)  | 
|
3315  | 
then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>x\<in>S. P x)"  | 
|
3316  | 
    by (intro exI[of _ "{x. ?N P x}"]) (auto dest: uniformity_refl simp: *)
 | 
|
3317  | 
qed (force simp add: open_uniformity elim: eventually_mono)  | 
|
3318  | 
||
| 63494 | 3319  | 
|
| 62101 | 3320  | 
subsubsection \<open>Totally bounded sets\<close>  | 
3321  | 
||
| 63494 | 3322  | 
definition totally_bounded :: "'a set \<Rightarrow> bool"  | 
3323  | 
where "totally_bounded S \<longleftrightarrow>  | 
|
| 62101 | 3324  | 
(\<forall>E. eventually E uniformity \<longrightarrow> (\<exists>X. finite X \<and> (\<forall>s\<in>S. \<exists>x\<in>X. E (x, s))))"  | 
3325  | 
||
3326  | 
lemma totally_bounded_empty[iff]: "totally_bounded {}"
 | 
|
3327  | 
by (auto simp add: totally_bounded_def)  | 
|
3328  | 
||
3329  | 
lemma totally_bounded_subset: "totally_bounded S \<Longrightarrow> T \<subseteq> S \<Longrightarrow> totally_bounded T"  | 
|
| 63171 | 3330  | 
by (fastforce simp add: totally_bounded_def)  | 
| 62101 | 3331  | 
|
| 
62102
 
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
 
hoelzl 
parents: 
62101 
diff
changeset
 | 
3332  | 
lemma totally_bounded_Union[intro]:  | 
| 63494 | 3333  | 
assumes M: "finite M" "\<And>S. S \<in> M \<Longrightarrow> totally_bounded S"  | 
3334  | 
shows "totally_bounded (\<Union>M)"  | 
|
| 62101 | 3335  | 
unfolding totally_bounded_def  | 
3336  | 
proof safe  | 
|
| 63494 | 3337  | 
fix E  | 
3338  | 
assume "eventually E uniformity"  | 
|
| 62101 | 3339  | 
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))"  | 
3340  | 
by (metis totally_bounded_def)  | 
|
| 62175 | 3341  | 
with \<open>finite M\<close> show "\<exists>X. finite X \<and> (\<forall>s\<in>\<Union>M. \<exists>x\<in>X. E (x, s))"  | 
| 62101 | 3342  | 
by (intro exI[of _ "\<Union>S\<in>M. X S"]) force  | 
3343  | 
qed  | 
|
3344  | 
||
| 63494 | 3345  | 
|
| 62101 | 3346  | 
subsubsection \<open>Cauchy filter\<close>  | 
3347  | 
||
| 63494 | 3348  | 
definition cauchy_filter :: "'a filter \<Rightarrow> bool"  | 
3349  | 
where "cauchy_filter F \<longleftrightarrow> F \<times>\<^sub>F F \<le> uniformity"  | 
|
3350  | 
||
3351  | 
definition Cauchy :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool"  | 
|
3352  | 
where Cauchy_uniform: "Cauchy X = cauchy_filter (filtermap X sequentially)"  | 
|
| 62101 | 3353  | 
|
3354  | 
lemma Cauchy_uniform_iff:  | 
|
3355  | 
"Cauchy X \<longleftrightarrow> (\<forall>P. eventually P uniformity \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. P (X n, X m)))"  | 
|
3356  | 
unfolding Cauchy_uniform cauchy_filter_def le_filter_def eventually_prod_same  | 
|
3357  | 
eventually_filtermap eventually_sequentially  | 
|
3358  | 
proof safe  | 
|
3359  | 
let ?U = "\<lambda>P. eventually P uniformity"  | 
|
| 63494 | 3360  | 
  {
 | 
3361  | 
fix P  | 
|
3362  | 
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)))"  | 
|
| 62101 | 3363  | 
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)"  | 
3364  | 
by metis  | 
|
3365  | 
then show "\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. P (X n, X m)"  | 
|
| 63494 | 3366  | 
by blast  | 
3367  | 
next  | 
|
3368  | 
fix P  | 
|
3369  | 
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))"  | 
|
| 62101 | 3370  | 
then obtain Q where "?U Q" and Q: "\<And>x y z. Q (x, y) \<Longrightarrow> Q (y, z) \<Longrightarrow> P (x, z)"  | 
3371  | 
by (auto elim: uniformity_transE)  | 
|
3372  | 
then have "?U (\<lambda>x. Q x \<and> (\<lambda>(x, y). Q (y, x)) x)"  | 
|
3373  | 
unfolding eventually_conj_iff by (simp add: uniformity_sym)  | 
|
3374  | 
from P[rule_format, OF this]  | 
|
3375  | 
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)"  | 
|
3376  | 
by auto  | 
|
3377  | 
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))"  | 
|
3378  | 
proof (safe intro!: exI[of _ "\<lambda>x. \<forall>n\<ge>N. Q (x, X n) \<and> Q (X n, x)"] exI[of _ N] N)  | 
|
| 63494 | 3379  | 
fix x y  | 
3380  | 
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)"  | 
|
| 62101 | 3381  | 
then have "Q (x, X N)" "Q (X N, y)" by auto  | 
3382  | 
then show "P (x, y)"  | 
|
3383  | 
by (rule Q)  | 
|
| 63494 | 3384  | 
qed  | 
3385  | 
}  | 
|
| 62101 | 3386  | 
qed  | 
3387  | 
||
3388  | 
lemma nhds_imp_cauchy_filter:  | 
|
| 63494 | 3389  | 
assumes *: "F \<le> nhds x"  | 
3390  | 
shows "cauchy_filter F"  | 
|
| 62101 | 3391  | 
proof -  | 
3392  | 
have "F \<times>\<^sub>F F \<le> nhds x \<times>\<^sub>F nhds x"  | 
|
3393  | 
by (intro prod_filter_mono *)  | 
|
3394  | 
also have "\<dots> \<le> uniformity"  | 
|
3395  | 
unfolding le_filter_def eventually_nhds_uniformity eventually_prod_same  | 
|
3396  | 
proof safe  | 
|
| 63494 | 3397  | 
fix P  | 
3398  | 
assume "eventually P uniformity"  | 
|
3399  | 
then obtain Ql where ev: "eventually Ql uniformity"  | 
|
3400  | 
and "Ql (x, y) \<Longrightarrow> Ql (y, z) \<Longrightarrow> P (x, z)" for x y z  | 
|
3401  | 
by (rule uniformity_transE) simp  | 
|
3402  | 
with ev[THEN uniformity_sym]  | 
|
3403  | 
show "\<exists>Q. eventually (\<lambda>(x', y). x' = x \<longrightarrow> Q y) uniformity \<and>  | 
|
3404  | 
(\<forall>x y. Q x \<longrightarrow> Q y \<longrightarrow> P (x, y))"  | 
|
| 62101 | 3405  | 
by (rule_tac exI[of _ "\<lambda>y. Ql (y, x) \<and> Ql (x, y)"]) (fastforce elim: eventually_elim2)  | 
3406  | 
qed  | 
|
3407  | 
finally show ?thesis  | 
|
3408  | 
by (simp add: cauchy_filter_def)  | 
|
3409  | 
qed  | 
|
3410  | 
||
3411  | 
lemma LIMSEQ_imp_Cauchy: "X \<longlonglongrightarrow> x \<Longrightarrow> Cauchy X"  | 
|
3412  | 
unfolding Cauchy_uniform filterlim_def by (intro nhds_imp_cauchy_filter)  | 
|
3413  | 
||
| 63494 | 3414  | 
lemma Cauchy_subseq_Cauchy:  | 
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
3415  | 
assumes "Cauchy X" "strict_mono f"  | 
| 63494 | 3416  | 
shows "Cauchy (X \<circ> f)"  | 
| 62101 | 3417  | 
unfolding Cauchy_uniform comp_def filtermap_filtermap[symmetric] cauchy_filter_def  | 
3418  | 
by (rule order_trans[OF _ \<open>Cauchy X\<close>[unfolded Cauchy_uniform cauchy_filter_def]])  | 
|
| 
66447
 
a1f5c5c26fa6
Replaced subseq with strict_mono
 
eberlm <eberlm@in.tum.de> 
parents: 
66162 
diff
changeset
 | 
3419  | 
(intro prod_filter_mono filtermap_mono filterlim_subseq[OF \<open>strict_mono f\<close>, unfolded filterlim_def])  | 
| 62101 | 3420  | 
|
3421  | 
lemma convergent_Cauchy: "convergent X \<Longrightarrow> Cauchy X"  | 
|
3422  | 
unfolding convergent_def by (erule exE, erule LIMSEQ_imp_Cauchy)  | 
|
3423  | 
||
| 63494 | 3424  | 
definition complete :: "'a set \<Rightarrow> bool"  | 
3425  | 
where complete_uniform: "complete S \<longleftrightarrow>  | 
|
3426  | 
(\<forall>F \<le> principal S. F \<noteq> bot \<longrightarrow> cauchy_filter F \<longrightarrow> (\<exists>x\<in>S. F \<le> nhds x))"  | 
|
| 62101 | 3427  | 
|
3428  | 
end  | 
|
3429  | 
||
| 63494 | 3430  | 
|
| 62101 | 3431  | 
subsubsection \<open>Uniformly continuous functions\<close>  | 
3432  | 
||
| 63494 | 3433  | 
definition uniformly_continuous_on :: "'a set \<Rightarrow> ('a::uniform_space \<Rightarrow> 'b::uniform_space) \<Rightarrow> bool"
 | 
3434  | 
where uniformly_continuous_on_uniformity: "uniformly_continuous_on s f \<longleftrightarrow>  | 
|
| 62101 | 3435  | 
(LIM (x, y) (uniformity_on s). (f x, f y) :> uniformity)"  | 
3436  | 
||
3437  | 
lemma uniformly_continuous_onD:  | 
|
| 63494 | 3438  | 
"uniformly_continuous_on s f \<Longrightarrow> eventually E uniformity \<Longrightarrow>  | 
3439  | 
eventually (\<lambda>(x, y). x \<in> s \<longrightarrow> y \<in> s \<longrightarrow> E (f x, f y)) uniformity"  | 
|
3440  | 
by (simp add: uniformly_continuous_on_uniformity filterlim_iff  | 
|
3441  | 
eventually_inf_principal split_beta' mem_Times_iff imp_conjL)  | 
|
| 62101 | 3442  | 
|
3443  | 
lemma uniformly_continuous_on_const[continuous_intros]: "uniformly_continuous_on s (\<lambda>x. c)"  | 
|
3444  | 
by (auto simp: uniformly_continuous_on_uniformity filterlim_iff uniformity_refl)  | 
|
3445  | 
||
3446  | 
lemma uniformly_continuous_on_id[continuous_intros]: "uniformly_continuous_on s (\<lambda>x. x)"  | 
|
3447  | 
by (auto simp: uniformly_continuous_on_uniformity filterlim_def)  | 
|
3448  | 
||
3449  | 
lemma uniformly_continuous_on_compose[continuous_intros]:  | 
|
| 63494 | 3450  | 
"uniformly_continuous_on s g \<Longrightarrow> uniformly_continuous_on (g`s) f \<Longrightarrow>  | 
3451  | 
uniformly_continuous_on s (\<lambda>x. f (g x))"  | 
|
3452  | 
using filterlim_compose[of "\<lambda>(x, y). (f x, f y)" uniformity  | 
|
3453  | 
"uniformity_on (g`s)" "\<lambda>(x, y). (g x, g y)" "uniformity_on s"]  | 
|
3454  | 
by (simp add: split_beta' uniformly_continuous_on_uniformity  | 
|
3455  | 
filterlim_inf filterlim_principal eventually_inf_principal mem_Times_iff)  | 
|
3456  | 
||
3457  | 
lemma uniformly_continuous_imp_continuous:  | 
|
3458  | 
assumes f: "uniformly_continuous_on s f"  | 
|
3459  | 
shows "continuous_on s f"  | 
|
| 62101 | 3460  | 
by (auto simp: filterlim_iff eventually_at_filter eventually_nhds_uniformity continuous_on_def  | 
3461  | 
elim: eventually_mono dest!: uniformly_continuous_onD[OF f])  | 
|
3462  | 
||
| 63494 | 3463  | 
|
| 62367 | 3464  | 
section \<open>Product Topology\<close>  | 
3465  | 
||
3466  | 
subsection \<open>Product is a topological space\<close>  | 
|
3467  | 
||
3468  | 
instantiation prod :: (topological_space, topological_space) topological_space  | 
|
3469  | 
begin  | 
|
3470  | 
||
3471  | 
definition open_prod_def[code del]:  | 
|
3472  | 
  "open (S :: ('a \<times> 'b) set) \<longleftrightarrow>
 | 
|
3473  | 
(\<forall>x\<in>S. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S)"  | 
|
3474  | 
||
3475  | 
lemma open_prod_elim:  | 
|
3476  | 
assumes "open S" and "x \<in> S"  | 
|
3477  | 
obtains A B where "open A" and "open B" and "x \<in> A \<times> B" and "A \<times> B \<subseteq> S"  | 
|
| 63494 | 3478  | 
using assms unfolding open_prod_def by fast  | 
| 62367 | 3479  | 
|
3480  | 
lemma open_prod_intro:  | 
|
3481  | 
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"  | 
|
3482  | 
shows "open S"  | 
|
| 63494 | 3483  | 
using assms unfolding open_prod_def by fast  | 
| 62367 | 3484  | 
|
3485  | 
instance  | 
|
3486  | 
proof  | 
|
3487  | 
  show "open (UNIV :: ('a \<times> 'b) set)"
 | 
|
3488  | 
unfolding open_prod_def by auto  | 
|
3489  | 
next  | 
|
3490  | 
  fix S T :: "('a \<times> 'b) set"
 | 
|
3491  | 
assume "open S" "open T"  | 
|
3492  | 
show "open (S \<inter> T)"  | 
|
3493  | 
proof (rule open_prod_intro)  | 
|
| 63494 | 3494  | 
fix x  | 
3495  | 
assume x: "x \<in> S \<inter> T"  | 
|
| 62367 | 3496  | 
from x have "x \<in> S" by simp  | 
3497  | 
obtain Sa Sb where A: "open Sa" "open Sb" "x \<in> Sa \<times> Sb" "Sa \<times> Sb \<subseteq> S"  | 
|
3498  | 
using \<open>open S\<close> and \<open>x \<in> S\<close> by (rule open_prod_elim)  | 
|
3499  | 
from x have "x \<in> T" by simp  | 
|
3500  | 
obtain Ta Tb where B: "open Ta" "open Tb" "x \<in> Ta \<times> Tb" "Ta \<times> Tb \<subseteq> T"  | 
|
3501  | 
using \<open>open T\<close> and \<open>x \<in> T\<close> by (rule open_prod_elim)  | 
|
3502  | 
let ?A = "Sa \<inter> Ta" and ?B = "Sb \<inter> Tb"  | 
|
3503  | 
have "open ?A \<and> open ?B \<and> x \<in> ?A \<times> ?B \<and> ?A \<times> ?B \<subseteq> S \<inter> T"  | 
|
3504  | 
using A B by (auto simp add: open_Int)  | 
|
| 63494 | 3505  | 
then show "\<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S \<inter> T"  | 
| 62367 | 3506  | 
by fast  | 
3507  | 
qed  | 
|
3508  | 
next  | 
|
3509  | 
  fix K :: "('a \<times> 'b) set set"
 | 
|
| 63494 | 3510  | 
assume "\<forall>S\<in>K. open S"  | 
3511  | 
then show "open (\<Union>K)"  | 
|
| 62367 | 3512  | 
unfolding open_prod_def by fast  | 
3513  | 
qed  | 
|
3514  | 
||
| 62101 | 3515  | 
end  | 
| 62367 | 3516  | 
|
| 63494 | 3517  | 
declare [[code abort: "open :: ('a::topological_space \<times> 'b::topological_space) set \<Rightarrow> bool"]]
 | 
| 62367 | 3518  | 
|
3519  | 
lemma open_Times: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<times> T)"  | 
|
| 63494 | 3520  | 
unfolding open_prod_def by auto  | 
| 62367 | 3521  | 
|
3522  | 
lemma fst_vimage_eq_Times: "fst -` S = S \<times> UNIV"  | 
|
| 63494 | 3523  | 
by auto  | 
| 62367 | 3524  | 
|
3525  | 
lemma snd_vimage_eq_Times: "snd -` S = UNIV \<times> S"  | 
|
| 63494 | 3526  | 
by auto  | 
| 62367 | 3527  | 
|
3528  | 
lemma open_vimage_fst: "open S \<Longrightarrow> open (fst -` S)"  | 
|
| 63494 | 3529  | 
by (simp add: fst_vimage_eq_Times open_Times)  | 
| 62367 | 3530  | 
|
3531  | 
lemma open_vimage_snd: "open S \<Longrightarrow> open (snd -` S)"  | 
|
| 63494 | 3532  | 
by (simp add: snd_vimage_eq_Times open_Times)  | 
| 62367 | 3533  | 
|
3534  | 
lemma closed_vimage_fst: "closed S \<Longrightarrow> closed (fst -` S)"  | 
|
| 63494 | 3535  | 
unfolding closed_open vimage_Compl [symmetric]  | 
3536  | 
by (rule open_vimage_fst)  | 
|
| 62367 | 3537  | 
|
3538  | 
lemma closed_vimage_snd: "closed S \<Longrightarrow> closed (snd -` S)"  | 
|
| 63494 | 3539  | 
unfolding closed_open vimage_Compl [symmetric]  | 
3540  | 
by (rule open_vimage_snd)  | 
|
| 62367 | 3541  | 
|
3542  | 
lemma closed_Times: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"  | 
|
3543  | 
proof -  | 
|
| 63494 | 3544  | 
have "S \<times> T = (fst -` S) \<inter> (snd -` T)"  | 
3545  | 
by auto  | 
|
3546  | 
then show "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"  | 
|
| 62367 | 3547  | 
by (simp add: closed_vimage_fst closed_vimage_snd closed_Int)  | 
3548  | 
qed  | 
|
3549  | 
||
3550  | 
lemma subset_fst_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> y \<in> B \<Longrightarrow> A \<subseteq> fst ` S"  | 
|
3551  | 
unfolding image_def subset_eq by force  | 
|
3552  | 
||
3553  | 
lemma subset_snd_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> x \<in> A \<Longrightarrow> B \<subseteq> snd ` S"  | 
|
3554  | 
unfolding image_def subset_eq by force  | 
|
3555  | 
||
| 63494 | 3556  | 
lemma open_image_fst:  | 
3557  | 
assumes "open S"  | 
|
3558  | 
shows "open (fst ` S)"  | 
|
| 62367 | 3559  | 
proof (rule openI)  | 
| 63494 | 3560  | 
fix x  | 
3561  | 
assume "x \<in> fst ` S"  | 
|
3562  | 
then obtain y where "(x, y) \<in> S"  | 
|
3563  | 
by auto  | 
|
| 62367 | 3564  | 
then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"  | 
3565  | 
using \<open>open S\<close> unfolding open_prod_def by auto  | 
|
| 63494 | 3566  | 
from \<open>A \<times> B \<subseteq> S\<close> \<open>y \<in> B\<close> have "A \<subseteq> fst ` S"  | 
3567  | 
by (rule subset_fst_imageI)  | 
|
3568  | 
with \<open>open A\<close> \<open>x \<in> A\<close> have "open A \<and> x \<in> A \<and> A \<subseteq> fst ` S"  | 
|
3569  | 
by simp  | 
|
3570  | 
then show "\<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> fst ` S" ..  | 
|
| 62367 | 3571  | 
qed  | 
3572  | 
||
| 63494 | 3573  | 
lemma open_image_snd:  | 
3574  | 
assumes "open S"  | 
|
3575  | 
shows "open (snd ` S)"  | 
|
| 62367 | 3576  | 
proof (rule openI)  | 
| 63494 | 3577  | 
fix y  | 
3578  | 
assume "y \<in> snd ` S"  | 
|
3579  | 
then obtain x where "(x, y) \<in> S"  | 
|
3580  | 
by auto  | 
|
| 62367 | 3581  | 
then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"  | 
3582  | 
using \<open>open S\<close> unfolding open_prod_def by auto  | 
|
| 63494 | 3583  | 
from \<open>A \<times> B \<subseteq> S\<close> \<open>x \<in> A\<close> have "B \<subseteq> snd ` S"  | 
3584  | 
by (rule subset_snd_imageI)  | 
|
3585  | 
with \<open>open B\<close> \<open>y \<in> B\<close> have "open B \<and> y \<in> B \<and> B \<subseteq> snd ` S"  | 
|
3586  | 
by simp  | 
|
3587  | 
then show "\<exists>T. open T \<and> y \<in> T \<and> T \<subseteq> snd ` S" ..  | 
|
| 62367 | 3588  | 
qed  | 
3589  | 
||
3590  | 
lemma nhds_prod: "nhds (a, b) = nhds a \<times>\<^sub>F nhds b"  | 
|
3591  | 
unfolding nhds_def  | 
|
3592  | 
proof (subst prod_filter_INF, auto intro!: antisym INF_greatest simp: principal_prod_principal)  | 
|
| 63494 | 3593  | 
fix S T  | 
3594  | 
assume "open S" "a \<in> S" "open T" "b \<in> T"  | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3595  | 
  then show "(INF x \<in> {S. open S \<and> (a, b) \<in> S}. principal x) \<le> principal (S \<times> T)"
 | 
| 62367 | 3596  | 
by (intro INF_lower) (auto intro!: open_Times)  | 
3597  | 
next  | 
|
| 63494 | 3598  | 
fix S'  | 
3599  | 
assume "open S'" "(a, b) \<in> S'"  | 
|
| 62367 | 3600  | 
then obtain S T where "open S" "a \<in> S" "open T" "b \<in> T" "S \<times> T \<subseteq> S'"  | 
3601  | 
by (auto elim: open_prod_elim)  | 
|
| 
69260
 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 
haftmann 
parents: 
69164 
diff
changeset
 | 
3602  | 
  then show "(INF x \<in> {S. open S \<and> a \<in> S}. INF y \<in> {S. open S \<and> b \<in> S}.
 | 
| 63494 | 3603  | 
principal (x \<times> y)) \<le> principal S'"  | 
| 62367 | 3604  | 
by (auto intro!: INF_lower2)  | 
3605  | 
qed  | 
|
3606  | 
||
| 63494 | 3607  | 
|
| 62367 | 3608  | 
subsubsection \<open>Continuity of operations\<close>  | 
3609  | 
||
3610  | 
lemma tendsto_fst [tendsto_intros]:  | 
|
3611  | 
assumes "(f \<longlongrightarrow> a) F"  | 
|
3612  | 
shows "((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F"  | 
|
3613  | 
proof (rule topological_tendstoI)  | 
|
| 63494 | 3614  | 
fix S  | 
3615  | 
assume "open S" and "fst a \<in> S"  | 
|
| 62367 | 3616  | 
then have "open (fst -` S)" and "a \<in> fst -` S"  | 
3617  | 
by (simp_all add: open_vimage_fst)  | 
|
3618  | 
with assms have "eventually (\<lambda>x. f x \<in> fst -` S) F"  | 
|
3619  | 
by (rule topological_tendstoD)  | 
|
3620  | 
then show "eventually (\<lambda>x. fst (f x) \<in> S) F"  | 
|
3621  | 
by simp  | 
|
3622  | 
qed  | 
|
3623  | 
||
3624  | 
lemma tendsto_snd [tendsto_intros]:  | 
|
3625  | 
assumes "(f \<longlongrightarrow> a) F"  | 
|
3626  | 
shows "((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F"  | 
|
3627  | 
proof (rule topological_tendstoI)  | 
|
| 63494 | 3628  | 
fix S  | 
3629  | 
assume "open S" and "snd a \<in> S"  | 
|
| 62367 | 3630  | 
then have "open (snd -` S)" and "a \<in> snd -` S"  | 
3631  | 
by (simp_all add: open_vimage_snd)  | 
|
3632  | 
with assms have "eventually (\<lambda>x. f x \<in> snd -` S) F"  | 
|
3633  | 
by (rule topological_tendstoD)  | 
|
3634  | 
then show "eventually (\<lambda>x. snd (f x) \<in> S) F"  | 
|
3635  | 
by simp  | 
|
3636  | 
qed  | 
|
3637  | 
||
3638  | 
lemma tendsto_Pair [tendsto_intros]:  | 
|
3639  | 
assumes "(f \<longlongrightarrow> a) F" and "(g \<longlongrightarrow> b) F"  | 
|
3640  | 
shows "((\<lambda>x. (f x, g x)) \<longlongrightarrow> (a, b)) F"  | 
|
| 67957 | 3641  | 
unfolding nhds_prod using assms by (rule filterlim_Pair)  | 
| 62367 | 3642  | 
|
3643  | 
lemma continuous_fst[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. fst (f x))"  | 
|
3644  | 
unfolding continuous_def by (rule tendsto_fst)  | 
|
3645  | 
||
3646  | 
lemma continuous_snd[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. snd (f x))"  | 
|
3647  | 
unfolding continuous_def by (rule tendsto_snd)  | 
|
3648  | 
||
| 63494 | 3649  | 
lemma continuous_Pair[continuous_intros]:  | 
3650  | 
"continuous F f \<Longrightarrow> continuous F g \<Longrightarrow> continuous F (\<lambda>x. (f x, g x))"  | 
|
| 62367 | 3651  | 
unfolding continuous_def by (rule tendsto_Pair)  | 
3652  | 
||
| 63494 | 3653  | 
lemma continuous_on_fst[continuous_intros]:  | 
3654  | 
"continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. fst (f x))"  | 
|
| 62367 | 3655  | 
unfolding continuous_on_def by (auto intro: tendsto_fst)  | 
3656  | 
||
| 63494 | 3657  | 
lemma continuous_on_snd[continuous_intros]:  | 
3658  | 
"continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. snd (f x))"  | 
|
| 62367 | 3659  | 
unfolding continuous_on_def by (auto intro: tendsto_snd)  | 
3660  | 
||
| 63494 | 3661  | 
lemma continuous_on_Pair[continuous_intros]:  | 
3662  | 
"continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> continuous_on s (\<lambda>x. (f x, g x))"  | 
|
| 62367 | 3663  | 
unfolding continuous_on_def by (auto intro: tendsto_Pair)  | 
3664  | 
||
3665  | 
lemma continuous_on_swap[continuous_intros]: "continuous_on A prod.swap"  | 
|
| 63494 | 3666  | 
by (simp add: prod.swap_def continuous_on_fst continuous_on_snd  | 
3667  | 
continuous_on_Pair continuous_on_id)  | 
|
| 62367 | 3668  | 
|
3669  | 
lemma continuous_on_swap_args:  | 
|
3670  | 
assumes "continuous_on (A\<times>B) (\<lambda>(x,y). d x y)"  | 
|
3671  | 
shows "continuous_on (B\<times>A) (\<lambda>(x,y). d y x)"  | 
|
3672  | 
proof -  | 
|
| 63494 | 3673  | 
have "(\<lambda>(x,y). d y x) = (\<lambda>(x,y). d x y) \<circ> prod.swap"  | 
| 62367 | 3674  | 
by force  | 
3675  | 
then show ?thesis  | 
|
| 
70749
 
5d06b7bb9d22
More type class generalisations. Note that linorder_antisym_conv1 and linorder_antisym_conv2 no longer exist.
 
paulson <lp15@cam.ac.uk> 
parents: 
70723 
diff
changeset
 | 
3676  | 
by (metis assms continuous_on_compose continuous_on_swap product_swap)  | 
| 62367 | 3677  | 
qed  | 
3678  | 
||
3679  | 
lemma isCont_fst [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. fst (f x)) a"  | 
|
3680  | 
by (fact continuous_fst)  | 
|
3681  | 
||
3682  | 
lemma isCont_snd [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. snd (f x)) a"  | 
|
3683  | 
by (fact continuous_snd)  | 
|
3684  | 
||
3685  | 
lemma isCont_Pair [simp]: "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. (f x, g x)) a"  | 
|
3686  | 
by (fact continuous_Pair)  | 
|
3687  | 
||
| 
67685
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3688  | 
lemma continuous_on_compose_Pair:  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3689  | 
assumes f: "continuous_on (Sigma A B) (\<lambda>(a, b). f a b)"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3690  | 
assumes g: "continuous_on C g"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3691  | 
assumes h: "continuous_on C h"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3692  | 
assumes subset: "\<And>c. c \<in> C \<Longrightarrow> g c \<in> A" "\<And>c. c \<in> C \<Longrightarrow> h c \<in> B (g c)"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3693  | 
shows "continuous_on C (\<lambda>c. f (g c) (h c))"  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3694  | 
using continuous_on_compose2[OF f continuous_on_Pair[OF g h]] subset  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3695  | 
by auto  | 
| 
 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 
immler 
parents: 
67577 
diff
changeset
 | 
3696  | 
|
| 63494 | 3697  | 
|
| 67577 | 3698  | 
subsubsection \<open>Connectedness of products\<close>  | 
3699  | 
||
3700  | 
proposition connected_Times:  | 
|
3701  | 
assumes S: "connected S" and T: "connected T"  | 
|
3702  | 
shows "connected (S \<times> T)"  | 
|
3703  | 
proof (rule connectedI_const)  | 
|
3704  | 
fix P::"'a \<times> 'b \<Rightarrow> bool"  | 
|
3705  | 
assume P[THEN continuous_on_compose2, continuous_intros]: "continuous_on (S \<times> T) P"  | 
|
3706  | 
have "continuous_on S (\<lambda>s. P (s, t))" if "t \<in> T" for t  | 
|
3707  | 
by (auto intro!: continuous_intros that)  | 
|
3708  | 
from connectedD_const[OF S this]  | 
|
3709  | 
obtain c1 where c1: "\<And>s t. t \<in> T \<Longrightarrow> s \<in> S \<Longrightarrow> P (s, t) = c1 t"  | 
|
3710  | 
by metis  | 
|
3711  | 
moreover  | 
|
3712  | 
have "continuous_on T (\<lambda>t. P (s, t))" if "s \<in> S" for s  | 
|
3713  | 
by (auto intro!: continuous_intros that)  | 
|
3714  | 
from connectedD_const[OF T this]  | 
|
3715  | 
obtain c2 where "\<And>s t. t \<in> T \<Longrightarrow> s \<in> S \<Longrightarrow> P (s, t) = c2 s"  | 
|
3716  | 
by metis  | 
|
3717  | 
ultimately show "\<exists>c. \<forall>s\<in>S \<times> T. P s = c"  | 
|
3718  | 
by auto  | 
|
3719  | 
qed  | 
|
3720  | 
||
3721  | 
corollary connected_Times_eq [simp]:  | 
|
3722  | 
   "connected (S \<times> T) \<longleftrightarrow> S = {} \<or> T = {} \<or> connected S \<and> connected T"  (is "?lhs = ?rhs")
 | 
|
3723  | 
proof  | 
|
3724  | 
assume L: ?lhs  | 
|
3725  | 
show ?rhs  | 
|
3726  | 
proof cases  | 
|
3727  | 
    assume "S \<noteq> {} \<and> T \<noteq> {}"
 | 
|
3728  | 
moreover  | 
|
3729  | 
have "connected (fst ` (S \<times> T))" "connected (snd ` (S \<times> T))"  | 
|
3730  | 
using continuous_on_fst continuous_on_snd continuous_on_id  | 
|
3731  | 
by (blast intro: connected_continuous_image [OF _ L])+  | 
|
3732  | 
ultimately show ?thesis  | 
|
3733  | 
by auto  | 
|
3734  | 
qed auto  | 
|
3735  | 
qed (auto simp: connected_Times)  | 
|
3736  | 
||
3737  | 
||
| 62367 | 3738  | 
subsubsection \<open>Separation axioms\<close>  | 
3739  | 
||
3740  | 
instance prod :: (t0_space, t0_space) t0_space  | 
|
3741  | 
proof  | 
|
| 63494 | 3742  | 
fix x y :: "'a \<times> 'b"  | 
3743  | 
assume "x \<noteq> y"  | 
|
3744  | 
then have "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
| 62367 | 3745  | 
by (simp add: prod_eq_iff)  | 
| 63494 | 3746  | 
then show "\<exists>U. open U \<and> (x \<in> U) \<noteq> (y \<in> U)"  | 
| 62367 | 3747  | 
by (fast dest: t0_space elim: open_vimage_fst open_vimage_snd)  | 
3748  | 
qed  | 
|
3749  | 
||
3750  | 
instance prod :: (t1_space, t1_space) t1_space  | 
|
3751  | 
proof  | 
|
| 63494 | 3752  | 
fix x y :: "'a \<times> 'b"  | 
3753  | 
assume "x \<noteq> y"  | 
|
3754  | 
then have "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
| 62367 | 3755  | 
by (simp add: prod_eq_iff)  | 
| 63494 | 3756  | 
then show "\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U"  | 
| 62367 | 3757  | 
by (fast dest: t1_space elim: open_vimage_fst open_vimage_snd)  | 
3758  | 
qed  | 
|
3759  | 
||
3760  | 
instance prod :: (t2_space, t2_space) t2_space  | 
|
3761  | 
proof  | 
|
| 63494 | 3762  | 
fix x y :: "'a \<times> 'b"  | 
3763  | 
assume "x \<noteq> y"  | 
|
3764  | 
then have "fst x \<noteq> fst y \<or> snd x \<noteq> snd y"  | 
|
| 62367 | 3765  | 
by (simp add: prod_eq_iff)  | 
| 63494 | 3766  | 
  then show "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}"
 | 
| 62367 | 3767  | 
by (fast dest: hausdorff elim: open_vimage_fst open_vimage_snd)  | 
3768  | 
qed  | 
|
3769  | 
||
3770  | 
lemma isCont_swap[continuous_intros]: "isCont prod.swap a"  | 
|
3771  | 
using continuous_on_eq_continuous_within continuous_on_swap by blast  | 
|
3772  | 
||
| 
64284
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3773  | 
lemma open_diagonal_complement:  | 
| 67957 | 3774  | 
  "open {(x,y) |x y. x \<noteq> (y::('a::t2_space))}"
 | 
3775  | 
proof -  | 
|
3776  | 
  have "open {(x, y). x \<noteq> (y::'a)}"
 | 
|
3777  | 
unfolding split_def by (intro open_Collect_neq continuous_intros)  | 
|
3778  | 
  also have "{(x, y). x \<noteq> (y::'a)} = {(x, y) |x y. x \<noteq> (y::'a)}"
 | 
|
3779  | 
by auto  | 
|
3780  | 
finally show ?thesis .  | 
|
| 
64284
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3781  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3782  | 
|
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3783  | 
lemma closed_diagonal:  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3784  | 
  "closed {y. \<exists> x::('a::t2_space). y = (x,x)}"
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3785  | 
proof -  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3786  | 
  have "{y. \<exists> x::'a. y = (x,x)} = UNIV - {(x,y) | x y. x \<noteq> y}" by auto
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3787  | 
then show ?thesis using open_diagonal_complement closed_Diff by auto  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3788  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3789  | 
|
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3790  | 
lemma open_superdiagonal:  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3791  | 
  "open {(x,y) | x y. x > (y::'a::{linorder_topology})}"
 | 
| 67957 | 3792  | 
proof -  | 
3793  | 
  have "open {(x, y). x > (y::'a)}"
 | 
|
3794  | 
unfolding split_def by (intro open_Collect_less continuous_intros)  | 
|
3795  | 
  also have "{(x, y). x > (y::'a)} = {(x, y) |x y. x > (y::'a)}"
 | 
|
3796  | 
by auto  | 
|
3797  | 
finally show ?thesis .  | 
|
| 
64284
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3798  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3799  | 
|
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3800  | 
lemma closed_subdiagonal:  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3801  | 
  "closed {(x,y) | x y. x \<le> (y::'a::{linorder_topology})}"
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3802  | 
proof -  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3803  | 
  have "{(x,y) | x y. x \<le> (y::'a)} = UNIV - {(x,y) | x y. x > (y::'a)}" by auto
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3804  | 
then show ?thesis using open_superdiagonal closed_Diff by auto  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3805  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3806  | 
|
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3807  | 
lemma open_subdiagonal:  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3808  | 
  "open {(x,y) | x y. x < (y::'a::{linorder_topology})}"
 | 
| 67957 | 3809  | 
proof -  | 
3810  | 
  have "open {(x, y). x < (y::'a)}"
 | 
|
3811  | 
unfolding split_def by (intro open_Collect_less continuous_intros)  | 
|
3812  | 
  also have "{(x, y). x < (y::'a)} = {(x, y) |x y. x < (y::'a)}"
 | 
|
3813  | 
by auto  | 
|
3814  | 
finally show ?thesis .  | 
|
| 
64284
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3815  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3816  | 
|
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3817  | 
lemma closed_superdiagonal:  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3818  | 
  "closed {(x,y) | x y. x \<ge> (y::('a::{linorder_topology}))}"
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3819  | 
proof -  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3820  | 
  have "{(x,y) | x y. x \<ge> (y::'a)} = UNIV - {(x,y) | x y. x < y}" by auto
 | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3821  | 
then show ?thesis using open_subdiagonal closed_Diff by auto  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3822  | 
qed  | 
| 
 
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
 
hoelzl 
parents: 
64283 
diff
changeset
 | 
3823  | 
|
| 62367 | 3824  | 
end  |