0
+ − 1
theory QuotScript
530
+ − 2
imports Plain ATP_Linkup
0
+ − 3
begin
+ − 4
543
+ − 5
definition
+ − 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
+ − 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
+ − 19
unfolding equivp_def reflp_def symp_def transp_def expand_fun_eq
+ − 20
by (blast)
0
+ − 21
528
+ − 22
lemma equivp_reflp:
+ − 23
shows "equivp E \<Longrightarrow> (\<And>x. E x x)"
593
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 24
by (simp only: equivp_reflp_symp_transp reflp_def)
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 25
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 26
lemma equivp_symp:
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 27
shows "equivp E \<Longrightarrow> (\<And>x y. E x y \<Longrightarrow> E y x)"
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 28
by (metis equivp_reflp_symp_transp symp_def)
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 29
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 30
lemma equivp_transp:
18eac4596ef1
QuotProd with product_quotient and a 3 respects and preserves lemmas.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 31
shows "equivp E \<Longrightarrow> (\<And>x y z. E x y \<Longrightarrow> E y z \<Longrightarrow> E x z)"
721
+ − 32
by (metis equivp_reflp_symp_transp transp_def)
217
+ − 33
700
91b079db7380
added Larry's theory; introduced lemma equivpI; added something to the TODO about error messages
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 34
lemma equivpI:
91b079db7380
added Larry's theory; introduced lemma equivpI; added something to the TODO about error messages
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 35
assumes "reflp R" "symp R" "transp R"
91b079db7380
added Larry's theory; introduced lemma equivpI; added something to the TODO about error messages
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 36
shows "equivp R"
721
+ − 37
using assms by (simp add: equivp_reflp_symp_transp)
700
91b079db7380
added Larry's theory; introduced lemma equivpI; added something to the TODO about error messages
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 38
0
+ − 39
definition
541
+ − 40
"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
+ − 41
541
+ − 42
lemma equivp_IMP_part_equivp:
528
+ − 43
assumes a: "equivp E"
541
+ − 44
shows "part_equivp E"
543
+ − 45
using a unfolding equivp_def part_equivp_def
+ − 46
by auto
0
+ − 47
+ − 48
definition
543
+ − 49
"Quotient E Abs Rep \<equiv> (\<forall>a. Abs (Rep a) = a) \<and>
+ − 50
(\<forall>a. E (Rep a) (Rep a)) \<and>
0
+ − 51
(\<forall>r s. E r s = (E r r \<and> E s s \<and> (Abs r = Abs s)))"
+ − 52
540
c0b13fb70d6d
More code cleaning and renaming: moved rsp and prs lemmas from Int to QuotList
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 53
lemma Quotient_abs_rep:
528
+ − 54
assumes a: "Quotient E Abs Rep"
546
+ − 55
shows "Abs (Rep a) \<equiv> a"
543
+ − 56
using a unfolding Quotient_def
+ − 57
by simp
0
+ − 58
541
+ − 59
lemma Quotient_rep_reflp:
528
+ − 60
assumes a: "Quotient E Abs Rep"
541
+ − 61
shows "E (Rep a) (Rep a)"
543
+ − 62
using a unfolding Quotient_def
+ − 63
by blast
0
+ − 64
539
+ − 65
lemma Quotient_rel:
528
+ − 66
assumes a: "Quotient E Abs Rep"
0
+ − 67
shows " E r s = (E r r \<and> E s s \<and> (Abs r = Abs s))"
543
+ − 68
using a unfolding Quotient_def
+ − 69
by blast
0
+ − 70
541
+ − 71
lemma Quotient_rel_rep:
528
+ − 72
assumes a: "Quotient R Abs Rep"
541
+ − 73
shows "R (Rep a) (Rep b) \<equiv> (a = b)"
543
+ − 74
apply (rule eq_reflection)
+ − 75
using a unfolding Quotient_def
+ − 76
by metis
0
+ − 77
540
c0b13fb70d6d
More code cleaning and renaming: moved rsp and prs lemmas from Int to QuotList
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 78
lemma Quotient_rep_abs:
528
+ − 79
assumes a: "Quotient R Abs Rep"
459
+ − 80
shows "R r r \<Longrightarrow> R (Rep (Abs r)) r"
543
+ − 81
using a unfolding Quotient_def
+ − 82
by blast
0
+ − 83
721
+ − 84
lemma Quotient_rel_abs:
+ − 85
assumes a: "Quotient E Abs Rep"
+ − 86
shows "E r s \<Longrightarrow> Abs r = Abs s"
+ − 87
using a unfolding Quotient_def
+ − 88
by blast
+ − 89
542
+ − 90
lemma identity_equivp:
528
+ − 91
shows "equivp (op =)"
543
+ − 92
unfolding equivp_def
+ − 93
by auto
0
+ − 94
542
+ − 95
lemma identity_quotient:
528
+ − 96
shows "Quotient (op =) id id"
543
+ − 97
unfolding Quotient_def id_def
+ − 98
by blast
0
+ − 99
528
+ − 100
lemma Quotient_symp:
+ − 101
assumes a: "Quotient E Abs Rep"
+ − 102
shows "symp E"
543
+ − 103
using a unfolding Quotient_def symp_def
+ − 104
by metis
0
+ − 105
528
+ − 106
lemma Quotient_transp:
+ − 107
assumes a: "Quotient E Abs Rep"
+ − 108
shows "transp E"
543
+ − 109
using a unfolding Quotient_def transp_def
+ − 110
by metis
0
+ − 111
+ − 112
fun
112
+ − 113
fun_map
0
+ − 114
where
+ − 115
"fun_map f g h x = g (h (f x))"
+ − 116
+ − 117
abbreviation
112
+ − 118
fun_map_syn (infixr "--->" 55)
0
+ − 119
where
112
+ − 120
"f ---> g \<equiv> fun_map f g"
0
+ − 121
537
+ − 122
lemma fun_map_id:
126
+ − 123
shows "(id ---> id) = id"
543
+ − 124
by (simp add: expand_fun_eq id_def)
0
+ − 125
+ − 126
fun
536
+ − 127
fun_rel
0
+ − 128
where
536
+ − 129
"fun_rel E1 E2 f g = (\<forall>x y. E1 x y \<longrightarrow> E2 (f x) (g y))"
0
+ − 130
+ − 131
abbreviation
536
+ − 132
fun_rel_syn (infixr "===>" 55)
0
+ − 133
where
536
+ − 134
"E1 ===> E2 \<equiv> fun_rel E1 E2"
0
+ − 135
536
+ − 136
lemma fun_rel_eq:
511
+ − 137
"(op =) ===> (op =) \<equiv> (op =)"
721
+ − 138
by (rule eq_reflection) (simp add: expand_fun_eq)
0
+ − 139
537
+ − 140
lemma fun_quotient:
528
+ − 141
assumes q1: "Quotient R1 abs1 rep1"
+ − 142
and q2: "Quotient R2 abs2 rep2"
+ − 143
shows "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)"
0
+ − 144
proof -
+ − 145
have "\<forall>a. (rep1 ---> abs2) ((abs1 ---> rep2) a) = a"
+ − 146
apply(simp add: expand_fun_eq)
+ − 147
using q1 q2
528
+ − 148
apply(simp add: Quotient_def)
0
+ − 149
done
+ − 150
moreover
+ − 151
have "\<forall>a. (R1 ===> R2) ((abs1 ---> rep2) a) ((abs1 ---> rep2) a)"
+ − 152
apply(auto)
528
+ − 153
using q1 q2 unfolding Quotient_def
0
+ − 154
apply(metis)
+ − 155
done
+ − 156
moreover
+ − 157
have "\<forall>r s. (R1 ===> R2) r s = ((R1 ===> R2) r r \<and> (R1 ===> R2) s s \<and>
+ − 158
(rep1 ---> abs2) r = (rep1 ---> abs2) s)"
+ − 159
apply(auto simp add: expand_fun_eq)
528
+ − 160
using q1 q2 unfolding Quotient_def
0
+ − 161
apply(metis)
528
+ − 162
using q1 q2 unfolding Quotient_def
0
+ − 163
apply(metis)
528
+ − 164
using q1 q2 unfolding Quotient_def
0
+ − 165
apply(metis)
528
+ − 166
using q1 q2 unfolding Quotient_def
0
+ − 167
apply(metis)
+ − 168
done
+ − 169
ultimately
528
+ − 170
show "Quotient (R1 ===> R2) (rep1 ---> abs2) (abs1 ---> rep2)"
+ − 171
unfolding Quotient_def by blast
0
+ − 172
qed
+ − 173
+ − 174
definition
+ − 175
Respects
+ − 176
where
+ − 177
"Respects R x \<equiv> (R x x)"
+ − 178
542
+ − 179
lemma in_respects:
0
+ − 180
shows "(x \<in> Respects R) = R x x"
543
+ − 181
unfolding mem_def Respects_def by simp
0
+ − 182
527
+ − 183
lemma equals_rsp:
528
+ − 184
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>
diff
changeset
+ − 185
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>
diff
changeset
+ − 186
shows "R xa ya = R xb yb"
543
+ − 187
using Quotient_symp[OF q] Quotient_transp[OF q] unfolding symp_def transp_def
+ − 188
using a by blast
0
+ − 189
527
+ − 190
lemma lambda_prs:
528
+ − 191
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 192
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>
diff
changeset
+ − 193
shows "(Rep1 ---> Abs2) (\<lambda>x. Rep2 (f (Abs1 x))) = (\<lambda>x. f x)"
543
+ − 194
unfolding expand_fun_eq
+ − 195
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2]
+ − 196
by simp
0
+ − 197
527
+ − 198
lemma lambda_prs1:
528
+ − 199
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 200
and q2: "Quotient R2 Abs2 Rep2"
527
+ − 201
shows "(Rep1 ---> Abs2) (\<lambda>x. (Abs1 ---> Rep2) f x) = (\<lambda>x. f x)"
543
+ − 202
unfolding expand_fun_eq
+ − 203
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2]
+ − 204
by simp
253
e169a99c6ada
Automatic computation of application preservation and manually finished "alpha.induct". Slow...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 205
542
+ − 206
lemma rep_abs_rsp:
528
+ − 207
assumes q: "Quotient R Abs Rep"
459
+ − 208
and a: "R x1 x2"
+ − 209
shows "R x1 (Rep (Abs x2))"
543
+ − 210
using q a by (metis Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q])
0
+ − 211
721
+ − 212
lemma rep_abs_rsp_left:
+ − 213
assumes q: "Quotient R Abs Rep"
+ − 214
and a: "R x1 x2"
+ − 215
shows "R (Rep (Abs x1)) x2"
+ − 216
using q a by (metis Quotient_rel[OF q] Quotient_abs_rep[OF q] Quotient_rep_reflp[OF q])
+ − 217
527
+ − 218
(* In the following theorem R1 can be instantiated with anything,
516
+ − 219
but we know some of the types of the Rep and Abs functions;
543
+ − 220
so by solving Quotient assumptions we can get a unique R1 that
+ − 221
will be provable; which is why we need to use apply_rsp and
+ − 222
not the primed version *)
527
+ − 223
lemma apply_rsp:
528
+ − 224
assumes q: "Quotient R1 Abs1 Rep1"
516
+ − 225
and a: "(R1 ===> R2) f g" "R1 x y"
+ − 226
shows "R2 ((f::'a\<Rightarrow>'c) x) ((g::'a\<Rightarrow>'c) y)"
543
+ − 227
using a by simp
516
+ − 228
527
+ − 229
lemma apply_rsp':
317
+ − 230
assumes a: "(R1 ===> R2) f g" "R1 x y"
+ − 231
shows "R2 (f x) (g y)"
543
+ − 232
using a by simp
458
+ − 233
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>
diff
changeset
+ − 234
(* Set of lemmas for regularisation of ball and bex *)
543
+ − 235
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>
diff
changeset
+ − 236
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>
diff
changeset
+ − 237
fixes P :: "'a \<Rightarrow> bool"
528
+ − 238
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>
diff
changeset
+ − 239
shows "Ball (Respects R) P = (All P)"
542
+ − 240
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>
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>
diff
changeset
+ − 242
lemma bex_reg_eqv:
93
+ − 243
fixes P :: "'a \<Rightarrow> bool"
528
+ − 244
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>
diff
changeset
+ − 245
shows "Bex (Respects R) P = (Ex P)"
542
+ − 246
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>
diff
changeset
+ − 247
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 248
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>
diff
changeset
+ − 249
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>
diff
changeset
+ − 250
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>
diff
changeset
+ − 251
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>
diff
changeset
+ − 252
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 253
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>
diff
changeset
+ − 254
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>
diff
changeset
+ − 255
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>
diff
changeset
+ − 256
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>
diff
changeset
+ − 257
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 258
lemma ball_reg_left:
528
+ − 259
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>
diff
changeset
+ − 260
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ball (Respects R) Q \<longrightarrow> All P"
542
+ − 261
by (metis equivp_reflp in_respects a)
93
+ − 262
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>
diff
changeset
+ − 263
lemma bex_reg_right:
528
+ − 264
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>
diff
changeset
+ − 265
shows "(\<And>x. (Q x \<longrightarrow> P x)) \<Longrightarrow> Ex Q \<longrightarrow> Bex (Respects R) P"
542
+ − 266
by (metis equivp_reflp in_respects a)
93
+ − 267
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>
diff
changeset
+ − 268
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>
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>
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>
diff
changeset
+ − 272
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>
diff
changeset
+ − 273
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>
diff
changeset
+ − 274
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>
diff
changeset
+ − 275
apply(drule_tac x="\<lambda>y. f x" in bspec)
605
120e479ed367
first attempt to deal with Babs in regularise and cleaning (not yet working)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 276
apply(simp add: 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>
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>
diff
changeset
+ − 280
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>
diff
changeset
+ − 281
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>
diff
changeset
+ − 282
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>
diff
changeset
+ − 283
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 284
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>
diff
changeset
+ − 285
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>
diff
changeset
+ − 286
and x::"'a"
528
+ − 287
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>
diff
changeset
+ − 288
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>
diff
changeset
+ − 289
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>
diff
changeset
+ − 290
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>
diff
changeset
+ − 291
apply(simp)
542
+ − 292
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>
diff
changeset
+ − 293
apply(rule impI)
528
+ − 294
using a equivp_reflp_symp_transp[of "R2"]
+ − 295
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>
diff
changeset
+ − 296
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>
diff
changeset
+ − 297
5a3965aa4d80
Cleaned all lemmas about regularisation of Ball and Bex and moved in one place. Second Ball simprox.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 298
lemma all_reg:
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 299
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>
diff
changeset
+ − 300
and b: "All P"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 301
shows "All Q"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 302
using a b by (metis)
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 303
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>
diff
changeset
+ − 304
lemma ex_reg:
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 305
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>
diff
changeset
+ − 306
and b: "Ex P"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 307
shows "Ex Q"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 308
using a b by (metis)
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 309
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>
diff
changeset
+ − 310
lemma ball_reg:
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 311
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>
diff
changeset
+ − 312
and b: "Ball R P"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 313
shows "Ball R Q"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 314
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>
diff
changeset
+ − 315
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>
diff
changeset
+ − 316
lemma bex_reg:
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 317
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>
diff
changeset
+ − 318
and b: "Bex R P"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 319
shows "Bex R Q"
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 320
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>
diff
changeset
+ − 321
432
+ − 322
lemma ball_all_comm:
+ − 323
"(\<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))"
721
+ − 324
by auto
432
+ − 325
+ − 326
lemma bex_ex_comm:
+ − 327
"((\<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))"
721
+ − 328
by auto
96
4da714704611
A number of lemmas for REGULARIZE_TAC and regularizing card1.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 329
595
+ − 330
(* Bounded abstraction *)
+ − 331
definition
+ − 332
Babs :: "('a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"
+ − 333
where
+ − 334
"(x \<in> p) \<Longrightarrow> (Babs p m x = m x)"
+ − 335
+ − 336
(* 3 lemmas needed for proving repabs_inj *)
458
+ − 337
lemma ball_rsp:
+ − 338
assumes a: "(R ===> (op =)) f g"
+ − 339
shows "Ball (Respects R) f = Ball (Respects R) g"
542
+ − 340
using a by (simp add: Ball_def in_respects)
153
+ − 341
458
+ − 342
lemma bex_rsp:
+ − 343
assumes a: "(R ===> (op =)) f g"
+ − 344
shows "(Bex (Respects R) f = Bex (Respects R) g)"
542
+ − 345
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>
diff
changeset
+ − 346
595
+ − 347
lemma babs_rsp:
+ − 348
assumes q: "Quotient R1 Abs1 Rep1"
+ − 349
and a: "(R1 ===> R2) f g"
+ − 350
shows "(R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)"
+ − 351
apply (auto simp add: Babs_def)
+ − 352
apply (subgoal_tac "x \<in> Respects R1 \<and> y \<in> Respects R1")
+ − 353
using a apply (simp add: Babs_def)
+ − 354
apply (simp add: in_respects)
+ − 355
using Quotient_rel[OF q]
+ − 356
by metis
+ − 357
607
+ − 358
lemma babs_prs:
+ − 359
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 360
and q2: "Quotient R2 Abs2 Rep2"
+ − 361
shows "(Rep1 ---> Abs2) (Babs (Respects R1) ((Abs1 ---> Rep2) f)) \<equiv> f"
+ − 362
apply(rule eq_reflection)
+ − 363
apply(rule ext)
+ − 364
apply simp
+ − 365
apply (subgoal_tac "Rep1 x \<in> Respects R1")
+ − 366
apply (simp add: Babs_def Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2])
+ − 367
apply (simp add: in_respects Quotient_rel_rep[OF q1])
+ − 368
done
+ − 369
696
fd718dde1d61
Simplification of Babses for regularize; will probably become injection
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 370
lemma babs_simp:
fd718dde1d61
Simplification of Babses for regularize; will probably become injection
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 371
assumes q: "Quotient R1 Abs Rep"
fd718dde1d61
Simplification of Babses for regularize; will probably become injection
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 372
shows "((R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)) = ((R1 ===> R2) f g)"
721
+ − 373
apply(rule iffI)
+ − 374
apply(simp_all only: babs_rsp[OF q])
+ − 375
apply(auto simp add: Babs_def)
+ − 376
apply (subgoal_tac "x \<in> Respects R1 \<and> y \<in> Respects R1")
+ − 377
apply(metis Babs_def)
+ − 378
apply (simp add: in_respects)
+ − 379
using Quotient_rel[OF q]
+ − 380
by metis
696
fd718dde1d61
Simplification of Babses for regularize; will probably become injection
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 381
721
+ − 382
(* If a user proves that a particular functional relation is an equivalence
+ − 383
this may be useful in regularising *)
605
120e479ed367
first attempt to deal with Babs in regularise and cleaning (not yet working)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 384
lemma babs_reg_eqv:
120e479ed367
first attempt to deal with Babs in regularise and cleaning (not yet working)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 385
shows "equivp R \<Longrightarrow> Babs (Respects R) P = P"
721
+ − 386
by (simp add: expand_fun_eq Babs_def in_respects equivp_reflp)
605
120e479ed367
first attempt to deal with Babs in regularise and cleaning (not yet working)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 387
458
+ − 388
(* 2 lemmas needed for cleaning of quantifiers *)
+ − 389
lemma all_prs:
528
+ − 390
assumes a: "Quotient R absf repf"
458
+ − 391
shows "Ball (Respects R) ((absf ---> id) f) = All f"
528
+ − 392
using a unfolding Quotient_def
542
+ − 393
by (metis in_respects fun_map.simps id_apply)
162
+ − 394
458
+ − 395
lemma ex_prs:
528
+ − 396
assumes a: "Quotient R absf repf"
458
+ − 397
shows "Bex (Respects R) ((absf ---> id) f) = Ex f"
528
+ − 398
using a unfolding Quotient_def
542
+ − 399
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>
diff
changeset
+ − 400
554
+ − 401
lemma fun_rel_id:
+ − 402
assumes a: "\<And>x y. R1 x y \<Longrightarrow> R2 (f x) (g y)"
+ − 403
shows "(R1 ===> R2) f g"
721
+ − 404
using a by simp
554
+ − 405
697
+ − 406
lemma fun_rel_id_asm:
+ − 407
assumes a: "\<And>x y. R1 x y \<Longrightarrow> (A \<longrightarrow> R2 (f x) (g y))"
+ − 408
shows "A \<longrightarrow> (R1 ===> R2) f g"
721
+ − 409
using a by auto
697
+ − 410
554
+ − 411
lemma quot_rel_rsp:
+ − 412
assumes a: "Quotient R Abs Rep"
+ − 413
shows "(R ===> R ===> op =) R R"
+ − 414
apply(rule fun_rel_id)+
+ − 415
apply(rule equals_rsp[OF a])
+ − 416
apply(assumption)+
+ − 417
done
+ − 418
721
+ − 419
lemma o_prs:
+ − 420
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 421
and q2: "Quotient R2 Abs2 Rep2"
+ − 422
and q3: "Quotient R3 Abs3 Rep3"
+ − 423
shows "(Rep1 ---> Abs3) (((Abs2 ---> Rep3) f) o ((Abs1 ---> Rep2) g)) = f o g"
+ − 424
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] Quotient_abs_rep[OF q3]
+ − 425
unfolding o_def expand_fun_eq by simp
541
+ − 426
721
+ − 427
lemma o_rsp:
+ − 428
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 429
and q2: "Quotient R2 Abs2 Rep2"
+ − 430
and q3: "Quotient R3 Abs3 Rep3"
+ − 431
and a1: "(R2 ===> R3) f1 f2"
+ − 432
and a2: "(R1 ===> R2) g1 g2"
+ − 433
shows "(R1 ===> R3) (f1 o g1) (f2 o g2)"
+ − 434
using a1 a2 unfolding o_def expand_fun_eq
+ − 435
by (auto)
+ − 436
+ − 437
lemma cond_prs:
+ − 438
assumes a: "Quotient R absf repf"
+ − 439
shows "absf (if a then repf b else repf c) = (if a then b else c)"
+ − 440
using a unfolding Quotient_def by auto
+ − 441
+ − 442
lemma if_prs:
+ − 443
assumes q: "Quotient R Abs Rep"
+ − 444
shows "Abs (If a (Rep b) (Rep c)) = If a b c"
+ − 445
using Quotient_abs_rep[OF q] by auto
+ − 446
+ − 447
(* q not used *)
+ − 448
lemma if_rsp:
+ − 449
assumes q: "Quotient R Abs Rep"
+ − 450
and a: "a1 = a2" "R b1 b2" "R c1 c2"
+ − 451
shows "R (If a1 b1 c1) (If a2 b2 c2)"
+ − 452
using a by auto
+ − 453
+ − 454
lemma let_prs:
+ − 455
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 456
and q2: "Quotient R2 Abs2 Rep2"
+ − 457
shows "Abs2 (Let (Rep1 x) ((Abs1 ---> Rep2) f)) = Let x f"
+ − 458
using Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2] by auto
+ − 459
+ − 460
lemma let_rsp:
+ − 461
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 462
and a1: "(R1 ===> R2) f g"
+ − 463
and a2: "R1 x y"
+ − 464
shows "R2 ((Let x f)::'c) ((Let y g)::'c)"
+ − 465
using apply_rsp[OF q1 a1] a2 by auto
543
+ − 466
+ − 467
+ − 468
+ − 469
+ − 470
(******************************************)
+ − 471
(* REST OF THE FILE IS UNUSED (until now) *)
+ − 472
(******************************************)
656
c86a47d4966e
Temporarily repeated fun_map_tac 4 times. Cleaning for all examples work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 473
542
+ − 474
lemma in_fun:
+ − 475
shows "x \<in> ((f ---> g) s) = g (f x \<in> s)"
721
+ − 476
by (simp add: mem_def)
542
+ − 477
721
+ − 478
lemma respects_thm:
542
+ − 479
shows "Respects (R1 ===> R2) f = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (f y))"
721
+ − 480
unfolding Respects_def
+ − 481
by (simp add: expand_fun_eq)
542
+ − 482
721
+ − 483
lemma respects_rep_abs:
542
+ − 484
assumes a: "Quotient R1 Abs1 Rep1"
+ − 485
and b: "Respects (R1 ===> R2) f"
+ − 486
and c: "R1 x x"
+ − 487
shows "R2 (f (Rep1 (Abs1 x))) (f x)"
721
+ − 488
using a b[simplified respects_thm] c unfolding Quotient_def
+ − 489
by blast
542
+ − 490
721
+ − 491
lemma respects_mp:
542
+ − 492
assumes a: "Respects (R1 ===> R2) f"
+ − 493
and b: "R1 x y"
+ − 494
shows "R2 (f x) (f y)"
721
+ − 495
using a b unfolding Respects_def
+ − 496
by simp
542
+ − 497
721
+ − 498
lemma respects_o:
542
+ − 499
assumes a: "Respects (R2 ===> R3) f"
+ − 500
and b: "Respects (R1 ===> R2) g"
+ − 501
shows "Respects (R1 ===> R3) (f o g)"
721
+ − 502
using a b unfolding Respects_def
+ − 503
by simp
542
+ − 504
721
+ − 505
lemma fun_rel_eq_rel:
542
+ − 506
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 507
and q2: "Quotient R2 Abs2 Rep2"
721
+ − 508
shows "(R1 ===> R2) f g = ((Respects (R1 ===> R2) f) \<and> (Respects (R1 ===> R2) g)
542
+ − 509
\<and> ((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g))"
721
+ − 510
using fun_quotient[OF q1 q2] unfolding Respects_def Quotient_def expand_fun_eq
+ − 511
by blast
542
+ − 512
721
+ − 513
lemma let_babs:
+ − 514
"v \<in> r \<Longrightarrow> Let v (Babs r lam) = Let v lam"
+ − 515
by (simp add: Babs_def)
542
+ − 516
721
+ − 517
lemma fun_rel_equals:
542
+ − 518
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 519
and q2: "Quotient R2 Abs2 Rep2"
+ − 520
and r1: "Respects (R1 ===> R2) f"
+ − 521
and r2: "Respects (R1 ===> R2) g"
+ − 522
shows "((Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g) = (\<forall>x y. R1 x y \<longrightarrow> R2 (f x) (g y))"
721
+ − 523
apply(rule_tac iffI)
+ − 524
using fun_quotient[OF q1 q2] r1 r2 unfolding Quotient_def Respects_def
+ − 525
apply(metis apply_rsp')
+ − 526
using r1 unfolding Respects_def expand_fun_eq
+ − 527
apply(simp (no_asm_use))
+ − 528
apply(metis Quotient_rel[OF q2] Quotient_rel_rep[OF q1])
+ − 529
done
542
+ − 530
+ − 531
(* ask Peter: fun_rel_IMP used twice *)
+ − 532
lemma fun_rel_IMP2:
+ − 533
assumes q1: "Quotient R1 Abs1 Rep1"
+ − 534
and q2: "Quotient R2 Abs2 Rep2"
+ − 535
and r1: "Respects (R1 ===> R2) f"
+ − 536
and r2: "Respects (R1 ===> R2) g"
+ − 537
and a: "(Rep1 ---> Abs2) f = (Rep1 ---> Abs2) g"
+ − 538
shows "R1 x y \<Longrightarrow> R2 (f x) (g y)"
721
+ − 539
using q1 q2 r1 r2 a
+ − 540
by (simp add: fun_rel_equals)
542
+ − 541
721
+ − 542
lemma lambda_rep_abs_rsp:
542
+ − 543
assumes r1: "\<And>r r'. R1 r r' \<Longrightarrow>R1 r (Rep1 (Abs1 r'))"
+ − 544
and r2: "\<And>r r'. R2 r r' \<Longrightarrow>R2 r (Rep2 (Abs2 r'))"
+ − 545
shows "(R1 ===> R2) f1 f2 \<Longrightarrow> (R1 ===> R2) f1 ((Abs1 ---> Rep2) ((Rep1 ---> Abs2) f2))"
721
+ − 546
using r1 r2 by auto
543
+ − 547
+ − 548
(* ask peter what are literal_case *)
+ − 549
(* literal_case_PRS *)
+ − 550
(* literal_case_RSP *)
721
+ − 551
(* Cez: !f x. literal_case f x = f x *)
543
+ − 552
+ − 553
(* We use id_simps which includes id_apply; so these 2 theorems can be removed *)
721
+ − 554
lemma id_prs:
543
+ − 555
assumes q: "Quotient R Abs Rep"
721
+ − 556
shows "Abs (id (Rep e)) = id e"
+ − 557
using Quotient_abs_rep[OF q] by auto
543
+ − 558
721
+ − 559
lemma id_rsp:
543
+ − 560
assumes q: "Quotient R Abs Rep"
+ − 561
and a: "R e1 e2"
+ − 562
shows "R (id e1) (id e2)"
721
+ − 563
using a by auto
543
+ − 564
93
+ − 565
end
95
+ − 566