| author | paulson | 
| Thu, 17 Jun 1999 10:35:01 +0200 | |
| changeset 6833 | 15d6c121d75f | 
| parent 6826 | 02c4dd469ec0 | 
| child 6835 | 588f791ee737 | 
| permissions | -rw-r--r-- | 
| 5899 | 1 | (* Title: HOL/UNITY/PPROD.ML | 
| 2 | ID: $Id$ | |
| 3 | Author: Lawrence C Paulson, Cambridge University Computer Laboratory | |
| 4 | Copyright 1998 University of Cambridge | |
| 5 | *) | |
| 6 | ||
| 6020 | 7 | |
| 8 | val rinst = read_instantiate_sg (sign_of thy); | |
| 9 | ||
| 5899 | 10 | (**** PPROD ****) | 
| 11 | ||
| 12 | (*** Basic properties ***) | |
| 13 | ||
| 6020 | 14 | Goalw [lift_set_def] "(f : lift_set i A) = (f i : A)"; | 
| 15 | by Auto_tac; | |
| 16 | qed "lift_set_iff"; | |
| 17 | AddIffs [lift_set_iff]; | |
| 18 | ||
| 6826 | 19 | Goalw [lift_set_def] "lift_set i (A Int B) = lift_set i A Int lift_set i B"; | 
| 20 | by Auto_tac; | |
| 21 | qed "lift_set_Int"; | |
| 22 | ||
| 6295 
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
 paulson parents: 
6020diff
changeset | 23 | Goalw [lift_act_def] "lift_act i Id = Id"; | 
| 5899 | 24 | by Auto_tac; | 
| 6295 
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
 paulson parents: 
6020diff
changeset | 25 | qed "lift_act_Id"; | 
| 
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
 paulson parents: 
6020diff
changeset | 26 | Addsimps [lift_act_Id]; | 
| 5899 | 27 | |
| 6299 | 28 | Goalw [lift_prog_def] "Init (lift_prog i F) = lift_set i (Init F)"; | 
| 5972 | 29 | by Auto_tac; | 
| 30 | qed "Init_lift_prog"; | |
| 31 | Addsimps [Init_lift_prog]; | |
| 32 | ||
| 33 | Goalw [lift_prog_def] "Acts (lift_prog i F) = lift_act i `` Acts F"; | |
| 6295 
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
 paulson parents: 
6020diff
changeset | 34 | by (auto_tac (claset() addIs [Id_in_Acts RSN (2,image_eqI)], simpset())); | 
| 5972 | 35 | qed "Acts_lift_prog"; | 
| 36 | ||
| 6826 | 37 | |
| 38 | (** Injectivity of lift_set, lift_act, lift_prog **) | |
| 39 | ||
| 40 | Goalw [inj_on_def] "inj (lift_set i)"; | |
| 41 | by (simp_tac (simpset() addsimps [lift_set_def]) 1); | |
| 42 | by (fast_tac (claset() addEs [equalityE]) 1); | |
| 43 | qed "inj_lift_set"; | |
| 44 | ||
| 45 | Goalw [lift_act_def] "lift_act i x <= lift_act i y ==> x <= y"; | |
| 46 | by Auto_tac; | |
| 47 | by (dres_inst_tac [("c", "((%s. a), (%s. a)(i:=b))")] subsetD 1);
 | |
| 48 | by Auto_tac; | |
| 49 | by (dres_inst_tac [("x", "i")] fun_cong 1);
 | |
