src/HOLCF/Ssum3.ML
changeset 1267 bca91b4e1710
parent 1168 74be52691d62
child 1274 ea0668a1c0ba
equal deleted inserted replaced
1266:3ae9fe3c0f68 1267:bca91b4e1710
    39 	(atac 1),
    39 	(atac 1),
    40 	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
    40 	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
    41 	(etac (monofun_Isinl RS ch2ch_monofun) 1),
    41 	(etac (monofun_Isinl RS ch2ch_monofun) 1),
    42 	(rtac allI 1),
    42 	(rtac allI 1),
    43 	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
    43 	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
    44 	(asm_simp_tac Ssum_ss 1),
    44 	(Asm_simp_tac 1),
    45 	(asm_simp_tac Ssum_ss 1)
    45 	(Asm_simp_tac 1)
    46 	]);
    46 	]);
    47 
    47 
    48 qed_goal "contlub_Isinr" Ssum3.thy "contlub(Isinr)"
    48 qed_goal "contlub_Isinr" Ssum3.thy "contlub(Isinr)"
    49  (fn prems =>
    49  (fn prems =>
    50 	[
    50 	[
    70 	(atac 1),
    70 	(atac 1),
    71 	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
    71 	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
    72 	(etac (monofun_Isinr RS ch2ch_monofun) 1),
    72 	(etac (monofun_Isinr RS ch2ch_monofun) 1),
    73 	(rtac allI 1),
    73 	(rtac allI 1),
    74 	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
    74 	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
    75 	(asm_simp_tac Ssum_ss 1),
    75 	(Asm_simp_tac 1),
    76 	(asm_simp_tac Ssum_ss 1)
    76 	(Asm_simp_tac 1)
    77 	]);
    77 	]);
    78 
    78 
    79 qed_goal "cont_Isinl" Ssum3.thy "cont(Isinl)"
    79 qed_goal "cont_Isinl" Ssum3.thy "cont(Isinl)"
    80  (fn prems =>
    80  (fn prems =>
    81 	[
    81 	[
   112 	(rtac ch2ch_fun 2),
   112 	(rtac ch2ch_fun 2),
   113 	(etac (monofun_Iwhen1 RS ch2ch_monofun) 2),
   113 	(etac (monofun_Iwhen1 RS ch2ch_monofun) 2),
   114 	(rtac (expand_fun_eq RS iffD2) 1),
   114 	(rtac (expand_fun_eq RS iffD2) 1),
   115 	(strip_tac 1),
   115 	(strip_tac 1),
   116 	(res_inst_tac [("p","xa")] IssumE 1),
   116 	(res_inst_tac [("p","xa")] IssumE 1),
   117 	(asm_simp_tac Ssum_ss 1),
   117 	(Asm_simp_tac 1),
   118 	(rtac (lub_const RS thelubI RS sym) 1),
   118 	(rtac (lub_const RS thelubI RS sym) 1),
   119 	(asm_simp_tac Ssum_ss 1),
   119 	(Asm_simp_tac 1),
   120 	(etac contlub_cfun_fun 1),
   120 	(etac contlub_cfun_fun 1),
   121 	(asm_simp_tac Ssum_ss 1),
   121 	(Asm_simp_tac 1),
   122 	(rtac (lub_const RS thelubI RS sym) 1)
   122 	(rtac (lub_const RS thelubI RS sym) 1)
   123 	]);
   123 	]);
   124 
   124 
   125 qed_goal "contlub_Iwhen2" Ssum3.thy "contlub(Iwhen(f))"
   125 qed_goal "contlub_Iwhen2" Ssum3.thy "contlub(Iwhen(f))"
   126  (fn prems =>
   126  (fn prems =>
   131 	(rtac (thelub_fun RS sym) 2),
   131 	(rtac (thelub_fun RS sym) 2),
   132 	(etac (monofun_Iwhen2 RS ch2ch_monofun) 2),
   132 	(etac (monofun_Iwhen2 RS ch2ch_monofun) 2),
   133 	(rtac (expand_fun_eq RS iffD2) 1),
   133 	(rtac (expand_fun_eq RS iffD2) 1),
   134 	(strip_tac 1),
   134 	(strip_tac 1),
   135 	(res_inst_tac [("p","x")] IssumE 1),
   135 	(res_inst_tac [("p","x")] IssumE 1),
   136 	(asm_simp_tac Ssum_ss 1),
   136 	(Asm_simp_tac 1),
   137 	(rtac (lub_const RS thelubI RS sym) 1),
   137 	(rtac (lub_const RS thelubI RS sym) 1),
   138 	(asm_simp_tac Ssum_ss 1),
   138 	(Asm_simp_tac 1),
   139 	(rtac (lub_const RS thelubI RS sym) 1),
   139 	(rtac (lub_const RS thelubI RS sym) 1),
   140 	(asm_simp_tac Ssum_ss 1),
   140 	(Asm_simp_tac 1),
   141 	(etac contlub_cfun_fun 1)
   141 	(etac contlub_cfun_fun 1)
   142 	]);
   142 	]);
   143 
   143 
   144 (* ------------------------------------------------------------------------ *)
   144 (* ------------------------------------------------------------------------ *)
   145 (* continuity for Iwhen in its third argument                               *)
   145 (* continuity for Iwhen in its third argument                               *)
   190 "[| is_chain(Y); lub(range(Y)) = Isinl(UU) |] ==>\
   190 "[| is_chain(Y); lub(range(Y)) = Isinl(UU) |] ==>\
   191 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   191 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   192  (fn prems =>
   192  (fn prems =>
   193 	[
   193 	[
   194 	(cut_facts_tac prems 1),
   194 	(cut_facts_tac prems 1),
   195 	(asm_simp_tac Ssum_ss 1),
   195 	(Asm_simp_tac 1),
   196 	(rtac (chain_UU_I_inverse RS sym) 1),
   196 	(rtac (chain_UU_I_inverse RS sym) 1),
   197 	(rtac allI 1),
   197 	(rtac allI 1),
   198 	(res_inst_tac [("s","Isinl(UU)"),("t","Y(i)")] subst 1),
   198 	(res_inst_tac [("s","Isinl(UU)"),("t","Y(i)")] subst 1),
   199 	(rtac (inst_ssum_pcpo RS subst) 1),
   199 	(rtac (inst_ssum_pcpo RS subst) 1),
   200 	(rtac (chain_UU_I RS spec RS sym) 1),
   200 	(rtac (chain_UU_I RS spec RS sym) 1),
   201 	(atac 1),
   201 	(atac 1),
   202 	(etac (inst_ssum_pcpo RS ssubst) 1),
   202 	(etac (inst_ssum_pcpo RS ssubst) 1),
   203 	(asm_simp_tac Ssum_ss 1)
   203 	(Asm_simp_tac 1)
   204 	]);
   204 	]);
   205 
   205 
   206 qed_goal "ssum_lemma12" Ssum3.thy 
   206 qed_goal "ssum_lemma12" Ssum3.thy 
   207 "[| is_chain(Y); lub(range(Y)) = Isinl(x); x ~= UU |] ==>\
   207 "[| is_chain(Y); lub(range(Y)) = Isinl(x); x ~= UU |] ==>\
   208 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   208 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   209  (fn prems =>
   209  (fn prems =>
   210 	[
   210 	[
   211 	(cut_facts_tac prems 1),
   211 	(cut_facts_tac prems 1),
   212 	(asm_simp_tac Ssum_ss 1),
   212 	(Asm_simp_tac 1),
   213 	(res_inst_tac [("t","x")] subst 1),
   213 	(res_inst_tac [("t","x")] subst 1),
   214 	(rtac inject_Isinl 1),
   214 	(rtac inject_Isinl 1),
   215 	(rtac trans 1),
   215 	(rtac trans 1),
   216 	(atac 2),
   216 	(atac 2),
   217 	(rtac (thelub_ssum1a RS sym) 1),
   217 	(rtac (thelub_ssum1a RS sym) 1),
   253 	(fast_tac HOL_cs 1),
   253 	(fast_tac HOL_cs 1),
   254 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   254 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   255 	(res_inst_tac [("t","Y(i)")] ssubst 1),
   255 	(res_inst_tac [("t","Y(i)")] ssubst 1),
   256 	(atac 1),
   256 	(atac 1),
   257 	(fast_tac HOL_cs 1),
   257 	(fast_tac HOL_cs 1),
   258 	(simp_tac Cfun_ss 1),
   258 	(Simp_tac 1),
   259 	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
   259 	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
   260 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
   260 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
   261 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
   261 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
   262 	]);
   262 	]);
   263 
   263 
   266 "[| is_chain(Y); lub(range(Y)) = Isinr(x); x ~= UU |] ==>\
   266 "[| is_chain(Y); lub(range(Y)) = Isinr(x); x ~= UU |] ==>\
   267 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   267 \   Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"
   268  (fn prems =>
   268  (fn prems =>
   269 	[
   269 	[
   270 	(cut_facts_tac prems 1),
   270 	(cut_facts_tac prems 1),
   271 	(asm_simp_tac Ssum_ss 1),
   271 	(Asm_simp_tac 1),
   272 	(res_inst_tac [("t","x")] subst 1),
   272 	(res_inst_tac [("t","x")] subst 1),
   273 	(rtac inject_Isinr 1),
   273 	(rtac inject_Isinr 1),
   274 	(rtac trans 1),
   274 	(rtac trans 1),
   275 	(atac 2),
   275 	(atac 2),
   276 	(rtac (thelub_ssum1b RS sym) 1),
   276 	(rtac (thelub_ssum1b RS sym) 1),
   317 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   317 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   318 	(rtac (strict_IsinlIsinr RS ssubst) 1),
   318 	(rtac (strict_IsinlIsinr RS ssubst) 1),
   319 	(res_inst_tac [("t","Y(i)")] ssubst 1),
   319 	(res_inst_tac [("t","Y(i)")] ssubst 1),
   320 	(atac 1),
   320 	(atac 1),
   321 	(fast_tac HOL_cs 1),
   321 	(fast_tac HOL_cs 1),
   322 	(simp_tac Cfun_ss 1),
   322 	(Simp_tac 1),
   323 	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
   323 	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
   324 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
   324 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
   325 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
   325 	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
   326 	]);
   326 	]);
   327 
   327 
   371 (* ------------------------------------------------------------------------ *)
   371 (* ------------------------------------------------------------------------ *)
   372 
   372 
   373 qed_goalw "strict_sinl" Ssum3.thy [sinl_def] "sinl`UU =UU"
   373 qed_goalw "strict_sinl" Ssum3.thy [sinl_def] "sinl`UU =UU"
   374  (fn prems =>
   374  (fn prems =>
   375 	[
   375 	[
   376 	(simp_tac (Ssum_ss addsimps [cont_Isinl]) 1),
   376 	(simp_tac (!simpset addsimps [cont_Isinl]) 1),
   377 	(rtac (inst_ssum_pcpo RS sym) 1)
   377 	(rtac (inst_ssum_pcpo RS sym) 1)
   378 	]);
   378 	]);
   379 
   379 
   380 qed_goalw "strict_sinr" Ssum3.thy [sinr_def] "sinr`UU=UU"
   380 qed_goalw "strict_sinr" Ssum3.thy [sinr_def] "sinr`UU=UU"
   381  (fn prems =>
   381  (fn prems =>
   382 	[
   382 	[
   383 	(simp_tac (Ssum_ss addsimps [cont_Isinr]) 1),
   383 	(simp_tac (!simpset addsimps [cont_Isinr]) 1),
   384 	(rtac (inst_ssum_pcpo RS sym) 1)
   384 	(rtac (inst_ssum_pcpo RS sym) 1)
   385 	]);
   385 	]);
   386 
   386 
   387 qed_goalw "noteq_sinlsinr" Ssum3.thy [sinl_def,sinr_def] 
   387 qed_goalw "noteq_sinlsinr" Ssum3.thy [sinl_def,sinr_def] 
   388 	"sinl`a=sinr`b ==> a=UU & b=UU"
   388 	"sinl`a=sinr`b ==> a=UU & b=UU"
   389  (fn prems =>
   389  (fn prems =>
   390 	[
   390 	[
   391 	(cut_facts_tac prems 1),
   391 	(cut_facts_tac prems 1),
   392 	(rtac noteq_IsinlIsinr 1),
   392 	(rtac noteq_IsinlIsinr 1),
   393 	(etac box_equals 1),
   393 	(etac box_equals 1),
   394 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   394 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   395 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1)
   395 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1)
   396 	]);
   396 	]);
   397 
   397 
   398 qed_goalw "inject_sinl" Ssum3.thy [sinl_def,sinr_def] 
   398 qed_goalw "inject_sinl" Ssum3.thy [sinl_def,sinr_def] 
   399 	"sinl`a1=sinl`a2==> a1=a2"
   399 	"sinl`a1=sinl`a2==> a1=a2"
   400  (fn prems =>
   400  (fn prems =>
   401 	[
   401 	[
   402 	(cut_facts_tac prems 1),
   402 	(cut_facts_tac prems 1),
   403 	(rtac inject_Isinl 1),
   403 	(rtac inject_Isinl 1),
   404 	(etac box_equals 1),
   404 	(etac box_equals 1),
   405 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   405 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   406 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1)
   406 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1)
   407 	]);
   407 	]);
   408 
   408 
   409 qed_goalw "inject_sinr" Ssum3.thy [sinl_def,sinr_def] 
   409 qed_goalw "inject_sinr" Ssum3.thy [sinl_def,sinr_def] 
   410 	"sinr`a1=sinr`a2==> a1=a2"
   410 	"sinr`a1=sinr`a2==> a1=a2"
   411  (fn prems =>
   411  (fn prems =>
   412 	[
   412 	[
   413 	(cut_facts_tac prems 1),
   413 	(cut_facts_tac prems 1),
   414 	(rtac inject_Isinr 1),
   414 	(rtac inject_Isinr 1),
   415 	(etac box_equals 1),
   415 	(etac box_equals 1),
   416 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   416 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   417 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1)
   417 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1)
   418 	]);
   418 	]);
   419 
   419 
   420 
   420 
   421 qed_goal "defined_sinl" Ssum3.thy  
   421 qed_goal "defined_sinl" Ssum3.thy  
   422 	"x~=UU ==> sinl`x ~= UU"
   422 	"x~=UU ==> sinl`x ~= UU"
   442 
   442 
   443 qed_goalw "Exh_Ssum1" Ssum3.thy [sinl_def,sinr_def] 
   443 qed_goalw "Exh_Ssum1" Ssum3.thy [sinl_def,sinr_def] 
   444 	"z=UU | (? a. z=sinl`a & a~=UU) | (? b. z=sinr`b & b~=UU)"
   444 	"z=UU | (? a. z=sinl`a & a~=UU) | (? b. z=sinr`b & b~=UU)"
   445  (fn prems =>
   445  (fn prems =>
   446 	[
   446 	[
   447 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   447 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   448 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   448 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   449 	(rtac Exh_Ssum 1)
   449 	(rtac Exh_Ssum 1)
   450 	]);
   450 	]);
   451 
   451 
   452 
   452 
   460 	(resolve_tac prems 1),
   460 	(resolve_tac prems 1),
   461 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   461 	(rtac (inst_ssum_pcpo RS ssubst) 1),
   462 	(atac 1),
   462 	(atac 1),
   463 	(resolve_tac prems 1),
   463 	(resolve_tac prems 1),
   464 	(atac 2),
   464 	(atac 2),
   465 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   465 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   466 	(resolve_tac prems 1),
   466 	(resolve_tac prems 1),
   467 	(atac 2),
   467 	(atac 2),
   468 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1)
   468 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1)
   469 	]);
   469 	]);
   470 
   470 
   471 
   471 
   472 qed_goalw "ssumE2" Ssum3.thy [sinl_def,sinr_def] 
   472 qed_goalw "ssumE2" Ssum3.thy [sinl_def,sinr_def] 
   473       "[|!!x.[|p=sinl`x|] ==> Q;\
   473       "[|!!x.[|p=sinl`x|] ==> Q;\
   497 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   497 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   498 		cont_Iwhen3,cont2cont_CF1L]) 1)),
   498 		cont_Iwhen3,cont2cont_CF1L]) 1)),
   499 	(rtac (beta_cfun RS ssubst) 1),
   499 	(rtac (beta_cfun RS ssubst) 1),
   500 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   500 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   501 		cont_Iwhen3,cont2cont_CF1L]) 1)),
   501 		cont_Iwhen3,cont2cont_CF1L]) 1)),
   502 	(simp_tac Ssum_ss  1)
   502 	(Simp_tac 1)
   503 	]);
   503 	]);
   504 
   504 
   505 qed_goalw "sswhen2" Ssum3.thy [sswhen_def,sinl_def,sinr_def] 
   505 qed_goalw "sswhen2" Ssum3.thy [sswhen_def,sinl_def,sinr_def] 
   506 	"x~=UU==> sswhen`f`g`(sinl`x) = f`x"
   506 	"x~=UU==> sswhen`f`g`(sinl`x) = f`x"
   507  (fn prems =>
   507  (fn prems =>
   517 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   517 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   518 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   518 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   519 	(rtac (beta_cfun RS ssubst) 1),
   519 	(rtac (beta_cfun RS ssubst) 1),
   520 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   520 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   521 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   521 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   522 	(asm_simp_tac Ssum_ss  1)
   522 	(Asm_simp_tac  1)
   523 	]);
   523 	]);
   524 
   524 
   525 
   525 
   526 
   526 
   527 qed_goalw "sswhen3" Ssum3.thy [sswhen_def,sinl_def,sinr_def] 
   527 qed_goalw "sswhen3" Ssum3.thy [sswhen_def,sinl_def,sinr_def] 
   539 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   539 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   540 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   540 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   541 	(rtac (beta_cfun RS ssubst) 1),
   541 	(rtac (beta_cfun RS ssubst) 1),
   542 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   542 	(REPEAT (resolve_tac (cont_lemmas @ [cont_Iwhen1,cont_Iwhen2,
   543 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   543 		cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)),
   544 	(asm_simp_tac Ssum_ss  1)
   544 	(Asm_simp_tac 1)
   545 	]);
   545 	]);
   546 
   546 
   547 
   547 
   548 qed_goalw "less_ssum4a" Ssum3.thy [sinl_def,sinr_def] 
   548 qed_goalw "less_ssum4a" Ssum3.thy [sinl_def,sinr_def] 
   549 	"(sinl`x << sinl`y) = (x << y)"
   549 	"(sinl`x << sinl`y) = (x << y)"
   600 qed_goalw "ssum_chainE" Ssum3.thy [sinl_def,sinr_def] 
   600 qed_goalw "ssum_chainE" Ssum3.thy [sinl_def,sinr_def] 
   601 	"is_chain(Y) ==> (!i.? x.(Y i)=sinl`x)|(!i.? y.(Y i)=sinr`y)"
   601 	"is_chain(Y) ==> (!i.? x.(Y i)=sinl`x)|(!i.? y.(Y i)=sinr`y)"
   602  (fn prems =>
   602  (fn prems =>
   603 	[
   603 	[
   604 	(cut_facts_tac prems 1),
   604 	(cut_facts_tac prems 1),
   605 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinr,cont_Isinl]) 1),
   605 	(asm_simp_tac (!simpset addsimps [cont_Isinr,cont_Isinl]) 1),
   606 	(etac ssum_lemma4 1)
   606 	(etac ssum_lemma4 1)
   607 	]);
   607 	]);
   608 
   608 
   609 
   609 
   610 qed_goalw "thelub_ssum2a" Ssum3.thy [sinl_def,sinr_def,sswhen_def] 
   610 qed_goalw "thelub_ssum2a" Ssum3.thy [sinl_def,sinr_def,sswhen_def] 
   627 	(etac allE 1),
   627 	(etac allE 1),
   628 	(etac exE 1),
   628 	(etac exE 1),
   629 	(rtac exI 1),
   629 	(rtac exI 1),
   630 	(etac box_equals 1),
   630 	(etac box_equals 1),
   631 	(rtac refl 1),
   631 	(rtac refl 1),
   632 	(asm_simp_tac (Ssum_ss addsimps [cont_Isinl]) 1)
   632 	(asm_simp_tac (!simpset addsimps [cont_Isinl]) 1)
   633 	]);
   633 	]);
   634 
   634 
   635 qed_goalw "thelub_ssum2b" Ssum3.thy [sinl_def,sinr_def,sswhen_def] 
   635 qed_goalw "thelub_ssum2b" Ssum3.thy [sinl_def,sinr_def,sswhen_def] 
   636 "[| is_chain(Y); !i.? x. Y(i) = sinr`x |] ==>\ 
   636 "[| is_chain(Y); !i.? x. Y(i) = sinr`x |] ==>\ 
   637 \   lub(range(Y)) = sinr`(lub(range(%i. sswhen`(LAM y. UU)`(LAM x.x)`(Y i))))"
   637 \   lub(range(Y)) = sinr`(lub(range(%i. sswhen`(LAM y. UU)`(LAM x.x)`(Y i))))"
   656 	(etac allE 1),
   656 	(etac allE 1),
   657 	(etac exE 1),
   657 	(etac exE 1),
   658 	(rtac exI 1),
   658 	(rtac exI 1),
   659 	(etac box_equals 1),
   659 	(etac box_equals 1),
   660 	(rtac refl 1),
   660 	(rtac refl 1),
   661 	(asm_simp_tac (Ssum_ss addsimps 
   661 	(asm_simp_tac (!simpset addsimps 
   662 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   662 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   663 	cont_Iwhen3]) 1)
   663 	cont_Iwhen3]) 1)
   664 	]);
   664 	]);
   665 
   665 
   666 qed_goalw "thelub_ssum2a_rev" Ssum3.thy [sinl_def,sinr_def] 
   666 qed_goalw "thelub_ssum2a_rev" Ssum3.thy [sinl_def,sinr_def] 
   667 	"[| is_chain(Y); lub(range(Y)) = sinl`x|] ==> !i.? x.Y(i)=sinl`x"
   667 	"[| is_chain(Y); lub(range(Y)) = sinl`x|] ==> !i.? x.Y(i)=sinl`x"
   668  (fn prems =>
   668  (fn prems =>
   669 	[
   669 	[
   670 	(cut_facts_tac prems 1),
   670 	(cut_facts_tac prems 1),
   671 	(asm_simp_tac (Ssum_ss addsimps 
   671 	(asm_simp_tac (!simpset addsimps 
   672 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   672 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   673 	cont_Iwhen3]) 1),
   673 	cont_Iwhen3]) 1),
   674 	(etac ssum_lemma9 1),
   674 	(etac ssum_lemma9 1),
   675 	(asm_simp_tac (Ssum_ss addsimps 
   675 	(asm_simp_tac (!simpset addsimps 
   676 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   676 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   677 	cont_Iwhen3]) 1)
   677 	cont_Iwhen3]) 1)
   678 	]);
   678 	]);
   679 
   679 
   680 qed_goalw "thelub_ssum2b_rev" Ssum3.thy [sinl_def,sinr_def] 
   680 qed_goalw "thelub_ssum2b_rev" Ssum3.thy [sinl_def,sinr_def] 
   681 	"[| is_chain(Y); lub(range(Y)) = sinr`x|] ==> !i.? x.Y(i)=sinr`x"
   681 	"[| is_chain(Y); lub(range(Y)) = sinr`x|] ==> !i.? x.Y(i)=sinr`x"
   682  (fn prems =>
   682  (fn prems =>
   683 	[
   683 	[
   684 	(cut_facts_tac prems 1),
   684 	(cut_facts_tac prems 1),
   685 	(asm_simp_tac (Ssum_ss addsimps 
   685 	(asm_simp_tac (!simpset addsimps 
   686 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   686 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   687 	cont_Iwhen3]) 1),
   687 	cont_Iwhen3]) 1),
   688 	(etac ssum_lemma10 1),
   688 	(etac ssum_lemma10 1),
   689 	(asm_simp_tac (Ssum_ss addsimps 
   689 	(asm_simp_tac (!simpset addsimps 
   690 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   690 	[cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2,
   691 	cont_Iwhen3]) 1)
   691 	cont_Iwhen3]) 1)
   692 	]);
   692 	]);
   693 
   693 
   694 qed_goal "thelub_ssum3" Ssum3.thy  
   694 qed_goal "thelub_ssum3" Ssum3.thy  
   712 qed_goal "sswhen4" Ssum3.thy  
   712 qed_goal "sswhen4" Ssum3.thy  
   713 	"sswhen`sinl`sinr`z=z"
   713 	"sswhen`sinl`sinr`z=z"
   714  (fn prems =>
   714  (fn prems =>
   715 	[
   715 	[
   716 	(res_inst_tac [("p","z")] ssumE 1),
   716 	(res_inst_tac [("p","z")] ssumE 1),
   717 	(asm_simp_tac (Cfun_ss addsimps [sswhen1,sswhen2,sswhen3]) 1),
   717 	(asm_simp_tac (!simpset addsimps [sswhen1,sswhen2,sswhen3]) 1),
   718 	(asm_simp_tac (Cfun_ss addsimps [sswhen1,sswhen2,sswhen3]) 1),
   718 	(asm_simp_tac (!simpset addsimps [sswhen1,sswhen2,sswhen3]) 1),
   719 	(asm_simp_tac (Cfun_ss addsimps [sswhen1,sswhen2,sswhen3]) 1)
   719 	(asm_simp_tac (!simpset addsimps [sswhen1,sswhen2,sswhen3]) 1)
   720 	]);
   720 	]);
   721 
   721 
   722 
   722 
   723 (* ------------------------------------------------------------------------ *)
   723 (* ------------------------------------------------------------------------ *)
   724 (* install simplifier for Ssum                                              *)
   724 (* install simplifier for Ssum                                              *)
   725 (* ------------------------------------------------------------------------ *)
   725 (* ------------------------------------------------------------------------ *)
   726 
   726 
   727 val Ssum_rews = [strict_sinl,strict_sinr,sswhen1,sswhen2,sswhen3];
   727 Addsimps [strict_sinl,strict_sinr,sswhen1,sswhen2,sswhen3];
   728 val Ssum_ss = Cfun_ss addsimps Ssum_rews;