14052
|
1 |
(* Title: ZF/UNITY/GenIncreasing
|
|
2 |
ID: $Id$
|
|
3 |
Author: Sidi O Ehmety, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1998 University of Cambridge
|
|
5 |
|
|
6 |
A general form of the `Increasing' relation of Charpentier
|
|
7 |
*)
|
|
8 |
|
|
9 |
(** increasing **)
|
|
10 |
|
|
11 |
Goalw [increasing_def] "increasing[A](r, f) <= program";
|
|
12 |
by (Blast_tac 1);
|
|
13 |
qed "increasing_type";
|
|
14 |
|
|
15 |
Goalw [increasing_def] "F:increasing[A](r, f) ==> F:program";
|
|
16 |
by (Blast_tac 1);
|
|
17 |
qed "increasing_into_program";
|
|
18 |
|
|
19 |
Goalw [increasing_def]
|
|
20 |
"[| F:increasing[A](r, f); x:A |] ==>F:stable({s:state. <x, f(s)>:r})";
|
|
21 |
by (Blast_tac 1);
|
|
22 |
qed "increasing_imp_stable";
|
|
23 |
|
|
24 |
Goalw [increasing_def]
|
|
25 |
"F:increasing[A](r,f) ==> F:program & (EX a. a:A) & (ALL s:state. f(s):A)";
|
|
26 |
by (subgoal_tac "EX x. x:state" 1);
|
|
27 |
by (auto_tac (claset() addDs [stable_type RS subsetD]
|
|
28 |
addIs [st0_in_state], simpset()));
|
|
29 |
qed "increasingD";
|
|
30 |
|
|
31 |
Goalw [increasing_def, stable_def]
|
|
32 |
"F:increasing[A](r, %s. c) <-> F:program & c:A";
|
|
33 |
by (subgoal_tac "EX x. x:state" 1);
|
|
34 |
by (auto_tac (claset() addDs [stable_type RS subsetD]
|
|
35 |
addIs [st0_in_state], simpset()));
|
|
36 |
qed "increasing_constant";
|
|
37 |
Addsimps [increasing_constant];
|
|
38 |
|
|
39 |
Goalw [increasing_def, stable_def, part_order_def,
|
|
40 |
constrains_def, mono1_def, comp_def]
|
|
41 |
"[| mono1(A, r, B, s, g); refl(A, r); trans[B](s) |] ==> \
|
|
42 |
\ increasing[A](r, f) <= increasing[B](s, g comp f)";
|
|
43 |
by (Clarify_tac 1);
|
|
44 |
by (Asm_full_simp_tac 1);
|
|
45 |
by (Clarify_tac 1);
|
|
46 |
by (subgoal_tac "xa:state" 1);
|
|
47 |
by (blast_tac (claset() addSDs [ActsD]) 2);
|
|
48 |
by (subgoal_tac "<f(xb), f(xb)>:r" 1);
|
|
49 |
by (force_tac (claset(), simpset() addsimps [refl_def]) 2);
|
|
50 |
by (rotate_tac 5 1);
|
|
51 |
by (dres_inst_tac [("x", "f(xb)")] bspec 1);
|
|
52 |
by (rotate_tac ~1 2);
|
|
53 |
by (dres_inst_tac [("x", "act")] bspec 2);
|
|
54 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
55 |
by (dres_inst_tac [("A", "act``?u"), ("c", "xa")] subsetD 1);
|
|
56 |
by (Blast_tac 1);
|
|
57 |
by (dres_inst_tac [("x", "f(xa)"), ("x1", "f(xb)")] (bspec RS bspec) 1);
|
|
58 |
by (res_inst_tac [("b", "g(f(xb))"), ("A", "B")] trans_onD 3);
|
|
59 |
by (ALLGOALS(Asm_simp_tac));
|
|
60 |
qed "subset_increasing_comp";
|
|
61 |
|
|
62 |
Goal "[| F:increasing[A](r, f); mono1(A, r, B, s, g); \
|
|
63 |
\ refl(A, r); trans[B](s) |] ==> F:increasing[B](s, g comp f)";
|
|
64 |
by (rtac (subset_increasing_comp RS subsetD) 1);
|
|
65 |
by Auto_tac;
|
|
66 |
qed "imp_increasing_comp";
|
|
67 |
|
14055
|
68 |
Goalw [increasing_def, Lt_def]
|
14052
|
69 |
"increasing[nat](Le, f) <= increasing[nat](Lt, f)";
|
|
70 |
by Auto_tac;
|
|
71 |
qed "strict_increasing";
|
|
72 |
|
|
73 |
Goalw [increasing_def, Gt_def, Ge_def]
|
|
74 |
"increasing[nat](Ge, f) <= increasing[nat](Gt, f)";
|
|
75 |
by Auto_tac;
|
|
76 |
by (etac natE 1);
|
|
77 |
by (auto_tac (claset(), simpset() addsimps [stable_def]));
|
|
78 |
qed "strict_gt_increasing";
|
|
79 |
|
|
80 |
(** Increasing **)
|
|
81 |
|
|
82 |
Goalw [increasing_def, Increasing_def]
|
|
83 |
"F : increasing[A](r, f) ==> F : Increasing[A](r, f)";
|
|
84 |
by (auto_tac (claset() addIs [stable_imp_Stable], simpset()));
|
|
85 |
qed "increasing_imp_Increasing";
|
|
86 |
|
|
87 |
Goalw [Increasing_def] "Increasing[A](r, f) <= program";
|
|
88 |
by Auto_tac;
|
|
89 |
qed "Increasing_type";
|
|
90 |
|
|
91 |
Goalw [Increasing_def] "F:Increasing[A](r, f) ==> F:program";
|
|
92 |
by Auto_tac;
|
|
93 |
qed "Increasing_into_program";
|
|
94 |
|
|
95 |
Goalw [Increasing_def]
|
|
96 |
"[| F:Increasing[A](r, f); a:A |] ==> F: Stable({s:state. <a,f(s)>:r})";
|
|
97 |
by (Blast_tac 1);
|
|
98 |
qed "Increasing_imp_Stable";
|
|
99 |
|
|
100 |
Goalw [Increasing_def]
|
|
101 |
"F:Increasing[A](r, f) ==> F:program & (EX a. a:A) & (ALL s:state. f(s):A)";
|
|
102 |
by (subgoal_tac "EX x. x:state" 1);
|
|
103 |
by (auto_tac (claset() addIs [st0_in_state], simpset()));
|
|
104 |
qed "IncreasingD";
|
|
105 |
|
|
106 |
Goal
|
|
107 |
"F:Increasing[A](r, %s. c) <-> F:program & (c:A)";
|
|
108 |
by (subgoal_tac "EX x. x:state" 1);
|
|
109 |
by (auto_tac (claset() addSDs [IncreasingD]
|
|
110 |
addIs [st0_in_state,
|
|
111 |
increasing_imp_Increasing], simpset()));
|
|
112 |
qed "Increasing_constant";
|
|
113 |
Addsimps [Increasing_constant];
|
|
114 |
|
|
115 |
Goalw [Increasing_def, Stable_def, Constrains_def, part_order_def,
|
|
116 |
constrains_def, mono1_def, comp_def]
|
|
117 |
"[| mono1(A, r, B, s, g); refl(A, r); trans[B](s) |] ==> \
|
|
118 |
\ Increasing[A](r, f) <= Increasing[B](s, g comp f)";
|
|
119 |
by Safe_tac;
|
|
120 |
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [ActsD])));
|
|
121 |
by (subgoal_tac "xb:state & xa:state" 1);
|
|
122 |
by (asm_simp_tac (simpset() addsimps [ActsD]) 2);
|
|
123 |
by (subgoal_tac "<f(xb), f(xb)>:r" 1);
|
|
124 |
by (force_tac (claset(), simpset() addsimps [refl_def]) 2);
|
|
125 |
by (rotate_tac 5 1);
|
|
126 |
by (dres_inst_tac [("x", "f(xb)")] bspec 1);
|
|
127 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
128 |
by (Clarify_tac 1);
|
|
129 |
by (rotate_tac ~2 1);
|
|
130 |
by (dres_inst_tac [("x", "act")] bspec 1);
|
|
131 |
by (dres_inst_tac [("A", "act``?u"), ("c", "xa")] subsetD 2);
|
|
132 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
133 |
by (Blast_tac 1);
|
|
134 |
by (dres_inst_tac [("x", "f(xa)"), ("x1", "f(xb)")] (bspec RS bspec) 1);
|
|
135 |
by (res_inst_tac [("b", "g(f(xb))"), ("A", "B")] trans_onD 3);
|
|
136 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
137 |
qed "subset_Increasing_comp";
|
|
138 |
|
|
139 |
Goal "[| F:Increasing[A](r, f); mono1(A, r, B, s, g); refl(A, r); trans[B](s) |] \
|
|
140 |
\ ==> F:Increasing[B](s, g comp f)";
|
|
141 |
by (rtac (subset_Increasing_comp RS subsetD) 1);
|
|
142 |
by Auto_tac;
|
|
143 |
qed "imp_Increasing_comp";
|
|
144 |
|
14055
|
145 |
Goalw [Increasing_def, Lt_def]
|
14052
|
146 |
"Increasing[nat](Le, f) <= Increasing[nat](Lt, f)";
|
|
147 |
by Auto_tac;
|
|
148 |
qed "strict_Increasing";
|
|
149 |
|
|
150 |
Goalw [Increasing_def, Ge_def, Gt_def]
|
|
151 |
"Increasing[nat](Ge, f)<= Increasing[nat](Gt, f)";
|
|
152 |
by Auto_tac;
|
|
153 |
by (etac natE 1);
|
|
154 |
by (auto_tac (claset(), simpset() addsimps [Stable_def]));
|
|
155 |
qed "strict_gt_Increasing";
|
|
156 |
|
|
157 |
(** Two-place monotone operations **)
|
|
158 |
|
|
159 |
Goalw [increasing_def, stable_def,
|
|
160 |
part_order_def, constrains_def, mono2_def]
|
|
161 |
"[| F:increasing[A](r, f); F:increasing[B](s, g); \
|
|
162 |
\ mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t) |] ==> \
|
|
163 |
\ F:increasing[C](t, %x. h(f(x), g(x)))";
|
|
164 |
by (Clarify_tac 1);
|
|
165 |
by (Asm_full_simp_tac 1);
|
|
166 |
by (Clarify_tac 1);
|
|
167 |
by (rename_tac "xa xb" 1);
|
|
168 |
by (subgoal_tac "xb:state & xa:state" 1);
|
|
169 |
by (blast_tac (claset() addSDs [ActsD]) 2);
|
|
170 |
by (subgoal_tac "<f(xb), f(xb)>:r & <g(xb), g(xb)>:s" 1);
|
|
171 |
by (force_tac (claset(), simpset() addsimps [refl_def]) 2);
|
|
172 |
by (rotate_tac 6 1);
|
|
173 |
by (dres_inst_tac [("x", "f(xb)")] bspec 1);
|
|
174 |
by (rotate_tac 1 2);
|
|
175 |
by (dres_inst_tac [("x", "g(xb)")] bspec 2);
|
|
176 |
by (ALLGOALS(Asm_simp_tac));
|
|
177 |
by (rotate_tac ~1 1);
|
|
178 |
by (dres_inst_tac [("x", "act")] bspec 1);
|
|
179 |
by (rotate_tac ~3 2);
|
|
180 |
by (dres_inst_tac [("x", "act")] bspec 2);
|
|
181 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
182 |
by (dres_inst_tac [("A", "act``?u"), ("c", "xa")] subsetD 1);
|
|
183 |
by (dres_inst_tac [("A", "act``?u"), ("c", "xa")] subsetD 2);
|
|
184 |
by (Blast_tac 1);
|
|
185 |
by (Blast_tac 1);
|
|
186 |
by (rotate_tac ~4 1);
|
|
187 |
by (dres_inst_tac [("x", "f(xa)"), ("x1", "f(xb)")] (bspec RS bspec) 1);
|
|
188 |
by (rotate_tac ~1 3);
|
|
189 |
by (dres_inst_tac [("x", "g(xa)"), ("x1", "g(xb)")] (bspec RS bspec) 3);
|
|
190 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
191 |
by (res_inst_tac [("b", "h(f(xb), g(xb))"), ("A", "C")] trans_onD 1);
|
|
192 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
193 |
qed "imp_increasing_comp2";
|
|
194 |
|
|
195 |
Goalw [Increasing_def, stable_def,
|
|
196 |
part_order_def, constrains_def, mono2_def, Stable_def, Constrains_def]
|
|
197 |
"[| F:Increasing[A](r, f); F:Increasing[B](s, g); \
|
|
198 |
\ mono2(A, r, B, s, C, t, h); refl(A, r); refl(B, s); trans[C](t) |] ==> \
|
|
199 |
\ F:Increasing[C](t, %x. h(f(x), g(x)))";
|
|
200 |
by Safe_tac;
|
|
201 |
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [ActsD])));
|
|
202 |
by (subgoal_tac "xa:state & x:state" 1);
|
|
203 |
by (blast_tac (claset() addSDs [ActsD]) 2);
|
|
204 |
by (subgoal_tac "<f(xa), f(xa)>:r & <g(xa), g(xa)>:s" 1);
|
|
205 |
by (force_tac (claset(), simpset() addsimps [refl_def]) 2);
|
|
206 |
by (rotate_tac 6 1);
|
|
207 |
by (dres_inst_tac [("x", "f(xa)")] bspec 1);
|
|
208 |
by (rotate_tac 1 2);
|
|
209 |
by (dres_inst_tac [("x", "g(xa)")] bspec 2);
|
|
210 |
by (ALLGOALS(Asm_simp_tac));
|
|
211 |
by (Clarify_tac 1);
|
|
212 |
by (rotate_tac ~2 1);
|
|
213 |
by (dres_inst_tac [("x", "act")] bspec 1);
|
|
214 |
by (rotate_tac ~3 2);
|
|
215 |
by (dres_inst_tac [("x", "act")] bspec 2);
|
|
216 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
217 |
by (dres_inst_tac [("A", "act``?u"), ("c", "x")] subsetD 1);
|
|
218 |
by (dres_inst_tac [("A", "act``?u"), ("c", "x")] subsetD 2);
|
|
219 |
by (Blast_tac 1);
|
|
220 |
by (Blast_tac 1);
|
|
221 |
by (rotate_tac ~9 1);
|
|
222 |
by (dres_inst_tac [("x", "f(x)"), ("x1", "f(xa)")] (bspec RS bspec) 1);
|
|
223 |
by (rotate_tac ~1 3);
|
|
224 |
by (dres_inst_tac [("x", "g(x)"), ("x1", "g(xa)")] (bspec RS bspec) 3);
|
|
225 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
226 |
by (res_inst_tac [("b", "h(f(xa), g(xa))"), ("A", "C")] trans_onD 1);
|
|
227 |
by (ALLGOALS(Asm_full_simp_tac));
|
|
228 |
qed "imp_Increasing_comp2";
|
|
229 |
|