| 50 | by Auto_tac; | |
| 51 | val lemma = result(); | |
| 52 | ||
| 53 | Goalw [inj_on_def] "inj (lift_act i)"; | |
| 54 | by (blast_tac (claset() addEs [equalityE] | |
| 55 | addDs [lemma]) 1); | |
| 56 | qed "inj_lift_act"; | |
| 57 | ||
| 58 | Goal "insert Id (lift_act i `` Acts F) = (lift_act i `` Acts F)"; | |
| 59 | by (rtac (image_eqI RS insert_absorb) 1); | |
| 60 | by (rtac Id_in_Acts 2); | |
| 61 | by (rtac (lift_act_Id RS sym) 1); | |
| 62 | qed "insert_Id_lift_act_eq"; | |
| 63 | ||
| 64 | Goalw [inj_on_def] "inj (lift_prog i)"; | |
| 65 | by (simp_tac (simpset() addsimps [lift_prog_def]) 1); | |
| 66 | by Auto_tac; | |
| 67 | by (etac program_equalityE 1); | |
| 68 | by (full_simp_tac | |
| 69 | (simpset() addsimps [insert_Id_lift_act_eq, inj_lift_set RS inj_eq, | |
| 70 | inj_lift_act RS inj_image_eq_iff]) 1); | |
| 71 | by (blast_tac (claset() addSIs [program_equalityI]) 1); | |
| 72 | qed "inj_lift_prog"; | |
| 73 | ||
| 74 | ||
| 75 | ||
| 76 | (** PPROD **) | |
| 77 | ||
| 6020 | 78 | Goalw [PPROD_def] "Init (PPROD I F) = (INT i:I. lift_set i (Init (F i)))"; | 
| 5972 | 79 | by Auto_tac; | 
| 80 | qed "Init_PPROD"; | |
| 81 | Addsimps [Init_PPROD]; | |
| 82 | ||
| 5899 | 83 | Goalw [lift_act_def] | 
| 84 | "((f,f') : lift_act i act) = (EX s'. f' = f(i := s') & (f i, s') : act)"; | |
| 85 | by (Blast_tac 1); | |
| 86 | qed "lift_act_eq"; | |
| 87 | AddIffs [lift_act_eq]; | |
| 88 | ||
| 6299 | 89 | Goal "Acts (PPROD I F) = insert Id (UN i:I. lift_act i `` Acts (F i))"; | 
| 5899 | 90 | by (auto_tac (claset(), | 
| 5972 | 91 | simpset() addsimps [PPROD_def, Acts_lift_prog, Acts_JN])); | 
| 5899 | 92 | qed "Acts_PPROD"; | 
| 93 | ||
| 94 | Goal "PPROD {} F = SKIP";
 | |
