src/HOL/MiniML/W.ML
changeset 2749 2f477a0e690d
parent 2637 e9b203f854ae
child 2779 9c42ae57b5f4
equal deleted inserted replaced
2748:3ae9ccdd701e 2749:2f477a0e690d
   482 by (res_inst_tac [("x","%x. (if x < n then S' x else S (x - n))")] exI 1);
   482 by (res_inst_tac [("x","%x. (if x < n then S' x else S (x - n))")] exI 1);
   483 by (rtac conjI 1);
   483 by (rtac conjI 1);
   484 by (Asm_simp_tac 1);
   484 by (Asm_simp_tac 1);
   485 by (asm_simp_tac (!simpset addsimps [(bound_typ_inst_composed_subst RS sym),new_tv_nth_nat_A,o_def,nth_subst] 
   485 by (asm_simp_tac (!simpset addsimps [(bound_typ_inst_composed_subst RS sym),new_tv_nth_nat_A,o_def,nth_subst] 
   486                            delsimps [bound_typ_inst_composed_subst]) 1);
   486                            delsimps [bound_typ_inst_composed_subst]) 1);
   487 
   487 (** LEVEL 12 **)
   488 (* case Abs e *)
   488 (* case Abs e *)
   489 by (strip_tac 1);
   489 by (strip_tac 1);
   490 by (eresolve_tac has_type_casesE 1);
   490 by (eresolve_tac has_type_casesE 1);
   491 by (eres_inst_tac [("x","%x.if x=n then t1 else (S' x)")] allE 1);
   491 by (eres_inst_tac [("x","%x.if x=n then t1 else (S' x)")] allE 1);
   492 by (eres_inst_tac [("x","(FVar n)#A")] allE 1);
   492 by (eres_inst_tac [("x","(FVar n)#A")] allE 1);
   493 by (eres_inst_tac [("x","t2")] allE 1);
   493 by (eres_inst_tac [("x","t2")] allE 1);
   494 by (eres_inst_tac [("x","Suc n")] allE 1);
   494 by (eres_inst_tac [("x","Suc n")] allE 1);
   495 by (best_tac (HOL_cs addSDs [mk_scheme_injective] unsafe_addss (!simpset addcongs [conj_cong] 
   495 by (best_tac (HOL_cs addSDs [mk_scheme_injective] 
   496     setloop (split_tac [expand_option_bind]))) 1);
   496                   unsafe_addss (!simpset addcongs [conj_cong] 
       
   497 				setloop (split_tac [expand_option_bind]))) 1);
       
   498 (** LEVEL 19 **)
   497 
   499 
   498 (* case App e1 e2 *)
   500 (* case App e1 e2 *)
   499 by (strip_tac 1);
   501 by (strip_tac 1);
   500 by (eresolve_tac has_type_casesE 1);
   502 by (eresolve_tac has_type_casesE 1);
   501 by (eres_inst_tac [("x","S'")] allE 1);
   503 by (eres_inst_tac [("x","S'")] allE 1);
   502 by (eres_inst_tac [("x","A")] allE 1);
   504 by (eres_inst_tac [("x","A")] allE 1);
   503 by (eres_inst_tac [("x","t2 -> t'")] allE 1);
   505 by (eres_inst_tac [("x","t2 -> t'")] allE 1);
   504 by (eres_inst_tac [("x","n")] allE 1);
   506 by (eres_inst_tac [("x","n")] allE 1);
   505 by (safe_tac HOL_cs);
   507 by (safe_tac HOL_cs);
       
   508 (** LEVEL 26 **)
   506 by (eres_inst_tac [("x","R")] allE 1);
   509 by (eres_inst_tac [("x","R")] allE 1);
   507 by (eres_inst_tac [("x","$ S A")] allE 1);
   510 by (eres_inst_tac [("x","$ S A")] allE 1);
   508 by (eres_inst_tac [("x","t2")] allE 1);
   511 by (eres_inst_tac [("x","t2")] allE 1);
   509 by (eres_inst_tac [("x","m")] allE 1);
   512 by (eres_inst_tac [("x","m")] allE 1);
   510 by (dtac asm_rl 1);
   513 by (rotate_tac ~3 1);
   511 by (dtac asm_rl 1);
       
   512 by (dtac asm_rl 1);
       
   513 by (Asm_full_simp_tac 1);
   514 by (Asm_full_simp_tac 1);
   514 by (safe_tac HOL_cs);
   515 by (safe_tac HOL_cs);
   515 by (fast_tac HOL_cs 1);
       
   516 by (fast_tac (HOL_cs addIs [sym RS W_var_geD,new_tv_W RS
   516 by (fast_tac (HOL_cs addIs [sym RS W_var_geD,new_tv_W RS
   517         conjunct1,new_scheme_list_le,new_tv_subst_scheme_list]) 1);
   517         conjunct1,new_scheme_list_le,new_tv_subst_scheme_list]) 1);
   518 
   518 
   519 by (subgoal_tac
   519 by (subgoal_tac
   520   "$ (%x.if x=ma then t' else (if x:(free_tv t - free_tv Sa) then R x \
   520   "$ (%x.if x=ma then t' else (if x:(free_tv t - free_tv Sa) then R x \
   526     ("s","($ Ra ta) -> t'")] ssubst 2);
   526     ("s","($ Ra ta) -> t'")] ssubst 2);
   527 by (asm_simp_tac (!simpset addsimps [subst_comp_te]) 2);
   527 by (asm_simp_tac (!simpset addsimps [subst_comp_te]) 2);
   528 by (rtac eq_free_eq_subst_te 2);  
   528 by (rtac eq_free_eq_subst_te 2);  
   529 by (strip_tac 2);
   529 by (strip_tac 2);
   530 by (subgoal_tac "na ~=ma" 2);
   530 by (subgoal_tac "na ~=ma" 2);
   531 by (fast_tac (HOL_cs addDs [new_tv_W,sym RS W_var_geD,
   531 by (best_tac (HOL_cs addDs [new_tv_W,sym RS W_var_geD,
   532     new_tv_not_free_tv,new_tv_le]) 3);
   532     new_tv_not_free_tv,new_tv_le]) 3);
   533 by (case_tac "na:free_tv Sa" 2);
   533 by (case_tac "na:free_tv Sa" 2);
   534 (* n1 ~: free_tv S1 *)
   534 (* n1 ~: free_tv S1 *)
   535 by (forward_tac [not_free_impl_id] 3);
   535 by (forward_tac [not_free_impl_id] 3);
   536 by (asm_simp_tac (!simpset 
   536 by (asm_simp_tac (!simpset