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