7186
|
1 |
(* Title: HOL/UNITY/Lift_prog.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1998 University of Cambridge
|
|
5 |
*)
|
|
6 |
|
|
7 |
|
|
8 |
(*** Basic properties ***)
|
|
9 |
|
|
10 |
(** lift_set and drop_set **)
|
|
11 |
|
|
12 |
Goalw [lift_set_def] "(f : lift_set i A) = (f i : A)";
|
|
13 |
by Auto_tac;
|
|
14 |
qed "lift_set_iff";
|
|
15 |
AddIffs [lift_set_iff];
|
|
16 |
|
|
17 |
Goalw [lift_set_def] "lift_set i (A Int B) = lift_set i A Int lift_set i B";
|
|
18 |
by Auto_tac;
|
|
19 |
qed "lift_set_Int";
|
|
20 |
|
|
21 |
(*Converse fails*)
|
|
22 |
Goalw [drop_set_def] "f : A ==> f i : drop_set i A";
|
|
23 |
by Auto_tac;
|
|
24 |
qed "drop_set_I";
|
|
25 |
|
|
26 |
(** lift_act and drop_act **)
|
|
27 |
|
|
28 |
Goalw [lift_act_def] "lift_act i Id = Id";
|
|
29 |
by Auto_tac;
|
|
30 |
by (etac rev_mp 1);
|
|
31 |
by (dtac sym 1);
|
|
32 |
by (asm_simp_tac (simpset() addsimps [fun_upd_idem_iff]) 1);
|
|
33 |
qed "lift_act_Id";
|
|
34 |
Addsimps [lift_act_Id];
|
|
35 |
|
|
36 |
Goalw [drop_act_def] "(s, s') : act ==> (s i, s' i) : drop_act i act";
|
|
37 |
by (auto_tac (claset() addSIs [image_eqI], simpset()));
|
|
38 |
qed "drop_act_I";
|
|
39 |
|
|
40 |
Goalw [drop_act_def] "drop_act i Id = Id";
|
|
41 |
by Auto_tac;
|
|
42 |
by (res_inst_tac [("x", "((%u. x), (%u. x))")] image_eqI 1);
|
|
43 |
by Auto_tac;
|
|
44 |
qed "drop_act_Id";
|
|
45 |
Addsimps [drop_act_Id];
|
|
46 |
|
|
47 |
(** lift_prog and drop_prog **)
|
|
48 |
|
|
49 |
Goalw [lift_prog_def] "Init (lift_prog i F) = lift_set i (Init F)";
|
|
50 |
by Auto_tac;
|
|
51 |
qed "Init_lift_prog";
|
|
52 |
Addsimps [Init_lift_prog];
|
|
53 |
|
|
54 |
Goalw [lift_prog_def] "Acts (lift_prog i F) = lift_act i `` Acts F";
|
|
55 |
by (auto_tac (claset() addIs [Id_in_Acts RSN (2,image_eqI)], simpset()));
|
|
56 |
qed "Acts_lift_prog";
|
|
57 |
Addsimps [Acts_lift_prog];
|
|
58 |
|
|
59 |
Goalw [drop_prog_def] "Init (drop_prog i F) = drop_set i (Init F)";
|
|
60 |
by Auto_tac;
|
|
61 |
qed "Init_drop_prog";
|
|
62 |
Addsimps [Init_drop_prog];
|
|
63 |
|
|
64 |
Goalw [drop_prog_def] "Acts (drop_prog i F) = drop_act i `` Acts F";
|
|
65 |
by (auto_tac (claset() addIs [Id_in_Acts RSN (2,image_eqI)], simpset()));
|
|
66 |
qed "Acts_drop_prog";
|
|
67 |
Addsimps [Acts_drop_prog];
|
|
68 |
|
|
69 |
Goal "F component G ==> lift_prog i F component lift_prog i G";
|
|
70 |
by (full_simp_tac (simpset() addsimps [component_eq_subset]) 1);
|
|
71 |
by Auto_tac;
|
|
72 |
qed "lift_prog_mono";
|
|
73 |
|
|
74 |
Goal "F component G ==> drop_prog i F component drop_prog i G";
|
|
75 |
by (full_simp_tac (simpset() addsimps [component_eq_subset, drop_set_def]) 1);
|
|
76 |
by Auto_tac;
|
|
77 |
qed "drop_prog_mono";
|
|
78 |
|
|
79 |
Goal "lift_prog i SKIP = SKIP";
|
|
80 |
by (auto_tac (claset() addSIs [program_equalityI],
|
|
81 |
simpset() addsimps [SKIP_def, lift_prog_def]));
|
|
82 |
qed "lift_prog_SKIP";
|
|
83 |
|
|
84 |
Goal "lift_prog i (F Join G) = (lift_prog i F) Join (lift_prog i G)";
|
|
85 |
by (rtac program_equalityI 1);
|
|
86 |
by (auto_tac (claset(), simpset() addsimps [Acts_Join]));
|
|
87 |
qed "lift_prog_Join";
|
|
88 |
|
|
89 |
Goal "lift_prog i (JOIN I F) = (JN j:I. lift_prog i (F j))";
|
|
90 |
by (rtac program_equalityI 1);
|
|
91 |
by (auto_tac (claset(), simpset() addsimps [Acts_JN]));
|
|
92 |
qed "lift_prog_JN";
|
|
93 |
|
|
94 |
Goal "drop_prog i SKIP = SKIP";
|
|
95 |
by (auto_tac (claset() addSIs [program_equalityI],
|
|
96 |
simpset() addsimps [SKIP_def, drop_set_def, drop_prog_def]));
|
|
97 |
qed "drop_prog_SKIP";
|
|
98 |
|
|
99 |
|
|
100 |
(** Injectivity of lift_set, lift_act, lift_prog **)
|
|
101 |
|
|
102 |
Goalw [lift_set_def, drop_set_def] "drop_set i (lift_set i F) = F";
|
|
103 |
by Auto_tac;
|
|
104 |
qed "lift_set_inverse";
|
|
105 |
Addsimps [lift_set_inverse];
|
|
106 |
|
|
107 |
Goal "inj (lift_set i)";
|
|
108 |
by (rtac inj_on_inverseI 1);
|
|
109 |
by (rtac lift_set_inverse 1);
|
|
110 |
qed "inj_lift_set";
|
|
111 |
|
|
112 |
(*Because A and B could differ outside i, cannot generalize result to
|
|
113 |
drop_set i (A Int B) = drop_set i A Int drop_set i B
|
|
114 |
*)
|
|
115 |
Goalw [lift_set_def, drop_set_def]
|
|
116 |
"drop_set i ((lift_set i A) Int B) = A Int (drop_set i B)";
|
|
117 |
by Auto_tac;
|
|
118 |
qed "drop_set_lift_set_Int";
|
|
119 |
|
|
120 |
Goalw [lift_set_def, drop_set_def]
|
|
121 |
"drop_set i (B Int (lift_set i A)) = (drop_set i B) Int A";
|
|
122 |
by Auto_tac;
|
|
123 |
qed "drop_set_lift_set_Int2";
|
|
124 |
|
|
125 |
Goalw [drop_set_def]
|
|
126 |
"i : I ==> drop_set i (INT j:I. lift_set j A) = A";
|
|
127 |
by Auto_tac;
|
|
128 |
qed "drop_set_INT";
|
|
129 |
|
|
130 |
Goalw [lift_act_def, drop_act_def] "drop_act i (lift_act i act) = act";
|
|
131 |
by Auto_tac;
|
|
132 |
by (res_inst_tac [("x", "f(i:=a)")] exI 1);
|
|
133 |
by (Asm_simp_tac 1);
|
|
134 |
by (res_inst_tac [("x", "f(i:=b)")] exI 1);
|
|
135 |
by (Asm_simp_tac 1);
|
|
136 |
by (rtac ext 1);
|
|
137 |
by (Asm_simp_tac 1);
|
|
138 |
qed "lift_act_inverse";
|
|
139 |
Addsimps [lift_act_inverse];
|
|
140 |
|
|
141 |
Goal "inj (lift_act i)";
|
|
142 |
by (rtac inj_on_inverseI 1);
|
|
143 |
by (rtac lift_act_inverse 1);
|
|
144 |
qed "inj_lift_act";
|
|
145 |
|
|
146 |
Goal "drop_prog i (lift_prog i F) = F";
|
|
147 |
by (simp_tac (simpset() addsimps [lift_prog_def, drop_prog_def]) 1);
|
|
148 |
by (rtac program_equalityI 1);
|
|
149 |
by (simp_tac (simpset() addsimps [image_compose RS sym, o_def]) 2);
|
|
150 |
by (Simp_tac 1);
|
|
151 |
qed "lift_prog_inverse";
|
|
152 |
Addsimps [lift_prog_inverse];
|
|
153 |
|
|
154 |
Goal "inj (lift_prog i)";
|
|
155 |
by (rtac inj_on_inverseI 1);
|
|
156 |
by (rtac lift_prog_inverse 1);
|
|
157 |
qed "inj_lift_prog";
|
|
158 |
|
|
159 |
|
|
160 |
(*For compatibility with the original definition and perhaps simpler proofs*)
|
|
161 |
Goalw [lift_act_def]
|
|
162 |
"((f,f') : lift_act i act) = (EX s'. f' = f(i := s') & (f i, s') : act)";
|
|
163 |
by Auto_tac;
|
|
164 |
by (rtac exI 1);
|
|
165 |
by Auto_tac;
|
|
166 |
qed "lift_act_eq";
|
|
167 |
AddIffs [lift_act_eq];
|
|
168 |
|
|
169 |
|
|
170 |
(*** Safety: co, stable, invariant ***)
|
|
171 |
|
|
172 |
(** Safety and lift_prog **)
|
|
173 |
|
|
174 |
Goal "(lift_prog i F : (lift_set i A) co (lift_set i B)) = \
|
|
175 |
\ (F : A co B)";
|
|
176 |
by (auto_tac (claset(),
|
|
177 |
simpset() addsimps [constrains_def]));
|
|
178 |
by (Blast_tac 2);
|
|
179 |
by (Force_tac 1);
|
|
180 |
qed "lift_prog_constrains_eq";
|
|
181 |
|
|
182 |
Goal "(lift_prog i F : stable (lift_set i A)) = (F : stable A)";
|
|
183 |
by (simp_tac (simpset() addsimps [stable_def, lift_prog_constrains_eq]) 1);
|
|
184 |
qed "lift_prog_stable_eq";
|
|
185 |
|
|
186 |
Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)";
|
|
187 |
by (auto_tac (claset(),
|
|
188 |
simpset() addsimps [invariant_def, lift_prog_stable_eq]));
|
|
189 |
qed "lift_prog_invariant_eq";
|
|
190 |
|
|
191 |
(*This one looks strange! Proof probably is by case analysis on i=j.
|
|
192 |
If i~=j then lift_prog j (F j) does nothing to lift_set i, and the
|
|
193 |
premise ensures A<=B.*)
|
|
194 |
Goal "F i : A co B \
|
|
195 |
\ ==> lift_prog j (F j) : (lift_set i A) co (lift_set i B)";
|
|
196 |
by (auto_tac (claset(),
|
|
197 |
simpset() addsimps [constrains_def]));
|
|
198 |
by (REPEAT (Blast_tac 1));
|
|
199 |
qed "constrains_imp_lift_prog_constrains";
|
|
200 |
|
|
201 |
|
|
202 |
(** Safety and drop_prog **)
|
|
203 |
|
|
204 |
Goalw [constrains_def]
|
|
205 |
"(drop_prog i F : A co B) = (F : (lift_set i A) co (lift_set i B))";
|
|
206 |
by Auto_tac;
|
|
207 |
by (force_tac (claset(),
|
|
208 |
simpset() addsimps [drop_act_def]) 2);
|
|
209 |
by (blast_tac (claset() addIs [drop_act_I]) 1);
|
|
210 |
qed "drop_prog_constrains_eq";
|
|
211 |
|
|
212 |
Goal "(drop_prog i F : stable A) = (F : stable (lift_set i A))";
|
|
213 |
by (simp_tac (simpset() addsimps [stable_def, drop_prog_constrains_eq]) 1);
|
|
214 |
qed "drop_prog_stable_eq";
|
|
215 |
|
|
216 |
|
|
217 |
(** Diff, needed for localTo **)
|
|
218 |
|
|
219 |
Goal "Diff G (lift_act i `` Acts F) : (lift_set i A) co (lift_set i B) \
|
|
220 |
\ ==> Diff (drop_prog i G) (Acts F) : A co B";
|
|
221 |
by (auto_tac (claset(),
|
|
222 |
simpset() addsimps [constrains_def, Diff_def]));
|
|
223 |
by (dtac bspec 1);
|
|
224 |
by (Force_tac 1);
|
|
225 |
by (auto_tac (claset(), simpset() addsimps [drop_act_def]));
|
|
226 |
by (auto_tac (claset(), simpset() addsimps [lift_set_def]));
|
|
227 |
qed "Diff_drop_prog_co";
|
|
228 |
|
|
229 |
Goalw [stable_def]
|
|
230 |
"Diff G (lift_act i `` Acts F) : stable (lift_set i A) \
|
|
231 |
\ ==> Diff (drop_prog i G) (Acts F) : stable A";
|
|
232 |
by (etac Diff_drop_prog_co 1);
|
|
233 |
qed "Diff_drop_prog_stable";
|
|
234 |
|
|
235 |
Goal "Diff G (Acts F) : A co B \
|
|
236 |
\ ==> Diff (lift_prog i G) (lift_act i `` Acts F) \
|
|
237 |
\ : (lift_set i A) co (lift_set i B)";
|
|
238 |
by (auto_tac (claset(),
|
|
239 |
simpset() addsimps [constrains_def, Diff_def]));
|
|
240 |
by (auto_tac (claset(), simpset() addsimps [drop_act_def]));
|
|
241 |
qed "Diff_lift_prog_co";
|
|
242 |
|
|
243 |
Goalw [stable_def]
|
|
244 |
"Diff G (Acts F) : stable A \
|
|
245 |
\ ==> Diff (lift_prog i G) (lift_act i `` Acts F) : stable (lift_set i A)";
|
|
246 |
by (etac Diff_lift_prog_co 1);
|
|
247 |
qed "Diff_lift_prog_stable";
|
|
248 |
|
|
249 |
|
|
250 |
(*** Weak versions: Co, Stable ***)
|
|
251 |
|
|
252 |
(** Reachability **)
|
|
253 |
|
|
254 |
Goal "s : reachable F ==> f(i:=s) : reachable (lift_prog i F)";
|
|
255 |
by (etac reachable.induct 1);
|
|
256 |
by (force_tac (claset() addIs [reachable.Acts, ext],
|
|
257 |
simpset()) 2);
|
|
258 |
by (force_tac (claset() addIs [reachable.Init], simpset()) 1);
|
|
259 |
qed "reachable_lift_progI";
|
|
260 |
|
|
261 |
Goal "f : reachable (lift_prog i F) ==> f i : reachable F";
|
|
262 |
by (etac reachable.induct 1);
|
|
263 |
by Auto_tac;
|
|
264 |
by (ALLGOALS (blast_tac (claset() addIs reachable.intrs)));
|
|
265 |
qed "reachable_lift_progD";
|
|
266 |
|
|
267 |
Goal "reachable (lift_prog i F) = lift_set i (reachable F)";
|
|
268 |
by Auto_tac;
|
|
269 |
by (etac reachable_lift_progD 1);
|
|
270 |
ren "f" 1;
|
|
271 |
by (dres_inst_tac [("f","f"),("i","i")] reachable_lift_progI 1);
|
|
272 |
by Auto_tac;
|
|
273 |
qed "reachable_lift_prog";
|
|
274 |
|
|
275 |
Goal "(lift_prog i F : (lift_set i A) Co (lift_set i B)) = \
|
|
276 |
\ (F : A Co B)";
|
|
277 |
by (simp_tac (simpset() addsimps [Constrains_def, reachable_lift_prog,
|
|
278 |
lift_set_Int RS sym,
|
|
279 |
lift_prog_constrains_eq]) 1);
|
|
280 |
qed "lift_prog_Constrains_eq";
|
|
281 |
|
|
282 |
Goal "(lift_prog i F : Stable (lift_set i A)) = (F : Stable A)";
|
|
283 |
by (simp_tac (simpset() addsimps [Stable_def, lift_prog_Constrains_eq]) 1);
|
|
284 |
qed "lift_prog_Stable_eq";
|
|
285 |
|
|
286 |
(** Reachability and drop_prog **)
|
|
287 |
|
|
288 |
Goal "f : reachable F ==> f i : reachable (drop_prog i F)";
|
|
289 |
by (etac reachable.induct 1);
|
|
290 |
by (force_tac (claset() addIs [reachable.Acts, drop_act_I],
|
|
291 |
simpset()) 2);
|
|
292 |
by (force_tac (claset() addIs [reachable.Init, drop_set_I],
|
|
293 |
simpset()) 1);
|
|
294 |
qed "reachable_imp_reachable_drop_prog";
|
|
295 |
|
|
296 |
(*Converse fails because it would require
|
|
297 |
[| s i : reachable (drop_prog i F); s i : A |] ==> s : reachable F
|
|
298 |
*)
|
|
299 |
Goalw [Constrains_def]
|
|
300 |
"drop_prog i F : A Co B ==> F : (lift_set i A) Co (lift_set i B)";
|
|
301 |
by (full_simp_tac (simpset() addsimps [drop_prog_constrains_eq]) 1);
|
|
302 |
by (etac constrains_weaken_L 1);
|
|
303 |
by Auto_tac;
|
|
304 |
by (etac reachable_imp_reachable_drop_prog 1);
|
|
305 |
qed "drop_prog_Constrains_D";
|
|
306 |
|
|
307 |
Goalw [Stable_def]
|
|
308 |
"drop_prog i F : Stable A ==> F : Stable (lift_set i A)";
|
|
309 |
by (asm_simp_tac (simpset() addsimps [drop_prog_Constrains_D]) 1);
|
|
310 |
qed "drop_prog_Stable_D";
|
|
311 |
|
|
312 |
|
|
313 |
(*** Programs of the form lift_prog i F Join G
|
|
314 |
in other words programs containing a replicated component ***)
|
|
315 |
|
|
316 |
Goal "drop_prog i ((lift_prog i F) Join G) = F Join (drop_prog i G)";
|
|
317 |
by (rtac program_equalityI 1);
|
|
318 |
by (simp_tac (simpset() addsimps [Acts_Join, image_Un,
|
|
319 |
image_compose RS sym, o_def]) 2);
|
|
320 |
by (simp_tac (simpset() addsimps [drop_set_lift_set_Int]) 1);
|
|
321 |
qed "drop_prog_lift_prog_Join";
|
|
322 |
|
|
323 |
Goal "(lift_prog i F) Join G = lift_prog i H \
|
|
324 |
\ ==> H = F Join (drop_prog i G)";
|
|
325 |
by (dres_inst_tac [("f", "drop_prog i")] arg_cong 1);
|
|
326 |
by (full_simp_tac (simpset() addsimps [drop_prog_lift_prog_Join]) 1);
|
|
327 |
by (etac sym 1);
|
|
328 |
qed "lift_prog_Join_eq_lift_prog_D";
|
|
329 |
|
|
330 |
Goal "f : reachable (lift_prog i F Join G) \
|
|
331 |
\ ==> f i : reachable (F Join drop_prog i G)";
|
|
332 |
by (etac reachable.induct 1);
|
|
333 |
by (force_tac (claset() addIs [reachable.Init, drop_set_I], simpset()) 1);
|
|
334 |
(*By case analysis on whether the action is of lift_prog i F or G*)
|
|
335 |
by (force_tac (claset() addIs [reachable.Acts, drop_act_I],
|
|
336 |
simpset() addsimps [Acts_Join, image_iff]) 1);
|
|
337 |
qed "reachable_lift_prog_Join_D";
|
|
338 |
|
|
339 |
(*Opposite inclusion fails, even for the initial state: lift_set i includes
|
|
340 |
ALL functions determined only by their value at i.*)
|
|
341 |
Goal "reachable (lift_prog i F Join G) <= \
|
|
342 |
\ lift_set i (reachable (F Join drop_prog i G))";
|
|
343 |
by Auto_tac;
|
|
344 |
by (etac reachable_lift_prog_Join_D 1);
|
|
345 |
qed "reachable_lift_prog_Join_subset";
|
|
346 |
|
|
347 |
Goal "F Join drop_prog i G : Stable A \
|
|
348 |
\ ==> lift_prog i F Join G : Stable (lift_set i A)";
|
|
349 |
by (full_simp_tac (simpset() addsimps [Stable_def, Constrains_def]) 1);
|
|
350 |
by (subgoal_tac
|
|
351 |
"lift_prog i F Join G : lift_set i (reachable (F Join drop_prog i G)) Int \
|
|
352 |
\ lift_set i A \
|
|
353 |
\ co lift_set i A" 1);
|
|
354 |
by (asm_full_simp_tac
|
|
355 |
(simpset() addsimps [lift_set_Int RS sym,
|
|
356 |
lift_prog_constrains_eq,
|
|
357 |
drop_prog_constrains_eq RS sym,
|
|
358 |
drop_prog_lift_prog_Join]) 2);
|
|
359 |
by (blast_tac (claset() addIs [constrains_weaken,
|
|
360 |
reachable_lift_prog_Join_D]) 1);
|
|
361 |
qed "lift_prog_Join_Stable_eq";
|
|
362 |
|
|
363 |
|
|
364 |
(*** guarantees properties ***)
|
|
365 |
|
|
366 |
(** It seems that neither of these can be proved from the other. **)
|
|
367 |
|
|
368 |
(*Strong precondition and postcondition; doesn't seem very useful*)
|
|
369 |
Goal "F : X guar Y \
|
|
370 |
\ ==> lift_prog i F : (lift_prog i `` X) guar (lift_prog i `` Y)";
|
|
371 |
by (rtac guaranteesI 1);
|
|
372 |
by Auto_tac;
|
|
373 |
by (blast_tac (claset() addDs [lift_prog_Join_eq_lift_prog_D, guaranteesD]) 1);
|
|
374 |
qed "lift_prog_guarantees";
|
|
375 |
|
|
376 |
(*Weak precondition and postcondition; doesn't seem very useful*)
|
|
377 |
Goal "[| F : X guar Y; drop_prog i `` XX <= X; \
|
|
378 |
\ ALL G. F Join drop_prog i G : Y --> lift_prog i F Join G : YY |] \
|
|
379 |
\ ==> lift_prog i F : XX guar YY";
|
|
380 |
by (rtac guaranteesI 1);
|
|
381 |
by (dtac guaranteesD 1);
|
|
382 |
by (etac subsetD 1);
|
|
383 |
by (rtac image_eqI 1);
|
|
384 |
by (auto_tac (claset(), simpset() addsimps [drop_prog_lift_prog_Join]));
|
|
385 |
qed "drop_prog_guarantees";
|
|
386 |
|
|
387 |
|
|
388 |
(*** sub ***)
|
|
389 |
|
|
390 |
Addsimps [sub_def];
|
|
391 |
|
|
392 |
Goal "lift_set i {s. P s} = {s. P (sub i s)}";
|
|
393 |
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
|
|
394 |
qed "lift_set_sub";
|
|
395 |
|
|
396 |
Goal "{s. P (s i)} = lift_set i {s. P s}";
|
|
397 |
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
|
|
398 |
qed "Collect_eq_lift_set";
|
|
399 |
|
|
400 |
|
|
401 |
(** Are these two useful?? **)
|
|
402 |
|
|
403 |
(*The other direction fails: having FF : Stable {s. z <= f (s i)} does not
|
|
404 |
ensure that F has the form lift_prog i F for some F.*)
|
|
405 |
Goal "lift_prog i `` Stable {s. P (f s)} <= Stable {s. P (f (s i))}";
|
|
406 |
by Auto_tac;
|
|
407 |
by (stac Collect_eq_lift_set 1);
|
|
408 |
by (asm_simp_tac (simpset() addsimps [lift_prog_Stable_eq]) 1);
|
|
409 |
qed "image_lift_prog_Stable";
|
|
410 |
|
|
411 |
Goal "lift_prog i `` Increasing f <= Increasing (f o sub i)";
|
|
412 |
by (simp_tac (simpset() addsimps [Increasing_def,
|
|
413 |
inj_lift_prog RS image_INT]) 1);
|
|
414 |
by (blast_tac (claset() addIs [impOfSubs image_lift_prog_Stable]) 1);
|
|
415 |
qed "image_lift_prog_Increasing";
|
|
416 |
|
|
417 |
|
|
418 |
(*** guarantees corollaries ***)
|
|
419 |
|
|
420 |
Goalw [increasing_def]
|
|
421 |
"F : UNIV guar increasing f \
|
|
422 |
\ ==> lift_prog i F : UNIV guar increasing (f o sub i)";
|
|
423 |
by (etac drop_prog_guarantees 1);
|
|
424 |
by Auto_tac;
|
|
425 |
by (stac Collect_eq_lift_set 1);
|
|
426 |
by (asm_full_simp_tac
|
|
427 |
(simpset() addsimps [lift_prog_stable_eq, drop_prog_stable_eq,
|
|
428 |
stable_Join]) 1);
|
|
429 |
qed "lift_prog_guar_increasing";
|
|
430 |
|
|
431 |
Goalw [Increasing_def]
|
|
432 |
"F : UNIV guar Increasing f \
|
|
433 |
\ ==> lift_prog i F : UNIV guar Increasing (f o sub i)";
|
|
434 |
by (etac drop_prog_guarantees 1);
|
|
435 |
by Auto_tac;
|
|
436 |
by (stac Collect_eq_lift_set 1);
|
|
437 |
by (asm_simp_tac (simpset() addsimps [lift_prog_Join_Stable_eq]) 1);
|
|
438 |
qed "lift_prog_guar_Increasing";
|
|
439 |
|
|
440 |
Goalw [localTo_def, increasing_def]
|
|
441 |
"F : (f localTo F) guar increasing f \
|
|
442 |
\ ==> lift_prog i F : (f o sub i) localTo (lift_prog i F) \
|
|
443 |
\ guar increasing (f o sub i)";
|
|
444 |
by (etac drop_prog_guarantees 1);
|
|
445 |
by Auto_tac;
|
|
446 |
by (stac Collect_eq_lift_set 2);
|
|
447 |
(*the "increasing" guarantee*)
|
|
448 |
by (asm_full_simp_tac
|
|
449 |
(simpset() addsimps [lift_prog_stable_eq, drop_prog_stable_eq,
|
|
450 |
stable_Join]) 2);
|
|
451 |
(*the "localTo" requirement*)
|
|
452 |
by (asm_simp_tac
|
|
453 |
(simpset() addsimps [Diff_drop_prog_stable,
|
|
454 |
Collect_eq_lift_set RS sym]) 1);
|
|
455 |
qed "lift_prog_guar_increasing2";
|
|
456 |
|
|
457 |
Goalw [localTo_def, Increasing_def]
|
|
458 |
"F : (f localTo F) guar Increasing f \
|
|
459 |
\ ==> lift_prog i F : (f o sub i) localTo (lift_prog i F) \
|
|
460 |
\ guar Increasing (f o sub i)";
|
|
461 |
by (etac drop_prog_guarantees 1);
|
|
462 |
by Auto_tac;
|
|
463 |
by (stac Collect_eq_lift_set 2);
|
|
464 |
(*the "Increasing" guarantee*)
|
|
465 |
by (asm_simp_tac (simpset() addsimps [lift_prog_Join_Stable_eq]) 2);
|
|
466 |
(*the "localTo" requirement*)
|
|
467 |
by (asm_simp_tac
|
|
468 |
(simpset() addsimps [Diff_drop_prog_stable,
|
|
469 |
Collect_eq_lift_set RS sym]) 1);
|
|
470 |
qed "lift_prog_guar_Increasing2";
|
|
471 |
|
|
472 |
(*Converse fails. Useful?*)
|
|
473 |
Goal "lift_prog i `` (f localTo F) <= (f o sub i) localTo (lift_prog i F)";
|
|
474 |
by (simp_tac (simpset() addsimps [localTo_def]) 1);
|
|
475 |
by Auto_tac;
|
|
476 |
by (stac Collect_eq_lift_set 1);
|
|
477 |
by (asm_simp_tac (simpset() addsimps [Diff_lift_prog_stable]) 1);
|
|
478 |
qed "localTo_lift_prog_I";
|