author | Christian Urban <urbanc@in.tum.de> |
Thu, 05 Nov 2009 09:55:21 +0100 | |
changeset 286 | a031bcaf6719 |
parent 253 | e169a99c6ada |
child 317 | d3c7f6d19c7f |
permissions | -rw-r--r-- |
0 | 1 |
theory QuotScript |
2 |
imports Main |
|
3 |
begin |
|
4 |
||
5 |
definition |
|
6 |
"EQUIV E \<equiv> \<forall>x y. E x y = (E x = E y)" |
|
7 |
||
8 |
definition |
|
9 |
"REFL E \<equiv> \<forall>x. E x x" |
|
10 |
||
11 |
definition |
|
12 |
"SYM E \<equiv> \<forall>x y. E x y \<longrightarrow> E y x" |
|
13 |
||
14 |
definition |
|
15 |
"TRANS E \<equiv> \<forall>x y z. E x y \<and> E y z \<longrightarrow> E x z" |
|
16 |
||
17 |
lemma EQUIV_REFL_SYM_TRANS: |
|
18 |
shows "EQUIV E = (REFL E \<and> SYM E \<and> TRANS E)" |
|
19 |
unfolding EQUIV_def REFL_def SYM_def TRANS_def expand_fun_eq |
|
20 |
by (blast) |
|
21 |
||
217
9cc87d02190a
First experiments with Lambda
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
188
diff
changeset
|
22 |
lemma EQUIV_REFL: |
9cc87d02190a
First experiments with Lambda
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
188
diff
changeset
|
23 |
shows "EQUIV E ==> REFL E" |
9cc87d02190a
First experiments with Lambda
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
188
diff
changeset
|
24 |
by (simp add: EQUIV_REFL_SYM_TRANS) |
9cc87d02190a
First experiments with Lambda
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
188
diff
changeset
|
25 |
|
0 | 26 |
definition |
27 |
"PART_EQUIV E \<equiv> (\<exists>x. E x x) \<and> (\<forall>x y. E x y = (E x x \<and> E y y \<and> (E x = E y)))" |
|
28 |
||
29 |
lemma EQUIV_IMP_PART_EQUIV: |
|
30 |
assumes a: "EQUIV E" |
|
31 |
shows "PART_EQUIV E" |
|
32 |
using a unfolding EQUIV_def PART_EQUIV_def |
|
33 |
by auto |
|
34 |
||
35 |
definition |
|
36 |
"QUOTIENT E Abs Rep \<equiv> (\<forall>a. Abs (Rep a) = a) \<and> |
|
37 |
(\<forall>a. E (Rep a) (Rep a)) \<and> |
|
38 |
(\<forall>r s. E r s = (E r r \<and> E s s \<and> (Abs r = Abs s)))" |
|
39 |
||
40 |
lemma QUOTIENT_ABS_REP: |
|
41 |
assumes a: "QUOTIENT E Abs Rep" |
|
42 |
shows "Abs (Rep a) = a" |
|
43 |
using a unfolding QUOTIENT_def |
|
44 |
by simp |
|
45 |
||
46 |
lemma QUOTIENT_REP_REFL: |
|
47 |
assumes a: "QUOTIENT E Abs Rep" |
|
48 |
shows "E (Rep a) (Rep a)" |
|
49 |
using a unfolding QUOTIENT_def |
|
50 |
by blast |
|
51 |
||
52 |
lemma QUOTIENT_REL: |
|
53 |
assumes a: "QUOTIENT E Abs Rep" |
|
54 |
shows " E r s = (E r r \<and> E s s \<and> (Abs r = Abs s))" |
|
55 |
using a unfolding QUOTIENT_def |
|
56 |
by blast |
|
57 |
||
58 |
lemma QUOTIENT_REL_ABS: |
|
59 |
assumes a: "QUOTIENT E Abs Rep" |
|
60 |
shows "E r s \<Longrightarrow> Abs r = Abs s" |
|
61 |
using a unfolding QUOTIENT_def |
|
62 |
by blast |
|
63 |
||
64 |
lemma QUOTIENT_REL_ABS_EQ: |
|
65 |
assumes a: "QUOTIENT E Abs Rep" |
|
66 |
shows "E r r \<Longrightarrow> E s s \<Longrightarrow> E r s = (Abs r = Abs s)" |
|
67 |
using a unfolding QUOTIENT_def |
|
68 |
by blast |
|
69 |
||
70 |
lemma QUOTIENT_REL_REP: |
|
71 |
assumes a: "QUOTIENT E Abs Rep" |
|
72 |
shows "E (Rep a) (Rep b) = (a = b)" |
|
73 |
using a unfolding QUOTIENT_def |
|
74 |
by metis |
|
75 |
||
76 |
lemma QUOTIENT_REP_ABS: |
|
77 |
assumes a: "QUOTIENT E Abs Rep" |
|
78 |
shows "E r r \<Longrightarrow> E (Rep (Abs r)) r" |
|
79 |
using a unfolding QUOTIENT_def |
|
80 |
by blast |
|
81 |
||
82 |
lemma IDENTITY_EQUIV: |
|
83 |
shows "EQUIV (op =)" |
|
84 |
unfolding EQUIV_def |
|
85 |
by auto |
|
86 |
||
87 |
lemma IDENTITY_QUOTIENT: |
|
126
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
88 |
shows "QUOTIENT (op =) id id" |
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
89 |
unfolding QUOTIENT_def id_def |
0 | 90 |
by blast |
91 |
||
92 |
lemma QUOTIENT_SYM: |
|
93 |
assumes a: "QUOTIENT E Abs Rep" |
|
94 |
shows "SYM E" |
|
95 |
using a unfolding QUOTIENT_def SYM_def |
|
96 |
by metis |
|
97 |
||
98 |
lemma QUOTIENT_TRANS: |
|
99 |
assumes a: "QUOTIENT E Abs Rep" |
|
100 |
shows "TRANS E" |
|
101 |
using a unfolding QUOTIENT_def TRANS_def |
|
102 |
by metis |
|
103 |
||
104 |
fun |
|
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
105 |
prod_rel |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
106 |
where |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
107 |
"prod_rel r1 r2 = (\<lambda>(a,b) (c,d). r1 a c \<and> r2 b d)" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
108 |
|
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
109 |
fun |
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
110 |
fun_map |
0 | 111 |
where |
112 |
"fun_map f g h x = g (h (f x))" |
|
113 |
||
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
114 |
|
0 | 115 |
abbreviation |
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
116 |
fun_map_syn (infixr "--->" 55) |
0 | 117 |
where |
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
118 |
"f ---> g \<equiv> fun_map f g" |
0 | 119 |
|
120 |
lemma FUN_MAP_I: |
|
126
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
121 |
shows "(id ---> id) = id" |
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
122 |
by (simp add: expand_fun_eq id_def) |
0 | 123 |
|
124 |
lemma IN_FUN: |
|
125 |
shows "x \<in> ((f ---> g) s) = g (f x \<in> s)" |
|
126 |
by (simp add: mem_def) |
|
127 |
||
128 |
fun |
|
129 |
FUN_REL |
|
130 |
where |
|
131 |
"FUN_REL E1 E2 f g = (\<forall>x y. E1 x y \<longrightarrow> E2 (f x) (g y))" |
|
132 |
||
133 |
abbreviation |
|
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
217
diff
changeset
|
134 |
FUN_REL_syn (infixr "===>" 55) |
0 | 135 |
where |
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
217
diff
changeset
|
136 |
"E1 ===> E2 \<equiv> FUN_REL E1 E2" |
0 | 137 |
|
138 |
lemma FUN_REL_EQ: |
|
139 |
"(op =) ===> (op =) = (op =)" |
|
140 |
by (simp add: expand_fun_eq) |
|
141 |
||
142 |
lemma FUN_QUOTIENT: |
|
143 |
assumes q1: "QUOTIENT R1 abs1 rep1" |
|
144 |
and q2: "QUOTIENT R2 abs2 rep2" |
|
145 |
shows "QUOTIENT (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
|
146 |
proof - |
|
147 |
have "\<forall>a. (rep1 ---> abs2) ((abs1 ---> rep2) a) = a" |
|
148 |
apply(simp add: expand_fun_eq) |
|
149 |
using q1 q2 |
|
150 |
apply(simp add: QUOTIENT_def) |
|
151 |
done |
|
152 |
moreover |
|
153 |
have "\<forall>a. (R1 ===> R2) ((abs1 ---> rep2) a) ((abs1 ---> rep2) a)" |
|
154 |
apply(auto) |
|
155 |
using q1 q2 unfolding QUOTIENT_def |
|
156 |
apply(metis) |
|
157 |
done |
|
158 |
moreover |
|
159 |
have "\<forall>r s. (R1 ===> R2) r s = ((R1 ===> R2) r r \<and> (R1 ===> R2) s s \<and> |
|
160 |
(rep1 ---> abs2) r = (rep1 ---> abs2) s)" |
|
161 |
apply(auto simp add: expand_fun_eq) |
|
162 |
using q1 q2 unfolding QUOTIENT_def |
|
163 |
apply(metis) |
|
164 |
using q1 q2 unfolding QUOTIENT_def |
|
165 |
apply(metis) |
|
166 |
using q1 q2 unfolding QUOTIENT_def |
|
167 |
apply(metis) |
|
168 |
using q1 q2 unfolding QUOTIENT_def |
|
169 |
apply(metis) |
|
170 |
done |
|
171 |
ultimately |
|
172 |
show "QUOTIENT (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
|
173 |
unfolding QUOTIENT_def by blast |
|
174 |
qed |
|
175 |
||
176 |
definition |
|
177 |
Respects |
|
178 |
where |
|
179 |
"Respects R x \<equiv> (R x x)" |
|
180 |
||
181 |
lemma IN_RESPECTS: |
|
182 |
shows "(x \<in> Respects R) = R x x" |
|
183 |
unfolding mem_def Respects_def by simp |
|
184 |
||
185 |
lemma RESPECTS_THM: |
|
186 |
shows "Respects (R1 ===> R2) f = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (f y))" |
|
187 |
unfolding Respects_def |
|
188 |
by (simp add: expand_fun_eq) |
|
189 |
||
190 |
lemma RESPECTS_MP: |
|
191 |
assumes a: "Respects (R1 ===> R2) f" |
|
192 |
and b: "R1 x y" |
|
193 |
shows "R2 (f x) (f y)" |
|
194 |
using a b unfolding Respects_def |
|
195 |
by simp |
|
196 |
||
197 |
lemma RESPECTS_REP_ABS: |
|
198 |
assumes a: "QUOTIENT R1 Abs1 Rep1" |
|
199 |
and b: "Respects (R1 ===> R2) f" |
|
200 |
and c: "R1 x x" |
|
201 |
shows "R2 (f (Rep1 (Abs1 x))) (f x)" |
|
202 |
using a b[simplified RESPECTS_THM] c unfolding QUOTIENT_def |
|
203 |
by blast |
|
204 |
||
205 |
lemma RESPECTS_o: |
|
206 |
assumes a: "Respects (R2 ===> R3) f" |
|
207 |
and b: "Respects (R1 ===> R2) g" |
|
208 |
shows "Respects (R1 ===> R3) (f o g)" |
|
209 |
using a b unfolding Respects_def |
|
210 |
by simp |
|
211 |
||
212 |
(* |
|
213 |
definition |
|
214 |
"RES_EXISTS_EQUIV R P \<equiv> (\<exists>x \<in> Respects R. P x) \<and> |
|
215 |
(\<forall>x\<in> Respects R. \<forall>y\<in> Respects R. P x \<and> P y \<longrightarrow> R x y)" |
|
216 |
*) |
|
217 |
||
218 |
lemma FUN_REL_EQ_REL: |
|
219 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
220 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
221 |
shows "(R1 ===> R2) f g = ((Respects (R1 ===> R2) f) \<and> (Respects (R1 ===> R2) g) |
|
222 |
\<and> ((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g))" |
|
223 |
using FUN_QUOTIENT[OF q1 q2] unfolding Respects_def QUOTIENT_def expand_fun_eq |
|
224 |
by blast |
|
225 |
||
226 |
(* q1 and q2 not used; see next lemma *) |
|
227 |
lemma FUN_REL_MP: |
|
228 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
229 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
230 |
shows "(R1 ===> R2) f g \<Longrightarrow> R1 x y \<Longrightarrow> R2 (f x) (g y)" |
|
231 |
by simp |
|
232 |
||
233 |
lemma FUN_REL_IMP: |
|
234 |
shows "(R1 ===> R2) f g \<Longrightarrow> R1 x y \<Longrightarrow> R2 (f x) (g y)" |
|
235 |
by simp |
|
236 |
||
237 |
lemma FUN_REL_EQUALS: |
|
238 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
239 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
240 |
and r1: "Respects (R1 ===> R2) f" |
|
241 |
and r2: "Respects (R1 ===> R2) g" |
|
242 |
shows "((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g) = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (g y))" |
|
243 |
apply(rule_tac iffI) |
|
244 |
using FUN_QUOTIENT[OF q1 q2] r1 r2 unfolding QUOTIENT_def Respects_def |
|
245 |
apply(metis FUN_REL_IMP) |
|
246 |
using r1 unfolding Respects_def expand_fun_eq |
|
247 |
apply(simp (no_asm_use)) |
|
248 |
apply(metis QUOTIENT_REL[OF q2] QUOTIENT_REL_REP[OF q1]) |
|
249 |
done |
|
250 |
||
251 |
(* ask Peter: FUN_REL_IMP used twice *) |
|
252 |
lemma FUN_REL_IMP2: |
|
253 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
254 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
255 |
and r1: "Respects (R1 ===> R2) f" |
|
256 |
and r2: "Respects (R1 ===> R2) g" |
|
257 |
and a: "(Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g" |
|
258 |
shows "R1 x y \<Longrightarrow> R2 (f x) (g y)" |
|
259 |
using q1 q2 r1 r2 a |
|
260 |
by (simp add: FUN_REL_EQUALS) |
|
261 |
||
262 |
lemma EQUALS_PRS: |
|
263 |
assumes q: "QUOTIENT R Abs Rep" |
|
264 |
shows "(x = y) = R (Rep x) (Rep y)" |
|
265 |
by (simp add: QUOTIENT_REL_REP[OF q]) |
|
266 |
||
267 |
lemma EQUALS_RSP: |
|
268 |
assumes q: "QUOTIENT R Abs Rep" |
|
269 |
and a: "R x1 x2" "R y1 y2" |
|
270 |
shows "R x1 y1 = R x2 y2" |
|
271 |
using QUOTIENT_SYM[OF q] QUOTIENT_TRANS[OF q] unfolding SYM_def TRANS_def |
|
272 |
using a by blast |
|
273 |
||
274 |
lemma LAMBDA_PRS: |
|
275 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
276 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
253
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
277 |
shows "(Rep1 ---> Abs2) (\<lambda>x. Rep2 (f (Abs1 x))) = (\<lambda>x. f x)" |
0 | 278 |
unfolding expand_fun_eq |
279 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] |
|
280 |
by simp |
|
281 |
||
282 |
lemma LAMBDA_PRS1: |
|
283 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
284 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
285 |
shows "(\<lambda>x. f x) = (Rep1 ---> Abs2) (\<lambda>x. (Abs1 ---> Rep2) f x)" |
|
286 |
unfolding expand_fun_eq |
|
253
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
287 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
288 |
by (simp) |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
289 |
|
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
290 |
lemma APP_PRS: |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
291 |
assumes q1: "QUOTIENT R1 abs1 rep1" |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
292 |
and q2: "QUOTIENT R2 abs2 rep2" |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
293 |
shows "abs2 ((abs1 ---> rep2) f (rep1 x)) = f x" |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
294 |
unfolding expand_fun_eq |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
295 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] |
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
296 |
by simp |
0 | 297 |
|
298 |
(* Ask Peter: assumption q1 and q2 not used and lemma is the 'identity' *) |
|
299 |
lemma LAMBDA_RSP: |
|
300 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
301 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
302 |
and a: "(R1 ===> R2) f1 f2" |
|
303 |
shows "(R1 ===> R2) (\<lambda>x. f1 x) (\<lambda>y. f2 y)" |
|
304 |
by (rule a) |
|
305 |
||
306 |
(* ASK Peter about next four lemmas in quotientScript |
|
307 |
lemma ABSTRACT_PRS: |
|
308 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
309 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
310 |
shows "f = (Rep1 ---> Abs2) ???" |
|
311 |
*) |
|
312 |
||
313 |
lemma LAMBDA_REP_ABS_RSP: |
|
314 |
assumes r1: "\<And>r r'. R1 r r' \<Longrightarrow>R1 r (Rep1 (Abs1 r'))" |
|
315 |
and r2: "\<And>r r'. R2 r r' \<Longrightarrow>R2 r (Rep2 (Abs2 r'))" |
|
316 |
shows "(R1 ===> R2) f1 f2 \<Longrightarrow> (R1 ===> R2) f1 ((Abs1 ---> Rep2) ((Rep1 ---> Abs2) f2))" |
|
317 |
using r1 r2 by auto |
|
318 |
||
319 |
lemma REP_ABS_RSP: |
|
320 |
assumes q: "QUOTIENT R Abs Rep" |
|
321 |
and a: "R x1 x2" |
|
322 |
shows "R x1 (Rep (Abs x2))" |
|
113
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
323 |
and "R (Rep (Abs x1)) x2" |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
324 |
proof - |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
325 |
show "R x1 (Rep (Abs x2))" |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
326 |
using q a by (metis QUOTIENT_REL[OF q] QUOTIENT_ABS_REP[OF q] QUOTIENT_REP_REFL[OF q]) |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
327 |
next |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
328 |
show "R (Rep (Abs x1)) x2" |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
329 |
using q a by (metis QUOTIENT_REL[OF q] QUOTIENT_ABS_REP[OF q] QUOTIENT_REP_REFL[OF q] QUOTIENT_SYM[of q]) |
e3a963e6418b
Symmetric version of REP_ABS_RSP
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
112
diff
changeset
|
330 |
qed |
0 | 331 |
|
332 |
(* ----------------------------------------------------- *) |
|
333 |
(* Quantifiers: FORALL, EXISTS, EXISTS_UNIQUE, *) |
|
334 |
(* RES_FORALL, RES_EXISTS, RES_EXISTS_EQUIV *) |
|
335 |
(* ----------------------------------------------------- *) |
|
336 |
||
337 |
(* what is RES_FORALL *) |
|
338 |
(*--`!R (abs:'a -> 'b) rep. QUOTIENT R abs rep ==> |
|
339 |
!f. $! f = RES_FORALL (respects R) ((abs --> I) f)`--*) |
|
340 |
(*as peter here *) |
|
341 |
||
342 |
(* bool theory: COND, LET *) |
|
343 |
||
344 |
lemma IF_PRS: |
|
345 |
assumes q: "QUOTIENT R Abs Rep" |
|
346 |
shows "If a b c = Abs (If a (Rep b) (Rep c))" |
|
347 |
using QUOTIENT_ABS_REP[OF q] by auto |
|
348 |
||
349 |
(* ask peter: no use of q *) |
|
350 |
lemma IF_RSP: |
|
351 |
assumes q: "QUOTIENT R Abs Rep" |
|
352 |
and a: "a1 = a2" "R b1 b2" "R c1 c2" |
|
353 |
shows "R (If a1 b1 c1) (If a2 b2 c2)" |
|
354 |
using a by auto |
|
355 |
||
356 |
lemma LET_PRS: |
|
357 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
358 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
359 |
shows "Let x f = Abs2 (Let (Rep1 x) ((Abs1 ---> Rep2) f))" |
|
360 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] by auto |
|
361 |
||
362 |
lemma LET_RSP: |
|
363 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
364 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
365 |
and a1: "(R1 ===> R2) f g" |
|
366 |
and a2: "R1 x y" |
|
367 |
shows "R2 (Let x f) (Let y g)" |
|
368 |
using FUN_REL_MP[OF q1 q2 a1] a2 |
|
369 |
by auto |
|
370 |
||
371 |
||
372 |
(* ask peter what are literal_case *) |
|
373 |
(* literal_case_PRS *) |
|
374 |
(* literal_case_RSP *) |
|
375 |
||
376 |
||
377 |
(* FUNCTION APPLICATION *) |
|
378 |
||
379 |
lemma APPLY_PRS: |
|
380 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
381 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
382 |
shows "f x = Abs2 (((Abs1 ---> Rep2) f) (Rep1 x))" |
|
383 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] by auto |
|
384 |
||
385 |
(* ask peter: no use of q1 q2 *) |
|
386 |
lemma APPLY_RSP: |
|
387 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
388 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
389 |
and a: "(R1 ===> R2) f g" "R1 x y" |
|
390 |
shows "R2 (f x) (g y)" |
|
391 |
using a by (rule FUN_REL_IMP) |
|
392 |
||
393 |
||
394 |
(* combinators: I, K, o, C, W *) |
|
395 |
||
396 |
lemma I_PRS: |
|
397 |
assumes q: "QUOTIENT R Abs Rep" |
|
126
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
398 |
shows "id e = Abs (id (Rep e))" |
0 | 399 |
using QUOTIENT_ABS_REP[OF q] by auto |
400 |
||
401 |
lemma I_RSP: |
|
402 |
assumes q: "QUOTIENT R Abs Rep" |
|
403 |
and a: "R e1 e2" |
|
126
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
404 |
shows "R (id e1) (id e2)" |
0 | 405 |
using a by auto |
406 |
||
407 |
lemma o_PRS: |
|
408 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
409 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
410 |
and q3: "QUOTIENT R3 Abs3 Rep3" |
|
411 |
shows "f o g = (Rep1 ---> Abs3) (((Abs2 ---> Rep3) f) o ((Abs1 ---> Rep2) g))" |
|
412 |
using QUOTIENT_ABS_REP[OF q1] QUOTIENT_ABS_REP[OF q2] QUOTIENT_ABS_REP[OF q3] |
|
413 |
unfolding o_def expand_fun_eq |
|
414 |
by simp |
|
415 |
||
416 |
lemma o_RSP: |
|
417 |
assumes q1: "QUOTIENT R1 Abs1 Rep1" |
|
418 |
and q2: "QUOTIENT R2 Abs2 Rep2" |
|
419 |
and q3: "QUOTIENT R3 Abs3 Rep3" |
|
420 |
and a1: "(R2 ===> R3) f1 f2" |
|
421 |
and a2: "(R1 ===> R2) g1 g2" |
|
422 |
shows "(R1 ===> R3) (f1 o g1) (f2 o g2)" |
|
423 |
using a1 a2 unfolding o_def expand_fun_eq |
|
424 |
by (auto) |
|
425 |
||
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
426 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
427 |
(* TODO: Put the following lemmas in proper places *) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
428 |
|
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
429 |
lemma equiv_res_forall: |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
430 |
fixes P :: "'a \<Rightarrow> bool" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
431 |
assumes a: "EQUIV E" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
432 |
shows "Ball (Respects E) P = (All P)" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
433 |
using a by (metis EQUIV_def IN_RESPECTS a) |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
434 |
|
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
435 |
lemma equiv_res_exists: |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
436 |
fixes P :: "'a \<Rightarrow> bool" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
437 |
assumes a: "EQUIV E" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
438 |
shows "Bex (Respects E) P = (Ex P)" |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
439 |
using a by (metis EQUIV_def IN_RESPECTS a) |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
440 |
|
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
441 |
lemma FORALL_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
442 |
assumes a: "!x :: 'a. (P x --> Q x)" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
443 |
and b: "All P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
444 |
shows "All Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
445 |
using a b by (metis) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
446 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
447 |
lemma EXISTS_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
448 |
assumes a: "!x :: 'a. (P x --> Q x)" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
449 |
and b: "Ex P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
450 |
shows "Ex Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
451 |
using a b by (metis) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
452 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
453 |
lemma RES_FORALL_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
454 |
assumes a: "!x :: 'a. (R x --> P x --> Q x)" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
455 |
and b: "Ball R P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
456 |
shows "Ball R Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
457 |
using a b by (metis COMBC_def Collect_def Collect_mem_eq) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
458 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
459 |
lemma RES_EXISTS_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
460 |
assumes a: "!x :: 'a. (R x --> P x --> Q x)" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
461 |
and b: "Bex R P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
462 |
shows "Bex R Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
463 |
using a b by (metis COMBC_def Collect_def Collect_mem_eq) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
464 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
465 |
lemma LEFT_RES_FORALL_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
466 |
assumes a: "!x. (R x \<and> (Q x --> P x))" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
467 |
shows "Ball R Q ==> All P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
468 |
using a |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
469 |
apply (metis COMBC_def Collect_def Collect_mem_eq a) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
470 |
done |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
471 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
472 |
lemma RIGHT_RES_FORALL_REGULAR: |
252
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
228
diff
changeset
|
473 |
assumes a: "\<And>x :: 'a. (R x \<Longrightarrow> P x \<longrightarrow> Q x)" |
e30997c88050
Regularize for equalities and a better tactic. "alpha.cases" now lifts.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
228
diff
changeset
|
474 |
shows "All P \<longrightarrow> Ball R Q" |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
475 |
using a |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
476 |
apply (metis COMBC_def Collect_def Collect_mem_eq a) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
477 |
done |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
478 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
479 |
lemma LEFT_RES_EXISTS_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
480 |
assumes a: "!x :: 'a. (R x --> Q x --> P x)" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
481 |
shows "Bex R Q ==> Ex P" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
482 |
using a by (metis COMBC_def Collect_def Collect_mem_eq) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
483 |
|
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
484 |
lemma RIGHT_RES_EXISTS_REGULAR: |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
485 |
assumes a: "!x :: 'a. (R x \<and> (P x --> Q x))" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
486 |
shows "Ex P \<Longrightarrow> Bex R Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
487 |
using a by (metis COMBC_def Collect_def Collect_mem_eq) |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
488 |
|
162 | 489 |
(* TODO: Add similar *) |
153
0288dd5b7ed4
The problems with 'abs' term.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
126
diff
changeset
|
490 |
lemma RES_FORALL_RSP: |
0288dd5b7ed4
The problems with 'abs' term.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
126
diff
changeset
|
491 |
shows "\<And>f g. (R ===> (op =)) f g ==> |
0288dd5b7ed4
The problems with 'abs' term.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
126
diff
changeset
|
492 |
(Ball (Respects R) f = Ball (Respects R) g)" |
155 | 493 |
apply (simp add: FUN_REL.simps Ball_def IN_RESPECTS) |
494 |
done |
|
153
0288dd5b7ed4
The problems with 'abs' term.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
126
diff
changeset
|
495 |
|
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
496 |
lemma RES_EXISTS_RSP: |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
497 |
shows "\<And>f g. (R ===> (op =)) f g ==> |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
498 |
(Bex (Respects R) f = Bex (Respects R) g)" |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
499 |
apply (simp add: FUN_REL.simps Bex_def IN_RESPECTS) |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
500 |
done |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
501 |
|
188
b8485573548d
Finished COND_PRS proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
187
diff
changeset
|
502 |
|
162 | 503 |
lemma FORALL_PRS: |
504 |
assumes a: "QUOTIENT R absf repf" |
|
183
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
505 |
shows "All f = Ball (Respects R) ((absf ---> id) f)" |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
506 |
using a |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
507 |
unfolding QUOTIENT_def |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
508 |
by (metis IN_RESPECTS fun_map.simps id_apply) |
162 | 509 |
|
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
510 |
lemma EXISTS_PRS: |
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
511 |
assumes a: "QUOTIENT R absf repf" |
183
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
512 |
shows "Ex f = Bex (Respects R) ((absf ---> id) f)" |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
513 |
using a |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
514 |
unfolding QUOTIENT_def |
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
515 |
by (metis COMBC_def Collect_def Collect_mem_eq IN_RESPECTS fun_map.simps id_apply mem_def) |
187 | 516 |
|
517 |
lemma COND_PRS: |
|
518 |
assumes a: "QUOTIENT R absf repf" |
|
519 |
shows "(if a then b else c) = absf (if a then repf b else repf c)" |
|
188
b8485573548d
Finished COND_PRS proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
187
diff
changeset
|
520 |
using a unfolding QUOTIENT_def by auto |
187 | 521 |
|
522 |
(* These are the fixed versions, general ones need to be proved. *) |
|
523 |
lemma ho_all_prs: |
|
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
217
diff
changeset
|
524 |
shows "((op = ===> op =) ===> op =) All All" |
183
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
525 |
by auto |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
526 |
|
228
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
217
diff
changeset
|
527 |
lemma ho_ex_prs: |
268a727b0f10
disambiguate ===> syntax
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
217
diff
changeset
|
528 |
shows "((op = ===> op =) ===> op =) Ex Ex" |
183
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
parents:
173
diff
changeset
|
529 |
by auto |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
530 |
|
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
531 |
end |
95
8c3a35da4560
Proving the proper RepAbs version
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
93
diff
changeset
|
532 |