1440
|
1 |
|
|
2 |
|
|
3 |
(** basic properties of "&&" and "||" **)
|
|
4 |
|
|
5 |
(* unique existence *)
|
|
6 |
|
5069
|
7 |
Goalw [inf_def] "is_inf x y (x && y)";
|
4153
|
8 |
by (rtac (ex_inf RS spec RS spec RS selectI1) 1);
|
1440
|
9 |
qed "inf_is_inf";
|
|
10 |
|
5069
|
11 |
Goal "is_inf x y inf --> x && y = inf";
|
4153
|
12 |
by (rtac impI 1);
|
|
13 |
by (rtac (is_inf_uniq RS mp) 1);
|
|
14 |
by (rtac conjI 1);
|
|
15 |
by (rtac inf_is_inf 1);
|
|
16 |
by (assume_tac 1);
|
1440
|
17 |
qed "inf_uniq";
|
|
18 |
|
5069
|
19 |
Goalw [Ex1_def] "ALL x y. EX! inf::'a::lattice. is_inf x y inf";
|
4153
|
20 |
by Safe_tac;
|
1899
|
21 |
by (Step_tac 1);
|
|
22 |
by (Step_tac 1);
|
4153
|
23 |
by (rtac inf_is_inf 1);
|
|
24 |
by (rtac (inf_uniq RS mp RS sym) 1);
|
|
25 |
by (assume_tac 1);
|
1440
|
26 |
qed "ex1_inf";
|
|
27 |
|
|
28 |
|
5069
|
29 |
Goalw [sup_def] "is_sup x y (x || y)";
|
4153
|
30 |
by (rtac (ex_sup RS spec RS spec RS selectI1) 1);
|
1440
|
31 |
qed "sup_is_sup";
|
|
32 |
|
5069
|
33 |
Goal "is_sup x y sup --> x || y = sup";
|
4153
|
34 |
by (rtac impI 1);
|
|
35 |
by (rtac (is_sup_uniq RS mp) 1);
|
|
36 |
by (rtac conjI 1);
|
|
37 |
by (rtac sup_is_sup 1);
|
|
38 |
by (assume_tac 1);
|
1440
|
39 |
qed "sup_uniq";
|
|
40 |
|
5069
|
41 |
Goalw [Ex1_def] "ALL x y. EX! sup::'a::lattice. is_sup x y sup";
|
4153
|
42 |
by Safe_tac;
|
1899
|
43 |
by (Step_tac 1);
|
|
44 |
by (Step_tac 1);
|
4153
|
45 |
by (rtac sup_is_sup 1);
|
|
46 |
by (rtac (sup_uniq RS mp RS sym) 1);
|
|
47 |
by (assume_tac 1);
|
1440
|
48 |
qed "ex1_sup";
|
|
49 |
|
|
50 |
|
|
51 |
(* "&&" yields g.l.bs, "||" yields l.u.bs. --- in pieces *)
|
|
52 |
|
|
53 |
val tac =
|
|
54 |
cut_facts_tac [inf_is_inf] 1 THEN
|
|
55 |
rewrite_goals_tac [inf_def, is_inf_def] THEN
|
1899
|
56 |
Fast_tac 1;
|
1440
|
57 |
|
5069
|
58 |
Goal "x && y [= x";
|
1440
|
59 |
by tac;
|
|
60 |
qed "inf_lb1";
|
|
61 |
|
5069
|
62 |
Goal "x && y [= y";
|
1440
|
63 |
by tac;
|
|
64 |
qed "inf_lb2";
|
|
65 |
|
|
66 |
val prems = goal thy "[| z [= x; z [= y |] ==> z [= x && y";
|
|
67 |
by (cut_facts_tac prems 1);
|
|
68 |
by tac;
|
|
69 |
qed "inf_ub_lbs";
|
|
70 |
|
|
71 |
|
|
72 |
val tac =
|
|
73 |
cut_facts_tac [sup_is_sup] 1 THEN
|
|
74 |
rewrite_goals_tac [sup_def, is_sup_def] THEN
|
1899
|
75 |
Fast_tac 1;
|
1440
|
76 |
|
5069
|
77 |
Goal "x [= x || y";
|
1440
|
78 |
by tac;
|
|
79 |
qed "sup_ub1";
|
|
80 |
|
5069
|
81 |
Goal "y [= x || y";
|
1440
|
82 |
by tac;
|
|
83 |
qed "sup_ub2";
|
|
84 |
|
|
85 |
val prems = goal thy "[| x [= z; y [= z |] ==> x || y [= z";
|
|
86 |
by (cut_facts_tac prems 1);
|
|
87 |
by tac;
|
|
88 |
qed "sup_lb_ubs";
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
(** some equations concerning "&&" and "||" vs. "[=" **)
|
|
93 |
|
|
94 |
(* the Connection Theorems: "[=" expressed via "&&" or "||" *)
|
|
95 |
|
5069
|
96 |
Goal "(x && y = x) = (x [= y)";
|
4153
|
97 |
by (rtac iffI 1);
|
1440
|
98 |
(*==>*)
|
4153
|
99 |
by (etac subst 1);
|
|
100 |
by (rtac inf_lb2 1);
|
1440
|
101 |
(*<==*)
|
4153
|
102 |
by (rtac (inf_uniq RS mp) 1);
|
1465
|
103 |
by (rewtac is_inf_def);
|
1440
|
104 |
by (REPEAT_FIRST (rtac conjI));
|
4153
|
105 |
by (rtac le_refl 1);
|
|
106 |
by (assume_tac 1);
|
1899
|
107 |
by (Fast_tac 1);
|
1440
|
108 |
qed "inf_connect";
|
|
109 |
|
5069
|
110 |
Goal "(x || y = y) = (x [= y)";
|
4153
|
111 |
by (rtac iffI 1);
|
1440
|
112 |
(*==>*)
|
4153
|
113 |
by (etac subst 1);
|
|
114 |
by (rtac sup_ub1 1);
|
1440
|
115 |
(*<==*)
|
4153
|
116 |
by (rtac (sup_uniq RS mp) 1);
|
1465
|
117 |
by (rewtac is_sup_def);
|
1440
|
118 |
by (REPEAT_FIRST (rtac conjI));
|
4153
|
119 |
by (assume_tac 1);
|
|
120 |
by (rtac le_refl 1);
|
1899
|
121 |
by (Fast_tac 1);
|
1440
|
122 |
qed "sup_connect";
|
|
123 |
|
|
124 |
|
|
125 |
(* minorized infs / majorized sups *)
|
|
126 |
|
5069
|
127 |
Goal "(x [= y && z) = (x [= y & x [= z)";
|
4153
|
128 |
by (rtac iffI 1);
|
1440
|
129 |
(*==> (level 1)*)
|
|
130 |
by (cut_facts_tac [inf_lb1, inf_lb2] 1);
|
4153
|
131 |
by (rtac conjI 1);
|
|
132 |
by (rtac (le_trans RS mp) 1);
|
|
133 |
by (etac conjI 1);
|
|
134 |
by (assume_tac 1);
|
|
135 |
by (rtac (le_trans RS mp) 1);
|
|
136 |
by (etac conjI 1);
|
|
137 |
by (assume_tac 1);
|
1440
|
138 |
(*<== (level 9)*)
|
4153
|
139 |
by (etac conjE 1);
|
|
140 |
by (etac inf_ub_lbs 1);
|
|
141 |
by (assume_tac 1);
|
1440
|
142 |
qed "le_inf_eq";
|
|
143 |
|
5069
|
144 |
Goal "(x || y [= z) = (x [= z & y [= z)";
|
4153
|
145 |
by (rtac iffI 1);
|
1440
|
146 |
(*==> (level 1)*)
|
|
147 |
by (cut_facts_tac [sup_ub1, sup_ub2] 1);
|
4153
|
148 |
by (rtac conjI 1);
|
|
149 |
by (rtac (le_trans RS mp) 1);
|
|
150 |
by (etac conjI 1);
|
|
151 |
by (assume_tac 1);
|
|
152 |
by (rtac (le_trans RS mp) 1);
|
|
153 |
by (etac conjI 1);
|
|
154 |
by (assume_tac 1);
|
1440
|
155 |
(*<== (level 9)*)
|
4153
|
156 |
by (etac conjE 1);
|
|
157 |
by (etac sup_lb_ubs 1);
|
|
158 |
by (assume_tac 1);
|
1440
|
159 |
qed "ge_sup_eq";
|
|
160 |
|
|
161 |
|
|
162 |
(** algebraic properties of "&&" and "||": A, C, I, AB **)
|
|
163 |
|
|
164 |
(* associativity *)
|
|
165 |
|
5069
|
166 |
Goal "(x && y) && z = x && (y && z)";
|
1440
|
167 |
by (stac (inf_uniq RS mp RS sym) 1);
|
|
168 |
back();
|
|
169 |
back();
|
|
170 |
back();
|
|
171 |
back();
|
|
172 |
back();
|
|
173 |
back();
|
|
174 |
back();
|
|
175 |
back();
|
4153
|
176 |
by (rtac refl 2);
|
|
177 |
by (rtac (is_inf_assoc RS mp) 1);
|
1440
|
178 |
by (REPEAT_FIRST (rtac conjI));
|
|
179 |
by (REPEAT_FIRST (rtac inf_is_inf));
|
|
180 |
qed "inf_assoc";
|
|
181 |
|
5069
|
182 |
Goal "(x || y) || z = x || (y || z)";
|
1440
|
183 |
by (stac (sup_uniq RS mp RS sym) 1);
|
|
184 |
back();
|
|
185 |
back();
|
|
186 |
back();
|
|
187 |
back();
|
|
188 |
back();
|
|
189 |
back();
|
|
190 |
back();
|
|
191 |
back();
|
4153
|
192 |
by (rtac refl 2);
|
|
193 |
by (rtac (is_sup_assoc RS mp) 1);
|
1440
|
194 |
by (REPEAT_FIRST (rtac conjI));
|
|
195 |
by (REPEAT_FIRST (rtac sup_is_sup));
|
|
196 |
qed "sup_assoc";
|
|
197 |
|
|
198 |
|
|
199 |
(* commutativity *)
|
|
200 |
|
5069
|
201 |
Goalw [inf_def] "x && y = y && x";
|
1440
|
202 |
by (stac (is_inf_commut RS ext) 1);
|
4153
|
203 |
by (rtac refl 1);
|
1440
|
204 |
qed "inf_commut";
|
|
205 |
|
5069
|
206 |
Goalw [sup_def] "x || y = y || x";
|
1440
|
207 |
by (stac (is_sup_commut RS ext) 1);
|
4153
|
208 |
by (rtac refl 1);
|
1440
|
209 |
qed "sup_commut";
|
|
210 |
|
|
211 |
|
|
212 |
(* idempotency *)
|
|
213 |
|
5069
|
214 |
Goal "x && x = x";
|
1440
|
215 |
by (stac inf_connect 1);
|
4153
|
216 |
by (rtac le_refl 1);
|
1440
|
217 |
qed "inf_idemp";
|
|
218 |
|
5069
|
219 |
Goal "x || x = x";
|
1440
|
220 |
by (stac sup_connect 1);
|
4153
|
221 |
by (rtac le_refl 1);
|
1440
|
222 |
qed "sup_idemp";
|
|
223 |
|
|
224 |
|
|
225 |
(* absorption *)
|
|
226 |
|
5069
|
227 |
Goal "x || (x && y) = x";
|
1440
|
228 |
by (stac sup_commut 1);
|
|
229 |
by (stac sup_connect 1);
|
4153
|
230 |
by (rtac inf_lb1 1);
|
1440
|
231 |
qed "sup_inf_absorb";
|
|
232 |
|
5069
|
233 |
Goal "x && (x || y) = x";
|
1440
|
234 |
by (stac inf_connect 1);
|
4153
|
235 |
by (rtac sup_ub1 1);
|
1440
|
236 |
qed "inf_sup_absorb";
|
|
237 |
|
|
238 |
|
|
239 |
(* monotonicity *)
|
|
240 |
|
|
241 |
val prems = goal thy "[| a [= b; x [= y |] ==> a && x [= b && y";
|
|
242 |
by (cut_facts_tac prems 1);
|
|
243 |
by (stac le_inf_eq 1);
|
4153
|
244 |
by (rtac conjI 1);
|
|
245 |
by (rtac (le_trans RS mp) 1);
|
|
246 |
by (rtac conjI 1);
|
|
247 |
by (rtac inf_lb1 1);
|
|
248 |
by (assume_tac 1);
|
|
249 |
by (rtac (le_trans RS mp) 1);
|
|
250 |
by (rtac conjI 1);
|
|
251 |
by (rtac inf_lb2 1);
|
|
252 |
by (assume_tac 1);
|
1440
|
253 |
qed "inf_mon";
|
|
254 |
|
|
255 |
val prems = goal thy "[| a [= b; x [= y |] ==> a || x [= b || y";
|
|
256 |
by (cut_facts_tac prems 1);
|
|
257 |
by (stac ge_sup_eq 1);
|
4153
|
258 |
by (rtac conjI 1);
|
|
259 |
by (rtac (le_trans RS mp) 1);
|
|
260 |
by (rtac conjI 1);
|
|
261 |
by (assume_tac 1);
|
|
262 |
by (rtac sup_ub1 1);
|
|
263 |
by (rtac (le_trans RS mp) 1);
|
|
264 |
by (rtac conjI 1);
|
|
265 |
by (assume_tac 1);
|
|
266 |
by (rtac sup_ub2 1);
|
1440
|
267 |
qed "sup_mon";
|