| author | paulson | 
| Thu, 29 Jun 2000 12:15:08 +0200 | |
| changeset 9187 | 68ecc04785f1 | 
| parent 9169 | 85a47aa21f74 | 
| child 9245 | 428385c4bc50 | 
| permissions | -rw-r--r-- | 
| 2278 | 1 | (* Title: HOLCF/Up2.ML | 
| 2 | ID: $Id$ | |
| 3 | Author: Franz Regensburger | |
| 4 | Copyright 1993 Technische Universitaet Muenchen | |
| 5 | ||
| 2640 | 6 | Lemmas for Up2.thy | 
| 2278 | 7 | *) | 
| 8 | ||
| 2640 | 9 | (* for compatibility with old HOLCF-Version *) | 
| 9169 | 10 | Goal "(op <<)=(%x1 x2. case Rep_Up(x1) of \ | 
| 2640 | 11 | \ Inl(y1) => True \ | 
| 12 | \ | Inr(y2) => (case Rep_Up(x2) of Inl(z1) => False \ | |
| 9169 | 13 | \ | Inr(z2) => y2<<z2))"; | 
| 14 | by (fold_goals_tac [less_up_def]); | |
| 15 | by (rtac refl 1); | |
| 16 | qed "inst_up_po"; | |
| 2640 | 17 | |
| 2278 | 18 | (* -------------------------------------------------------------------------*) | 
| 19 | (* type ('a)u is pointed                                                    *)
 | |
| 20 | (* ------------------------------------------------------------------------ *) | |
| 21 | ||
| 9169 | 22 | Goal "Abs_Up(Inl ()) << z"; | 
| 23 | by (simp_tac (simpset() addsimps [less_up1a]) 1); | |
| 24 | qed "minimal_up"; | |
| 2640 | 25 | |
| 26 | bind_thm ("UU_up_def",minimal_up RS minimal2UU RS sym);
 | |
| 27 | ||
| 9169 | 28 | Goal "? x::'a u.!y. x<<y"; | 
| 29 | by (res_inst_tac [("x","Abs_Up(Inl ())")] exI 1);
 | |
| 30 | by (rtac (minimal_up RS allI) 1); | |
| 31 | qed "least_up"; | |
| 2278 | 32 | |
| 33 | (* -------------------------------------------------------------------------*) | |
| 34 | (* access to less_up in class po *) | |
| 35 | (* ------------------------------------------------------------------------ *) | |
| 36 | ||
| 9169 | 37 | Goal "~ Iup(x) << Abs_Up(Inl ())"; | 
| 38 | by (simp_tac (simpset() addsimps [less_up1b]) 1); | |
| 39 | qed "less_up2b"; | |
| 2278 | 40 | |
| 9169 | 41 | Goal "(Iup(x)<<Iup(y)) = (x<<y)"; | 
| 42 | by (simp_tac (simpset() addsimps [less_up1c]) 1); | |
| 43 | qed "less_up2c"; | |
| 2278 | 44 | |
| 45 | (* ------------------------------------------------------------------------ *) | |
| 46 | (* Iup and Ifup are monotone *) | |
| 47 | (* ------------------------------------------------------------------------ *) | |
| 48 | ||
| 2640 | 49 | qed_goalw "monofun_Iup" thy [monofun] "monofun(Iup)" | 
| 2278 | 50 | (fn prems => | 
| 51 | [ | |
| 52 | (strip_tac 1), | |
| 53 | (etac (less_up2c RS iffD2) 1) | |
| 54 | ]); | |
| 55 | ||
| 2640 | 56 | qed_goalw "monofun_Ifup1" thy [monofun] "monofun(Ifup)" | 
| 2278 | 57 | (fn prems => | 
| 58 | [ | |
| 59 | (strip_tac 1), | |
| 60 | (rtac (less_fun RS iffD2) 1), | |
| 61 | (strip_tac 1), | |
| 62 |         (res_inst_tac [("p","xa")] upE 1),
 | |
| 63 | (asm_simp_tac Up0_ss 1), | |
| 64 | (asm_simp_tac Up0_ss 1), | |
| 65 | (etac monofun_cfun_fun 1) | |
| 66 | ]); | |
| 67 | ||
| 2640 | 68 | qed_goalw "monofun_Ifup2" thy [monofun] "monofun(Ifup(f))" | 
| 2278 | 69 | (fn prems => | 
| 70 | [ | |
| 71 | (strip_tac 1), | |
| 72 |         (res_inst_tac [("p","x")] upE 1),
 | |
| 73 | (asm_simp_tac Up0_ss 1), | |
| 74 | (asm_simp_tac Up0_ss 1), | |
| 75 |         (res_inst_tac [("p","y")] upE 1),
 | |
| 76 | (hyp_subst_tac 1), | |
| 77 | (rtac notE 1), | |
| 78 | (rtac less_up2b 1), | |
| 79 | (atac 1), | |
| 80 | (asm_simp_tac Up0_ss 1), | |
| 81 | (rtac monofun_cfun_arg 1), | |
| 82 | (hyp_subst_tac 1), | |
| 83 | (etac (less_up2c RS iffD1) 1) | |
| 84 | ]); | |
| 85 | ||
| 86 | (* ------------------------------------------------------------------------ *) | |
| 87 | (* Some kind of surjectivity lemma *) | |
| 88 | (* ------------------------------------------------------------------------ *) | |
| 89 | ||
| 9169 | 90 | Goal "z=Iup(x) ==> Iup(Ifup(LAM x. x)(z)) = z"; | 
| 91 | by (asm_simp_tac Up0_ss 1); | |
| 92 | qed "up_lemma1"; | |
| 2278 | 93 | |
| 94 | (* ------------------------------------------------------------------------ *) | |
| 95 | (* ('a)u is a cpo                                                           *)
 | |
| 96 | (* ------------------------------------------------------------------------ *) | |
| 97 | ||
| 9169 | 98 | Goal "[|chain(Y);? i x. Y(i)=Iup(x)|] \ | 
| 99 | \ ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))"; | |
| 100 | by (rtac is_lubI 1); | |
| 101 | by (rtac conjI 1); | |
| 102 | by (rtac ub_rangeI 1); | |
| 103 | by (rtac allI 1); | |
| 104 | by (res_inst_tac [("p","Y(i)")] upE 1);
 | |
| 105 | by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1);
 | |
| 106 | by (etac sym 1); | |
| 107 | by (rtac minimal_up 1); | |
| 108 | by (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1);
 | |
| 109 | by (atac 1); | |
| 110 | by (rtac (less_up2c RS iffD2) 1); | |
| 111 | by (rtac is_ub_thelub 1); | |
| 112 | by (etac (monofun_Ifup2 RS ch2ch_monofun) 1); | |
| 113 | by (strip_tac 1); | |
| 114 | by (res_inst_tac [("p","u")] upE 1);
 | |
| 115 | by (etac exE 1); | |
| 116 | by (etac exE 1); | |
| 117 | by (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1);
 | |
| 118 | by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
 | |
| 119 | by (atac 1); | |
| 120 | by (rtac less_up2b 1); | |
| 121 | by (hyp_subst_tac 1); | |
| 122 | by (etac (ub_rangeE RS spec) 1); | |
| 123 | by (res_inst_tac [("t","u")] (up_lemma1 RS subst) 1);
 | |
| 124 | by (atac 1); | |
| 125 | by (rtac (less_up2c RS iffD2) 1); | |
| 126 | by (rtac is_lub_thelub 1); | |
| 127 | by (etac (monofun_Ifup2 RS ch2ch_monofun) 1); | |
| 128 | by (etac (monofun_Ifup2 RS ub2ub_monofun) 1); | |
| 129 | qed "lub_up1a"; | |
| 2278 | 130 | |
| 9169 | 131 | Goal "[|chain(Y);!i x. Y(i)~=Iup(x)|] ==> range(Y) <<| Abs_Up (Inl ())"; | 
| 132 | by (rtac is_lubI 1); | |
| 133 | by (rtac conjI 1); | |
| 134 | by (rtac ub_rangeI 1); | |
| 135 | by (rtac allI 1); | |
| 136 | by (res_inst_tac [("p","Y(i)")] upE 1);
 | |
| 137 | by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1);
 | |