| 95 | by (simp_tac (simpset() addsimps [PPROD_def]) 1); | |
| 96 | qed "PPROD_empty"; | |
| 97 | ||
| 6299 | 98 | Goal "(PPI i: I. SKIP) = SKIP"; | 
| 99 | by (auto_tac (claset() addSIs [program_equalityI], | |
| 100 | simpset() addsimps [Acts_lift_prog, SKIP_def, Acts_PPROD])); | |
| 101 | qed "PPROD_SKIP"; | |
| 102 | ||
| 5899 | 103 | Addsimps [PPROD_SKIP, PPROD_empty]; | 
| 104 | ||
| 5972 | 105 | Goalw [PPROD_def] | 
| 106 | "PPROD (insert i I) F = (lift_prog i (F i)) Join (PPROD I F)"; | |
| 5899 | 107 | by Auto_tac; | 
| 108 | qed "PPROD_insert"; | |
| 109 | ||
| 6646 | 110 | Goalw [PPROD_def] "i : I ==> (lift_prog i (F i)) component (PPROD I F)"; | 
| 5972 | 111 | (*blast_tac doesn't use HO unification*) | 
| 112 | by (fast_tac (claset() addIs [component_JN]) 1); | |
| 113 | qed "component_PPROD"; | |
| 5899 | 114 | |
| 5972 | 115 | |
| 6536 | 116 | (*** Safety: co, stable, invariant ***) | 
| 5972 | 117 | |
| 118 | (** 1st formulation of lifting **) | |
| 5899 | 119 | |
| 6536 | 120 | Goal "(lift_prog i F : (lift_set i A) co (lift_set i B)) = \ | 
| 121 | \ (F : A co B)"; | |
| 5972 | 122 | by (auto_tac (claset(), | 
| 123 | simpset() addsimps [constrains_def, Acts_lift_prog])); | |
| 124 | by (Blast_tac 2); | |
| 125 | by (Force_tac 1); | |
| 126 | qed "lift_prog_constrains_eq"; | |
| 127 | ||
| 6020 | 128 | Goal "(lift_prog i F : stable (lift_set i A)) = (F : stable A)"; | 
| 5972 | 129 | by (simp_tac (simpset() addsimps [stable_def, lift_prog_constrains_eq]) 1); | 
| 130 | qed "lift_prog_stable_eq"; | |
| 131 | ||
| 132 | (*This one looks strange! Proof probably is by case analysis on i=j.*) | |
| 6536 | 133 | Goal "F i : A co B \ | 
| 134 | \ ==> lift_prog j (F j) : (lift_set i A) co (lift_set i B)"; | |
| 5972 | 135 | by (auto_tac (claset(), | 
| 136 | simpset() addsimps [constrains_def, Acts_lift_prog])); | |
| 137 | by (REPEAT (Blast_tac 1)); | |
| 138 | qed "constrains_imp_lift_prog_constrains"; | |
| 5899 | 139 | |
| 140 | Goal "i : I ==> \ | |
| 6536 | 141 | \ (PPROD I F : (lift_set i A) co (lift_set i B)) = \ | 
| 142 | \ (F i : A co B)"; | |
| 5972 | 143 | by (asm_simp_tac (simpset() addsimps [PPROD_def, constrains_JN]) 1); | 
| 144 | by (blast_tac (claset() addIs [lift_prog_constrains_eq RS iffD1, | |
| 145 | constrains_imp_lift_prog_constrains]) 1); | |
| 5899 | 146 | qed "PPROD_constrains"; | 
| 147 | ||
| 6020 | 148 | Goal "i : I ==> (PPROD I F : stable (lift_set i A)) = (F i : stable A)"; | 
| 5972 | 149 | by (asm_simp_tac (simpset() addsimps [stable_def, PPROD_constrains]) 1); | 
| 150 | qed "PPROD_stable"; | |
| 151 | ||
| 152 | ||
| 153 | (** 2nd formulation of lifting **) | |
| 154 | ||
| 6536 | 155 | Goal "[| lift_prog i F : AA co BB |] \ | 
| 156 | \ ==> F : (Applyall AA i) co (Applyall BB i)"; | |
| 5899 | 157 | by (auto_tac (claset(), | 
| 158 | simpset() addsimps [Applyall_def, constrains_def, | |
| 5972 | 159 | Acts_lift_prog])); | 
| 160 | by (force_tac (claset() addSIs [rinst [("x", "?ff(i := ?u)")] image_eqI],
 | |
| 5899 | 161 | simpset()) 1); | 
| 5972 | 162 | qed "lift_prog_constrains_projection"; | 
| 163 | ||
| 6536 | 164 | Goal "[| PPROD I F : AA co BB; i: I |] \ | 
| 165 | \ ==> F i : (Applyall AA i) co (Applyall BB i)"; | |
| 5972 | 166 | by (rtac lift_prog_constrains_projection 1); | 
| 167 | (*rotate this assumption to be last*) | |
| 168 | by (dres_inst_tac [("psi", "PPROD I F : ?C")] asm_rl 1);
 | |
| 169 | by (asm_full_simp_tac (simpset() addsimps [PPROD_def, constrains_JN]) 1); | |
| 5899 | 170 | qed "PPROD_constrains_projection"; | 
| 171 | ||
| 172 | ||
| 5972 | 173 | (** invariant **) | 
| 174 | ||
| 6451 | 175 | (*UNUSED*) | 
| 176 | Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)"; | |
| 5972 | 177 | by (auto_tac (claset(), | 
| 178 | simpset() addsimps [invariant_def, lift_prog_stable_eq])); | |
| 6451 | 179 | qed "lift_prog_invariant_eq"; | 
| 5899 | 180 | |
| 6299 | 181 | Goal "[| F i : invariant A; i : I |] \ | 
| 182 | \ ==> PPROD I F : invariant (lift_set i A)"; | |
| 5972 | 183 | by (auto_tac (claset(), | 
| 184 | simpset() addsimps [invariant_def, PPROD_stable])); | |
| 185 | qed "invariant_imp_PPROD_invariant"; | |
| 186 | ||
| 187 | (*The f0 premise ensures that the product is well-defined.*) | |
| 6020 | 188 | Goal "[| PPROD I F : invariant (lift_set i A); i : I; \ | 
| 5972 | 189 | \ f0: Init (PPROD I F) |] ==> F i : invariant A"; | 
| 5899 | 190 | by (auto_tac (claset(), | 
| 191 | simpset() addsimps [invariant_def, PPROD_stable])); | |
| 5972 | 192 | by (dres_inst_tac [("c", "f0(i:=x)")] subsetD 1);
 | 
