author | huffman |
Thu, 03 Mar 2005 01:37:32 +0100 | |
changeset 15568 | 41bfe19eabe2 |
parent 14981 | e73f8140af78 |
permissions | -rw-r--r-- |
2640 | 1 |
(* Title: HOLCF/Ssum1.thy |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1479 | 3 |
Author: Franz Regensburger |
15568 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
5 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
6 |
Partial ordering for the strict sum ++ |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
7 |
*) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
8 |
|
15568 | 9 |
theory Ssum1 = Ssum0: |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
10 |
|
15568 | 11 |
instance "++"::(pcpo,pcpo)sq_ord .. |
3323
194ae2e0c193
eliminated the constant less by the introduction of the axclass sq_ord
slotosch
parents:
2640
diff
changeset
|
12 |
|
15568 | 13 |
defs (overloaded) |
14 |
less_ssum_def: "(op <<) == (%s1 s2.@z. |
|
3842 | 15 |
(! u x. s1=Isinl u & s2=Isinl x --> z = u << x) |
16 |
&(! v y. s1=Isinr v & s2=Isinr y --> z = v << y) |
|
17 |
&(! u y. s1=Isinl u & s2=Isinr y --> z = (u = UU)) |
|
18 |
&(! v x. s1=Isinr v & s2=Isinl x --> z = (v = UU)))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
19 |
|
15568 | 20 |
(* Title: HOLCF/Ssum1.ML |
21 |
ID: $Id$ |
|
22 |
Author: Franz Regensburger |
|
23 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
|
24 |
||
25 |
Partial ordering for the strict sum ++ |
|
26 |
*) |
|
27 |
||
28 |
lemma less_ssum1a: |
|
29 |
"[|s1=Isinl(x::'a); s2=Isinl(y::'a)|] ==> s1 << s2 = (x << y)" |
|
30 |
apply (unfold less_ssum_def) |
|
31 |
apply (rule some_equality) |
|
32 |
apply (drule_tac [2] conjunct1) |
|
33 |
apply (drule_tac [2] spec) |
|
34 |
apply (drule_tac [2] spec) |
|
35 |
apply (erule_tac [2] mp) |
|
36 |
prefer 2 apply fast |
|
37 |
apply (rule conjI) |
|
38 |
apply (intro strip) |
|
39 |
apply (erule conjE) |
|
40 |
apply simp |
|
41 |
apply (drule inject_Isinl) |
|
42 |
apply (drule inject_Isinl) |
|
43 |
apply simp |
|
44 |
apply (rule conjI) |
|
45 |
apply (intro strip) |
|
46 |
apply (erule conjE) |
|
47 |
apply simp |
|
48 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
49 |
apply simp |
|
50 |
apply (rule conjI) |
|
51 |
apply (intro strip) |
|
52 |
apply (erule conjE) |
|
53 |
apply simp |
|
54 |
apply (drule inject_Isinl) |
|
55 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
56 |
apply simp |
|
57 |
apply (rule eq_UU_iff[symmetric]) |
|
58 |
apply (intro strip) |
|
59 |
apply (erule conjE) |
|
60 |
apply simp |
|
61 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
62 |
apply simp |
|
63 |
done |
|
64 |
||
65 |
||
66 |
lemma less_ssum1b: |
|
67 |
"[|s1=Isinr(x::'b); s2=Isinr(y::'b)|] ==> s1 << s2 = (x << y)" |
|
68 |
||
69 |
apply (unfold less_ssum_def) |
|
70 |
apply (rule some_equality) |
|
71 |
apply (drule_tac [2] conjunct2) |
|
72 |
apply (drule_tac [2] conjunct1) |
|
73 |
apply (drule_tac [2] spec) |
|
74 |
apply (drule_tac [2] spec) |
|
75 |
apply (erule_tac [2] mp) |
|
76 |
prefer 2 apply fast |
|
77 |
apply (rule conjI) |
|
78 |
apply (intro strip) |
|
79 |
apply (erule conjE) |
|
80 |
apply simp |
|
81 |
apply (drule noteq_IsinlIsinr) |
|
82 |
apply (drule noteq_IsinlIsinr) |
|
83 |
apply simp |
|
84 |
apply (rule conjI) |
|
85 |
apply (intro strip) |
|
86 |
apply (erule conjE) |
|
87 |
apply simp |
|
88 |
apply (drule inject_Isinr) |
|
89 |
apply (drule inject_Isinr) |
|
90 |
apply simp |
|
91 |
apply (rule conjI) |
|
92 |
apply (intro strip) |
|
93 |
apply (erule conjE) |
|
94 |
apply simp |
|
95 |
apply (drule noteq_IsinlIsinr) |
|
96 |
apply (drule inject_Isinr) |
|
97 |
apply simp |
|
98 |
apply (intro strip) |
|
99 |
apply (erule conjE) |
|
100 |
apply simp |
|
101 |
apply (drule inject_Isinr) |
|
102 |
apply (drule noteq_IsinlIsinr) |
|
103 |
apply simp |
|
104 |
apply (rule eq_UU_iff[symmetric]) |
|
105 |
done |
|
106 |
||
107 |
||
108 |
lemma less_ssum1c: |
|
109 |
"[|s1=Isinl(x::'a); s2=Isinr(y::'b)|] ==> s1 << s2 = ((x::'a) = UU)" |
|
110 |
||
111 |
apply (unfold less_ssum_def) |
|
112 |
apply (rule some_equality) |
|
113 |
apply (rule conjI) |
|
114 |
apply (intro strip) |
|
115 |
apply (erule conjE) |
|
116 |
apply simp |
|
117 |
apply (drule inject_Isinl) |
|
118 |
apply (drule noteq_IsinlIsinr) |
|
119 |
apply simp |
|
120 |
apply (rule eq_UU_iff) |
|
121 |
apply (rule conjI) |
|
122 |
apply (intro strip) |
|
123 |
apply (erule conjE) |
|
124 |
apply simp |
|
125 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
126 |
apply (drule inject_Isinr) |
|
127 |
apply simp |
|
128 |
apply (rule conjI) |
|
129 |
apply (intro strip) |
|
130 |
apply (erule conjE) |
|
131 |
apply simp |
|
132 |
apply (drule inject_Isinl) |
|
133 |
apply (drule inject_Isinr) |
|
134 |
apply simp |
|
135 |
apply (intro strip) |
|
136 |
apply (erule conjE) |
|
137 |
apply simp |
|
138 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
139 |
apply (drule noteq_IsinlIsinr) |
|
140 |
apply simp |
|
141 |
apply (drule conjunct2) |
|
142 |
apply (drule conjunct2) |
|
143 |
apply (drule conjunct1) |
|
144 |
apply (drule spec) |
|
145 |
apply (drule spec) |
|
146 |
apply (erule mp) |
|
147 |
apply fast |
|
148 |
done |
|
149 |
||
150 |
||
151 |
lemma less_ssum1d: |
|
152 |
"[|s1=Isinr(x); s2=Isinl(y)|] ==> s1 << s2 = (x = UU)" |
|
153 |
||
154 |
apply (unfold less_ssum_def) |
|
155 |
apply (rule some_equality) |
|
156 |
apply (drule_tac [2] conjunct2) |
|
157 |
apply (drule_tac [2] conjunct2) |
|
158 |
apply (drule_tac [2] conjunct2) |
|
159 |
apply (drule_tac [2] spec) |
|
160 |
apply (drule_tac [2] spec) |
|
161 |
apply (erule_tac [2] mp) |
|
162 |
prefer 2 apply fast |
|
163 |
apply (rule conjI) |
|
164 |
apply (intro strip) |
|
165 |
apply (erule conjE) |
|
166 |
apply simp |
|
167 |
apply (drule noteq_IsinlIsinr) |
|
168 |
apply (drule inject_Isinl) |
|
169 |
apply simp |
|
170 |
apply (rule conjI) |
|
171 |
apply (intro strip) |
|
172 |
apply (erule conjE) |
|
173 |
apply simp |
|
174 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
175 |
apply (drule inject_Isinr) |
|
176 |
apply simp |
|
177 |
apply (rule eq_UU_iff) |
|
178 |
apply (rule conjI) |
|
179 |
apply (intro strip) |
|
180 |
apply (erule conjE) |
|
181 |
apply simp |
|
182 |
apply (drule noteq_IsinlIsinr) |
|
183 |
apply (drule noteq_IsinlIsinr[OF sym]) |
|
184 |
apply simp |
|
185 |
apply (intro strip) |
|
186 |
apply (erule conjE) |
|
187 |
apply simp |
|
188 |
apply (drule inject_Isinr) |
|
189 |
apply simp |
|
190 |
done |
|
191 |
||
192 |
||
193 |
(* ------------------------------------------------------------------------ *) |
|
194 |
(* optimize lemmas about less_ssum *) |
|
195 |
(* ------------------------------------------------------------------------ *) |
|
196 |
||
197 |
lemma less_ssum2a: "(Isinl x) << (Isinl y) = (x << y)" |
|
198 |
apply (rule less_ssum1a) |
|
199 |
apply (rule refl) |
|
200 |
apply (rule refl) |
|
201 |
done |
|
202 |
||
203 |
lemma less_ssum2b: "(Isinr x) << (Isinr y) = (x << y)" |
|
204 |
apply (rule less_ssum1b) |
|
205 |
apply (rule refl) |
|
206 |
apply (rule refl) |
|
207 |
done |
|
208 |
||
209 |
lemma less_ssum2c: "(Isinl x) << (Isinr y) = (x = UU)" |
|
210 |
apply (rule less_ssum1c) |
|
211 |
apply (rule refl) |
|
212 |
apply (rule refl) |
|
213 |
done |
|
214 |
||
215 |
lemma less_ssum2d: "(Isinr x) << (Isinl y) = (x = UU)" |
|
216 |
apply (rule less_ssum1d) |
|
217 |
apply (rule refl) |
|
218 |
apply (rule refl) |
|
219 |
done |
|
220 |
||
221 |
||
222 |
(* ------------------------------------------------------------------------ *) |
|
223 |
(* less_ssum is a partial order on ++ *) |
|
224 |
(* ------------------------------------------------------------------------ *) |
|
225 |
||
226 |
lemma refl_less_ssum: "(p::'a++'b) << p" |
|
227 |
apply (rule_tac p = "p" in IssumE2) |
|
228 |
apply (erule ssubst) |
|
229 |
apply (rule less_ssum2a [THEN iffD2]) |
|
230 |
apply (rule refl_less) |
|
231 |
apply (erule ssubst) |
|
232 |
apply (rule less_ssum2b [THEN iffD2]) |
|
233 |
apply (rule refl_less) |
|
234 |
done |
|
235 |
||
236 |
lemma antisym_less_ssum: "[|(p1::'a++'b) << p2; p2 << p1|] ==> p1=p2" |
|
237 |
apply (rule_tac p = "p1" in IssumE2) |
|
238 |
apply simp |
|
239 |
apply (rule_tac p = "p2" in IssumE2) |
|
240 |
apply simp |
|
241 |
apply (rule_tac f = "Isinl" in arg_cong) |
|
242 |
apply (rule antisym_less) |
|
243 |
apply (erule less_ssum2a [THEN iffD1]) |
|
244 |
apply (erule less_ssum2a [THEN iffD1]) |
|
245 |
apply simp |
|
246 |
apply (erule less_ssum2d [THEN iffD1, THEN ssubst]) |
|
247 |
apply (erule less_ssum2c [THEN iffD1, THEN ssubst]) |
|
248 |
apply (rule strict_IsinlIsinr) |
|
249 |
apply simp |
|
250 |
apply (rule_tac p = "p2" in IssumE2) |
|
251 |
apply simp |
|
252 |
apply (erule less_ssum2c [THEN iffD1, THEN ssubst]) |
|
253 |
apply (erule less_ssum2d [THEN iffD1, THEN ssubst]) |
|
254 |
apply (rule strict_IsinlIsinr [symmetric]) |
|
255 |
apply simp |
|
256 |
apply (rule_tac f = "Isinr" in arg_cong) |
|
257 |
apply (rule antisym_less) |
|
258 |
apply (erule less_ssum2b [THEN iffD1]) |
|
259 |
apply (erule less_ssum2b [THEN iffD1]) |
|
260 |
done |
|
261 |
||
262 |
lemma trans_less_ssum: "[|(p1::'a++'b) << p2; p2 << p3|] ==> p1 << p3" |
|
263 |
apply (rule_tac p = "p1" in IssumE2) |
|
264 |
apply simp |
|
265 |
apply (rule_tac p = "p3" in IssumE2) |
|
266 |
apply simp |
|
267 |
apply (rule less_ssum2a [THEN iffD2]) |
|
268 |
apply (rule_tac p = "p2" in IssumE2) |
|
269 |
apply simp |
|
270 |
apply (rule trans_less) |
|
271 |
apply (erule less_ssum2a [THEN iffD1]) |
|
272 |
apply (erule less_ssum2a [THEN iffD1]) |
|
273 |
apply simp |
|
274 |
apply (erule less_ssum2c [THEN iffD1, THEN ssubst]) |
|
275 |
apply (rule minimal) |
|
276 |
apply simp |
|
277 |
apply (rule less_ssum2c [THEN iffD2]) |
|
278 |
apply (rule_tac p = "p2" in IssumE2) |
|
279 |
apply simp |
|
280 |
apply (rule UU_I) |
|
281 |
apply (rule trans_less) |
|
282 |
apply (erule less_ssum2a [THEN iffD1]) |
|
283 |
apply (rule antisym_less_inverse [THEN conjunct1]) |
|
284 |
apply (erule less_ssum2c [THEN iffD1]) |
|
285 |
apply simp |
|
286 |
apply (erule less_ssum2c [THEN iffD1]) |
|
287 |
apply simp |
|
288 |
apply (rule_tac p = "p3" in IssumE2) |
|
289 |
apply simp |
|
290 |
apply (rule less_ssum2d [THEN iffD2]) |
|
291 |
apply (rule_tac p = "p2" in IssumE2) |
|
292 |
apply simp |
|
293 |
apply (erule less_ssum2d [THEN iffD1]) |
|
294 |
apply simp |
|
295 |
apply (rule UU_I) |
|
296 |
apply (rule trans_less) |
|
297 |
apply (erule less_ssum2b [THEN iffD1]) |
|
298 |
apply (rule antisym_less_inverse [THEN conjunct1]) |
|
299 |
apply (erule less_ssum2d [THEN iffD1]) |
|
300 |
apply simp |
|
301 |
apply (rule less_ssum2b [THEN iffD2]) |
|
302 |
apply (rule_tac p = "p2" in IssumE2) |
|
303 |
apply simp |
|
304 |
apply (erule less_ssum2d [THEN iffD1, THEN ssubst]) |
|
305 |
apply (rule minimal) |
|
306 |
apply simp |
|
307 |
apply (rule trans_less) |
|
308 |
apply (erule less_ssum2b [THEN iffD1]) |
|
309 |
apply (erule less_ssum2b [THEN iffD1]) |
|
310 |
done |
|
311 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
312 |
end |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
313 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
314 |