author | wenzelm |
Wed, 25 May 2005 09:44:34 +0200 | |
changeset 16070 | 4a83dd540b88 |
parent 16053 | 603820cad083 |
child 16096 | 16e895296b2a |
permissions | -rw-r--r-- |
15600 | 1 |
(* Title: HOLCF/Cont.thy |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1479 | 3 |
Author: Franz Regensburger |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
4 |
|
16070
4a83dd540b88
removed LICENCE note -- everything is subject to Isabelle licence as
wenzelm
parents:
16053
diff
changeset
|
5 |
Results about continuity and monotonicity. |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
6 |
*) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
7 |
|
15577 | 8 |
header {* Continuity and monotonicity *} |
9 |
||
10 |
theory Cont |
|
11 |
imports FunCpo |
|
12 |
begin |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
13 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
14 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
15 |
Now we change the default class! Form now on all untyped type variables are |
3323
194ae2e0c193
eliminated the constant less by the introduction of the axclass sq_ord
slotosch
parents:
2838
diff
changeset
|
16 |
of default class po |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
17 |
*} |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
18 |
|
15565 | 19 |
defaultsort po |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
20 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
21 |
consts |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
22 |
monofun :: "('a => 'b) => bool" -- "monotonicity" |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
23 |
contlub :: "('a::cpo => 'b::cpo) => bool" -- "first cont. def" |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
24 |
cont :: "('a::cpo => 'b::cpo) => bool" -- "secnd cont. def" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
25 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
1150
diff
changeset
|
26 |
defs |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
27 |
|
15565 | 28 |
monofun: "monofun(f) == ! x y. x << y --> f(x) << f(y)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
29 |
|
15565 | 30 |
contlub: "contlub(f) == ! Y. chain(Y) --> |
3842 | 31 |
f(lub(range(Y))) = lub(range(% i. f(Y(i))))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
32 |
|
15565 | 33 |
cont: "cont(f) == ! Y. chain(Y) --> |
3842 | 34 |
range(% i. f(Y(i))) <<| f(lub(range(Y)))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
35 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
36 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
37 |
the main purpose of cont.thy is to show: |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
38 |
@{prop "monofun(f) & contlub(f) == cont(f)"} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
39 |
*} |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
40 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
41 |
text {* access to definition *} |
15565 | 42 |
|
43 |
lemma contlubI: |
|
44 |
"! Y. chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))==> |
|
45 |
contlub(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
46 |
by (unfold contlub) |
15565 | 47 |
|
48 |
lemma contlubE: |
|
49 |
" contlub(f)==> |
|
50 |
! Y. chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
51 |
by (unfold contlub) |
15565 | 52 |
|
53 |
lemma contI: |
|
54 |
"! Y. chain(Y) --> range(% i. f(Y(i))) <<| f(lub(range(Y))) ==> cont(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
55 |
by (unfold cont) |
15565 | 56 |
|
57 |
lemma contE: |
|
58 |
"cont(f) ==> ! Y. chain(Y) --> range(% i. f(Y(i))) <<| f(lub(range(Y)))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
59 |
by (unfold cont) |
15565 | 60 |
|
61 |
lemma monofunI: |
|
62 |
"! x y. x << y --> f(x) << f(y) ==> monofun(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
63 |
by (unfold monofun) |
15565 | 64 |
|
65 |
lemma monofunE: |
|
66 |
"monofun(f) ==> ! x y. x << y --> f(x) << f(y)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
67 |
by (unfold monofun) |
15565 | 68 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
69 |
text {* monotone functions map chains to chains *} |
15565 | 70 |
|
71 |
lemma ch2ch_monofun: |
|
72 |
"[| monofun(f); chain(Y) |] ==> chain(%i. f(Y(i)))" |
|
73 |
apply (rule chainI) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
74 |
apply (erule monofunE [rule_format]) |
15565 | 75 |
apply (erule chainE) |
76 |
done |
|
77 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
78 |
text {* monotone functions map upper bound to upper bounds *} |
15565 | 79 |
|
80 |
lemma ub2ub_monofun: |
|
81 |
"[| monofun(f); range(Y) <| u|] ==> range(%i. f(Y(i))) <| f(u)" |
|
82 |
apply (rule ub_rangeI) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
83 |
apply (erule monofunE [rule_format]) |
15565 | 84 |
apply (erule ub_rangeD) |
85 |
done |
|
86 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
87 |
text {* left to right: @{prop "monofun(f) & contlub(f) ==> cont(f)"} *} |
15565 | 88 |
|
89 |
lemma monocontlub2cont: |
|
90 |
"[|monofun(f);contlub(f)|] ==> cont(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
91 |
apply (rule contI [rule_format]) |
15565 | 92 |
apply (rule thelubE) |
93 |
apply (erule ch2ch_monofun) |
|
94 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
95 |
apply (erule contlubE [rule_format, symmetric]) |
15565 | 96 |
apply assumption |
97 |
done |
|
98 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
99 |
text {* first a lemma about binary chains *} |
15565 | 100 |
|
101 |
lemma binchain_cont: "[| cont(f); x << y |] |
|
102 |
==> range(%i::nat. f(if i = 0 then x else y)) <<| f(y)" |
|
103 |
apply (rule subst) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
104 |
prefer 2 apply (erule contE [rule_format]) |
15565 | 105 |
apply (erule bin_chain) |
106 |
apply (rule_tac y = "y" in arg_cong) |
|
107 |
apply (erule lub_bin_chain [THEN thelubI]) |
|
108 |
done |
|
109 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
110 |
text {* right to left: @{prop "cont(f) ==> monofun(f) & contlub(f)"} *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
111 |
text {* part1: @{prop "cont(f) ==> monofun(f)"} *} |
15565 | 112 |
|
113 |
lemma cont2mono: "cont(f) ==> monofun(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
114 |
apply (rule monofunI [rule_format]) |
15565 | 115 |
apply (drule binchain_cont [THEN is_ub_lub]) |
116 |
apply (auto split add: split_if_asm) |
|
117 |
done |
|
118 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
119 |
text {* right to left: @{prop "cont(f) ==> monofun(f) & contlub(f)"} *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
120 |
text {* part2: @{prop "cont(f) ==> contlub(f)"} *} |
15565 | 121 |
|
122 |
lemma cont2contlub: "cont(f) ==> contlub(f)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
123 |
apply (rule contlubI [rule_format]) |
15565 | 124 |
apply (rule thelubI [symmetric]) |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
125 |
apply (erule contE [rule_format]) |
15565 | 126 |
apply assumption |
127 |
done |
|
128 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
129 |
text {* monotone functions map finite chains to finite chains *} |
15565 | 130 |
|
131 |
lemma monofun_finch2finch: |
|
132 |
"[| monofun f; finite_chain Y |] ==> finite_chain (%n. f (Y n))" |
|
133 |
apply (unfold finite_chain_def) |
|
134 |
apply (force elim!: ch2ch_monofun simp add: max_in_chain_def) |
|
135 |
done |
|
136 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
137 |
text {* The same holds for continuous functions *} |
15565 | 138 |
|
139 |
lemmas cont_finch2finch = cont2mono [THEN monofun_finch2finch, standard] |
|
140 |
(* [| cont ?f; finite_chain ?Y |] ==> finite_chain (%n. ?f (?Y n)) *) |
|
141 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
142 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
143 |
The following results are about a curried function that is monotone |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
144 |
in both arguments |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
145 |
*} |
15565 | 146 |
|
147 |
lemma ch2ch_MF2L: |
|
148 |
"[|monofun(MF2); chain(F)|] ==> chain(%i. MF2 (F i) x)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
149 |
by (erule ch2ch_monofun [THEN ch2ch_fun]) |
15565 | 150 |
|
151 |
lemma ch2ch_MF2R: |
|
152 |
"[|monofun(MF2(f)); chain(Y)|] ==> chain(%i. MF2 f (Y i))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
153 |
by (erule ch2ch_monofun) |
15565 | 154 |
|
155 |
lemma ch2ch_MF2LR: |
|
156 |
"[|monofun(MF2); !f. monofun(MF2(f)); chain(F); chain(Y)|] ==> |
|
157 |
chain(%i. MF2(F(i))(Y(i)))" |
|
158 |
apply (rule chainI) |
|
159 |
apply (rule trans_less) |
|
160 |
apply (erule ch2ch_MF2L [THEN chainE]) |
|
161 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
162 |
apply (rule monofunE [rule_format], erule spec) |
15565 | 163 |
apply (erule chainE) |
164 |
done |
|
165 |
||
166 |
lemma ch2ch_lubMF2R: |
|
167 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
168 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
169 |
chain(F);chain(Y)|] ==> |
|
170 |
chain(%j. lub(range(%i. MF2 (F j) (Y i))))" |
|
171 |
apply (rule lub_mono [THEN chainI]) |
|
172 |
apply (rule ch2ch_MF2R, erule spec) |
|
173 |
apply assumption |
|
174 |
apply (rule ch2ch_MF2R, erule spec) |
|
175 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
176 |
apply (rule allI) |
15565 | 177 |
apply (rule chainE) |
178 |
apply (erule ch2ch_MF2L) |
|
179 |
apply assumption |
|
180 |
done |
|
181 |
||
182 |
lemma ch2ch_lubMF2L: |
|
183 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
184 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
185 |
chain(F);chain(Y)|] ==> |
|
186 |
chain(%i. lub(range(%j. MF2 (F j) (Y i))))" |
|
187 |
apply (rule lub_mono [THEN chainI]) |
|
188 |
apply (erule ch2ch_MF2L) |
|
189 |
apply assumption |
|
190 |
apply (erule ch2ch_MF2L) |
|
191 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
192 |
apply (rule allI) |
15565 | 193 |
apply (rule chainE) |
194 |
apply (rule ch2ch_MF2R, erule spec) |
|
195 |
apply assumption |
|
196 |
done |
|
197 |
||
198 |
lemma lub_MF2_mono: |
|
199 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
200 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
201 |
chain(F)|] ==> |
|
202 |
monofun(% x. lub(range(% j. MF2 (F j) (x))))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
203 |
apply (rule monofunI [rule_format]) |
15565 | 204 |
apply (rule lub_mono) |
205 |
apply (erule ch2ch_MF2L) |
|
206 |
apply assumption |
|
207 |
apply (erule ch2ch_MF2L) |
|
208 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
209 |
apply (rule allI) |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
210 |
apply (rule monofunE [rule_format], erule spec) |
15565 | 211 |
apply assumption |
212 |
done |
|
213 |
||
214 |
lemma ex_lubMF2: |
|
215 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
216 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
217 |
chain(F); chain(Y)|] ==> |
|
218 |
lub(range(%j. lub(range(%i. MF2(F j) (Y i))))) = |
|
219 |
lub(range(%i. lub(range(%j. MF2(F j) (Y i)))))" |
|
220 |
apply (rule antisym_less) |
|
221 |
apply (rule is_lub_thelub[OF _ ub_rangeI]) |
|
222 |
apply (erule ch2ch_lubMF2R) |
|
223 |
apply (assumption+) |
|
224 |
apply (rule lub_mono) |
|
225 |
apply (rule ch2ch_MF2R, erule spec) |
|
226 |
apply assumption |
|
227 |
apply (erule ch2ch_lubMF2L) |
|
228 |
apply (assumption+) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
229 |
apply (rule allI) |
15565 | 230 |
apply (rule is_ub_thelub) |
231 |
apply (erule ch2ch_MF2L) |
|
232 |
apply assumption |
|
233 |
apply (rule is_lub_thelub[OF _ ub_rangeI]) |
|
234 |
apply (erule ch2ch_lubMF2L) |
|
235 |
apply (assumption+) |
|
236 |
apply (rule lub_mono) |
|
237 |
apply (erule ch2ch_MF2L) |
|
238 |
apply assumption |
|
239 |
apply (erule ch2ch_lubMF2R) |
|
240 |
apply (assumption+) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
241 |
apply (rule allI) |
15565 | 242 |
apply (rule is_ub_thelub) |
243 |
apply (rule ch2ch_MF2R, erule spec) |
|
244 |
apply assumption |
|
245 |
done |
|
246 |
||
247 |
lemma diag_lubMF2_1: |
|
248 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
249 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
250 |
chain(FY);chain(TY)|] ==> |
|
251 |
lub(range(%i. lub(range(%j. MF2(FY(j))(TY(i)))))) = |
|
252 |
lub(range(%i. MF2(FY(i))(TY(i))))" |
|
253 |
apply (rule antisym_less) |
|
254 |
apply (rule is_lub_thelub[OF _ ub_rangeI]) |
|
255 |
apply (erule ch2ch_lubMF2L) |
|
256 |
apply (assumption+) |
|
257 |
apply (rule lub_mono3) |
|
258 |
apply (erule ch2ch_MF2L) |
|
259 |
apply (assumption+) |
|
260 |
apply (erule ch2ch_MF2LR) |
|
261 |
apply (assumption+) |
|
262 |
apply (rule allI) |
|
263 |
apply (rule_tac m = "i" and n = "ia" in nat_less_cases) |
|
264 |
apply (rule_tac x = "ia" in exI) |
|
265 |
apply (rule chain_mono) |
|
266 |
apply (erule allE) |
|
267 |
apply (erule ch2ch_MF2R) |
|
268 |
apply (assumption+) |
|
269 |
apply (erule ssubst) |
|
270 |
apply (rule_tac x = "ia" in exI) |
|
271 |
apply (rule refl_less) |
|
272 |
apply (rule_tac x = "i" in exI) |
|
273 |
apply (rule chain_mono) |
|
274 |
apply (erule ch2ch_MF2L) |
|
275 |
apply (assumption+) |
|
276 |
apply (rule lub_mono) |
|
277 |
apply (erule ch2ch_MF2LR) |
|
278 |
apply (assumption+) |
|
279 |
apply (erule ch2ch_lubMF2L) |
|
280 |
apply (assumption+) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
281 |
apply (rule allI) |
15565 | 282 |
apply (rule is_ub_thelub) |
283 |
apply (erule ch2ch_MF2L) |
|
284 |
apply assumption |
|
285 |
done |
|
286 |
||
287 |
lemma diag_lubMF2_2: |
|
288 |
"[|monofun(MF2::('a::po=>'b::po=>'c::cpo)); |
|
289 |
!f. monofun(MF2(f)::('b::po=>'c::cpo)); |
|
290 |
chain(FY);chain(TY)|] ==> |
|
291 |
lub(range(%j. lub(range(%i. MF2(FY(j))(TY(i)))))) = |
|
292 |
lub(range(%i. MF2(FY(i))(TY(i))))" |
|
293 |
apply (rule trans) |
|
294 |
apply (rule ex_lubMF2) |
|
295 |
apply (assumption+) |
|
296 |
apply (erule diag_lubMF2_1) |
|
297 |
apply (assumption+) |
|
298 |
done |
|
299 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
300 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
301 |
The following results are about a curried function that is continuous |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
302 |
in both arguments |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
303 |
*} |
15565 | 304 |
|
305 |
lemma contlub_CF2: |
|
306 |
assumes prem1: "cont(CF2)" |
|
307 |
assumes prem2: "!f. cont(CF2(f))" |
|
308 |
assumes prem3: "chain(FY)" |
|
309 |
assumes prem4: "chain(TY)" |
|
310 |
shows "CF2(lub(range(FY)))(lub(range(TY))) = lub(range(%i. CF2(FY(i))(TY(i))))" |
|
311 |
apply (subst prem1 [THEN cont2contlub, THEN contlubE, THEN spec, THEN mp]) |
|
312 |
apply assumption |
|
313 |
apply (subst thelub_fun) |
|
314 |
apply (rule prem1 [THEN cont2mono [THEN ch2ch_monofun]]) |
|
315 |
apply assumption |
|
316 |
apply (rule trans) |
|
317 |
apply (rule prem2 [THEN spec, THEN cont2contlub, THEN contlubE, THEN spec, THEN mp, THEN ext, THEN arg_cong, THEN arg_cong]) |
|
318 |
apply (rule prem4) |
|
319 |
apply (rule diag_lubMF2_2) |
|
320 |
apply (auto simp add: cont2mono prems) |
|
321 |
done |
|
322 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
323 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
324 |
The following results are about application for functions in @{typ "'a=>'b"} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
325 |
*} |
15565 | 326 |
|
327 |
lemma monofun_fun_fun: "f1 << f2 ==> f1(x) << f2(x)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
328 |
by (erule less_fun [THEN iffD1, THEN spec]) |
15565 | 329 |
|
330 |
lemma monofun_fun_arg: "[|monofun(f); x1 << x2|] ==> f(x1) << f(x2)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
331 |
by (erule monofunE [THEN spec, THEN spec, THEN mp]) |
15565 | 332 |
|
333 |
lemma monofun_fun: "[|monofun(f1); monofun(f2); f1 << f2; x1 << x2|] ==> f1(x1) << f2(x2)" |
|
334 |
apply (rule trans_less) |
|
335 |
apply (erule monofun_fun_arg) |
|
336 |
apply assumption |
|
337 |
apply (erule monofun_fun_fun) |
|
338 |
done |
|
339 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
340 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
341 |
The following results are about the propagation of monotonicity and |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
342 |
continuity |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
343 |
*} |
15565 | 344 |
|
345 |
lemma mono2mono_MF1L: "[|monofun(c1)|] ==> monofun(%x. c1 x y)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
346 |
apply (rule monofunI [rule_format]) |
15565 | 347 |
apply (erule monofun_fun_arg [THEN monofun_fun_fun]) |
348 |
apply assumption |
|
349 |
done |
|
350 |
||
351 |
lemma cont2cont_CF1L: "[|cont(c1)|] ==> cont(%x. c1 x y)" |
|
352 |
apply (rule monocontlub2cont) |
|
353 |
apply (erule cont2mono [THEN mono2mono_MF1L]) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
354 |
apply (rule contlubI [rule_format]) |
15565 | 355 |
apply (frule asm_rl) |
356 |
apply (erule cont2contlub [THEN contlubE, THEN spec, THEN mp, THEN ssubst]) |
|
357 |
apply assumption |
|
358 |
apply (subst thelub_fun) |
|
359 |
apply (rule ch2ch_monofun) |
|
360 |
apply (erule cont2mono) |
|
361 |
apply assumption |
|
362 |
apply (rule refl) |
|
363 |
done |
|
364 |
||
365 |
(********* Note "(%x.%y.c1 x y) = c1" ***********) |
|
366 |
||
367 |
lemma mono2mono_MF1L_rev: "!y. monofun(%x. c1 x y) ==> monofun(c1)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
368 |
apply (rule monofunI [rule_format]) |
15565 | 369 |
apply (rule less_fun [THEN iffD2]) |
370 |
apply (blast dest: monofunE) |
|
371 |
done |
|
372 |
||
373 |
lemma cont2cont_CF1L_rev: "!y. cont(%x. c1 x y) ==> cont(c1)" |
|
374 |
apply (rule monocontlub2cont) |
|
375 |
apply (rule cont2mono [THEN allI, THEN mono2mono_MF1L_rev]) |
|
376 |
apply (erule spec) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
377 |
apply (rule contlubI [rule_format]) |
15565 | 378 |
apply (rule ext) |
379 |
apply (subst thelub_fun) |
|
380 |
apply (rule cont2mono [THEN allI, THEN mono2mono_MF1L_rev, THEN ch2ch_monofun]) |
|
381 |
apply (erule spec) |
|
382 |
apply assumption |
|
383 |
apply (blast dest: cont2contlub [THEN contlubE]) |
|
384 |
done |
|
385 |
||
16053 | 386 |
lemma cont2cont_CF1L_rev2: "(!!y. cont (%x. c1 x y)) ==> cont c1" |
387 |
apply (rule cont2cont_CF1L_rev) |
|
388 |
apply simp |
|
389 |
done |
|
390 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
391 |
text {* |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
392 |
What D.A.Schmidt calls continuity of abstraction |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
393 |
never used here |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
394 |
*} |
15565 | 395 |
|
396 |
lemma contlub_abstraction: |
|
397 |
"[|chain(Y::nat=>'a);!y. cont(%x.(c::'a::cpo=>'b::cpo=>'c::cpo) x y)|] ==> |
|
398 |
(%y. lub(range(%i. c (Y i) y))) = (lub(range(%i.%y. c (Y i) y)))" |
|
399 |
apply (rule trans) |
|
400 |
prefer 2 apply (rule cont2contlub [THEN contlubE, THEN spec, THEN mp]) |
|
401 |
prefer 2 apply (assumption) |
|
402 |
apply (erule cont2cont_CF1L_rev) |
|
403 |
apply (rule ext) |
|
404 |
apply (rule cont2contlub [THEN contlubE, THEN spec, THEN mp, symmetric]) |
|
405 |
apply (erule spec) |
|
406 |
apply assumption |
|
407 |
done |
|
408 |
||
409 |
lemma mono2mono_app: "[|monofun(ft);!x. monofun(ft(x));monofun(tt)|] ==> |
|
410 |
monofun(%x.(ft(x))(tt(x)))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
411 |
apply (rule monofunI [rule_format]) |
15565 | 412 |
apply (rule_tac ?f1.0 = "ft(x)" and ?f2.0 = "ft(y)" in monofun_fun) |
413 |
apply (erule spec) |
|
414 |
apply (erule spec) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
415 |
apply (erule monofunE [rule_format]) |
15565 | 416 |
apply assumption |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
417 |
apply (erule monofunE [rule_format]) |
15565 | 418 |
apply assumption |
419 |
done |
|
420 |
||
421 |
lemma cont2contlub_app: "[|cont(ft);!x. cont(ft(x));cont(tt)|] ==> contlub(%x.(ft(x))(tt(x)))" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
422 |
apply (rule contlubI [rule_format]) |
15565 | 423 |
apply (rule_tac f3 = "tt" in contlubE [THEN spec, THEN mp, THEN ssubst]) |
424 |
apply (erule cont2contlub) |
|
425 |
apply assumption |
|
426 |
apply (rule contlub_CF2) |
|
427 |
apply (assumption+) |
|
428 |
apply (erule cont2mono [THEN ch2ch_monofun]) |
|
429 |
apply assumption |
|
430 |
done |
|
431 |
||
432 |
lemma cont2cont_app: "[|cont(ft); !x. cont(ft(x)); cont(tt)|] ==> cont(%x.(ft(x))(tt(x)))" |
|
433 |
apply (blast intro: monocontlub2cont mono2mono_app cont2mono cont2contlub_app) |
|
434 |
done |
|
435 |
||
436 |
lemmas cont2cont_app2 = cont2cont_app[OF _ allI] |
|
437 |
(* [| cont ?ft; !!x. cont (?ft x); cont ?tt |] ==> *) |
|
438 |
(* cont (%x. ?ft x (?tt x)) *) |
|
439 |
||
440 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
441 |
text {* The identity function is continuous *} |
15565 | 442 |
|
443 |
lemma cont_id: "cont(% x. x)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
444 |
apply (rule contI [rule_format]) |
15565 | 445 |
apply (erule thelubE) |
446 |
apply (rule refl) |
|
447 |
done |
|
448 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
449 |
text {* constant functions are continuous *} |
15565 | 450 |
|
451 |
lemma cont_const: "cont(%x. c)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
452 |
apply (rule contI [rule_format]) |
15565 | 453 |
apply (blast intro: is_lubI ub_rangeI dest: ub_rangeD) |
454 |
done |
|
455 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
456 |
lemma cont2cont_app3: "[|cont(f); cont(t) |] ==> cont(%x. f(t(x)))" |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
457 |
by (best intro: cont2cont_app2 cont_const) |
15565 | 458 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
459 |
text {* A non-emptiness result for Cfun *} |
15565 | 460 |
|
461 |
lemma CfunI: "?x:Collect cont" |
|
462 |
apply (rule CollectI) |
|
463 |
apply (rule cont_const) |
|
464 |
done |
|
465 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
466 |
text {* some properties of flat *} |
15565 | 467 |
|
468 |
lemma flatdom2monofun: "f UU = UU ==> monofun (f::'a::flat=>'b::pcpo)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
469 |
apply (rule monofunI [rule_format]) |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
470 |
apply (drule ax_flat [rule_format]) |
15565 | 471 |
apply auto |
472 |
done |
|
473 |
||
474 |
declare range_composition [simp del] |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
475 |
|
15565 | 476 |
lemma chfindom_monofun2cont: "monofun f ==> cont(f::'a::chfin=>'b::pcpo)" |
477 |
apply (rule monocontlub2cont) |
|
478 |
apply assumption |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
479 |
apply (rule contlubI [rule_format]) |
15565 | 480 |
apply (frule chfin2finch) |
481 |
apply (rule antisym_less) |
|
482 |
apply (clarsimp simp add: finite_chain_def maxinch_is_thelub) |
|
483 |
apply (rule is_ub_thelub) |
|
484 |
apply (erule ch2ch_monofun) |
|
485 |
apply assumption |
|
486 |
apply (drule monofun_finch2finch[COMP swap_prems_rl]) |
|
487 |
apply assumption |
|
488 |
apply (simp add: finite_chain_def) |
|
489 |
apply (erule conjE) |
|
490 |
apply (erule exE) |
|
491 |
apply (simp add: maxinch_is_thelub) |
|
492 |
apply (erule monofunE [THEN spec, THEN spec, THEN mp]) |
|
493 |
apply (erule is_ub_thelub) |
|
494 |
done |
|
495 |
||
496 |
lemmas flatdom_strict2cont = flatdom2monofun [THEN chfindom_monofun2cont, standard] |
|
497 |
(* f UU = UU ==> cont (f::'a=>'b::pcpo)" *) |
|
498 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
499 |
end |