author | paulson |
Thu, 11 Nov 1999 10:25:17 +0100 | |
changeset 8005 | b64d86018785 |
parent 7947 | b999c1ab9327 |
child 8041 | e3237d8c18d6 |
permissions | -rw-r--r-- |
6297 | 1 |
(* Title: HOL/UNITY/Extend.ML |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1999 University of Cambridge |
|
5 |
||
6 |
Extending of state sets |
|
7 |
function f (forget) maps the extended state to the original state |
|
8 |
function g (forgotten) maps the extended state to the "extending part" |
|
7482 | 9 |
*) |
7362
f08fade5ea0d
new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents:
7341
diff
changeset
|
10 |
|
7482 | 11 |
(** These we prove OUTSIDE the locale. **) |
12 |
||
13 |
(*Possibly easier than reasoning about "inv h"*) |
|
14 |
val [surj_h,prem] = |
|
15 |
Goalw [good_map_def] |
|
16 |
"[| surj h; !! x x' y y'. h(x,y) = h(x',y') ==> x=x' |] ==> good_map h"; |
|
17 |
by (safe_tac (claset() addSIs [surj_h])); |
|
18 |
by (rtac prem 1); |
|
19 |
by (stac (surjective_pairing RS sym) 1); |
|
20 |
by (stac (surj_h RS surj_f_inv_f) 1); |
|
21 |
by (rtac refl 1); |
|
22 |
qed "good_mapI"; |
|
23 |
||
24 |
Goalw [good_map_def] "good_map h ==> surj h"; |
|
25 |
by Auto_tac; |
|
26 |
qed "good_map_is_surj"; |
|
27 |
||
28 |
(*A convenient way of finding a closed form for inv h*) |
|
29 |
val [surj,prem] = Goalw [inv_def] |
|
30 |
"[| surj h; !! x y. g (h(x,y)) = x |] ==> fst (inv h z) = g z"; |
|
31 |
by (res_inst_tac [("y1", "z")] (surj RS surjD RS exE) 1); |
|
7499 | 32 |
by (rtac selectI2 1); |
7482 | 33 |
by (dres_inst_tac [("f", "g")] arg_cong 2); |
34 |
by (auto_tac (claset(), simpset() addsimps [prem])); |
|
35 |
qed "fst_inv_equalityI"; |
|
36 |
||
6297 | 37 |
|
38 |
Open_locale "Extend"; |
|
39 |
||
40 |
val slice_def = thm "slice_def"; |
|
41 |
||
42 |
(*** Trivial properties of f, g, h ***) |
|
43 |
||
7482 | 44 |
val good_h = rewrite_rule [good_map_def] (thm "good_h"); |
45 |
val surj_h = good_h RS conjunct1; |
|
6297 | 46 |
|
47 |
val f_def = thm "f_def"; |
|
48 |
val g_def = thm "g_def"; |
|
49 |
||
50 |
Goal "f(h(x,y)) = x"; |
|
7482 | 51 |
by (simp_tac (simpset() addsimps [f_def, good_h RS conjunct2]) 1); |
6297 | 52 |
qed "f_h_eq"; |
53 |
Addsimps [f_h_eq]; |
|
54 |
||
7482 | 55 |
Goal "h(x,y) = h(x',y') ==> x=x'"; |
56 |
by (dres_inst_tac [("f", "fst o inv h")] arg_cong 1); |
|
57 |
(*FIXME: If locales worked properly we could put just "f" above*) |
|
58 |
by (full_simp_tac (simpset() addsimps [f_def, good_h RS conjunct2]) 1); |
|
59 |
qed "h_inject1"; |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
60 |
AddDs [h_inject1]; |
6297 | 61 |
|
62 |
Goal "h(f z, g z) = z"; |
|
7482 | 63 |
by (simp_tac (simpset() addsimps [f_def, g_def, surjective_pairing RS sym, |
64 |
surj_h RS surj_f_inv_f]) 1); |
|
6297 | 65 |
qed "h_f_g_eq"; |
66 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
67 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
68 |
(** A sequence of proof steps borrowed from Provers/split_paired_all.ML **) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
69 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
70 |
val cT = TFree ("'c", ["term"]); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
71 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
72 |
(* "PROP P x == PROP P (h (f x, g x))" *) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
73 |
val lemma1 = Thm.combination |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
74 |
(Thm.reflexive (cterm_of (sign_of thy) (Free ("P", cT --> propT)))) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
75 |
(Drule.unvarify (h_f_g_eq RS sym RS eq_reflection)); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
76 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
77 |
val prems = Goalw [lemma1] "(!!u y. PROP P (h (u, y))) ==> PROP P x"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
78 |
by (resolve_tac prems 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
79 |
val lemma2 = result(); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
80 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
81 |
val prems = Goal "(!!u y. PROP P (h (u, y))) ==> (!!z. PROP P z)"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
82 |
by (rtac lemma2 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
83 |
by (resolve_tac prems 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
84 |
val lemma3 = result(); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
85 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
86 |
val prems = Goal "(!!z. PROP P z) ==> (!!u y. PROP P (h (u, y)))"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
87 |
(*not needed for proof, but prevents generalization over h, 'c, etc.*) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
88 |
by (cut_facts_tac [surj_h] 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
89 |
by (resolve_tac prems 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
90 |
val lemma4 = result(); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
91 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
92 |
val split_extended_all = Thm.equal_intr lemma4 lemma3; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
93 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
94 |
|
6297 | 95 |
(*** extend_set: basic properties ***) |
96 |
||
7594
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
97 |
Goalw [extend_set_def] "A<=B ==> extend_set h A <= extend_set h B"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
98 |
by (Blast_tac 1); |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
99 |
qed "extend_set_mono"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
100 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
101 |
Goalw [extend_set_def] "z : extend_set h A = (f z : A)"; |
7341 | 102 |
by (force_tac (claset() addIs [h_f_g_eq RS sym], simpset()) 1); |
6297 | 103 |
qed "mem_extend_set_iff"; |
104 |
AddIffs [mem_extend_set_iff]; |
|
105 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
106 |
Goalw [extend_set_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
107 |
"(extend_set h A <= extend_set h B) = (A <= B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
108 |
by (Force_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
109 |
qed "extend_set_strict_mono"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
110 |
AddIffs [extend_set_strict_mono]; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
111 |
|
7378 | 112 |
Goal "{s. P (f s)} = extend_set h {s. P s}"; |
113 |
by Auto_tac; |
|
114 |
qed "Collect_eq_extend_set"; |
|
115 |
||
7594
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
116 |
Goal "extend_set h {x} = {s. f s = x}"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
117 |
by Auto_tac; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
118 |
qed "extend_set_sing"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7546
diff
changeset
|
119 |
|
7537 | 120 |
Goalw [extend_set_def, project_set_def] |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
121 |
"project_set h (extend_set h C) = C"; |
7341 | 122 |
by Auto_tac; |
123 |
qed "extend_set_inverse"; |
|
124 |
Addsimps [extend_set_inverse]; |
|
125 |
||
7947 | 126 |
Goalw [extend_set_def, project_set_def] |
127 |
"C <= extend_set h (project_set h C)"; |
|
128 |
by (auto_tac (claset(), |
|
129 |
simpset() addsimps [split_extended_all])); |
|
130 |
by (Blast_tac 1); |
|
131 |
qed "extend_set_project_set"; |
|
132 |
||
6297 | 133 |
Goal "inj (extend_set h)"; |
7341 | 134 |
by (rtac inj_on_inverseI 1); |
135 |
by (rtac extend_set_inverse 1); |
|
6297 | 136 |
qed "inj_extend_set"; |
137 |
||
7689 | 138 |
Goalw [extend_set_def] "extend_set h UNIV = UNIV"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
139 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
140 |
simpset() addsimps [split_extended_all])); |
7689 | 141 |
qed "extend_set_UNIV_eq"; |
142 |
Addsimps [standard extend_set_UNIV_eq]; |
|
143 |
||
7482 | 144 |
(*** project_set: basic properties ***) |
145 |
||
146 |
(*project_set is simply image!*) |
|
147 |
Goalw [project_set_def] "project_set h C = f `` C"; |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
148 |
by (auto_tac (claset() addIs [f_h_eq RS sym], |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
149 |
simpset() addsimps [split_extended_all])); |
7482 | 150 |
qed "project_set_eq"; |
151 |
||
152 |
(*Converse appears to fail*) |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
153 |
Goalw [project_set_def] "!!z. z : C ==> f z : project_set h C"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
154 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
155 |
simpset() addsimps [split_extended_all])); |
7482 | 156 |
qed "project_set_I"; |
157 |
||
158 |
||
159 |
(*** More laws ***) |
|
160 |
||
7341 | 161 |
(*Because A and B could differ on the "other" part of the state, |
162 |
cannot generalize result to |
|
163 |
project_set h (A Int B) = project_set h A Int project_set h B |
|
164 |
*) |
|
165 |
Goalw [project_set_def] |
|
166 |
"project_set h ((extend_set h A) Int B) = A Int (project_set h B)"; |
|
167 |
by Auto_tac; |
|
168 |
qed "project_set_extend_set_Int"; |
|
169 |
||
170 |
Goal "extend_set h (A Un B) = extend_set h A Un extend_set h B"; |
|
6297 | 171 |
by Auto_tac; |
172 |
qed "extend_set_Un_distrib"; |
|
173 |
||
7341 | 174 |
Goal "extend_set h (A Int B) = extend_set h A Int extend_set h B"; |
6297 | 175 |
by Auto_tac; |
176 |
qed "extend_set_Int_distrib"; |
|
177 |
||
7341 | 178 |
Goal "extend_set h (INTER A B) = (INT x:A. extend_set h (B x))"; |
179 |
by Auto_tac; |
|
6834
44da4a2a9ef3
renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents:
6822
diff
changeset
|
180 |
qed "extend_set_INT_distrib"; |
6647 | 181 |
|
7341 | 182 |
Goal "extend_set h (A - B) = extend_set h A - extend_set h B"; |
6297 | 183 |
by Auto_tac; |
184 |
qed "extend_set_Diff_distrib"; |
|
185 |
||
7341 | 186 |
Goal "extend_set h (Union A) = (UN X:A. extend_set h X)"; |
6297 | 187 |
by (Blast_tac 1); |
188 |
qed "extend_set_Union"; |
|
189 |
||
7341 | 190 |
Goalw [extend_set_def] "(extend_set h A <= - extend_set h B) = (A <= - B)"; |
6297 | 191 |
by Auto_tac; |
192 |
qed "extend_set_subset_Compl_eq"; |
|
193 |
||
7341 | 194 |
|
6297 | 195 |
(*** extend_act ***) |
196 |
||
197 |
Goalw [extend_act_def] |
|
198 |
"((h(s,y), h(s',y)) : extend_act h act) = ((s, s') : act)"; |
|
199 |
by Auto_tac; |
|
200 |
qed "mem_extend_act_iff"; |
|
201 |
AddIffs [mem_extend_act_iff]; |
|
202 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
203 |
(*Converse fails: (z,z') would include actions that changed the g-part*) |
7341 | 204 |
Goalw [extend_act_def] |
205 |
"(z, z') : extend_act h act ==> (f z, f z') : act"; |
|
206 |
by Auto_tac; |
|
207 |
qed "extend_act_D"; |
|
208 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
209 |
Goalw [extend_act_def, project_act_def, project_set_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
210 |
"project_act h (Restrict C (extend_act h act)) = \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
211 |
\ Restrict (project_set h C) act"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
212 |
by (Blast_tac 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
213 |
qed "project_act_extend_act_restrict"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
214 |
Addsimps [project_act_extend_act_restrict]; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
215 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
216 |
Goalw [extend_act_def, project_act_def, project_set_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
217 |
"(Restrict C (extend_act h act) = Restrict C (extend_act h act')) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
218 |
\ = (Restrict (project_set h C) act = Restrict (project_set h C) act')"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
219 |
by Auto_tac; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
220 |
by (ALLGOALS (blast_tac (claset() addSEs [equalityE]))); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
221 |
qed "Restrict_extend_act_eq_Restrict_project_act"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
222 |
|
7537 | 223 |
(*Premise is still undesirably strong, since Domain act can include |
224 |
non-reachable states, but it seems necessary for this result.*) |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
225 |
Goal "Domain act <= project_set h C \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
226 |
\ ==> project_act h (Restrict C (extend_act h act)) = act"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
227 |
by (asm_simp_tac (simpset() addsimps [Restrict_triv]) 1); |
7341 | 228 |
qed "extend_act_inverse"; |
229 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
230 |
Goalw [extend_act_def, project_act_def] |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
231 |
"act' <= extend_act h act ==> project_act h act' <= act"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
232 |
by (Force_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
233 |
qed "subset_extend_act_D"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
234 |
|
6297 | 235 |
Goal "inj (extend_act h)"; |
7341 | 236 |
by (rtac inj_on_inverseI 1); |
237 |
by (rtac extend_act_inverse 1); |
|
7537 | 238 |
by (force_tac (claset(), simpset() addsimps [project_set_def]) 1); |
6297 | 239 |
qed "inj_extend_act"; |
240 |
||
241 |
Goalw [extend_set_def, extend_act_def] |
|
242 |
"extend_act h act ^^ (extend_set h A) = extend_set h (act ^^ A)"; |
|
243 |
by (Force_tac 1); |
|
244 |
qed "extend_act_Image"; |
|
245 |
Addsimps [extend_act_Image]; |
|
246 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
247 |
Goalw [extend_act_def] "(extend_act h act' <= extend_act h act) = (act'<=act)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
248 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
249 |
qed "extend_act_strict_mono"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
250 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
251 |
AddIffs [extend_act_strict_mono, inj_extend_act RS inj_eq]; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
252 |
(*The latter theorem is (extend_act h act' = extend_act h act) = (act'=act) *) |
6297 | 253 |
|
254 |
Goalw [extend_set_def, extend_act_def] |
|
255 |
"Domain (extend_act h act) = extend_set h (Domain act)"; |
|
256 |
by (Force_tac 1); |
|
257 |
qed "Domain_extend_act"; |
|
258 |
||
7341 | 259 |
Goalw [extend_act_def] |
6297 | 260 |
"extend_act h Id = Id"; |
261 |
by (force_tac (claset() addIs [h_f_g_eq RS sym], simpset()) 1); |
|
262 |
qed "extend_act_Id"; |
|
7341 | 263 |
|
264 |
Goalw [project_act_def] |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
265 |
"!!z z'. (z, z') : act ==> (f z, f z') : project_act h act"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
266 |
by (force_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
267 |
simpset() addsimps [split_extended_all]) 1); |
7341 | 268 |
qed "project_act_I"; |
269 |
||
270 |
Goalw [project_set_def, project_act_def] |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
271 |
"UNIV <= project_set h C ==> project_act h (Restrict C Id) = Id"; |
7341 | 272 |
by (Force_tac 1); |
273 |
qed "project_act_Id"; |
|
274 |
||
7482 | 275 |
Goalw [project_set_def, project_act_def] |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
276 |
"Domain (project_act h act) = project_set h (Domain act)"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
277 |
by (force_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
278 |
simpset() addsimps [split_extended_all]) 1); |
7482 | 279 |
qed "Domain_project_act"; |
280 |
||
7341 | 281 |
Addsimps [extend_act_Id, project_act_Id]; |
6297 | 282 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
283 |
Goal "(extend_act h act = Id) = (act = Id)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
284 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
285 |
by (rewtac extend_act_def); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
286 |
by (ALLGOALS (blast_tac (claset() addEs [equalityE]))); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
287 |
qed "extend_act_Id_iff"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
288 |
|
6297 | 289 |
Goal "Id : extend_act h `` Acts F"; |
290 |
by (auto_tac (claset() addSIs [extend_act_Id RS sym], |
|
291 |
simpset() addsimps [image_iff])); |
|
292 |
qed "Id_mem_extend_act"; |
|
293 |
||
294 |
||
295 |
(**** extend ****) |
|
296 |
||
297 |
(*** Basic properties ***) |
|
298 |
||
7341 | 299 |
Goalw [extend_def] "Init (extend h F) = extend_set h (Init F)"; |
6297 | 300 |
by Auto_tac; |
301 |
qed "Init_extend"; |
|
302 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
303 |
Goalw [project_def] "Init (project h C F) = project_set h (Init F)"; |
7341 | 304 |
by Auto_tac; |
305 |
qed "Init_project"; |
|
306 |
||
6297 | 307 |
Goal "Acts (extend h F) = (extend_act h `` Acts F)"; |
308 |
by (auto_tac (claset() addSIs [extend_act_Id RS sym], |
|
309 |
simpset() addsimps [extend_def, image_iff])); |
|
310 |
qed "Acts_extend"; |
|
311 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
312 |
Goal "Acts (project h C F) = insert Id (project_act h `` Restrict C `` Acts F)"; |
7546
36b26759147e
project_act no longer has a special case to allow identity actions
paulson
parents:
7538
diff
changeset
|
313 |
by (auto_tac (claset(), |
7341 | 314 |
simpset() addsimps [project_def, image_iff])); |
315 |
qed "Acts_project"; |
|
316 |
||
317 |
Addsimps [Init_extend, Init_project, Acts_extend, Acts_project]; |
|
6297 | 318 |
|
319 |
Goalw [SKIP_def] "extend h SKIP = SKIP"; |
|
320 |
by (rtac program_equalityI 1); |
|
7341 | 321 |
by Auto_tac; |
322 |
qed "extend_SKIP"; |
|
323 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
324 |
Goalw [project_set_def] "project_set h UNIV = UNIV"; |
7537 | 325 |
by Auto_tac; |
326 |
qed "project_set_UNIV"; |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
327 |
Addsimps [project_set_UNIV]; |
7537 | 328 |
|
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
329 |
Goal "project h C (extend h F) = \ |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
330 |
\ mk_program (Init F, Restrict (project_set h C) `` Acts F)"; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
331 |
by (rtac program_equalityI 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
332 |
by (asm_simp_tac (simpset() addsimps [image_eq_UN, |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
333 |
project_act_extend_act_restrict]) 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
334 |
by (Simp_tac 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
335 |
qed "project_extend_eq"; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
336 |
|
7537 | 337 |
(*ALL act: Acts F. Domain act is MUCH TOO STRONG since Domain Id = UNIV!*) |
338 |
Goal "UNIV <= project_set h C \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
339 |
\ ==> project h C (extend h F) = F"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
340 |
by (asm_simp_tac (simpset() addsimps [project_extend_eq, image_eq_UN, |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
341 |
subset_UNIV RS subset_trans RS Restrict_triv]) 1); |
7341 | 342 |
qed "extend_inverse"; |
343 |
Addsimps [extend_inverse]; |
|
6297 | 344 |
|
345 |
Goal "inj (extend h)"; |
|
7341 | 346 |
by (rtac inj_on_inverseI 1); |
347 |
by (rtac extend_inverse 1); |
|
7537 | 348 |
by (force_tac (claset(), simpset() addsimps [project_set_def]) 1); |
6297 | 349 |
qed "inj_extend"; |
350 |
||
351 |
Goal "extend h (F Join G) = extend h F Join extend h G"; |
|
352 |
by (rtac program_equalityI 1); |
|
7537 | 353 |
by (simp_tac (simpset() addsimps [image_Un]) 2); |
6297 | 354 |
by (simp_tac (simpset() addsimps [extend_set_Int_distrib]) 1); |
355 |
qed "extend_Join"; |
|
356 |
Addsimps [extend_Join]; |
|
357 |
||
6647 | 358 |
Goal "extend h (JOIN I F) = (JN i:I. extend h (F i))"; |
359 |
by (rtac program_equalityI 1); |
|
7537 | 360 |
by (simp_tac (simpset() addsimps [image_UN]) 2); |
6834
44da4a2a9ef3
renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents:
6822
diff
changeset
|
361 |
by (simp_tac (simpset() addsimps [extend_set_INT_distrib]) 1); |
6647 | 362 |
qed "extend_JN"; |
363 |
Addsimps [extend_JN]; |
|
364 |
||
7689 | 365 |
|
366 |
(** These monotonicity results look natural but are UNUSED **) |
|
367 |
||
368 |
Goal "F <= G ==> extend h F <= extend h G"; |
|
369 |
by (full_simp_tac (simpset() addsimps [component_eq_subset]) 1); |
|
370 |
by Auto_tac; |
|
371 |
qed "extend_mono"; |
|
372 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
373 |
Goal "F <= G ==> project h C F <= project h C G"; |
7689 | 374 |
by (full_simp_tac |
375 |
(simpset() addsimps [component_eq_subset, project_set_def]) 1); |
|
376 |
by Auto_tac; |
|
377 |
qed "project_mono"; |
|
378 |
||
379 |
||
6536 | 380 |
(*** Safety: co, stable ***) |
6297 | 381 |
|
6536 | 382 |
Goal "(extend h F : (extend_set h A) co (extend_set h B)) = \ |
383 |
\ (F : A co B)"; |
|
6297 | 384 |
by (simp_tac (simpset() addsimps [constrains_def]) 1); |
385 |
qed "extend_constrains"; |
|
386 |
||
387 |
Goal "(extend h F : stable (extend_set h A)) = (F : stable A)"; |
|
388 |
by (asm_simp_tac (simpset() addsimps [stable_def, extend_constrains]) 1); |
|
389 |
qed "extend_stable"; |
|
390 |
||
391 |
Goal "(extend h F : invariant (extend_set h A)) = (F : invariant A)"; |
|
392 |
by (asm_simp_tac (simpset() addsimps [invariant_def, extend_stable]) 1); |
|
393 |
qed "extend_invariant"; |
|
394 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
395 |
(*Converse fails: A and B may differ in their extra variables*) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
396 |
Goal "extend h F : A co B ==> F : (project_set h A) co (project_set h B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
397 |
by (auto_tac (claset(), |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
398 |
simpset() addsimps [constrains_def, project_set_def])); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
399 |
by (Force_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
400 |
qed "extend_constrains_project_set"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
401 |
|
7341 | 402 |
|
403 |
(*** Diff, needed for localTo ***) |
|
404 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
405 |
Goal "Restrict (extend_set h C) (extend_act h act) = \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
406 |
\ extend_act h (Restrict C act)"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
407 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
408 |
simpset() addsimps [split_extended_all])); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
409 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
410 |
simpset() addsimps [extend_act_def])); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
411 |
qed "Restrict_extend_set"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
412 |
|
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
413 |
Goalw [Diff_def] |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
414 |
"(Diff (extend_set h C) (extend h G) (extend_act h `` acts)) = \ |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
415 |
\ extend h (Diff C G acts)"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
416 |
by (rtac program_equalityI 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
417 |
by (Simp_tac 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
418 |
by (simp_tac (simpset() addsimps [inj_extend_act RS image_set_diff]) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
419 |
by (simp_tac (simpset() addsimps [image_eq_UN, |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
420 |
Restrict_extend_set]) 1); |
7387 | 421 |
qed "Diff_extend_eq"; |
422 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
423 |
(*Opposite inclusion fails; this inclusion's more general than that of |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
424 |
Diff_extend_eq*) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
425 |
Goal "Diff (project_set h C) G acts \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
426 |
\ <= project h C (Diff C (extend h G) (extend_act h `` acts))"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
427 |
by (simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
428 |
(simpset() addsimps [component_eq_subset, Diff_def,image_UN, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
429 |
image_image, image_Diff_image_eq, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
430 |
Restrict_extend_act_eq_Restrict_project_act, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
431 |
vimage_image_eq]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
432 |
by (blast_tac (claset() addSEs [equalityE])1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
433 |
qed "Diff_project_set_component"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
434 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
435 |
Goal "(Diff (extend_set h C) (extend h G) (extend_act h `` acts) \ |
7387 | 436 |
\ : (extend_set h A) co (extend_set h B)) \ |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
437 |
\ = (Diff C G acts : A co B)"; |
7387 | 438 |
by (simp_tac (simpset() addsimps [Diff_extend_eq, extend_constrains]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
439 |
qed "Diff_extend_constrains"; |
7341 | 440 |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
441 |
Goal "(Diff (extend_set h C) (extend h G) (extend_act h `` acts) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
442 |
\ : stable (extend_set h A)) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
443 |
\ = (Diff C G acts : stable A)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
444 |
by (simp_tac (simpset() addsimps [Diff_extend_constrains, stable_def]) 1); |
7341 | 445 |
qed "Diff_extend_stable"; |
446 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
447 |
(*UNUSED!!*) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
448 |
Goal "Diff (extend_set h C) (extend h G) (extend_act h `` acts) : A co B \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
449 |
\ ==> Diff C G acts : (project_set h A) co (project_set h B)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
450 |
by (asm_full_simp_tac (simpset() addsimps [Diff_extend_eq, |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
451 |
extend_constrains_project_set]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
452 |
qed "Diff_extend_constrains_project_set"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
453 |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
454 |
Goalw [LOCALTO_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
455 |
"(extend h F : (v o f) localTo[extend_set h C] extend h H) = \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
456 |
\ (F : v localTo[C] H)"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
457 |
by (Simp_tac 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
458 |
(*A trick to strip both quantifiers*) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
459 |
by (res_inst_tac [("f", "All")] (ext RS arg_cong) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
460 |
by (stac Collect_eq_extend_set 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
461 |
by (simp_tac (simpset() addsimps [Diff_extend_stable]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
462 |
qed "extend_localTo_extend_eq"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
463 |
|
7947 | 464 |
Goal "[| F : v localTo[C] H; C' <= extend_set h C |] \ |
465 |
\ ==> extend h F : (v o f) localTo[C'] extend h H"; |
|
466 |
by (blast_tac (claset() addDs [extend_localTo_extend_eq RS iffD2, |
|
467 |
impOfSubs localTo_anti_mono]) 1); |
|
468 |
qed "extend_localTo_extend_I"; |
|
469 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
470 |
(*USED?? opposite inclusion fails*) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
471 |
Goal "Restrict C (extend_act h act) <= \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
472 |
\ extend_act h (Restrict (project_set h C) act)"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
473 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
474 |
simpset() addsimps [split_extended_all])); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
475 |
by (auto_tac (claset(), |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
476 |
simpset() addsimps [extend_act_def, project_set_def])); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
477 |
qed "Restrict_extend_set_subset"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
478 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
479 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
480 |
Goal "(extend_act h `` Acts F) - {Id} = extend_act h `` (Acts F - {Id})"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
481 |
by (stac (extend_act_Id RS sym) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
482 |
by (simp_tac (simpset() addsimps [inj_extend_act RS image_set_diff]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
483 |
qed "extend_act_image_Id_eq"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
484 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
485 |
Goal "Disjoint C (extend h F) (extend h G) = Disjoint (project_set h C) F G"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
486 |
by (simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
487 |
(simpset() addsimps [Disjoint_def, disjoint_iff_not_equal, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
488 |
image_Diff_image_eq, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
489 |
Restrict_extend_act_eq_Restrict_project_act, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7826
diff
changeset
|
490 |
extend_act_Id_iff, vimage_def]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
491 |
qed "Disjoint_extend_eq"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
492 |
Addsimps [Disjoint_extend_eq]; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
493 |
|
7341 | 494 |
(*** Weak safety primitives: Co, Stable ***) |
6297 | 495 |
|
496 |
Goal "p : reachable (extend h F) ==> f p : reachable F"; |
|
497 |
by (etac reachable.induct 1); |
|
498 |
by (auto_tac |
|
499 |
(claset() addIs reachable.intrs, |
|
7341 | 500 |
simpset() addsimps [extend_act_def, image_iff])); |
6297 | 501 |
qed "reachable_extend_f"; |
502 |
||
503 |
Goal "h(s,y) : reachable (extend h F) ==> s : reachable F"; |
|
504 |
by (force_tac (claset() addSDs [reachable_extend_f], simpset()) 1); |
|
505 |
qed "h_reachable_extend"; |
|
506 |
||
507 |
Goalw [extend_set_def] |
|
508 |
"reachable (extend h F) = extend_set h (reachable F)"; |
|
509 |
by (rtac equalityI 1); |
|
510 |
by (force_tac (claset() addIs [h_f_g_eq RS sym] |
|
511 |
addSDs [reachable_extend_f], |
|
512 |
simpset()) 1); |
|
513 |
by (Clarify_tac 1); |
|
514 |
by (etac reachable.induct 1); |
|
515 |
by (ALLGOALS (force_tac (claset() addIs reachable.intrs, |
|
516 |
simpset()))); |
|
517 |
qed "reachable_extend_eq"; |
|
518 |
||
6536 | 519 |
Goal "(extend h F : (extend_set h A) Co (extend_set h B)) = \ |
520 |
\ (F : A Co B)"; |
|
6297 | 521 |
by (simp_tac |
522 |
(simpset() addsimps [Constrains_def, reachable_extend_eq, |
|
523 |
extend_constrains, extend_set_Int_distrib RS sym]) 1); |
|
524 |
qed "extend_Constrains"; |
|
525 |
||
526 |
Goal "(extend h F : Stable (extend_set h A)) = (F : Stable A)"; |
|
527 |
by (simp_tac (simpset() addsimps [Stable_def, extend_Constrains]) 1); |
|
528 |
qed "extend_Stable"; |
|
529 |
||
6647 | 530 |
Goal "(extend h F : Always (extend_set h A)) = (F : Always A)"; |
531 |
by (asm_simp_tac (simpset() addsimps [Always_def, extend_Stable]) 1); |
|
532 |
qed "extend_Always"; |
|
533 |
||
6297 | 534 |
|
535 |
(*** Progress: transient, ensures ***) |
|
536 |
||
537 |
Goal "(extend h F : transient (extend_set h A)) = (F : transient A)"; |
|
538 |
by (auto_tac (claset(), |
|
539 |
simpset() addsimps [transient_def, extend_set_subset_Compl_eq, |
|
540 |
Domain_extend_act])); |
|
541 |
qed "extend_transient"; |
|
542 |
||
6536 | 543 |
Goal "(extend h F : (extend_set h A) ensures (extend_set h B)) = \ |
544 |
\ (F : A ensures B)"; |
|
6297 | 545 |
by (simp_tac |
546 |
(simpset() addsimps [ensures_def, extend_constrains, extend_transient, |
|
547 |
extend_set_Un_distrib RS sym, |
|
548 |
extend_set_Diff_distrib RS sym]) 1); |
|
549 |
qed "extend_ensures"; |
|
550 |
||
6536 | 551 |
Goal "F : A leadsTo B \ |
552 |
\ ==> extend h F : (extend_set h A) leadsTo (extend_set h B)"; |
|
6297 | 553 |
by (etac leadsTo_induct 1); |
554 |
by (asm_simp_tac (simpset() addsimps [leadsTo_UN, extend_set_Union]) 3); |
|
555 |
by (blast_tac (claset() addIs [leadsTo_Trans]) 2); |
|
556 |
by (asm_simp_tac (simpset() addsimps [leadsTo_Basis, extend_ensures]) 1); |
|
557 |
qed "leadsTo_imp_extend_leadsTo"; |
|
558 |
||
559 |
(*** Proving the converse takes some doing! ***) |
|
560 |
||
561 |
Goalw [slice_def] "slice (Union S) y = (UN x:S. slice x y)"; |
|
562 |
by Auto_tac; |
|
563 |
qed "slice_Union"; |
|
564 |
||
565 |
Goalw [slice_def] "slice (extend_set h A) y = A"; |
|
566 |
by Auto_tac; |
|
567 |
qed "slice_extend_set"; |
|
568 |
||
7482 | 569 |
Goalw [slice_def, project_set_def] "project_set h A = (UN y. slice A y)"; |
6297 | 570 |
by Auto_tac; |
7482 | 571 |
qed "project_set_is_UN_slice"; |
6297 | 572 |
|
573 |
Goalw [slice_def, transient_def] |
|
574 |
"extend h F : transient A ==> F : transient (slice A y)"; |
|
575 |
by Auto_tac; |
|
576 |
by (rtac bexI 1); |
|
577 |
by Auto_tac; |
|
578 |
by (force_tac (claset(), simpset() addsimps [extend_act_def]) 1); |
|
579 |
qed "extend_transient_slice"; |
|
580 |
||
7482 | 581 |
Goal "extend h F : A ensures B ==> F : (slice A y) ensures (project_set h B)"; |
6297 | 582 |
by (full_simp_tac |
583 |
(simpset() addsimps [ensures_def, extend_constrains, extend_transient, |
|
7482 | 584 |
project_set_eq, image_Un RS sym, |
6297 | 585 |
extend_set_Un_distrib RS sym, |
586 |
extend_set_Diff_distrib RS sym]) 1); |
|
587 |
by Safe_tac; |
|
588 |
by (full_simp_tac (simpset() addsimps [constrains_def, extend_act_def, |
|
589 |
extend_set_def]) 1); |
|
590 |
by (Clarify_tac 1); |
|
591 |
by (ball_tac 1); |
|
592 |
by (full_simp_tac (simpset() addsimps [slice_def, image_iff, Image_iff]) 1); |
|
593 |
by (force_tac (claset() addSIs [h_f_g_eq RS sym], simpset()) 1); |
|
594 |
(*transient*) |
|
595 |
by (dtac extend_transient_slice 1); |
|
596 |
by (etac transient_strengthen 1); |
|
597 |
by (force_tac (claset() addIs [f_h_eq RS sym], |
|
598 |
simpset() addsimps [slice_def]) 1); |
|
599 |
qed "extend_ensures_slice"; |
|
600 |
||
7482 | 601 |
Goal "ALL y. F : (slice B y) leadsTo CU ==> F : (project_set h B) leadsTo CU"; |
602 |
by (simp_tac (simpset() addsimps [project_set_is_UN_slice]) 1); |
|
6297 | 603 |
by (blast_tac (claset() addIs [leadsTo_UN]) 1); |
604 |
qed "leadsTo_slice_image"; |
|
605 |
||
606 |
||
6536 | 607 |
Goal "extend h F : AU leadsTo BU \ |
7482 | 608 |
\ ==> ALL y. F : (slice AU y) leadsTo (project_set h BU)"; |
6297 | 609 |
by (etac leadsTo_induct 1); |
610 |
by (full_simp_tac (simpset() addsimps [slice_Union]) 3); |
|
611 |
by (blast_tac (claset() addIs [leadsTo_UN]) 3); |
|
612 |
by (blast_tac (claset() addIs [leadsTo_slice_image, leadsTo_Trans]) 2); |
|
613 |
by (blast_tac (claset() addIs [extend_ensures_slice, leadsTo_Basis]) 1); |
|
614 |
qed_spec_mp "extend_leadsTo_slice"; |
|
615 |
||
6536 | 616 |
Goal "(extend h F : (extend_set h A) leadsTo (extend_set h B)) = \ |
617 |
\ (F : A leadsTo B)"; |
|
6297 | 618 |
by Safe_tac; |
619 |
by (etac leadsTo_imp_extend_leadsTo 2); |
|
620 |
by (dtac extend_leadsTo_slice 1); |
|
621 |
by (full_simp_tac (simpset() addsimps [slice_extend_set]) 1); |
|
6647 | 622 |
qed "extend_leadsto"; |
6297 | 623 |
|
6536 | 624 |
Goal "(extend h F : (extend_set h A) LeadsTo (extend_set h B)) = \ |
625 |
\ (F : A LeadsTo B)"; |
|
6454 | 626 |
by (simp_tac |
627 |
(simpset() addsimps [LeadsTo_def, reachable_extend_eq, |
|
6647 | 628 |
extend_leadsto, extend_set_Int_distrib RS sym]) 1); |
6454 | 629 |
qed "extend_LeadsTo"; |
630 |
||
6297 | 631 |
|
632 |
Close_locale "Extend"; |
|
7482 | 633 |
|
634 |
(*Close_locale should do this! |
|
635 |
Delsimps [f_h_eq, extend_set_inverse, f_image_extend_set, extend_act_inverse, |
|
636 |
extend_act_Image]; |
|
637 |
Delrules [make_elim h_inject1]; |
|
638 |
*) |