author | wenzelm |
Wed, 31 Aug 2005 15:46:37 +0200 | |
changeset 17200 | 3a4d03d1a31b |
parent 15140 | 322485b816ac |
child 19736 | d8d0f8f51d69 |
permissions | -rw-r--r-- |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
1 |
(* Title: HOL/Library/Continuity.thy |
11355 | 2 |
ID: $Id$ |
3 |
Author: David von Oheimb, TU Muenchen |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
4 |
*) |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
5 |
|
14706 | 6 |
header {* Continuity and iterations (of set transformers) *} |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
7 |
|
15131 | 8 |
theory Continuity |
15140 | 9 |
imports Main |
15131 | 10 |
begin |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
11 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
12 |
subsection "Chains" |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
13 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
14 |
constdefs |
11355 | 15 |
up_chain :: "(nat => 'a set) => bool" |
16 |
"up_chain F == \<forall>i. F i \<subseteq> F (Suc i)" |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
17 |
|
11355 | 18 |
lemma up_chainI: "(!!i. F i \<subseteq> F (Suc i)) ==> up_chain F" |
19 |
by (simp add: up_chain_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
20 |
|
11355 | 21 |
lemma up_chainD: "up_chain F ==> F i \<subseteq> F (Suc i)" |
22 |
by (simp add: up_chain_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
23 |
|
11355 | 24 |
lemma up_chain_less_mono [rule_format]: |
25 |
"up_chain F ==> x < y --> F x \<subseteq> F y" |
|
26 |
apply (induct_tac y) |
|
27 |
apply (blast dest: up_chainD elim: less_SucE)+ |
|
28 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
29 |
|
11355 | 30 |
lemma up_chain_mono: "up_chain F ==> x \<le> y ==> F x \<subseteq> F y" |
31 |
apply (drule le_imp_less_or_eq) |
|
32 |
apply (blast dest: up_chain_less_mono) |
|
33 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
34 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
35 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
36 |
constdefs |
11355 | 37 |
down_chain :: "(nat => 'a set) => bool" |
38 |
"down_chain F == \<forall>i. F (Suc i) \<subseteq> F i" |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
39 |
|
11355 | 40 |
lemma down_chainI: "(!!i. F (Suc i) \<subseteq> F i) ==> down_chain F" |
41 |
by (simp add: down_chain_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
42 |
|
11355 | 43 |
lemma down_chainD: "down_chain F ==> F (Suc i) \<subseteq> F i" |
44 |
by (simp add: down_chain_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
45 |
|
11355 | 46 |
lemma down_chain_less_mono [rule_format]: |
47 |
"down_chain F ==> x < y --> F y \<subseteq> F x" |
|
48 |
apply (induct_tac y) |
|
49 |
apply (blast dest: down_chainD elim: less_SucE)+ |
|
50 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
51 |
|
11355 | 52 |
lemma down_chain_mono: "down_chain F ==> x \<le> y ==> F y \<subseteq> F x" |
53 |
apply (drule le_imp_less_or_eq) |
|
54 |
apply (blast dest: down_chain_less_mono) |
|
55 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
56 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
57 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
58 |
subsection "Continuity" |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
59 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
60 |
constdefs |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
61 |
up_cont :: "('a set => 'a set) => bool" |
11355 | 62 |
"up_cont f == \<forall>F. up_chain F --> f (\<Union>(range F)) = \<Union>(f ` range F)" |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
63 |
|
11355 | 64 |
lemma up_contI: |
65 |
"(!!F. up_chain F ==> f (\<Union>(range F)) = \<Union>(f ` range F)) ==> up_cont f" |
|
66 |
apply (unfold up_cont_def) |
|
67 |
apply blast |
|
68 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
69 |
|
11355 | 70 |
lemma up_contD: |
71 |
"up_cont f ==> up_chain F ==> f (\<Union>(range F)) = \<Union>(f ` range F)" |
|
72 |
apply (unfold up_cont_def) |
|
73 |
apply auto |
|
74 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
75 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
76 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
77 |
lemma up_cont_mono: "up_cont f ==> mono f" |
11355 | 78 |
apply (rule monoI) |
79 |
apply (drule_tac F = "\<lambda>i. if i = 0 then A else B" in up_contD) |
|
80 |
apply (rule up_chainI) |
|
81 |
apply simp+ |
|
82 |
apply (drule Un_absorb1) |
|
11461 | 83 |
apply (auto simp add: nat_not_singleton) |
11355 | 84 |
done |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
85 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
86 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
87 |
constdefs |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
88 |
down_cont :: "('a set => 'a set) => bool" |
11355 | 89 |
"down_cont f == |
90 |
\<forall>F. down_chain F --> f (Inter (range F)) = Inter (f ` range F)" |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
91 |
|
11355 | 92 |
lemma down_contI: |
93 |
"(!!F. down_chain F ==> f (Inter (range F)) = Inter (f ` range F)) ==> |
|
94 |
down_cont f" |
|
95 |
apply (unfold down_cont_def) |
|
96 |
apply blast |
|
97 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
98 |
|
11355 | 99 |
lemma down_contD: "down_cont f ==> down_chain F ==> |
100 |
f (Inter (range F)) = Inter (f ` range F)" |
|
101 |
apply (unfold down_cont_def) |
|
102 |
apply auto |
|
103 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
104 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
105 |
lemma down_cont_mono: "down_cont f ==> mono f" |
11355 | 106 |
apply (rule monoI) |
107 |
apply (drule_tac F = "\<lambda>i. if i = 0 then B else A" in down_contD) |
|
108 |
apply (rule down_chainI) |
|
109 |
apply simp+ |
|
110 |
apply (drule Int_absorb1) |
|
11461 | 111 |
apply (auto simp add: nat_not_singleton) |
11355 | 112 |
done |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
113 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
114 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
115 |
subsection "Iteration" |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
116 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
117 |
constdefs |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
118 |
up_iterate :: "('a set => 'a set) => nat => 'a set" |
11355 | 119 |
"up_iterate f n == (f^n) {}" |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
120 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
121 |
lemma up_iterate_0 [simp]: "up_iterate f 0 = {}" |
11355 | 122 |
by (simp add: up_iterate_def) |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
123 |
|
11355 | 124 |
lemma up_iterate_Suc [simp]: "up_iterate f (Suc i) = f (up_iterate f i)" |
125 |
by (simp add: up_iterate_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
126 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
127 |
lemma up_iterate_chain: "mono F ==> up_chain (up_iterate F)" |
11355 | 128 |
apply (rule up_chainI) |
129 |
apply (induct_tac i) |
|
130 |
apply simp+ |
|
131 |
apply (erule (1) monoD) |
|
132 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
133 |
|
11355 | 134 |
lemma UNION_up_iterate_is_fp: |
135 |
"up_cont F ==> |
|
136 |
F (UNION UNIV (up_iterate F)) = UNION UNIV (up_iterate F)" |
|
137 |
apply (frule up_cont_mono [THEN up_iterate_chain]) |
|
138 |
apply (drule (1) up_contD) |
|
139 |
apply simp |
|
140 |
apply (auto simp del: up_iterate_Suc simp add: up_iterate_Suc [symmetric]) |
|
141 |
apply (case_tac xa) |
|
142 |
apply auto |
|
143 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
144 |
|
11355 | 145 |
lemma UNION_up_iterate_lowerbound: |
146 |
"mono F ==> F P = P ==> UNION UNIV (up_iterate F) \<subseteq> P" |
|
147 |
apply (subgoal_tac "(!!i. up_iterate F i \<subseteq> P)") |
|
148 |
apply fast |
|
149 |
apply (induct_tac i) |
|
150 |
prefer 2 apply (drule (1) monoD) |
|
151 |
apply auto |
|
152 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
153 |
|
11355 | 154 |
lemma UNION_up_iterate_is_lfp: |
155 |
"up_cont F ==> lfp F = UNION UNIV (up_iterate F)" |
|
156 |
apply (rule set_eq_subset [THEN iffD2]) |
|
157 |
apply (rule conjI) |
|
158 |
prefer 2 |
|
159 |
apply (drule up_cont_mono) |
|
160 |
apply (rule UNION_up_iterate_lowerbound) |
|
161 |
apply assumption |
|
162 |
apply (erule lfp_unfold [symmetric]) |
|
163 |
apply (rule lfp_lowerbound) |
|
164 |
apply (rule set_eq_subset [THEN iffD1, THEN conjunct2]) |
|
165 |
apply (erule UNION_up_iterate_is_fp [symmetric]) |
|
166 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
167 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
168 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
169 |
constdefs |
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
170 |
down_iterate :: "('a set => 'a set) => nat => 'a set" |
11355 | 171 |
"down_iterate f n == (f^n) UNIV" |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
172 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
173 |
lemma down_iterate_0 [simp]: "down_iterate f 0 = UNIV" |
11355 | 174 |
by (simp add: down_iterate_def) |
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
175 |
|
11355 | 176 |
lemma down_iterate_Suc [simp]: |
177 |
"down_iterate f (Suc i) = f (down_iterate f i)" |
|
178 |
by (simp add: down_iterate_def) |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
179 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
180 |
lemma down_iterate_chain: "mono F ==> down_chain (down_iterate F)" |
11355 | 181 |
apply (rule down_chainI) |
182 |
apply (induct_tac i) |
|
183 |
apply simp+ |
|
184 |
apply (erule (1) monoD) |
|
185 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
186 |
|
11355 | 187 |
lemma INTER_down_iterate_is_fp: |
188 |
"down_cont F ==> |
|
189 |
F (INTER UNIV (down_iterate F)) = INTER UNIV (down_iterate F)" |
|
190 |
apply (frule down_cont_mono [THEN down_iterate_chain]) |
|
191 |
apply (drule (1) down_contD) |
|
192 |
apply simp |
|
193 |
apply (auto simp del: down_iterate_Suc simp add: down_iterate_Suc [symmetric]) |
|
194 |
apply (case_tac xa) |
|
195 |
apply auto |
|
196 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
197 |
|
11355 | 198 |
lemma INTER_down_iterate_upperbound: |
199 |
"mono F ==> F P = P ==> P \<subseteq> INTER UNIV (down_iterate F)" |
|
200 |
apply (subgoal_tac "(!!i. P \<subseteq> down_iterate F i)") |
|
201 |
apply fast |
|
202 |
apply (induct_tac i) |
|
203 |
prefer 2 apply (drule (1) monoD) |
|
204 |
apply auto |
|
205 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
206 |
|
11355 | 207 |
lemma INTER_down_iterate_is_gfp: |
208 |
"down_cont F ==> gfp F = INTER UNIV (down_iterate F)" |
|
209 |
apply (rule set_eq_subset [THEN iffD2]) |
|
210 |
apply (rule conjI) |
|
211 |
apply (drule down_cont_mono) |
|
212 |
apply (rule INTER_down_iterate_upperbound) |
|
213 |
apply assumption |
|
214 |
apply (erule gfp_unfold [symmetric]) |
|
215 |
apply (rule gfp_upperbound) |
|
216 |
apply (rule set_eq_subset [THEN iffD1, THEN conjunct2]) |
|
217 |
apply (erule INTER_down_iterate_is_fp) |
|
218 |
done |
|
11351
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
219 |
|
c5c403d30c77
added Library/Nat_Infinity.thy and Library/Continuity.thy
oheimb
parents:
diff
changeset
|
220 |
end |