src/HOLCF/Up2.ML
changeset 9248 e1dee89de037
parent 9245 428385c4bc50
child 12030 46d57d0290a2
equal deleted inserted replaced
9247:ad9f986616de 9248:e1dee89de037
    23 by (simp_tac (simpset() addsimps [less_up1a]) 1);
    23 by (simp_tac (simpset() addsimps [less_up1a]) 1);
    24 qed "minimal_up";
    24 qed "minimal_up";
    25 
    25 
    26 bind_thm ("UU_up_def",minimal_up RS minimal2UU RS sym);
    26 bind_thm ("UU_up_def",minimal_up RS minimal2UU RS sym);
    27 
    27 
    28 Goal "? x::'a u.!y. x<<y";
    28 Goal "EX x::'a u. ALL y. x<<y";
    29 by (res_inst_tac [("x","Abs_Up(Inl ())")] exI 1);
    29 by (res_inst_tac [("x","Abs_Up(Inl ())")] exI 1);
    30 by (rtac (minimal_up RS allI) 1);
    30 by (rtac (minimal_up RS allI) 1);
    31 qed "least_up";
    31 qed "least_up";
    32 
    32 
    33 (* -------------------------------------------------------------------------*)
    33 (* -------------------------------------------------------------------------*)
    44 
    44 
    45 (* ------------------------------------------------------------------------ *)
    45 (* ------------------------------------------------------------------------ *)
    46 (* Iup and Ifup are monotone                                               *)
    46 (* Iup and Ifup are monotone                                               *)
    47 (* ------------------------------------------------------------------------ *)
    47 (* ------------------------------------------------------------------------ *)
    48 
    48 
    49 val prems = goalw thy [monofun]  "monofun(Iup)";
    49 Goalw [monofun]  "monofun(Iup)";
    50 by (strip_tac 1);
    50 by (strip_tac 1);
    51 by (etac (less_up2c RS iffD2) 1);
    51 by (etac (less_up2c RS iffD2) 1);
    52 qed "monofun_Iup";
    52 qed "monofun_Iup";
    53 
    53 
    54 val prems = goalw thy [monofun]  "monofun(Ifup)";
    54 Goalw [monofun]  "monofun(Ifup)";
    55 by (strip_tac 1);
    55 by (strip_tac 1);
    56 by (rtac (less_fun RS iffD2) 1);
    56 by (rtac (less_fun RS iffD2) 1);
    57 by (strip_tac 1);
    57 by (strip_tac 1);
    58 by (res_inst_tac [("p","xa")] upE 1);
    58 by (res_inst_tac [("p","xa")] upE 1);
    59 by (asm_simp_tac Up0_ss 1);
    59 by (asm_simp_tac Up0_ss 1);
    60 by (asm_simp_tac Up0_ss 1);
    60 by (asm_simp_tac Up0_ss 1);
    61 by (etac monofun_cfun_fun 1);
    61 by (etac monofun_cfun_fun 1);
    62 qed "monofun_Ifup1";
    62 qed "monofun_Ifup1";
    63 
    63 
    64 val prems = goalw thy [monofun]  "monofun(Ifup(f))";
    64 Goalw [monofun]  "monofun(Ifup(f))";
    65 by (strip_tac 1);
    65 by (strip_tac 1);
    66 by (res_inst_tac [("p","x")] upE 1);
    66 by (res_inst_tac [("p","x")] upE 1);
    67 by (asm_simp_tac Up0_ss 1);
    67 by (asm_simp_tac Up0_ss 1);
    68 by (asm_simp_tac Up0_ss 1);
    68 by (asm_simp_tac Up0_ss 1);
    69 by (res_inst_tac [("p","y")] upE 1);
    69 by (res_inst_tac [("p","y")] upE 1);
    87 
    87 
    88 (* ------------------------------------------------------------------------ *)
    88 (* ------------------------------------------------------------------------ *)
    89 (* ('a)u is a cpo                                                           *)
    89 (* ('a)u is a cpo                                                           *)
    90 (* ------------------------------------------------------------------------ *)
    90 (* ------------------------------------------------------------------------ *)
    91 
    91 
    92 Goal "[|chain(Y);? i x. Y(i)=Iup(x)|] \
    92 Goal "[|chain(Y);EX i x. Y(i)=Iup(x)|] \
    93 \     ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))";
    93 \     ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))";
    94 by (rtac is_lubI 1);
    94 by (rtac is_lubI 1);
    95 by (rtac conjI 1);
       
    96 by (rtac ub_rangeI 1);
    95 by (rtac ub_rangeI 1);
    97 by (rtac allI 1);
       
    98 by (res_inst_tac [("p","Y(i)")] upE 1);
    96 by (res_inst_tac [("p","Y(i)")] upE 1);
    99 by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1);
    97 by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1);
   100 by (etac sym 1);
    98 by (etac sym 1);
   101 by (rtac minimal_up 1);
    99 by (rtac minimal_up 1);
   102 by (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1);
   100 by (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1);
   111 by (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1);
   109 by (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1);
   112 by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
   110 by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
   113 by (atac 1);
   111 by (atac 1);
   114 by (rtac less_up2b 1);
   112 by (rtac less_up2b 1);
   115 by (hyp_subst_tac 1);
   113 by (hyp_subst_tac 1);
   116 by (etac (ub_rangeE RS spec) 1);
   114 by (etac ub_rangeD 1);
   117 by (res_inst_tac [("t","u")] (up_lemma1 RS subst) 1);
   115 by (res_inst_tac [("t","u")] (up_lemma1 RS subst) 1);
   118 by (atac 1);
   116 by (atac 1);
   119 by (rtac (less_up2c RS iffD2) 1);
   117 by (rtac (less_up2c RS iffD2) 1);
   120 by (rtac is_lub_thelub 1);
   118 by (rtac is_lub_thelub 1);
   121 by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
   119 by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
   122 by (etac (monofun_Ifup2 RS ub2ub_monofun) 1);
   120 by (etac (monofun_Ifup2 RS ub2ub_monofun) 1);
   123 qed "lub_up1a";
   121 qed "lub_up1a";
   124 
   122 
   125 Goal "[|chain(Y);!i x. Y(i)~=Iup(x)|] ==> range(Y) <<| Abs_Up (Inl ())";
   123 Goal "[|chain(Y); ALL i x. Y(i)~=Iup(x)|] ==> range(Y) <<| Abs_Up (Inl ())";
   126 by (rtac is_lubI 1);
   124 by (rtac is_lubI 1);
   127 by (rtac conjI 1);
       
   128 by (rtac ub_rangeI 1);
   125 by (rtac ub_rangeI 1);
   129 by (rtac allI 1);
       
   130 by (res_inst_tac [("p","Y(i)")] upE 1);
   126 by (res_inst_tac [("p","Y(i)")] upE 1);
   131 by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1);
   127 by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1);
   132 by (atac 1);
   128 by (atac 1);
   133 by (rtac refl_less 1);
   129 by (rtac refl_less 1);
   134 by (rtac notE 1);
   130 by (rtac notE 1);
   140 by (rtac minimal_up 1);
   136 by (rtac minimal_up 1);
   141 qed "lub_up1b";
   137 qed "lub_up1b";
   142 
   138 
   143 bind_thm ("thelub_up1a", lub_up1a RS thelubI);
   139 bind_thm ("thelub_up1a", lub_up1a RS thelubI);
   144 (*
   140 (*
   145 [| chain ?Y1; ? i x. ?Y1 i = Iup x |] ==>
   141 [| chain ?Y1; EX i x. ?Y1 i = Iup x |] ==>
   146  lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i))))
   142  lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i))))
   147 *)
   143 *)
   148 
   144 
   149 bind_thm ("thelub_up1b", lub_up1b RS thelubI);
   145 bind_thm ("thelub_up1b", lub_up1b RS thelubI);
   150 (*
   146 (*
   151 [| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==>
   147 [| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==>
   152  lub (range ?Y1) = UU_up
   148  lub (range ?Y1) = UU_up
   153 *)
   149 *)
   154 
   150 
   155 Goal "chain(Y::nat=>('a)u) ==> ? x. range(Y) <<|x";
   151 Goal "chain(Y::nat=>('a)u) ==> EX x. range(Y) <<|x";
   156 by (rtac disjE 1);
   152 by (rtac disjE 1);
   157 by (rtac exI 2);
   153 by (rtac exI 2);
   158 by (etac lub_up1a 2);
   154 by (etac lub_up1a 2);
   159 by (atac 2);
   155 by (atac 2);
   160 by (rtac exI 2);
   156 by (rtac exI 2);