| 193 | by Auto_tac; | |
| 194 | qed "PPROD_invariant_imp_invariant"; | |
| 195 | ||
| 196 | Goal "[| i : I; f0: Init (PPROD I F) |] \ | |
| 6020 | 197 | \ ==> (PPROD I F : invariant (lift_set i A)) = (F i : invariant A)"; | 
| 5972 | 198 | by (blast_tac (claset() addIs [invariant_imp_PPROD_invariant, | 
| 199 | PPROD_invariant_imp_invariant]) 1); | |
| 5899 | 200 | qed "PPROD_invariant"; | 
| 201 | ||
| 5972 | 202 | (*The f0 premise isn't needed if F is a constant program because then | 
| 203 | we get an initial state by replicating that of F*) | |
| 204 | Goal "i : I \ | |
| 6020 | 205 | \ ==> ((PPI x:I. F) : invariant (lift_set i A)) = (F : invariant A)"; | 
| 5972 | 206 | by (auto_tac (claset(), | 
| 207 | simpset() addsimps [invariant_def, PPROD_stable])); | |
| 208 | qed "PFUN_invariant"; | |
| 209 | ||
| 5899 | 210 | |
| 6536 | 211 | (*** Substitution Axiom versions: Co, Stable ***) | 
| 5899 | 212 | |
| 6826 | 213 | (*** Reachability ***) | 
| 214 | ||
| 215 | (** for lift_prog **) | |
| 216 | ||
| 217 | Goal "s : reachable F ==> f(i:=s) : reachable (lift_prog i F)"; | |
| 218 | by (etac reachable.induct 1); | |
| 219 | by (force_tac (claset() addIs [reachable.Acts, ext], | |
| 220 | simpset() addsimps [Acts_lift_prog]) 2); | |
| 221 | by (force_tac (claset() addIs [reachable.Init], simpset()) 1); | |
| 222 | qed "reachable_lift_progI"; | |
| 223 | ||
| 224 | Goal "f : reachable (lift_prog i F) ==> f i : reachable F"; | |
| 225 | by (etac reachable.induct 1); | |
| 226 | by (auto_tac (claset(), simpset() addsimps [Acts_lift_prog])); | |
| 227 | by (ALLGOALS (blast_tac (claset() addIs reachable.intrs))); | |
| 228 | qed "reachable_lift_progD"; | |
| 229 | ||
| 230 | Goal "reachable (lift_prog i F) = lift_set i (reachable F)"; | |
| 231 | auto(); | |
| 232 | be reachable_lift_progD 1; | |
| 233 | ren "f" 1; | |
| 234 | by (dres_inst_tac [("f","f"),("i","i")] reachable_lift_progI 1);
 | |
| 235 | auto(); | |
| 236 | qed "reachable_lift_prog"; | |
| 237 | ||
| 238 | Goal "(lift_prog i F : (lift_set i A) Co (lift_set i B)) = \ | |
| 239 | \ (F : A Co B)"; | |
| 240 | by (simp_tac (simpset() addsimps [Constrains_def, reachable_lift_prog, | |
| 241 | lift_set_Int RS sym, | |
| 242 | lift_prog_constrains_eq]) 1); | |
| 243 | qed "lift_prog_Constrains_eq"; | |
| 244 | ||
| 245 | Goal "(lift_prog i F : Stable (lift_set i A)) = (F : Stable A)"; | |
| 246 | by (simp_tac (simpset() addsimps [Stable_def, lift_prog_Constrains_eq]) 1); | |
| 247 | qed "lift_prog_Stable_eq"; | |
| 248 | ||
| 249 | ||
| 250 | (** Reachability for PPROD **) | |
| 5972 | 251 | |
| 252 | Goal "[| f : reachable (PPROD I F); i : I |] ==> f i : reachable (F i)"; | |
| 5899 | 253 | by (etac reachable.induct 1); | 
| 254 | by (auto_tac | |
| 255 | (claset() addIs reachable.intrs, | |
| 256 | simpset() addsimps [Acts_PPROD])); | |
| 257 | qed "reachable_PPROD"; | |
| 258 | ||
| 5972 | 259 | Goal "reachable (PPROD I F) <= {f. ALL i:I. f i : reachable (F i)}";
 | 