| 138 | by (atac 1); | |
| 139 | by (rtac refl_less 1); | |
| 140 | by (rtac notE 1); | |
| 141 | by (dtac spec 1); | |
| 142 | by (dtac spec 1); | |
| 143 | by (atac 1); | |
| 144 | by (atac 1); | |
| 145 | by (strip_tac 1); | |
| 146 | by (rtac minimal_up 1); | |
| 147 | qed "lub_up1b"; | |
| 2278 | 148 | |
| 149 | bind_thm ("thelub_up1a", lub_up1a RS thelubI);
 | |
| 150 | (* | |
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 151 | [| chain ?Y1; ? i x. ?Y1 i = Iup x |] ==> | 
| 2278 | 152 | lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i)))) | 
| 153 | *) | |
| 154 | ||
| 155 | bind_thm ("thelub_up1b", lub_up1b RS thelubI);
 | |
| 156 | (* | |
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 157 | [| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==> | 
| 2278 | 158 | lub (range ?Y1) = UU_up | 
| 159 | *) | |
| 160 | ||
| 9169 | 161 | Goal "chain(Y::nat=>('a)u) ==> ? x. range(Y) <<|x";
 | 
| 162 | by (rtac disjE 1); | |
| 163 | by (rtac exI 2); | |
| 164 | by (etac lub_up1a 2); | |
| 165 | by (atac 2); | |
| 166 | by (rtac exI 2); | |
| 167 | by (etac lub_up1b 2); | |
| 168 | by (atac 2); | |
| 169 | by (fast_tac HOL_cs 1); | |
| 170 | qed "cpo_up"; | |
| 2278 | 171 |