| author | wenzelm | 
| Mon, 26 Jun 2000 16:54:38 +0200 | |
| changeset 9152 | 034cb4ac78b8 | 
| parent 8161 | bde1391fd0a5 | 
| child 9169 | 85a47aa21f74 | 
| permissions | -rw-r--r-- | 
| 2278 | 1 | (* Title: HOLCF/Up3.ML | 
| 2 | ID: $Id$ | |
| 3 | Author: Franz Regensburger | |
| 4 | Copyright 1993 Technische Universitaet Muenchen | |
| 5 | ||
| 6 | Lemmas for Up3.thy | |
| 7 | *) | |
| 8 | ||
| 9 | open Up3; | |
| 10 | ||
| 2640 | 11 | (* for compatibility with old HOLCF-Version *) | 
| 12 | qed_goal "inst_up_pcpo" thy "UU = Abs_Up(Inl ())" | |
| 13 | (fn prems => | |
| 14 | [ | |
| 15 | (simp_tac (HOL_ss addsimps [UU_def,UU_up_def]) 1) | |
| 16 | ]); | |
| 17 | ||
| 2278 | 18 | (* -------------------------------------------------------------------------*) | 
| 19 | (* some lemmas restated for class pcpo *) | |
| 20 | (* ------------------------------------------------------------------------ *) | |
| 21 | ||
| 2640 | 22 | qed_goal "less_up3b" thy "~ Iup(x) << UU" | 
| 2278 | 23 | (fn prems => | 
| 24 | [ | |
| 25 | (stac inst_up_pcpo 1), | |
| 26 | (rtac less_up2b 1) | |
| 27 | ]); | |
| 28 | ||
| 2640 | 29 | qed_goal "defined_Iup2" thy "Iup(x) ~= UU" | 
| 2278 | 30 | (fn prems => | 
| 31 | [ | |
| 32 | (stac inst_up_pcpo 1), | |
| 33 | (rtac defined_Iup 1) | |
| 34 | ]); | |
| 35 | ||
| 36 | (* ------------------------------------------------------------------------ *) | |
| 37 | (* continuity for Iup *) | |
| 38 | (* ------------------------------------------------------------------------ *) | |
| 39 | ||
| 2640 | 40 | qed_goal "contlub_Iup" thy "contlub(Iup)" | 
| 2278 | 41 | (fn prems => | 
| 42 | [ | |
| 43 | (rtac contlubI 1), | |
| 44 | (strip_tac 1), | |
| 45 | (rtac trans 1), | |
| 46 | (rtac (thelub_up1a RS sym) 2), | |
| 47 | (fast_tac HOL_cs 3), | |
| 48 | (etac (monofun_Iup RS ch2ch_monofun) 2), | |
| 49 |         (res_inst_tac [("f","Iup")] arg_cong  1),
 | |
| 50 | (rtac lub_equal 1), | |
| 51 | (atac 1), | |
| 52 | (rtac (monofun_Ifup2 RS ch2ch_monofun) 1), | |
| 53 | (etac (monofun_Iup RS ch2ch_monofun) 1), | |
| 54 | (asm_simp_tac Up0_ss 1) | |
| 55 | ]); | |
| 56 | ||
| 2640 | 57 | qed_goal "cont_Iup" thy "cont(Iup)" | 
| 2278 | 58 | (fn prems => | 
| 59 | [ | |
| 60 | (rtac monocontlub2cont 1), | |
| 61 | (rtac monofun_Iup 1), | |
| 62 | (rtac contlub_Iup 1) | |
| 63 | ]); | |
| 64 | ||
| 65 | ||
| 66 | (* ------------------------------------------------------------------------ *) | |
| 67 | (* continuity for Ifup *) | |
| 68 | (* ------------------------------------------------------------------------ *) | |
| 69 | ||
| 2640 | 70 | qed_goal "contlub_Ifup1" thy "contlub(Ifup)" | 
| 2278 | 71 | (fn prems => | 
| 72 | [ | |
| 73 | (rtac contlubI 1), | |
| 74 | (strip_tac 1), | |
| 75 | (rtac trans 1), | |
| 76 | (rtac (thelub_fun RS sym) 2), | |
| 77 | (etac (monofun_Ifup1 RS ch2ch_monofun) 2), | |
| 78 | (rtac ext 1), | |
| 79 |         (res_inst_tac [("p","x")] upE 1),
 | |
| 80 | (asm_simp_tac Up0_ss 1), | |
| 81 | (rtac (lub_const RS thelubI RS sym) 1), | |
| 82 | (asm_simp_tac Up0_ss 1), | |
| 83 | (etac contlub_cfun_fun 1) | |
| 84 | ]); | |
| 85 | ||
| 86 | ||
| 8161 | 87 | Goal "contlub(Ifup(f))"; | 
| 88 | by (rtac contlubI 1); | |
| 89 | by (strip_tac 1); | |
| 90 | by (rtac disjE 1); | |
| 91 | by (stac thelub_up1a 2); | |
| 92 | by (atac 2); | |
| 93 | by (atac 2); | |
| 94 | by (asm_simp_tac Up0_ss 2); | |
| 95 | by (stac thelub_up1b 3); | |
| 96 | by (atac 3); | |
| 97 | by (atac 3); | |
| 98 | by (fast_tac HOL_cs 1); | |
| 99 | by (asm_simp_tac Up0_ss 2); | |
| 100 | by (rtac (chain_UU_I_inverse RS sym) 2); | |
| 101 | by (rtac allI 2); | |
| 102 | by  (res_inst_tac [("p","Y(i)")] upE 2);
 | |