| 5899 | 260 | by (force_tac (claset() addSDs [reachable_PPROD], simpset()) 1); | 
| 261 | qed "reachable_PPROD_subset1"; | |
| 262 | ||
| 6826 | 263 | (*simplify using reachable_lift_prog??*) | 
| 5972 | 264 | Goal "[| i ~: I; A : reachable (F i) |] \ | 
| 265 | \ ==> ALL f. f : reachable (PPROD I F) \ | |
| 266 | \ --> f(i:=A) : reachable (lift_prog i (F i) Join PPROD I F)"; | |
| 5899 | 267 | by (etac reachable.induct 1); | 
| 268 | by (ALLGOALS Clarify_tac); | |
| 269 | by (etac reachable.induct 1); | |
| 270 | (*Init, Init case*) | |
| 6826 | 271 | by (force_tac (claset() addIs reachable.intrs, simpset()) 1); | 
| 5899 | 272 | (*Init of F, action of PPROD F case*) | 
| 5972 | 273 | by (rtac reachable.Acts 1); | 
| 5899 | 274 | by (force_tac (claset(), simpset() addsimps [Acts_Join]) 1); | 
| 5972 | 275 | by (assume_tac 1); | 
| 5899 | 276 | by (force_tac (claset() addIs [ext], simpset() addsimps [Acts_PPROD]) 1); | 
| 277 | (*induction over the 2nd "reachable" assumption*) | |
| 278 | by (eres_inst_tac [("xa","f")] reachable.induct 1);
 | |
| 279 | (*Init of PPROD F, action of F case*) | |
| 280 | by (res_inst_tac [("act","lift_act i act")] reachable.Acts 1);
 | |
| 5972 | 281 | by (force_tac (claset(), simpset() addsimps [Acts_lift_prog, Acts_Join]) 1); | 
| 5899 | 282 | by (force_tac (claset() addIs [reachable.Init], simpset()) 1); | 
| 283 | by (force_tac (claset() addIs [ext], simpset() addsimps [lift_act_def]) 1); | |
| 284 | (*last case: an action of PPROD I F*) | |
| 5972 | 285 | by (rtac reachable.Acts 1); | 
| 5899 | 286 | by (force_tac (claset(), simpset() addsimps [Acts_Join]) 1); | 
| 5972 | 287 | by (assume_tac 1); | 
| 5899 | 288 | by (force_tac (claset() addIs [ext], simpset() addsimps [Acts_PPROD]) 1); | 
| 289 | qed_spec_mp "reachable_lift_Join_PPROD"; | |
| 290 | ||
| 291 | ||
| 292 | (*The index set must be finite: otherwise infinitely many copies of F can | |
| 293 | perform actions, and PPROD can never catch up in finite time.*) | |
| 5972 | 294 | Goal "finite I \ | 
| 295 | \     ==> {f. ALL i:I. f i : reachable (F i)} <= reachable (PPROD I F)";
 | |
| 5899 | 296 | by (etac finite_induct 1); | 
| 297 | by (Simp_tac 1); | |
| 298 | by (force_tac (claset() addDs [reachable_lift_Join_PPROD], | |
| 299 | simpset() addsimps [PPROD_insert]) 1); | |
| 300 | qed "reachable_PPROD_subset2"; | |
| 301 | ||
| 5972 | 302 | Goal "finite I ==> \ | 
| 303 | \     reachable (PPROD I F) = {f. ALL i:I. f i : reachable (F i)}";
 | |
