src/HOL/ex/MT.ML
changeset 3842 b55686a7b22c
parent 2935 998cb95fdd43
child 4089 96fba19bcbe2
equal deleted inserted replaced
3841:22bbc1676768 3842:b55686a7b22c
    64 by (assume_tac 1);
    64 by (assume_tac 1);
    65 by (assume_tac 1);
    65 by (assume_tac 1);
    66 qed "lfp_elim2";
    66 qed "lfp_elim2";
    67 
    67 
    68 val prems = goal MT.thy
    68 val prems = goal MT.thy
    69   " [| x:lfp(f); mono(f); !!y. y:f(lfp(f) Int {x.P(x)}) ==> P(y) |] ==> \
    69   " [| x:lfp(f); mono(f); !!y. y:f(lfp(f) Int {x. P(x)}) ==> P(y) |] ==> \
    70 \   P(x)";
    70 \   P(x)";
    71 by (cut_facts_tac prems 1);
    71 by (cut_facts_tac prems 1);
    72 by (etac induct 1);
    72 by (etac induct 1);
    73 by (assume_tac 1);
    73 by (assume_tac 1);
    74 by (eresolve_tac prems 1);
    74 by (eresolve_tac prems 1);
   444 qed "elab_var_elim";
   444 qed "elab_var_elim";
   445 
   445 
   446 val prems = goal MT.thy 
   446 val prems = goal MT.thy 
   447   " te |- e ===> t ==> \
   447   " te |- e ===> t ==> \
   448 \   ( e = fn x1 => e1 --> \
   448 \   ( e = fn x1 => e1 --> \
   449 \     (? t1 t2.t=t_fun t1 t2 & te + {x1 |=> t1} |- e1 ===> t2) \
   449 \     (? t1 t2. t=t_fun t1 t2 & te + {x1 |=> t1} |- e1 ===> t2) \
   450 \   )";
   450 \   )";
   451 by (elab_e_elim_tac prems);
   451 by (elab_e_elim_tac prems);
   452 qed "elab_fn_elim_lem";
   452 qed "elab_fn_elim_lem";
   453 
   453 
   454 val prems = goal MT.thy 
   454 val prems = goal MT.thy 
   536 qed "hasty_rel_clos_coind";
   536 qed "hasty_rel_clos_coind";
   537 
   537 
   538 (* Elimination rule for hasty_rel *)
   538 (* Elimination rule for hasty_rel *)
   539 
   539 
   540 val prems = goalw MT.thy [hasty_rel_def]
   540 val prems = goalw MT.thy [hasty_rel_def]
   541   " [| !! c t.c isof t ==> P((v_const(c),t)); \
   541   " [| !! c t. c isof t ==> P((v_const(c),t)); \
   542 \      !! te ev e t ve. \
   542 \      !! te ev e t ve. \
   543 \        [| te |- fn ev => e ===> t; \
   543 \        [| te |- fn ev => e ===> t; \
   544 \           ve_dom(ve) = te_dom(te); \
   544 \           ve_dom(ve) = te_dom(te); \
   545 \           !ev1.ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
   545 \           !ev1. ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
   546 \        |] ==> P((v_clos(<|ev,e,ve|>),t)); \
   546 \        |] ==> P((v_clos(<|ev,e,ve|>),t)); \
   547 \      (v,t) : hasty_rel \
   547 \      (v,t) : hasty_rel \
   548 \   |] ==> P((v,t))";
   548 \   |] ==> P((v,t))";
   549 by (cut_facts_tac prems 1);
   549 by (cut_facts_tac prems 1);
   550 by (etac gfp_elim2 1);
   550 by (etac gfp_elim2 1);
   556 by (REPEAT (ares_tac prems 1));
   556 by (REPEAT (ares_tac prems 1));
   557 qed "hasty_rel_elim0";
   557 qed "hasty_rel_elim0";
   558 
   558 
   559 val prems = goal MT.thy 
   559 val prems = goal MT.thy 
   560   " [| (v,t) : hasty_rel; \
   560   " [| (v,t) : hasty_rel; \
   561 \      !! c t.c isof t ==> P (v_const c) t; \
   561 \      !! c t. c isof t ==> P (v_const c) t; \
   562 \      !! te ev e t ve. \
   562 \      !! te ev e t ve. \
   563 \        [| te |- fn ev => e ===> t; \
   563 \        [| te |- fn ev => e ===> t; \
   564 \           ve_dom(ve) = te_dom(te); \
   564 \           ve_dom(ve) = te_dom(te); \
   565 \           !ev1.ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
   565 \           !ev1. ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
   566 \        |] ==> P (v_clos <|ev,e,ve|>) t \
   566 \        |] ==> P (v_clos <|ev,e,ve|>) t \
   567 \   |] ==> P v t";
   567 \   |] ==> P v t";
   568 by (res_inst_tac [("P","P")] infsys_p2 1);
   568 by (res_inst_tac [("P","P")] infsys_p2 1);
   569 by (rtac hasty_rel_elim0 1);
   569 by (rtac hasty_rel_elim0 1);
   570 by (ALLGOALS (rtac infsys_p1));
   570 by (ALLGOALS (rtac infsys_p1));
   600 (* Elimination on closures for hasty *)
   600 (* Elimination on closures for hasty *)
   601 
   601 
   602 val prems = goalw MT.thy [hasty_env_def,hasty_def] 
   602 val prems = goalw MT.thy [hasty_env_def,hasty_def] 
   603   " v hasty t ==> \
   603   " v hasty t ==> \
   604 \   ! x e ve. \
   604 \   ! x e ve. \
   605 \     v=v_clos(<|x,e,ve|>) --> (? te.te |- fn x => e ===> t & ve hastyenv te)";
   605 \     v=v_clos(<|x,e,ve|>) --> (? te. te |- fn x => e ===> t & ve hastyenv te)";
   606 by (cut_facts_tac prems 1);
   606 by (cut_facts_tac prems 1);
   607 by (rtac hasty_rel_elim 1);
   607 by (rtac hasty_rel_elim 1);
   608 by (ALLGOALS (blast_tac (v_ext_cs HOL_cs)));
   608 by (ALLGOALS (blast_tac (v_ext_cs HOL_cs)));
   609 qed "hasty_elim_clos_lem";
   609 qed "hasty_elim_clos_lem";
   610 
   610 
   611 goal MT.thy 
   611 goal MT.thy 
   612   "!!t. v_clos(<|ev,e,ve|>) hasty t ==>  \
   612   "!!t. v_clos(<|ev,e,ve|>) hasty t ==>  \
   613 \       ? te.te |- fn ev => e ===> t & ve hastyenv te ";
   613 \       ? te. te |- fn ev => e ===> t & ve hastyenv te ";
   614 by (dtac hasty_elim_clos_lem 1);
   614 by (dtac hasty_elim_clos_lem 1);
   615 by (Blast_tac 1);
   615 by (Blast_tac 1);
   616 qed "hasty_elim_clos";
   616 qed "hasty_elim_clos";
   617 
   617 
   618 (* ############################################################ *)
   618 (* ############################################################ *)