author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Fri, 04 Dec 2009 17:57:03 +0100 | |
changeset 545 | 95371a8b17e1 |
parent 543 | d030c8e19465 |
child 546 | 8a1f4227dff9 |
permissions | -rw-r--r-- |
0 | 1 |
theory QuotScript |
530
5e92ce8f306d
smaller theory footprint
Christian Urban <urbanc@in.tum.de>
parents:
528
diff
changeset
|
2 |
imports Plain ATP_Linkup |
0 | 3 |
begin |
4 |
||
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
5 |
definition |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
6 |
"equivp E \<equiv> \<forall>x y. E x y = (E x = E y)" |
0 | 7 |
|
8 |
definition |
|
528 | 9 |
"reflp E \<equiv> \<forall>x. E x x" |
0 | 10 |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
11 |
definition |
528 | 12 |
"symp E \<equiv> \<forall>x y. E x y \<longrightarrow> E y x" |
0 | 13 |
|
14 |
definition |
|
528 | 15 |
"transp E \<equiv> \<forall>x y z. E x y \<and> E y z \<longrightarrow> E x z" |
0 | 16 |
|
528 | 17 |
lemma equivp_reflp_symp_transp: |
18 |
shows "equivp E = (reflp E \<and> symp E \<and> transp E)" |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
19 |
unfolding equivp_def reflp_def symp_def transp_def expand_fun_eq |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
20 |
by (blast) |
0 | 21 |
|
528 | 22 |
lemma equivp_refl: |
23 |
shows "equivp R \<Longrightarrow> (\<And>x. R x x)" |
|
24 |
by (simp add: equivp_reflp_symp_transp reflp_def) |
|
25 |
||
26 |
lemma equivp_reflp: |
|
27 |
shows "equivp E \<Longrightarrow> (\<And>x. E x x)" |
|
28 |
by (simp add: equivp_reflp_symp_transp reflp_def) |
|
217
9cc87d02190a
First experiments with Lambda
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
188
diff
changeset
|
29 |
|
0 | 30 |
definition |
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
31 |
"part_equivp 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)))" |
0 | 32 |
|
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
33 |
lemma equivp_IMP_part_equivp: |
528 | 34 |
assumes a: "equivp E" |
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
35 |
shows "part_equivp E" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
36 |
using a unfolding equivp_def part_equivp_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
37 |
by auto |
0 | 38 |
|
39 |
definition |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
40 |
"Quotient E Abs Rep \<equiv> (\<forall>a. Abs (Rep a) = a) \<and> |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
41 |
(\<forall>a. E (Rep a) (Rep a)) \<and> |
0 | 42 |
(\<forall>r s. E r s = (E r r \<and> E s s \<and> (Abs r = Abs s)))" |
43 |
||
540
c0b13fb70d6d
More code cleaning and renaming: moved rsp and prs lemmas from Int to QuotList
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
539
diff
changeset
|
44 |
lemma Quotient_abs_rep: |
528 | 45 |
assumes a: "Quotient E Abs Rep" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
46 |
shows "Abs (Rep a) = a" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
47 |
using a unfolding Quotient_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
48 |
by simp |
0 | 49 |
|
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
50 |
lemma Quotient_rep_reflp: |
528 | 51 |
assumes a: "Quotient E Abs Rep" |
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
52 |
shows "E (Rep a) (Rep a)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
53 |
using a unfolding Quotient_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
54 |
by blast |
0 | 55 |
|
539
8287fb5b8d7a
Cleaning & Renaming coming from QuotList
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
537
diff
changeset
|
56 |
lemma Quotient_rel: |
528 | 57 |
assumes a: "Quotient E Abs Rep" |
0 | 58 |
shows " E r s = (E r r \<and> E s s \<and> (Abs r = Abs s))" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
59 |
using a unfolding Quotient_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
60 |
by blast |
0 | 61 |
|
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
62 |
lemma Quotient_rel_rep: |
528 | 63 |
assumes a: "Quotient R Abs Rep" |
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
64 |
shows "R (Rep a) (Rep b) \<equiv> (a = b)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
65 |
apply (rule eq_reflection) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
66 |
using a unfolding Quotient_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
67 |
by metis |
0 | 68 |
|
540
c0b13fb70d6d
More code cleaning and renaming: moved rsp and prs lemmas from Int to QuotList
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
539
diff
changeset
|
69 |
lemma Quotient_rep_abs: |
528 | 70 |
assumes a: "Quotient R Abs Rep" |
459 | 71 |
shows "R r r \<Longrightarrow> R (Rep (Abs r)) r" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
72 |
using a unfolding Quotient_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
73 |
by blast |
0 | 74 |
|
542 | 75 |
lemma identity_equivp: |
528 | 76 |
shows "equivp (op =)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
77 |
unfolding equivp_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
78 |
by auto |
0 | 79 |
|
542 | 80 |
lemma identity_quotient: |
528 | 81 |
shows "Quotient (op =) id id" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
82 |
unfolding Quotient_def id_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
83 |
by blast |
0 | 84 |
|
528 | 85 |
lemma Quotient_symp: |
86 |
assumes a: "Quotient E Abs Rep" |
|
87 |
shows "symp E" |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
88 |
using a unfolding Quotient_def symp_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
89 |
by metis |
0 | 90 |
|
528 | 91 |
lemma Quotient_transp: |
92 |
assumes a: "Quotient E Abs Rep" |
|
93 |
shows "transp E" |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
94 |
using a unfolding Quotient_def transp_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
95 |
by metis |
0 | 96 |
|
97 |
fun |
|
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
98 |
prod_rel |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
99 |
where |
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
100 |
"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
|
101 |
|
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
102 |
fun |
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
103 |
fun_map |
0 | 104 |
where |
105 |
"fun_map f g h x = g (h (f x))" |
|
106 |
||
107 |
abbreviation |
|
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
108 |
fun_map_syn (infixr "--->" 55) |
0 | 109 |
where |
112
0d6d37d0589d
Progressing with the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
96
diff
changeset
|
110 |
"f ---> g \<equiv> fun_map f g" |
0 | 111 |
|
537
57073b0b8fac
Even more name changes and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
536
diff
changeset
|
112 |
lemma fun_map_id: |
126
9cb8f9a59402
Partial simplification of the proof
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
113
diff
changeset
|
113 |
shows "(id ---> id) = id" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
114 |
by (simp add: expand_fun_eq id_def) |
0 | 115 |
|
116 |
fun |
|
536
44fa9df44e6f
More code cleaning and name changes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
530
diff
changeset
|
117 |
fun_rel |
0 | 118 |
where |
536
44fa9df44e6f
More code cleaning and name changes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
530
diff
changeset
|
119 |
"fun_rel E1 E2 f g = (\<forall>x y. E1 x y \<longrightarrow> E2 (f x) (g y))" |
0 | 120 |
|
121 |
abbreviation |
|
536
44fa9df44e6f
More code cleaning and name changes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
530
diff
changeset
|
122 |
fun_rel_syn (infixr "===>" 55) |
0 | 123 |
where |
536
44fa9df44e6f
More code cleaning and name changes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
530
diff
changeset
|
124 |
"E1 ===> E2 \<equiv> fun_rel E1 E2" |
0 | 125 |
|
536
44fa9df44e6f
More code cleaning and name changes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
530
diff
changeset
|
126 |
lemma fun_rel_eq: |
511
28bb34eeedc5
Changing = to \<equiv> in case if we want to use simp.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
459
diff
changeset
|
127 |
"(op =) ===> (op =) \<equiv> (op =)" |
515
b00a9b58264d
Fixes after big merge.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
511
diff
changeset
|
128 |
by (rule eq_reflection) (simp add: expand_fun_eq) |
0 | 129 |
|
537
57073b0b8fac
Even more name changes and cleaning
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
536
diff
changeset
|
130 |
lemma fun_quotient: |
528 | 131 |
assumes q1: "Quotient R1 abs1 rep1" |
132 |
and q2: "Quotient R2 abs2 rep2" |
|
133 |
shows "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
|
0 | 134 |
proof - |
135 |
have "\<forall>a. (rep1 ---> abs2) ((abs1 ---> rep2) a) = a" |
|
136 |
apply(simp add: expand_fun_eq) |
|
137 |
using q1 q2 |
|
528 | 138 |
apply(simp add: Quotient_def) |
0 | 139 |
done |
140 |
moreover |
|
141 |
have "\<forall>a. (R1 ===> R2) ((abs1 ---> rep2) a) ((abs1 ---> rep2) a)" |
|
142 |
apply(auto) |
|
528 | 143 |
using q1 q2 unfolding Quotient_def |
0 | 144 |
apply(metis) |
145 |
done |
|
146 |
moreover |
|
147 |
have "\<forall>r s. (R1 ===> R2) r s = ((R1 ===> R2) r r \<and> (R1 ===> R2) s s \<and> |
|
148 |
(rep1 ---> abs2) r = (rep1 ---> abs2) s)" |
|
149 |
apply(auto simp add: expand_fun_eq) |
|
528 | 150 |
using q1 q2 unfolding Quotient_def |
0 | 151 |
apply(metis) |
528 | 152 |
using q1 q2 unfolding Quotient_def |
0 | 153 |
apply(metis) |
528 | 154 |
using q1 q2 unfolding Quotient_def |
0 | 155 |
apply(metis) |
528 | 156 |
using q1 q2 unfolding Quotient_def |
0 | 157 |
apply(metis) |
158 |
done |
|
159 |
ultimately |
|
528 | 160 |
show "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)" |
161 |
unfolding Quotient_def by blast |
|
0 | 162 |
qed |
163 |
||
164 |
definition |
|
165 |
Respects |
|
166 |
where |
|
167 |
"Respects R x \<equiv> (R x x)" |
|
168 |
||
542 | 169 |
lemma in_respects: |
0 | 170 |
shows "(x \<in> Respects R) = R x x" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
171 |
unfolding mem_def Respects_def by simp |
0 | 172 |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
173 |
lemma equals_rsp: |
528 | 174 |
assumes q: "Quotient R Abs Rep" |
519
ebfd747b47ab
Change equiv_trans2 to EQUALS_RSP, since we can prove it for any quotient type, not only for eqv relations.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
516
diff
changeset
|
175 |
and a: "R xa xb" "R ya yb" |
ebfd747b47ab
Change equiv_trans2 to EQUALS_RSP, since we can prove it for any quotient type, not only for eqv relations.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
516
diff
changeset
|
176 |
shows "R xa ya = R xb yb" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
177 |
using Quotient_symp[OF q] Quotient_transp[OF q] unfolding symp_def transp_def |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
178 |
using a by blast |
0 | 179 |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
180 |
lemma lambda_prs: |
528 | 181 |
assumes q1: "Quotient R1 Abs1 Rep1" |
182 |
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
|
183 |
shows "(Rep1 ---> Abs2) (\<lambda>x. Rep2 (f (Abs1 x))) = (\<lambda>x. f x)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
184 |
unfolding expand_fun_eq |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
185 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
186 |
by simp |
0 | 187 |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
188 |
lemma lambda_prs1: |
528 | 189 |
assumes q1: "Quotient R1 Abs1 Rep1" |
190 |
and q2: "Quotient R2 Abs2 Rep2" |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
191 |
shows "(Rep1 ---> Abs2) (\<lambda>x. (Abs1 ---> Rep2) f x) = (\<lambda>x. f x)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
192 |
unfolding expand_fun_eq |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
193 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
194 |
by simp |
253
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
252
diff
changeset
|
195 |
|
542 | 196 |
lemma rep_abs_rsp: |
528 | 197 |
assumes q: "Quotient R Abs Rep" |
459 | 198 |
and a: "R x1 x2" |
199 |
shows "R x1 (Rep (Abs x2))" |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
200 |
using q a by (metis Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q]) |
0 | 201 |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
202 |
(* In the following theorem R1 can be instantiated with anything, |
516
bed81795848c
Using APPLY_RSP1; again a little bit faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
515
diff
changeset
|
203 |
but we know some of the types of the Rep and Abs functions; |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
204 |
so by solving Quotient assumptions we can get a unique R1 that |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
205 |
will be provable; which is why we need to use apply_rsp and |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
206 |
not the primed version *) |
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
207 |
lemma apply_rsp: |
528 | 208 |
assumes q: "Quotient R1 Abs1 Rep1" |
516
bed81795848c
Using APPLY_RSP1; again a little bit faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
515
diff
changeset
|
209 |
and a: "(R1 ===> R2) f g" "R1 x y" |
bed81795848c
Using APPLY_RSP1; again a little bit faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
515
diff
changeset
|
210 |
shows "R2 ((f::'a\<Rightarrow>'c) x) ((g::'a\<Rightarrow>'c) y)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
211 |
using a by simp |
516
bed81795848c
Using APPLY_RSP1; again a little bit faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
515
diff
changeset
|
212 |
|
527
9b1ad366827f
code cleaning and renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
519
diff
changeset
|
213 |
lemma apply_rsp': |
317
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
253
diff
changeset
|
214 |
assumes a: "(R1 ===> R2) f g" "R1 x y" |
d3c7f6d19c7f
Still don't know how to do the proof automatically.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
253
diff
changeset
|
215 |
shows "R2 (f x) (g y)" |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
216 |
using a by simp |
458 | 217 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
218 |
(* Set of lemmas for regularisation of ball and bex *) |
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
219 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
220 |
lemma ball_reg_eqv: |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
221 |
fixes P :: "'a \<Rightarrow> bool" |
528 | 222 |
assumes a: "equivp R" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
223 |
shows "Ball (Respects R) P = (All P)" |
542 | 224 |
by (metis equivp_def in_respects a) |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
225 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
226 |
lemma bex_reg_eqv: |
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
227 |
fixes P :: "'a \<Rightarrow> bool" |
528 | 228 |
assumes a: "equivp R" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
229 |
shows "Bex (Respects R) P = (Ex P)" |
542 | 230 |
by (metis equivp_def in_respects a) |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
231 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
232 |
lemma ball_reg_right: |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
233 |
assumes a: "\<And>x. R x \<Longrightarrow> P x \<longrightarrow> Q x" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
234 |
shows "All P \<longrightarrow> Ball R Q" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
235 |
by (metis COMBC_def Collect_def Collect_mem_eq a) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
236 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
237 |
lemma bex_reg_left: |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
238 |
assumes a: "\<And>x. R x \<Longrightarrow> Q x \<longrightarrow> P x" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
239 |
shows "Bex R Q \<longrightarrow> Ex P" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
240 |
by (metis COMBC_def Collect_def Collect_mem_eq a) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
241 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
242 |
lemma ball_reg_left: |
528 | 243 |
assumes a: "equivp R" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
244 |
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ball (Respects R) Q \<longrightarrow> All P" |
542 | 245 |
by (metis equivp_reflp in_respects a) |
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
246 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
247 |
lemma bex_reg_right: |
528 | 248 |
assumes a: "equivp R" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
249 |
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ex Q \<longrightarrow> Bex (Respects R) P" |
542 | 250 |
by (metis equivp_reflp in_respects a) |
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
251 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
252 |
lemma ball_reg_eqv_range: |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
253 |
fixes P::"'a \<Rightarrow> bool" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
254 |
and x::"'a" |
528 | 255 |
assumes a: "equivp R2" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
256 |
shows "(Ball (Respects (R1 ===> R2)) (\<lambda>f. P (f x)) = All (\<lambda>f. P (f x)))" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
257 |
apply(rule iffI) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
258 |
apply(rule allI) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
259 |
apply(drule_tac x="\<lambda>y. f x" in bspec) |
542 | 260 |
apply(simp add: Respects_def in_respects) |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
261 |
apply(rule impI) |
528 | 262 |
using a equivp_reflp_symp_transp[of "R2"] |
263 |
apply(simp add: reflp_def) |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
264 |
apply(simp) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
265 |
apply(simp) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
266 |
done |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
267 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
268 |
lemma bex_reg_eqv_range: |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
269 |
fixes P::"'a \<Rightarrow> bool" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
270 |
and x::"'a" |
528 | 271 |
assumes a: "equivp R2" |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
272 |
shows "(Bex (Respects (R1 ===> R2)) (\<lambda>f. P (f x)) = Ex (\<lambda>f. P (f x)))" |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
273 |
apply(auto) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
274 |
apply(rule_tac x="\<lambda>y. f x" in bexI) |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
275 |
apply(simp) |
542 | 276 |
apply(simp add: Respects_def in_respects) |
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
277 |
apply(rule impI) |
528 | 278 |
using a equivp_reflp_symp_transp[of "R2"] |
279 |
apply(simp add: reflp_def) |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
280 |
done |
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
281 |
|
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
282 |
lemma all_reg: |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
283 |
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
|
284 |
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
|
285 |
shows "All Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
286 |
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
|
287 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
288 |
lemma ex_reg: |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
289 |
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
|
290 |
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
|
291 |
shows "Ex Q" |
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
292 |
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
|
293 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
294 |
lemma ball_reg: |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
295 |
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
|
296 |
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
|
297 |
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
|
298 |
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
|
299 |
|
427
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
416
diff
changeset
|
300 |
lemma bex_reg: |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
301 |
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
|
302 |
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
|
303 |
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
|
304 |
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
|
305 |
|
432
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
306 |
lemma ball_all_comm: |
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
307 |
"(\<And>y. (\<forall>x\<in>P. A x y) \<longrightarrow> (\<forall>x. B x y)) \<Longrightarrow> ((\<forall>x\<in>P. \<forall>y. A x y) \<longrightarrow> (\<forall>x. \<forall>y. B x y))" |
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
308 |
by auto |
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
309 |
|
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
310 |
lemma bex_ex_comm: |
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
311 |
"((\<exists>y. \<exists>x. A x y) \<longrightarrow> (\<exists>y. \<exists>x\<in>P. B x y)) \<Longrightarrow> ((\<exists>x. \<exists>y. A x y) \<longrightarrow> (\<exists>x\<in>P. \<exists>y. B x y))" |
9c33c0809733
Finished and tested the new regularize
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
427
diff
changeset
|
312 |
by auto |
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
95
diff
changeset
|
313 |
|
458 | 314 |
(* 2 lemmas needed for proving repabs_inj *) |
315 |
lemma ball_rsp: |
|
316 |
assumes a: "(R ===> (op =)) f g" |
|
317 |
shows "Ball (Respects R) f = Ball (Respects R) g" |
|
542 | 318 |
using a by (simp add: Ball_def in_respects) |
153
0288dd5b7ed4
The problems with 'abs' term.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
126
diff
changeset
|
319 |
|
458 | 320 |
lemma bex_rsp: |
321 |
assumes a: "(R ===> (op =)) f g" |
|
322 |
shows "(Bex (Respects R) f = Bex (Respects R) g)" |
|
542 | 323 |
using a by (simp add: Bex_def in_respects) |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
324 |
|
458 | 325 |
(* 2 lemmas needed for cleaning of quantifiers *) |
326 |
lemma all_prs: |
|
528 | 327 |
assumes a: "Quotient R absf repf" |
458 | 328 |
shows "Ball (Respects R) ((absf ---> id) f) = All f" |
528 | 329 |
using a unfolding Quotient_def |
542 | 330 |
by (metis in_respects fun_map.simps id_apply) |
162 | 331 |
|
458 | 332 |
lemma ex_prs: |
528 | 333 |
assumes a: "Quotient R absf repf" |
458 | 334 |
shows "Bex (Respects R) ((absf ---> id) f) = Ex f" |
528 | 335 |
using a unfolding Quotient_def |
542 | 336 |
by (metis COMBC_def Collect_def Collect_mem_eq in_respects fun_map.simps id_apply) |
171
13aab4c59096
More infrastructure for automatic lifting of theorems lifted before
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
166
diff
changeset
|
337 |
|
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
338 |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
339 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
340 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
341 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
342 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
343 |
(******************************************) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
344 |
(* REST OF THE FILE IS UNUSED (until now) *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
345 |
(******************************************) |
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
346 |
lemma Quotient_rel_abs: |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
347 |
assumes a: "Quotient E Abs Rep" |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
348 |
shows "E r s \<Longrightarrow> Abs r = Abs s" |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
349 |
using a unfolding Quotient_def |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
350 |
by blast |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
351 |
|
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
352 |
lemma Quotient_rel_abs_eq: |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
353 |
assumes a: "Quotient E Abs Rep" |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
354 |
shows "E r r \<Longrightarrow> E s s \<Longrightarrow> E r s = (Abs r = Abs s)" |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
355 |
using a unfolding Quotient_def |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
356 |
by blast |
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
357 |
|
542 | 358 |
lemma in_fun: |
359 |
shows "x \<in> ((f ---> g) s) = g (f x \<in> s)" |
|
360 |
by (simp add: mem_def) |
|
361 |
||
362 |
lemma RESPECTS_THM: |
|
363 |
shows "Respects (R1 ===> R2) f = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (f y))" |
|
364 |
unfolding Respects_def |
|
365 |
by (simp add: expand_fun_eq) |
|
366 |
||
367 |
lemma RESPECTS_REP_ABS: |
|
368 |
assumes a: "Quotient R1 Abs1 Rep1" |
|
369 |
and b: "Respects (R1 ===> R2) f" |
|
370 |
and c: "R1 x x" |
|
371 |
shows "R2 (f (Rep1 (Abs1 x))) (f x)" |
|
372 |
using a b[simplified RESPECTS_THM] c unfolding Quotient_def |
|
373 |
by blast |
|
374 |
||
375 |
lemma RESPECTS_MP: |
|
376 |
assumes a: "Respects (R1 ===> R2) f" |
|
377 |
and b: "R1 x y" |
|
378 |
shows "R2 (f x) (f y)" |
|
379 |
using a b unfolding Respects_def |
|
380 |
by simp |
|
381 |
||
382 |
lemma RESPECTS_o: |
|
383 |
assumes a: "Respects (R2 ===> R3) f" |
|
384 |
and b: "Respects (R1 ===> R2) g" |
|
385 |
shows "Respects (R1 ===> R3) (f o g)" |
|
386 |
using a b unfolding Respects_def |
|
387 |
by simp |
|
388 |
||
389 |
lemma fun_rel_EQ_REL: |
|
390 |
assumes q1: "Quotient R1 Abs1 Rep1" |
|
391 |
and q2: "Quotient R2 Abs2 Rep2" |
|
392 |
shows "(R1 ===> R2) f g = ((Respects (R1 ===> R2) f) \<and> (Respects (R1 ===> R2) g) |
|
393 |
\<and> ((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g))" |
|
394 |
using fun_quotient[OF q1 q2] unfolding Respects_def Quotient_def expand_fun_eq |
|
395 |
by blast |
|
396 |
||
397 |
(* Not used since in the end we just unfold fun_map *) |
|
398 |
lemma APP_PRS: |
|
399 |
assumes q1: "Quotient R1 abs1 rep1" |
|
400 |
and q2: "Quotient R2 abs2 rep2" |
|
401 |
shows "abs2 ((abs1 ---> rep2) f (rep1 x)) = f x" |
|
402 |
unfolding expand_fun_eq |
|
403 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] |
|
404 |
by simp |
|
405 |
||
406 |
(* Ask Peter: assumption q1 and q2 not used and lemma is the 'identity' *) |
|
407 |
lemma LAMBDA_RSP: |
|
408 |
assumes q1: "Quotient R1 Abs1 Rep1" |
|
409 |
and q2: "Quotient R2 Abs2 Rep2" |
|
410 |
and a: "(R1 ===> R2) f1 f2" |
|
411 |
shows "(R1 ===> R2) (\<lambda>x. f1 x) (\<lambda>y. f2 y)" |
|
412 |
by (rule a) |
|
413 |
||
414 |
(* ASK Peter about next four lemmas in quotientScript |
|
415 |
lemma ABSTRACT_PRS: |
|
416 |
assumes q1: "Quotient R1 Abs1 Rep1" |
|
417 |
and q2: "Quotient R2 Abs2 Rep2" |
|
418 |
shows "f = (Rep1 ---> Abs2) ???" |
|
419 |
*) |
|
420 |
||
421 |
||
422 |
lemma fun_rel_EQUALS: |
|
423 |
assumes q1: "Quotient R1 Abs1 Rep1" |
|
424 |
and q2: "Quotient R2 Abs2 Rep2" |
|
425 |
and r1: "Respects (R1 ===> R2) f" |
|
426 |
and r2: "Respects (R1 ===> R2) g" |
|
427 |
shows "((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g) = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (g y))" |
|
428 |
apply(rule_tac iffI) |
|
429 |
using fun_quotient[OF q1 q2] r1 r2 unfolding Quotient_def Respects_def |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
430 |
apply(metis apply_rsp') |
542 | 431 |
using r1 unfolding Respects_def expand_fun_eq |
432 |
apply(simp (no_asm_use)) |
|
433 |
apply(metis Quotient_rel[OF q2] Quotient_rel_rep[OF q1]) |
|
434 |
done |
|
435 |
||
436 |
(* ask Peter: fun_rel_IMP used twice *) |
|
437 |
lemma fun_rel_IMP2: |
|
438 |
assumes q1: "Quotient R1 Abs1 Rep1" |
|
439 |
and q2: "Quotient R2 Abs2 Rep2" |
|
440 |
and r1: "Respects (R1 ===> R2) f" |
|
441 |
and r2: "Respects (R1 ===> R2) g" |
|
442 |
and a: "(Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g" |
|
443 |
shows "R1 x y \<Longrightarrow> R2 (f x) (g y)" |
|
444 |
using q1 q2 r1 r2 a |
|
445 |
by (simp add: fun_rel_EQUALS) |
|
446 |
||
447 |
lemma LAMBDA_REP_ABS_RSP: |
|
448 |
assumes r1: "\<And>r r'. R1 r r' \<Longrightarrow>R1 r (Rep1 (Abs1 r'))" |
|
449 |
and r2: "\<And>r r'. R2 r r' \<Longrightarrow>R2 r (Rep2 (Abs2 r'))" |
|
450 |
shows "(R1 ===> R2) f1 f2 \<Longrightarrow> (R1 ===> R2) f1 ((Abs1 ---> Rep2) ((Rep1 ---> Abs2) f2))" |
|
451 |
using r1 r2 by auto |
|
452 |
||
453 |
(* Not used *) |
|
454 |
lemma rep_abs_rsp_left: |
|
455 |
assumes q: "Quotient R Abs Rep" |
|
456 |
and a: "R x1 x2" |
|
457 |
shows "R x1 (Rep (Abs x2))" |
|
458 |
using q a by (metis Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q]) |
|
541
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
459 |
|
94deffed619d
more name cleaning and removing
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
540
diff
changeset
|
460 |
|
543
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
461 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
462 |
(* bool theory: COND, LET *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
463 |
lemma IF_PRS: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
464 |
assumes q: "Quotient R Abs Rep" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
465 |
shows "If a b c = Abs (If a (Rep b) (Rep c))" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
466 |
using Quotient_abs_rep[OF q] by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
467 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
468 |
(* ask peter: no use of q *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
469 |
lemma IF_RSP: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
470 |
assumes q: "Quotient R Abs Rep" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
471 |
and a: "a1 = a2" "R b1 b2" "R c1 c2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
472 |
shows "R (If a1 b1 c1) (If a2 b2 c2)" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
473 |
using a by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
474 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
475 |
lemma LET_PRS: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
476 |
assumes q1: "Quotient R1 Abs1 Rep1" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
477 |
and q2: "Quotient R2 Abs2 Rep2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
478 |
shows "Let x f = Abs2 (Let (Rep1 x) ((Abs1 ---> Rep2) f))" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
479 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
480 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
481 |
lemma LET_RSP: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
482 |
assumes q1: "Quotient R1 Abs1 Rep1" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
483 |
and a1: "(R1 ===> R2) f g" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
484 |
and a2: "R1 x y" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
485 |
shows "R2 ((Let x f)::'c) ((Let y g)::'c)" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
486 |
using apply_rsp[OF q1 a1] a2 |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
487 |
by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
488 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
489 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
490 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
491 |
(* ask peter what are literal_case *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
492 |
(* literal_case_PRS *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
493 |
(* literal_case_RSP *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
494 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
495 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
496 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
497 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
498 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
499 |
(* combinators: I, K, o, C, W *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
500 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
501 |
(* We use id_simps which includes id_apply; so these 2 theorems can be removed *) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
502 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
503 |
lemma I_PRS: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
504 |
assumes q: "Quotient R Abs Rep" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
505 |
shows "id e = Abs (id (Rep e))" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
506 |
using Quotient_abs_rep[OF q] by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
507 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
508 |
lemma I_RSP: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
509 |
assumes q: "Quotient R Abs Rep" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
510 |
and a: "R e1 e2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
511 |
shows "R (id e1) (id e2)" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
512 |
using a by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
513 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
514 |
lemma o_PRS: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
515 |
assumes q1: "Quotient R1 Abs1 Rep1" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
516 |
and q2: "Quotient R2 Abs2 Rep2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
517 |
and q3: "Quotient R3 Abs3 Rep3" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
518 |
shows "f o g = (Rep1 ---> Abs3) (((Abs2 ---> Rep3) f) o ((Abs1 ---> Rep2) g))" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
519 |
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] Quotient_abs_rep[OF q3] |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
520 |
unfolding o_def expand_fun_eq |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
521 |
by simp |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
522 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
523 |
lemma o_RSP: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
524 |
assumes q1: "Quotient R1 Abs1 Rep1" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
525 |
and q2: "Quotient R2 Abs2 Rep2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
526 |
and q3: "Quotient R3 Abs3 Rep3" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
527 |
and a1: "(R2 ===> R3) f1 f2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
528 |
and a2: "(R1 ===> R2) g1 g2" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
529 |
shows "(R1 ===> R3) (f1 o g1) (f2 o g2)" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
530 |
using a1 a2 unfolding o_def expand_fun_eq |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
531 |
by (auto) |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
532 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
533 |
lemma COND_PRS: |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
534 |
assumes a: "Quotient R absf repf" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
535 |
shows "(if a then b else c) = absf (if a then repf b else repf c)" |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
536 |
using a unfolding Quotient_def by auto |
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
537 |
|
d030c8e19465
Cleaning/review of QuotScript.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
542
diff
changeset
|
538 |
|
93
ec29be471518
Manually regularized list_induct2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
0
diff
changeset
|
539 |
end |
95
8c3a35da4560
Proving the proper RepAbs version
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
93
diff
changeset
|
540 |