| 5899 | 304 | by (REPEAT_FIRST (ares_tac [equalityI, | 
| 305 | reachable_PPROD_subset1, | |
| 306 | reachable_PPROD_subset2])); | |
| 307 | qed "reachable_PPROD_eq"; | |
| 308 | ||
| 309 | ||
| 6536 | 310 | (** Co **) | 
| 5899 | 311 | |
| 6536 | 312 | Goal "[| F i : A Co B; i: I; finite I |] \ | 
| 313 | \ ==> PPROD I F : (lift_set i A) Co (lift_set i B)"; | |
| 5899 | 314 | by (auto_tac | 
| 315 | (claset(), | |
| 316 | simpset() addsimps [Constrains_def, Collect_conj_eq RS sym, | |
| 317 | reachable_PPROD_eq])); | |
| 318 | by (auto_tac (claset(), | |
| 5972 | 319 | simpset() addsimps [constrains_def, Acts_lift_prog, PPROD_def, | 
| 5899 | 320 | Acts_JN])); | 
| 321 | by (REPEAT (blast_tac (claset() addIs reachable.intrs) 1)); | |
| 5972 | 322 | qed "Constrains_imp_PPROD_Constrains"; | 
| 323 | ||
| 6299 | 324 | Goal "[| ALL i:I. f0 i : R i; i: I |] \ | 
| 325 | \     ==> Applyall ({f. (ALL i:I. f i : R i)} Int lift_set i A) i = R i Int A";
 | |