| 103 | by (asm_simp_tac Up0_ss 2); | |
| 104 | by (rtac notE 2); | |
| 105 | by (dtac spec 2); | |
| 106 | by (etac spec 2); | |
| 107 | by (atac 2); | |
| 108 | by (stac contlub_cfun_arg 1); | |
| 109 | by (etac (monofun_Ifup2 RS ch2ch_monofun) 1); | |
| 110 | by (rtac lub_equal2 1); | |
| 111 | by (rtac (monofun_Rep_CFun2 RS ch2ch_monofun) 2); | |
| 112 | by (etac (monofun_Ifup2 RS ch2ch_monofun) 2); | |
| 113 | by (etac (monofun_Ifup2 RS ch2ch_monofun) 2); | |
| 114 | by (rtac (chain_mono2 RS exE) 1); | |
| 115 | by (atac 2); | |
| 116 | by (etac exE 1); | |
| 117 | by (etac exE 1); | |
| 118 | by (rtac exI 1); | |
| 119 | by  (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
 | |
| 120 | by (atac 1); | |
| 121 | by (rtac defined_Iup2 1); | |
| 122 | by (rtac exI 1); | |
| 123 | by (strip_tac 1); | |
| 124 | by (res_inst_tac [("p","Y(i)")] upE 1);
 | |
| 125 | by (asm_simp_tac Up0_ss 2); | |
| 126 | by (res_inst_tac [("P","Y(i) = UU")] notE 1);
 | |
| 127 | by (fast_tac HOL_cs 1); | |
| 128 | by (stac inst_up_pcpo 1); | |
| 129 | by (atac 1); | |
| 130 | qed "contlub_Ifup2"; | |
| 2278 | 131 | |
| 2640 | 132 | qed_goal "cont_Ifup1" thy "cont(Ifup)" | 
| 2278 | 133 | (fn prems => | 
| 134 | [ | |
| 135 | (rtac monocontlub2cont 1), | |
| 136 | (rtac monofun_Ifup1 1), | |
| 137 | (rtac contlub_Ifup1 1) | |
| 138 | ]); | |
| 139 | ||
| 2640 | 140 | qed_goal "cont_Ifup2" thy "cont(Ifup(f))" | 
| 2278 | 141 | (fn prems => | 
| 142 | [ | |
| 143 | (rtac monocontlub2cont 1), | |
| 144 | (rtac monofun_Ifup2 1), | |
| 145 | (rtac contlub_Ifup2 1) | |
| 146 | ]); | |
| 147 | ||
| 148 | ||
| 149 | (* ------------------------------------------------------------------------ *) | |
| 150 | (* continuous versions of lemmas for ('a)u                                  *)
 | |
| 151 | (* ------------------------------------------------------------------------ *) | |
| 152 | ||
| 2640 | 153 | qed_goalw "Exh_Up1" thy [up_def] "z = UU | (? x. z = up`x)" | 
| 2278 | 154 | (fn prems => | 
| 155 | [ | |
| 156 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1), | |
| 157 | (stac inst_up_pcpo 1), | |
| 158 | (rtac Exh_Up 1) | |
| 159 | ]); | |
| 160 | ||
| 2640 | 161 | qed_goalw "inject_up" thy [up_def] "up`x=up`y ==> x=y" | 
| 2278 | 162 | (fn prems => | 
| 163 | [ | |
| 164 | (cut_facts_tac prems 1), | |
| 165 | (rtac inject_Iup 1), | |
| 166 | (etac box_equals 1), | |
| 167 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1), | |
| 168 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1) | |
| 169 | ]); | |
| 170 | ||
| 2640 | 171 | qed_goalw "defined_up" thy [up_def] " up`x ~= UU" | 
| 2278 | 172 | (fn prems => | 
| 173 | [ | |
| 174 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1), | |
| 175 | (rtac defined_Iup2 1) | |
| 176 | ]); | |
| 177 | ||
| 2640 | 178 | qed_goalw "upE1" thy [up_def] | 
| 2278 | 179 | "[| p=UU ==> Q; !!x. p=up`x==>Q|] ==>Q" | 
| 180 | (fn prems => | |
| 181 | [ | |
| 182 | (rtac upE 1), | |
| 183 | (resolve_tac prems 1), | |
| 184 | (etac (inst_up_pcpo RS ssubst) 1), | |
| 185 | (resolve_tac (tl prems) 1), | |
| 186 | (asm_simp_tac (Up0_ss addsimps [cont_Iup]) 1) | |
| 187 | ]); | |
| 188 | ||
| 4098 | 189 | val tac = (simp_tac (simpset() addsimps [cont_Iup,cont_Ifup1, | 
| 2566 | 190 | cont_Ifup2,cont2cont_CF1L]) 1); | 
| 2278 | 191 | |
| 2640 | 192 | qed_goalw "fup1" thy [up_def,fup_def] "fup`f`UU=UU" | 
| 2278 | 193 | (fn prems => | 
| 194 | [ | |
| 195 | (stac inst_up_pcpo 1), | |
| 196 | (stac beta_cfun 1), | |
| 2566 | 197 | tac, | 
| 2278 | 198 | (stac beta_cfun 1), | 
| 2566 | 199 | tac, | 
| 2278 | 200 | (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1) | 
| 201 | ]); | |
| 202 | ||
| 2640 | 203 | qed_goalw "fup2" thy [up_def,fup_def] "fup`f`(up`x)=f`x" | 
| 2278 | 204 | (fn prems => | 
| 205 | [ | |
| 206 | (stac beta_cfun 1), | |
| 207 | (rtac cont_Iup 1), | |
| 208 | (stac beta_cfun 1), | |
| 2566 | 209 | tac, | 
| 2278 | 210 | (stac beta_cfun 1), | 
| 211 | (rtac cont_Ifup2 1), | |
| 212 | (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1) | |
| 213 | ]); | |
| 214 | ||
| 2640 | 215 | qed_goalw "less_up4b" thy [up_def,fup_def] "~ up`x << UU" | 
| 2278 | 216 | (fn prems => | 
| 217 | [ | |
| 218 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1), | |
| 219 | (rtac less_up3b 1) | |
| 220 | ]); | |
| 221 | ||
| 2640 | 222 | qed_goalw "less_up4c" thy [up_def,fup_def] | 
| 2278 | 223 | "(up`x << up`y) = (x<<y)" | 
| 224 | (fn prems => | |
| 225 | [ | |
| 226 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1), | |
| 227 | (rtac less_up2c 1) | |
| 228 | ]); | |
| 229 | ||
| 2640 | 230 | qed_goalw "thelub_up2a" thy [up_def,fup_def] | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 231 | "[| chain(Y); ? i x. Y(i) = up`x |] ==>\ | 
| 2278 | 232 | \ lub(range(Y)) = up`(lub(range(%i. fup`(LAM x. x)`(Y i))))" | 
| 233 | (fn prems => | |
| 234 | [ | |
| 235 | (cut_facts_tac prems 1), | |
| 236 | (stac beta_cfun 1), | |
| 2566 | 237 | tac, | 
| 2278 | 238 | (stac beta_cfun 1), | 
| 2566 | 239 | tac, | 
| 2278 | 240 | (stac (beta_cfun RS ext) 1), | 
| 2566 | 241 | tac, | 
| 2278 | 242 | (rtac thelub_up1a 1), | 
| 243 | (atac 1), | |
| 244 | (etac exE 1), | |
| 245 | (etac exE 1), | |
| 246 | (rtac exI 1), | |
| 247 | (rtac exI 1), | |
| 248 | (etac box_equals 1), | |
| 249 | (rtac refl 1), | |
| 250 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1) | |
| 251 | ]); | |
| 252 | ||
| 253 | ||
| 254 | ||
| 2640 | 255 | qed_goalw "thelub_up2b" thy [up_def,fup_def] | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 256 | "[| chain(Y); ! i x. Y(i) ~= up`x |] ==> lub(range(Y)) = UU" | 
| 2278 | 257 | (fn prems => | 
| 258 | [ | |
| 259 | (cut_facts_tac prems 1), | |
| 260 | (stac inst_up_pcpo 1), | |
| 261 | (rtac thelub_up1b 1), | |
| 262 | (atac 1), | |
| 263 | (strip_tac 1), | |
| 264 | (dtac spec 1), | |
| 265 | (dtac spec 1), | |
| 266 | (rtac swap 1), | |
| 267 | (atac 1), | |
| 268 | (dtac notnotD 1), | |
| 269 | (etac box_equals 1), | |
| 270 | (rtac refl 1), | |
| 271 | (simp_tac (Up0_ss addsimps [cont_Iup]) 1) | |
| 272 | ]); | |
| 273 | ||
| 274 | ||
| 3842 | 275 | qed_goal "up_lemma2" thy " (? x. z = up`x) = (z~=UU)" | 
| 2278 | 276 | (fn prems => | 
| 277 | [ | |
| 278 | (rtac iffI 1), | |
| 279 | (etac exE 1), | |
| 280 | (hyp_subst_tac 1), | |
| 281 | (rtac defined_up 1), | |
| 282 |         (res_inst_tac [("p","z")] upE1 1),
 | |
| 283 | (etac notE 1), | |
| 284 | (atac 1), | |
| 285 | (etac exI 1) | |
| 286 | ]); | |
| 287 | ||
| 288 | ||
| 2640 | 289 | qed_goal "thelub_up2a_rev" thy | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 290 | "[| chain(Y); lub(range(Y)) = up`x |] ==> ? i x. Y(i) = up`x" | 
| 2278 | 291 | (fn prems => | 
| 292 | [ | |
| 293 | (cut_facts_tac prems 1), | |
| 294 | (rtac exE 1), | |
| 295 | (rtac chain_UU_I_inverse2 1), | |
| 296 | (rtac (up_lemma2 RS iffD1) 1), | |
| 297 | (etac exI 1), | |
| 298 | (rtac exI 1), | |
| 299 | (rtac (up_lemma2 RS iffD2) 1), | |
| 300 | (atac 1) | |
| 301 | ]); | |
| 302 | ||
| 2640 | 303 | qed_goal "thelub_up2b_rev" thy | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 304 | "[| chain(Y); lub(range(Y)) = UU |] ==> ! i x. Y(i) ~= up`x" | 
| 2278 | 305 | (fn prems => | 
| 306 | [ | |
| 307 | (cut_facts_tac prems 1), | |
| 308 | (rtac allI 1), | |
| 309 | (rtac (not_ex RS iffD1) 1), | |
| 310 | (rtac contrapos 1), | |
| 311 | (etac (up_lemma2 RS iffD1) 2), | |
| 312 | (fast_tac (HOL_cs addSDs [chain_UU_I RS spec]) 1) | |
| 313 | ]); | |
| 314 | ||
| 315 | ||
| 2640 | 316 | qed_goal "thelub_up3" thy | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 317 | "chain(Y) ==> lub(range(Y)) = UU |\ | 
| 3842 | 318 | \ lub(range(Y)) = up`(lub(range(%i. fup`(LAM x. x)`(Y i))))" | 
| 2278 | 319 | (fn prems => | 
| 320 | [ | |
| 321 | (cut_facts_tac prems 1), | |
| 322 | (rtac disjE 1), | |
| 323 | (rtac disjI1 2), | |
| 324 | (rtac thelub_up2b 2), | |
| 325 | (atac 2), | |
| 326 | (atac 2), | |
| 327 | (rtac disjI2 2), | |
| 328 | (rtac thelub_up2a 2), | |
| 329 | (atac 2), | |
| 330 | (atac 2), | |
| 331 | (fast_tac HOL_cs 1) | |
| 332 | ]); | |
| 333 | ||
| 2640 | 334 | qed_goal "fup3" thy "fup`up`x=x" | 
| 2278 | 335 | (fn prems => | 
| 336 | [ | |
| 337 |         (res_inst_tac [("p","x")] upE1 1),
 | |
| 4098 | 338 | (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1), | 
| 339 | (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1) | |
| 2278 | 340 | ]); | 
| 341 | ||
| 342 | (* ------------------------------------------------------------------------ *) | |
| 343 | (* install simplifier for ('a)u                                             *)
 | |
| 344 | (* ------------------------------------------------------------------------ *) | |
| 345 | ||
| 3327 | 346 | Addsimps [fup1,fup2,defined_up]; |