src/HOLCF/Up3.ML
changeset 10834 a7897aebbffc
parent 10230 5eb935d6cc69
child 12030 46d57d0290a2
equal deleted inserted replaced
10833:c0844a30ea4e 10834:a7897aebbffc
   131 
   131 
   132 (* ------------------------------------------------------------------------ *)
   132 (* ------------------------------------------------------------------------ *)
   133 (* continuous versions of lemmas for ('a)u                                  *)
   133 (* continuous versions of lemmas for ('a)u                                  *)
   134 (* ------------------------------------------------------------------------ *)
   134 (* ------------------------------------------------------------------------ *)
   135 
   135 
   136 Goalw [up_def] "z = UU | (EX x. z = up`x)";
   136 Goalw [up_def] "z = UU | (EX x. z = up$x)";
   137 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   137 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   138 by (stac inst_up_pcpo 1);
   138 by (stac inst_up_pcpo 1);
   139 by (rtac Exh_Up 1);
   139 by (rtac Exh_Up 1);
   140 qed "Exh_Up1";
   140 qed "Exh_Up1";
   141 
   141 
   142 Goalw [up_def] "up`x=up`y ==> x=y";
   142 Goalw [up_def] "up$x=up$y ==> x=y";
   143 by (rtac inject_Iup 1);
   143 by (rtac inject_Iup 1);
   144 by Auto_tac;
   144 by Auto_tac;
   145 qed "inject_up";
   145 qed "inject_up";
   146 
   146 
   147 Goalw [up_def] " up`x ~= UU";
   147 Goalw [up_def] " up$x ~= UU";
   148 by Auto_tac;
   148 by Auto_tac;
   149 qed "defined_up";
   149 qed "defined_up";
   150 
   150 
   151 val prems = Goalw [up_def] 
   151 val prems = Goalw [up_def] 
   152         "[| p=UU ==> Q; !!x. p=up`x==>Q|] ==>Q";
   152         "[| p=UU ==> Q; !!x. p=up$x==>Q|] ==>Q";
   153 by (rtac upE 1);
   153 by (rtac upE 1);
   154 by (resolve_tac prems 1);
   154 by (resolve_tac prems 1);
   155 by (etac (inst_up_pcpo RS ssubst) 1);
   155 by (etac (inst_up_pcpo RS ssubst) 1);
   156 by (resolve_tac (tl prems) 1);
   156 by (resolve_tac (tl prems) 1);
   157 by (asm_simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   157 by (asm_simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   158 qed "upE1";
   158 qed "upE1";
   159 
   159 
   160 val tac = (simp_tac (simpset() addsimps [cont_Iup,cont_Ifup1,
   160 val tac = (simp_tac (simpset() addsimps [cont_Iup,cont_Ifup1,
   161                 cont_Ifup2,cont2cont_CF1L]) 1);
   161                 cont_Ifup2,cont2cont_CF1L]) 1);
   162 
   162 
   163 Goalw [up_def,fup_def] "fup`f`UU=UU";
   163 Goalw [up_def,fup_def] "fup$f$UU=UU";
   164 by (stac inst_up_pcpo 1);
   164 by (stac inst_up_pcpo 1);
   165 by (stac beta_cfun 1);
   165 by (stac beta_cfun 1);
   166 by tac;
   166 by tac;
   167 by (stac beta_cfun 1);
   167 by (stac beta_cfun 1);
   168 by tac;
   168 by tac;
   169 by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1);
   169 by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1);
   170 qed "fup1";
   170 qed "fup1";
   171 
   171 
   172 Goalw [up_def,fup_def] "fup`f`(up`x)=f`x";
   172 Goalw [up_def,fup_def] "fup$f$(up$x)=f$x";
   173 by (stac beta_cfun 1);
   173 by (stac beta_cfun 1);
   174 by (rtac cont_Iup 1);
   174 by (rtac cont_Iup 1);
   175 by (stac beta_cfun 1);
   175 by (stac beta_cfun 1);
   176 by tac;
   176 by tac;
   177 by (stac beta_cfun 1);
   177 by (stac beta_cfun 1);
   178 by (rtac cont_Ifup2 1);
   178 by (rtac cont_Ifup2 1);
   179 by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1);
   179 by (simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1);
   180 qed "fup2";
   180 qed "fup2";
   181 
   181 
   182 Goalw [up_def,fup_def] "~ up`x << UU";
   182 Goalw [up_def,fup_def] "~ up$x << UU";
   183 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   183 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   184 by (rtac less_up3b 1);
   184 by (rtac less_up3b 1);
   185 qed "less_up4b";
   185 qed "less_up4b";
   186 
   186 
   187 Goalw [up_def,fup_def]
   187 Goalw [up_def,fup_def]
   188          "(up`x << up`y) = (x<<y)";
   188          "(up$x << up$y) = (x<<y)";
   189 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   189 by (simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   190 by (rtac less_up2c 1);
   190 by (rtac less_up2c 1);
   191 qed "less_up4c";
   191 qed "less_up4c";
   192 
   192 
   193 Goalw [up_def,fup_def] 
   193 Goalw [up_def,fup_def] 
   194 "[| chain(Y); EX i x. Y(i) = up`x |] ==>\
   194 "[| chain(Y); EX i x. Y(i) = up$x |] ==>\
   195 \      lub(range(Y)) = up`(lub(range(%i. fup`(LAM x. x)`(Y i))))";
   195 \      lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))";
   196 by (stac beta_cfun 1);
   196 by (stac beta_cfun 1);
   197 by tac;
   197 by tac;
   198 by (stac beta_cfun 1);
   198 by (stac beta_cfun 1);
   199 by tac;
   199 by tac;
   200 by (stac (beta_cfun RS ext) 1);
   200 by (stac (beta_cfun RS ext) 1);
   211 qed "thelub_up2a";
   211 qed "thelub_up2a";
   212 
   212 
   213 
   213 
   214 
   214 
   215 Goalw [up_def,fup_def] 
   215 Goalw [up_def,fup_def] 
   216 "[| chain(Y); ! i x. Y(i) ~= up`x |] ==> lub(range(Y)) = UU";
   216 "[| chain(Y); ! i x. Y(i) ~= up$x |] ==> lub(range(Y)) = UU";
   217 by (stac inst_up_pcpo 1);
   217 by (stac inst_up_pcpo 1);
   218 by (rtac thelub_up1b 1);
   218 by (rtac thelub_up1b 1);
   219 by (atac 1);
   219 by (atac 1);
   220 by (strip_tac 1);
   220 by (strip_tac 1);
   221 by (dtac spec 1);
   221 by (dtac spec 1);
   222 by (dtac spec 1);
   222 by (dtac spec 1);
   223 by (asm_full_simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   223 by (asm_full_simp_tac (Up0_ss addsimps [cont_Iup]) 1);
   224 qed "thelub_up2b";
   224 qed "thelub_up2b";
   225 
   225 
   226 
   226 
   227 Goal "(EX x. z = up`x) = (z~=UU)";
   227 Goal "(EX x. z = up$x) = (z~=UU)";
   228 by (rtac iffI 1);
   228 by (rtac iffI 1);
   229 by (etac exE 1);
   229 by (etac exE 1);
   230 by (hyp_subst_tac 1);
   230 by (hyp_subst_tac 1);
   231 by (rtac defined_up 1);
   231 by (rtac defined_up 1);
   232 by (res_inst_tac [("p","z")] upE1 1);
   232 by (res_inst_tac [("p","z")] upE1 1);
   234 by (atac 1);
   234 by (atac 1);
   235 by (etac exI 1);
   235 by (etac exI 1);
   236 qed "up_lemma2";
   236 qed "up_lemma2";
   237 
   237 
   238 
   238 
   239 Goal "[| chain(Y); lub(range(Y)) = up`x |] ==> EX i x. Y(i) = up`x";
   239 Goal "[| chain(Y); lub(range(Y)) = up$x |] ==> EX i x. Y(i) = up$x";
   240 by (rtac exE 1);
   240 by (rtac exE 1);
   241 by (rtac chain_UU_I_inverse2 1);
   241 by (rtac chain_UU_I_inverse2 1);
   242 by (rtac (up_lemma2 RS iffD1) 1);
   242 by (rtac (up_lemma2 RS iffD1) 1);
   243 by (etac exI 1);
   243 by (etac exI 1);
   244 by (rtac exI 1);
   244 by (rtac exI 1);
   245 by (rtac (up_lemma2 RS iffD2) 1);
   245 by (rtac (up_lemma2 RS iffD2) 1);
   246 by (atac 1);
   246 by (atac 1);
   247 qed "thelub_up2a_rev";
   247 qed "thelub_up2a_rev";
   248 
   248 
   249 Goal "[| chain(Y); lub(range(Y)) = UU |] ==> ! i x.  Y(i) ~= up`x";
   249 Goal "[| chain(Y); lub(range(Y)) = UU |] ==> ! i x.  Y(i) ~= up$x";
   250 by (blast_tac (claset() addSDs [chain_UU_I RS spec, 
   250 by (blast_tac (claset() addSDs [chain_UU_I RS spec, 
   251                                 exI RS (up_lemma2 RS iffD1)]) 1);
   251                                 exI RS (up_lemma2 RS iffD1)]) 1);
   252 qed "thelub_up2b_rev";
   252 qed "thelub_up2b_rev";
   253 
   253 
   254 
   254 
   255 Goal "chain(Y) ==> lub(range(Y)) = UU | \
   255 Goal "chain(Y) ==> lub(range(Y)) = UU | \
   256 \                  lub(range(Y)) = up`(lub(range(%i. fup`(LAM x. x)`(Y i))))";
   256 \                  lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))";
   257 by (rtac disjE 1);
   257 by (rtac disjE 1);
   258 by (rtac disjI1 2);
   258 by (rtac disjI1 2);
   259 by (rtac thelub_up2b 2);
   259 by (rtac thelub_up2b 2);
   260 by (atac 2);
   260 by (atac 2);
   261 by (atac 2);
   261 by (atac 2);
   264 by (atac 2);
   264 by (atac 2);
   265 by (atac 2);
   265 by (atac 2);
   266 by (fast_tac HOL_cs 1);
   266 by (fast_tac HOL_cs 1);
   267 qed "thelub_up3";
   267 qed "thelub_up3";
   268 
   268 
   269 Goal "fup`up`x=x";
   269 Goal "fup$up$x=x";
   270 by (res_inst_tac [("p","x")] upE1 1);
   270 by (res_inst_tac [("p","x")] upE1 1);
   271 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 by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1);
   272 by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [fup1,fup2]) 1);
   273 qed "fup3";
   273 qed "fup3";
   274 
   274