| 326 | by (force_tac (claset() addSIs [rinst [("x", "?ff(i := ?u)")] image_eqI],
 | |
| 327 | simpset() addsimps [Applyall_def, lift_set_def]) 1); | |
| 5972 | 328 | qed "Applyall_Int_depend"; | 
| 329 | ||
| 6575 | 330 | (*Again, we need the f0 premise so that PPROD I F has an initial state; | 
| 331 | otherwise its Co-property is vacuous.*) | |
| 6536 | 332 | Goal "[| PPROD I F : (lift_set i A) Co (lift_set i B); \ | 
| 5972 | 333 | \ i: I; finite I; f0: Init (PPROD I F) |] \ | 
| 6536 | 334 | \ ==> F i : A Co B"; | 
| 6575 | 335 | by (full_simp_tac (simpset() addsimps [Constrains_eq_constrains]) 1); | 
| 5972 | 336 | by (subgoal_tac "ALL i:I. f0 i : reachable (F i)" 1); | 
| 337 | by (blast_tac (claset() addIs [reachable.Init]) 2); | |
| 338 | by (dtac PPROD_constrains_projection 1); | |
| 339 | by (assume_tac 1); | |
| 340 | by (asm_full_simp_tac | |
| 6299 | 341 | (simpset() addsimps [Applyall_Int_depend, reachable_PPROD_eq]) 1); | 
| 5972 | 342 | qed "PPROD_Constrains_imp_Constrains"; | 
| 5899 | 343 | |
| 344 | ||
| 5972 | 345 | Goal "[| i: I; finite I; f0: Init (PPROD I F) |] \ | 
| 6536 | 346 | \ ==> (PPROD I F : (lift_set i A) Co (lift_set i B)) = \ | 
| 347 | \ (F i : A Co B)"; | |
| 5972 | 348 | by (blast_tac (claset() addIs [Constrains_imp_PPROD_Constrains, | 
| 349 | PPROD_Constrains_imp_Constrains]) 1); | |
| 350 | qed "PPROD_Constrains"; | |
| 351 | ||
| 352 | Goal "[| i: I; finite I; f0: Init (PPROD I F) |] \ | |
| 6020 | 353 | \ ==> (PPROD I F : Stable (lift_set i A)) = (F i : Stable A)"; | 
| 5972 | 354 | by (asm_simp_tac (simpset() delsimps [Init_PPROD] | 
| 355 | addsimps [Stable_def, PPROD_Constrains]) 1); | |
| 5899 | 356 | qed "PPROD_Stable"; | 
| 357 | ||
| 358 | ||
| 5972 | 359 | (** PFUN (no dependence on i) doesn't require the f0 premise **) | 
| 5899 | 360 | |
| 6299 | 361 | Goal "i: I \ | 
| 362 | \     ==> Applyall ({f. (ALL i:I. f i : R)} Int lift_set i A) i = R Int A";
 | |
| 5972 | 363 | by (force_tac (claset(), simpset() addsimps [Applyall_def]) 1); | 
| 364 | qed "Applyall_Int"; | |
| 365 | ||
| 6536 | 366 | Goal "[| (PPI x:I. F) : (lift_set i A) Co (lift_set i B); \ | 
| 5972 | 367 | \ i: I; finite I |] \ | 
| 6536 | 368 | \ ==> F : A Co B"; | 
| 6575 | 369 | by (full_simp_tac (simpset() addsimps [Constrains_eq_constrains]) 1); | 
| 5972 | 370 | by (dtac PPROD_constrains_projection 1); | 
| 371 | by (assume_tac 1); | |
| 372 | by (asm_full_simp_tac | |
| 373 | (simpset() addsimps [Applyall_Int, Collect_conj_eq RS sym, | |
| 374 | reachable_PPROD_eq]) 1); | |
| 375 | qed "PFUN_Constrains_imp_Constrains"; | |
| 376 | ||
| 377 | Goal "[| i: I; finite I |] \ | |
| 6536 | 378 | \ ==> ((PPI x:I. F) : (lift_set i A) Co (lift_set i B)) = \ | 
| 379 | \ (F : A Co B)"; | |
| 5972 | 380 | by (blast_tac (claset() addIs [Constrains_imp_PPROD_Constrains, | 
| 381 | PFUN_Constrains_imp_Constrains]) 1); | |
| 382 | qed "PFUN_Constrains"; | |
| 383 | ||
| 384 | Goal "[| i: I; finite I |] \ | |
| 6020 | 385 | \ ==> ((PPI x:I. F) : Stable (lift_set i A)) = (F : Stable A)"; | 
| 5972 | 386 | by (asm_simp_tac (simpset() addsimps [Stable_def, PFUN_Constrains]) 1); | 
| 387 | qed "PFUN_Stable"; | |
| 388 | ||
| 389 | ||
| 390 | ||
| 391 | (*** guarantees properties ***) | |
| 392 | ||
| 393 | ||
| 394 | Goal "drop_act i (lift_act i act) = act"; | |
| 395 | by (force_tac (claset() addSIs [rinst [("x", "?ff(i := ?u)")] exI],
 | |
| 396 | simpset() addsimps [drop_act_def, lift_act_def]) 1); | |
| 397 | qed "lift_act_inverse"; | |
| 398 | Addsimps [lift_act_inverse]; | |
| 399 | ||
| 400 | ||
| 401 | Goal "(lift_prog i F) Join G = lift_prog i H \ | |
| 402 | \ ==> EX J. H = F Join J"; | |
| 403 | by (etac program_equalityE 1); | |
| 404 | by (auto_tac (claset(), simpset() addsimps [Acts_lift_prog, Acts_Join])); | |
| 405 | by (res_inst_tac [("x", 
 | |
| 406 | "mk_program(Applyall(Init G) i, drop_act i `` Acts G)")] | |
| 407 | exI 1); | |
| 408 | by (rtac program_equalityI 1); | |
| 409 | (*Init*) | |
| 410 | by (simp_tac (simpset() addsimps [Applyall_def]) 1); | |
| 411 | (*Blast_tac can't do HO unification, needed to invent function states*) | |
| 412 | by (fast_tac (claset() addEs [equalityE]) 1); | |
| 413 | (*Now for the Actions*) | |
| 414 | by (dres_inst_tac [("f", "op `` (drop_act i)")] arg_cong 1);
 | |
| 415 | by (asm_full_simp_tac | |
| 6826 | 416 | (simpset() addsimps [Acts_Join, image_Un, image_compose RS sym, o_def]) 1); | 
| 5972 | 417 | qed "lift_prog_Join_eq_lift_prog_D"; | 
| 418 | ||
| 419 | ||
| 6826 | 420 | Goal "F : X guar Y \ | 
| 421 | \ ==> lift_prog i F : (lift_prog i `` X) guar (lift_prog i `` Y)"; | |
| 5972 | 422 | by (rtac guaranteesI 1); | 
| 423 | by Auto_tac; | |
| 424 | by (blast_tac (claset() addDs [lift_prog_Join_eq_lift_prog_D, guaranteesD]) 1); | |
| 425 | qed "lift_prog_guarantees"; | |
| 426 | ||
| 427 |