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