author | nipkow |
Thu, 22 Jul 2004 12:55:36 +0200 | |
changeset 15073 | 279c2daaf517 |
parent 14981 | e73f8140af78 |
permissions | -rw-r--r-- |
2278 | 1 |
(* Title: HOLCF/Up3.ML |
2 |
ID: $Id$ |
|
3 |
Author: Franz Regensburger |
|
4 |
||
9169 | 5 |
Class instance of ('a)u for class pcpo |
2278 | 6 |
*) |
7 |
||
2640 | 8 |
(* for compatibility with old HOLCF-Version *) |
9169 | 9 |
Goal "UU = Abs_Up(Inl ())"; |
10 |
by (simp_tac (HOL_ss addsimps [UU_def,UU_up_def]) 1); |
|
11 |
qed "inst_up_pcpo"; |
|
2640 | 12 |
|
2278 | 13 |
(* -------------------------------------------------------------------------*) |
14 |
(* some lemmas restated for class pcpo *) |
|
15 |
(* ------------------------------------------------------------------------ *) |
|
16 |
||
9169 | 17 |
Goal "~ Iup(x) << UU"; |
18 |
by (stac inst_up_pcpo 1); |
|
19 |
by (rtac less_up2b 1); |
|
20 |
qed "less_up3b"; |
|
2278 | 21 |
|
9169 | 22 |
Goal "Iup(x) ~= UU"; |
23 |
by (stac inst_up_pcpo 1); |
|
24 |
by (rtac defined_Iup 1); |
|
25 |
qed "defined_Iup2"; |
|
10230 | 26 |
AddIffs [defined_Iup2]; |
2278 | 27 |
|
28 |
(* ------------------------------------------------------------------------ *) |
|
29 |
(* continuity for Iup *) |
|
30 |
(* ------------------------------------------------------------------------ *) |
|
31 |
||
9169 | 32 |
Goal "contlub(Iup)"; |
33 |
by (rtac contlubI 1); |
|
34 |
by (strip_tac 1); |
|
35 |
by (rtac trans 1); |
|
36 |
by (rtac (thelub_up1a RS sym) 2); |
|
37 |
by (fast_tac HOL_cs 3); |
|
38 |
by (etac (monofun_Iup RS ch2ch_monofun) 2); |
|
39 |
by (res_inst_tac [("f","Iup")] arg_cong 1); |
|
40 |
by (rtac lub_equal 1); |
|
41 |
by (atac 1); |
|
42 |
by (rtac (monofun_Ifup2 RS ch2ch_monofun) 1); |
|
43 |
by (etac (monofun_Iup RS ch2ch_monofun) 1); |
|
44 |
by (asm_simp_tac Up0_ss 1); |
|
45 |
qed "contlub_Iup"; |
|
2278 | 46 |
|
9169 | 47 |
Goal "cont(Iup)"; |
48 |
by (rtac monocontlub2cont 1); |
|
49 |
by (rtac monofun_Iup 1); |
|
50 |
by (rtac contlub_Iup 1); |
|
51 |
qed "cont_Iup"; |
|
10230 | 52 |
AddIffs [cont_Iup]; |
2278 | 53 |
|
54 |
(* ------------------------------------------------------------------------ *) |
|
55 |
(* continuity for Ifup *) |
|
56 |
(* ------------------------------------------------------------------------ *) |
|
57 |
||
9169 | 58 |
Goal "contlub(Ifup)"; |
59 |
by (rtac contlubI 1); |
|
60 |
by (strip_tac 1); |
|
61 |
by (rtac trans 1); |
|
62 |
by (rtac (thelub_fun RS sym) 2); |
|
63 |
by (etac (monofun_Ifup1 RS ch2ch_monofun) 2); |
|
64 |
by (rtac ext 1); |
|
65 |
by (res_inst_tac [("p","x")] upE 1); |
|
66 |
by (asm_simp_tac Up0_ss 1); |
|
67 |
by (rtac (lub_const RS thelubI RS sym) 1); |
|
68 |
by (asm_simp_tac Up0_ss 1); |
|
69 |
by (etac contlub_cfun_fun 1); |
|
70 |
qed "contlub_Ifup1"; |
|
2278 | 71 |
|
72 |
||
8161 | 73 |
Goal "contlub(Ifup(f))"; |
74 |
by (rtac contlubI 1); |
|
75 |
by (strip_tac 1); |
|
76 |
by (rtac disjE 1); |
|
77 |
by (stac thelub_up1a 2); |
|
78 |
by (atac 2); |
|
79 |
by (atac 2); |
|
80 |
by (asm_simp_tac Up0_ss 2); |
|
81 |
by (stac thelub_up1b 3); |
|
82 |
by (atac 3); |
|
83 |
by (atac 3); |
|
84 |
by (fast_tac HOL_cs 1); |
|
85 |
by (asm_simp_tac Up0_ss 2); |
|
86 |
by (rtac (chain_UU_I_inverse RS sym) 2); |
|
87 |
by (rtac allI 2); |
|
88 |
by (res_inst_tac [("p","Y(i)")] upE 2); |
|
89 |
by (asm_simp_tac Up0_ss 2); |
|
90 |
by (rtac notE 2); |
|
91 |
by (dtac spec 2); |
|
92 |
by (etac spec 2); |
|
93 |
by (atac 2); |
|
94 |
by (stac contlub_cfun_arg 1); |
|
95 |
by (etac (monofun_Ifup2 RS ch2ch_monofun) 1); |
|
96 |
by (rtac lub_equal2 1); |
|
97 |
by (rtac (monofun_Rep_CFun2 RS ch2ch_monofun) 2); |
|
98 |
by (etac (monofun_Ifup2 RS ch2ch_monofun) 2); |
|
99 |
by (etac (monofun_Ifup2 RS ch2ch_monofun) 2); |
|
100 |
by (rtac (chain_mono2 RS exE) 1); |
|
101 |
by (atac 2); |
|
102 |
by (etac exE 1); |
|
103 |
by (etac exE 1); |
|
104 |
by (rtac exI 1); |
|
105 |
by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1); |
|
106 |
by (atac 1); |
|
107 |
by (rtac defined_Iup2 1); |
|
108 |
by (rtac exI 1); |
|
109 |
by (strip_tac 1); |
|
110 |
by (res_inst_tac [("p","Y(i)")] upE 1); |
|
111 |
by (asm_simp_tac Up0_ss 2); |
|
112 |
by (res_inst_tac [("P","Y(i) = UU")] notE 1); |
|
113 |
by (fast_tac HOL_cs 1); |
|
114 |
by (stac inst_up_pcpo 1); |
|
115 |
by (atac 1); |
|
116 |
qed "contlub_Ifup2"; |
|
2278 | 117 |
|
9169 | 118 |
Goal "cont(Ifup)"; |
119 |
by (rtac monocontlub2cont 1); |
|
120 |
by (rtac monofun_Ifup1 1); |
|
121 |
by (rtac contlub_Ifup1 1); |
|
122 |
qed "cont_Ifup1"; |
|
2278 | 123 |
|
9169 | 124 |
Goal "cont(Ifup(f))"; |
125 |
by (rtac monocontlub2cont 1); |
|
126 |
by (rtac monofun_Ifup2 1); |
|
127 |
by (rtac contlub_Ifup2 1); |
|
128 |
qed "cont_Ifup2"; |
|
2278 | 129 |
|
130 |
||
131 |
(* ------------------------------------------------------------------------ *) |
|
132 |
(* continuous versions of lemmas for ('a)u *) |
|
133 |
(* ------------------------------------------------------------------------ *) |
|
134 |
||
10834 | 135 |
Goalw [up_def] "z = UU | (EX x. z = up$x)"; |
9245 | 136 |
by (simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
137 |
by (stac inst_up_pcpo 1); |
|
138 |
by (rtac Exh_Up 1); |
|
139 |
qed "Exh_Up1"; |
|
2278 | 140 |
|
10834 | 141 |
Goalw [up_def] "up$x=up$y ==> x=y"; |
9245 | 142 |
by (rtac inject_Iup 1); |
10230 | 143 |
by Auto_tac; |
9245 | 144 |
qed "inject_up"; |
2278 | 145 |
|
10834 | 146 |
Goalw [up_def] " up$x ~= UU"; |
10230 | 147 |
by Auto_tac; |
9245 | 148 |
qed "defined_up"; |
2278 | 149 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
150 |
val prems = Goalw [up_def] |
10834 | 151 |
"[| p=UU ==> Q; !!x. p=up$x==>Q|] ==>Q"; |
9245 | 152 |
by (rtac upE 1); |
153 |
by (resolve_tac prems 1); |
|
154 |
by (etac (inst_up_pcpo RS ssubst) 1); |
|
155 |
by (resolve_tac (tl prems) 1); |
|
156 |
by (asm_simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
|
157 |
qed "upE1"; |
|
2278 | 158 |
|
4098 | 159 |
val tac = (simp_tac (simpset() addsimps [cont_Iup,cont_Ifup1, |
2566 | 160 |
cont_Ifup2,cont2cont_CF1L]) 1); |
2278 | 161 |
|
10834 | 162 |
Goalw [up_def,fup_def] "fup$f$UU=UU"; |
9245 | 163 |
by (stac inst_up_pcpo 1); |
164 |
by (stac beta_cfun 1); |
|
165 |
by tac; |
|
166 |
by (stac beta_cfun 1); |
|
167 |
by tac; |
|
168 |
by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1); |
|
169 |
qed "fup1"; |
|
2278 | 170 |
|
10834 | 171 |
Goalw [up_def,fup_def] "fup$f$(up$x)=f$x"; |
9245 | 172 |
by (stac beta_cfun 1); |
173 |
by (rtac cont_Iup 1); |
|
174 |
by (stac beta_cfun 1); |
|
175 |
by tac; |
|
176 |
by (stac beta_cfun 1); |
|
177 |
by (rtac cont_Ifup2 1); |
|
178 |
by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1); |
|
179 |
qed "fup2"; |
|
2278 | 180 |
|
10834 | 181 |
Goalw [up_def,fup_def] "~ up$x << UU"; |
9245 | 182 |
by (simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
183 |
by (rtac less_up3b 1); |
|
184 |
qed "less_up4b"; |
|
2278 | 185 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
186 |
Goalw [up_def,fup_def] |
10834 | 187 |
"(up$x << up$y) = (x<<y)"; |
9245 | 188 |
by (simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
189 |
by (rtac less_up2c 1); |
|
190 |
qed "less_up4c"; |
|
2278 | 191 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
192 |
Goalw [up_def,fup_def] |
10834 | 193 |
"[| chain(Y); EX i x. Y(i) = up$x |] ==>\ |
194 |
\ lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))"; |
|
9245 | 195 |
by (stac beta_cfun 1); |
196 |
by tac; |
|
197 |
by (stac beta_cfun 1); |
|
198 |
by tac; |
|
199 |
by (stac (beta_cfun RS ext) 1); |
|
200 |
by tac; |
|
201 |
by (rtac thelub_up1a 1); |
|
202 |
by (atac 1); |
|
203 |
by (etac exE 1); |
|
204 |
by (etac exE 1); |
|
205 |
by (rtac exI 1); |
|
206 |
by (rtac exI 1); |
|
207 |
by (etac box_equals 1); |
|
208 |
by (rtac refl 1); |
|
209 |
by (simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
|
210 |
qed "thelub_up2a"; |
|
2278 | 211 |
|
212 |
||
213 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
214 |
Goalw [up_def,fup_def] |
10834 | 215 |
"[| chain(Y); ! i x. Y(i) ~= up$x |] ==> lub(range(Y)) = UU"; |
9245 | 216 |
by (stac inst_up_pcpo 1); |
217 |
by (rtac thelub_up1b 1); |
|
218 |
by (atac 1); |
|
219 |
by (strip_tac 1); |
|
220 |
by (dtac spec 1); |
|
221 |
by (dtac spec 1); |
|
10230 | 222 |
by (asm_full_simp_tac (Up0_ss addsimps [cont_Iup]) 1); |
9245 | 223 |
qed "thelub_up2b"; |
2278 | 224 |
|
225 |
||
10834 | 226 |
Goal "(EX x. z = up$x) = (z~=UU)"; |
9169 | 227 |
by (rtac iffI 1); |
228 |
by (etac exE 1); |
|
229 |
by (hyp_subst_tac 1); |
|
230 |
by (rtac defined_up 1); |
|
231 |
by (res_inst_tac [("p","z")] upE1 1); |
|
232 |
by (etac notE 1); |
|
233 |
by (atac 1); |
|
234 |
by (etac exI 1); |
|
235 |
qed "up_lemma2"; |
|
2278 | 236 |
|
237 |
||
10834 | 238 |
Goal "[| chain(Y); lub(range(Y)) = up$x |] ==> EX i x. Y(i) = up$x"; |
9169 | 239 |
by (rtac exE 1); |
240 |
by (rtac chain_UU_I_inverse2 1); |
|
241 |
by (rtac (up_lemma2 RS iffD1) 1); |
|
242 |
by (etac exI 1); |
|
243 |
by (rtac exI 1); |
|
244 |
by (rtac (up_lemma2 RS iffD2) 1); |
|
245 |
by (atac 1); |
|
246 |
qed "thelub_up2a_rev"; |
|
2278 | 247 |
|
10834 | 248 |
Goal "[| chain(Y); lub(range(Y)) = UU |] ==> ! i x. Y(i) ~= up$x"; |
10230 | 249 |
by (blast_tac (claset() addSDs [chain_UU_I RS spec, |
250 |
exI RS (up_lemma2 RS iffD1)]) 1); |
|
9169 | 251 |
qed "thelub_up2b_rev"; |
2278 | 252 |
|
253 |
||
9169 | 254 |
Goal "chain(Y) ==> lub(range(Y)) = UU | \ |
10834 | 255 |
\ lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))"; |
9169 | 256 |
by (rtac disjE 1); |
257 |
by (rtac disjI1 2); |
|
258 |
by (rtac thelub_up2b 2); |
|
259 |
by (atac 2); |
|
260 |
by (atac 2); |
|
261 |
by (rtac disjI2 2); |
|
262 |
by (rtac thelub_up2a 2); |
|
263 |
by (atac 2); |
|
264 |
by (atac 2); |
|
265 |
by (fast_tac HOL_cs 1); |
|
266 |
qed "thelub_up3"; |
|
2278 | 267 |
|
10834 | 268 |
Goal "fup$up$x=x"; |
9169 | 269 |
by (res_inst_tac [("p","x")] upE1 1); |
270 |
by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1); |
|
271 |
by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1); |
|
272 |
qed "fup3"; |
|
2278 | 273 |
|
274 |
(* ------------------------------------------------------------------------ *) |
|
275 |
(* install simplifier for ('a)u *) |
|
276 |
(* ------------------------------------------------------------------------ *) |
|
277 |
||
3327 | 278 |
Addsimps [fup1,fup2,defined_up]; |