1062
+ − 1
(* Title: Nominal2_Base
+ − 2
Authors: Brian Huffman, Christian Urban
+ − 3
+ − 4
Basic definitions and lemma infrastructure for
+ − 5
Nominal Isabelle.
+ − 6
*)
+ − 7
theory Nominal2_Base
2635
+ − 8
imports Main
+ − 9
"~~/src/HOL/Library/Infinite_Set"
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 10
"~~/src/HOL/Quotient_Examples/FSet"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 11
uses ("nominal_basics.ML")
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 12
("nominal_thmdecls.ML")
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 13
("nominal_permeq.ML")
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 14
("nominal_library.ML")
2467
+ − 15
("nominal_atoms.ML")
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 16
("nominal_eqvt.ML")
1062
+ − 17
begin
+ − 18
+ − 19
section {* Atoms and Sorts *}
+ − 20
+ − 21
text {* A simple implementation for atom_sorts is strings. *}
+ − 22
(* types atom_sort = string *)
+ − 23
+ − 24
text {* To deal with Church-like binding we use trees of
+ − 25
strings as sorts. *}
+ − 26
+ − 27
datatype atom_sort = Sort "string" "atom_sort list"
+ − 28
+ − 29
datatype atom = Atom atom_sort nat
+ − 30
+ − 31
+ − 32
text {* Basic projection function. *}
+ − 33
+ − 34
primrec
+ − 35
sort_of :: "atom \<Rightarrow> atom_sort"
+ − 36
where
2742
+ − 37
"sort_of (Atom s n) = s"
1062
+ − 38
1930
+ − 39
primrec
+ − 40
nat_of :: "atom \<Rightarrow> nat"
+ − 41
where
+ − 42
"nat_of (Atom s n) = n"
+ − 43
1062
+ − 44
+ − 45
text {* There are infinitely many atoms of each sort. *}
+ − 46
lemma INFM_sort_of_eq:
+ − 47
shows "INFM a. sort_of a = s"
+ − 48
proof -
+ − 49
have "INFM i. sort_of (Atom s i) = s" by simp
+ − 50
moreover have "inj (Atom s)" by (simp add: inj_on_def)
+ − 51
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj)
+ − 52
qed
+ − 53
+ − 54
lemma infinite_sort_of_eq:
+ − 55
shows "infinite {a. sort_of a = s}"
+ − 56
using INFM_sort_of_eq unfolding INFM_iff_infinite .
+ − 57
+ − 58
lemma atom_infinite [simp]:
+ − 59
shows "infinite (UNIV :: atom set)"
+ − 60
using subset_UNIV infinite_sort_of_eq
+ − 61
by (rule infinite_super)
+ − 62
+ − 63
lemma obtain_atom:
+ − 64
fixes X :: "atom set"
+ − 65
assumes X: "finite X"
+ − 66
obtains a where "a \<notin> X" "sort_of a = s"
+ − 67
proof -
+ − 68
from X have "MOST a. a \<notin> X"
+ − 69
unfolding MOST_iff_cofinite by simp
+ − 70
with INFM_sort_of_eq
+ − 71
have "INFM a. sort_of a = s \<and> a \<notin> X"
+ − 72
by (rule INFM_conjI)
+ − 73
then obtain a where "a \<notin> X" "sort_of a = s"
+ − 74
by (auto elim: INFM_E)
+ − 75
then show ?thesis ..
+ − 76
qed
+ − 77
1930
+ − 78
lemma atom_components_eq_iff:
+ − 79
fixes a b :: atom
+ − 80
shows "a = b \<longleftrightarrow> sort_of a = sort_of b \<and> nat_of a = nat_of b"
+ − 81
by (induct a, induct b, simp)
+ − 82
2735
+ − 83
1062
+ − 84
section {* Sort-Respecting Permutations *}
+ − 85
+ − 86
typedef perm =
+ − 87
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}"
+ − 88
proof
+ − 89
show "id \<in> ?perm" by simp
+ − 90
qed
+ − 91
+ − 92
lemma permI:
+ − 93
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a"
+ − 94
shows "f \<in> perm"
+ − 95
using assms unfolding perm_def MOST_iff_cofinite by simp
+ − 96
+ − 97
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f"
+ − 98
unfolding perm_def by simp
+ − 99
+ − 100
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}"
+ − 101
unfolding perm_def by simp
+ − 102
+ − 103
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a"
+ − 104
unfolding perm_def by simp
+ − 105
+ − 106
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x"
+ − 107
unfolding perm_def MOST_iff_cofinite by simp
+ − 108
+ − 109
lemma perm_id: "id \<in> perm"
+ − 110
unfolding perm_def by simp
+ − 111
+ − 112
lemma perm_comp:
+ − 113
assumes f: "f \<in> perm" and g: "g \<in> perm"
+ − 114
shows "(f \<circ> g) \<in> perm"
+ − 115
apply (rule permI)
+ − 116
apply (rule bij_comp)
+ − 117
apply (rule perm_is_bij [OF g])
+ − 118
apply (rule perm_is_bij [OF f])
+ − 119
apply (rule MOST_rev_mp [OF perm_MOST [OF g]])
+ − 120
apply (rule MOST_rev_mp [OF perm_MOST [OF f]])
+ − 121
apply (simp)
+ − 122
apply (simp add: perm_is_sort_respecting [OF f])
+ − 123
apply (simp add: perm_is_sort_respecting [OF g])
+ − 124
done
+ − 125
+ − 126
lemma perm_inv:
+ − 127
assumes f: "f \<in> perm"
+ − 128
shows "(inv f) \<in> perm"
+ − 129
apply (rule permI)
+ − 130
apply (rule bij_imp_bij_inv)
+ − 131
apply (rule perm_is_bij [OF f])
+ − 132
apply (rule MOST_mono [OF perm_MOST [OF f]])
+ − 133
apply (erule subst, rule inv_f_f)
+ − 134
apply (rule bij_is_inj [OF perm_is_bij [OF f]])
+ − 135
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans])
+ − 136
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]])
+ − 137
done
+ − 138
+ − 139
lemma bij_Rep_perm: "bij (Rep_perm p)"
+ − 140
using Rep_perm [of p] unfolding perm_def by simp
+ − 141
+ − 142
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}"
+ − 143
using Rep_perm [of p] unfolding perm_def by simp
+ − 144
+ − 145
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a"
+ − 146
using Rep_perm [of p] unfolding perm_def by simp
+ − 147
+ − 148
lemma Rep_perm_ext:
+ − 149
"Rep_perm p1 = Rep_perm p2 \<Longrightarrow> p1 = p2"
2479
+ − 150
by (simp add: fun_eq_iff Rep_perm_inject [symmetric])
1062
+ − 151
2560
+ − 152
instance perm :: size ..
1062
+ − 153
2735
+ − 154
2732
+ − 155
subsection {* Permutations form a (multiplicative) group *}
+ − 156
1062
+ − 157
instantiation perm :: group_add
+ − 158
begin
+ − 159
+ − 160
definition
+ − 161
"0 = Abs_perm id"
+ − 162
+ − 163
definition
+ − 164
"- p = Abs_perm (inv (Rep_perm p))"
+ − 165
+ − 166
definition
+ − 167
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)"
+ − 168
+ − 169
definition
+ − 170
"(p1::perm) - p2 = p1 + - p2"
+ − 171
+ − 172
lemma Rep_perm_0: "Rep_perm 0 = id"
+ − 173
unfolding zero_perm_def
+ − 174
by (simp add: Abs_perm_inverse perm_id)
+ − 175
+ − 176
lemma Rep_perm_add:
+ − 177
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2"
+ − 178
unfolding plus_perm_def
+ − 179
by (simp add: Abs_perm_inverse perm_comp Rep_perm)
+ − 180
+ − 181
lemma Rep_perm_uminus:
+ − 182
"Rep_perm (- p) = inv (Rep_perm p)"
+ − 183
unfolding uminus_perm_def
+ − 184
by (simp add: Abs_perm_inverse perm_inv Rep_perm)
+ − 185
+ − 186
instance
+ − 187
apply default
+ − 188
unfolding Rep_perm_inject [symmetric]
+ − 189
unfolding minus_perm_def
+ − 190
unfolding Rep_perm_add
+ − 191
unfolding Rep_perm_uminus
+ − 192
unfolding Rep_perm_0
+ − 193
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]])
+ − 194
+ − 195
end
+ − 196
+ − 197
+ − 198
section {* Implementation of swappings *}
+ − 199
+ − 200
definition
+ − 201
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')")
+ − 202
where
+ − 203
"(a \<rightleftharpoons> b) =
+ − 204
Abs_perm (if sort_of a = sort_of b
+ − 205
then (\<lambda>c. if a = c then b else if b = c then a else c)
+ − 206
else id)"
+ − 207
+ − 208
lemma Rep_perm_swap:
+ − 209
"Rep_perm (a \<rightleftharpoons> b) =
+ − 210
(if sort_of a = sort_of b
+ − 211
then (\<lambda>c. if a = c then b else if b = c then a else c)
+ − 212
else id)"
+ − 213
unfolding swap_def
+ − 214
apply (rule Abs_perm_inverse)
+ − 215
apply (rule permI)
+ − 216
apply (auto simp add: bij_def inj_on_def surj_def)[1]
+ − 217
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]])
+ − 218
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]])
+ − 219
apply (simp)
+ − 220
apply (simp)
+ − 221
done
+ − 222
+ − 223
lemmas Rep_perm_simps =
+ − 224
Rep_perm_0
+ − 225
Rep_perm_add
+ − 226
Rep_perm_uminus
+ − 227
Rep_perm_swap
+ − 228
+ − 229
lemma swap_different_sorts [simp]:
+ − 230
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0"
+ − 231
by (rule Rep_perm_ext) (simp add: Rep_perm_simps)
+ − 232
+ − 233
lemma swap_cancel:
2679
+ − 234
shows "(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0"
+ − 235
and "(a \<rightleftharpoons> b) + (b \<rightleftharpoons> a) = 0"
+ − 236
by (rule_tac [!] Rep_perm_ext)
+ − 237
(simp_all add: Rep_perm_simps fun_eq_iff)
1062
+ − 238
+ − 239
lemma swap_self [simp]:
+ − 240
"(a \<rightleftharpoons> a) = 0"
2479
+ − 241
by (rule Rep_perm_ext, simp add: Rep_perm_simps fun_eq_iff)
1062
+ − 242
+ − 243
lemma minus_swap [simp]:
+ − 244
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)"
2679
+ − 245
by (rule minus_unique [OF swap_cancel(1)])
1062
+ − 246
+ − 247
lemma swap_commute:
+ − 248
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)"
+ − 249
by (rule Rep_perm_ext)
2479
+ − 250
(simp add: Rep_perm_swap fun_eq_iff)
1062
+ − 251
+ − 252
lemma swap_triple:
+ − 253
assumes "a \<noteq> b" and "c \<noteq> b"
+ − 254
assumes "sort_of a = sort_of b" "sort_of b = sort_of c"
+ − 255
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
+ − 256
using assms
+ − 257
by (rule_tac Rep_perm_ext)
2479
+ − 258
(auto simp add: Rep_perm_simps fun_eq_iff)
1062
+ − 259
+ − 260
+ − 261
section {* Permutation Types *}
+ − 262
+ − 263
text {*
+ − 264
Infix syntax for @{text permute} has higher precedence than
+ − 265
addition, but lower than unary minus.
+ − 266
*}
+ − 267
+ − 268
class pt =
+ − 269
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75)
+ − 270
assumes permute_zero [simp]: "0 \<bullet> x = x"
+ − 271
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)"
+ − 272
begin
+ − 273
+ − 274
lemma permute_diff [simp]:
+ − 275
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x"
+ − 276
unfolding diff_minus by simp
+ − 277
+ − 278
lemma permute_minus_cancel [simp]:
+ − 279
shows "p \<bullet> - p \<bullet> x = x"
+ − 280
and "- p \<bullet> p \<bullet> x = x"
+ − 281
unfolding permute_plus [symmetric] by simp_all
+ − 282
+ − 283
lemma permute_swap_cancel [simp]:
+ − 284
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x"
+ − 285
unfolding permute_plus [symmetric]
+ − 286
by (simp add: swap_cancel)
+ − 287
+ − 288
lemma permute_swap_cancel2 [simp]:
+ − 289
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x"
+ − 290
unfolding permute_plus [symmetric]
+ − 291
by (simp add: swap_commute)
+ − 292
+ − 293
lemma inj_permute [simp]:
+ − 294
shows "inj (permute p)"
+ − 295
by (rule inj_on_inverseI)
+ − 296
(rule permute_minus_cancel)
+ − 297
+ − 298
lemma surj_permute [simp]:
+ − 299
shows "surj (permute p)"
+ − 300
by (rule surjI, rule permute_minus_cancel)
+ − 301
+ − 302
lemma bij_permute [simp]:
+ − 303
shows "bij (permute p)"
+ − 304
by (rule bijI [OF inj_permute surj_permute])
+ − 305
+ − 306
lemma inv_permute:
+ − 307
shows "inv (permute p) = permute (- p)"
+ − 308
by (rule inv_equality) (simp_all)
+ − 309
+ − 310
lemma permute_minus:
+ − 311
shows "permute (- p) = inv (permute p)"
+ − 312
by (simp add: inv_permute)
+ − 313
+ − 314
lemma permute_eq_iff [simp]:
+ − 315
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y"
+ − 316
by (rule inj_permute [THEN inj_eq])
+ − 317
+ − 318
end
+ − 319
+ − 320
subsection {* Permutations for atoms *}
+ − 321
+ − 322
instantiation atom :: pt
+ − 323
begin
+ − 324
+ − 325
definition
1879
+ − 326
"p \<bullet> a = (Rep_perm p) a"
1062
+ − 327
+ − 328
instance
+ − 329
apply(default)
+ − 330
apply(simp_all add: permute_atom_def Rep_perm_simps)
+ − 331
done
+ − 332
+ − 333
end
+ − 334
+ − 335
lemma sort_of_permute [simp]:
+ − 336
shows "sort_of (p \<bullet> a) = sort_of a"
+ − 337
unfolding permute_atom_def by (rule sort_of_Rep_perm)
+ − 338
+ − 339
lemma swap_atom:
+ − 340
shows "(a \<rightleftharpoons> b) \<bullet> c =
+ − 341
(if sort_of a = sort_of b
+ − 342
then (if c = a then b else if c = b then a else c) else c)"
+ − 343
unfolding permute_atom_def
+ − 344
by (simp add: Rep_perm_swap)
+ − 345
+ − 346
lemma swap_atom_simps [simp]:
+ − 347
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b"
+ − 348
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a"
+ − 349
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c"
+ − 350
unfolding swap_atom by simp_all
+ − 351
2732
+ − 352
lemma perm_eq_iff:
1062
+ − 353
fixes p q :: "perm"
+ − 354
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)"
+ − 355
unfolding permute_atom_def
+ − 356
by (metis Rep_perm_ext ext)
+ − 357
+ − 358
+ − 359
subsection {* Permutations for permutations *}
+ − 360
+ − 361
instantiation perm :: pt
+ − 362
begin
+ − 363
+ − 364
definition
+ − 365
"p \<bullet> q = p + q - p"
+ − 366
+ − 367
instance
+ − 368
apply default
+ − 369
apply (simp add: permute_perm_def)
+ − 370
apply (simp add: permute_perm_def diff_minus minus_add add_assoc)
+ − 371
done
+ − 372
+ − 373
end
+ − 374
1879
+ − 375
lemma permute_self:
+ − 376
shows "p \<bullet> p = p"
+ − 377
unfolding permute_perm_def
+ − 378
by (simp add: diff_minus add_assoc)
1062
+ − 379
2732
+ − 380
lemma pemute_minus_self:
+ − 381
shows "- p \<bullet> p = p"
+ − 382
unfolding permute_perm_def
+ − 383
by (simp add: diff_minus add_assoc)
+ − 384
1062
+ − 385
+ − 386
subsection {* Permutations for functions *}
+ − 387
+ − 388
instantiation "fun" :: (pt, pt) pt
+ − 389
begin
+ − 390
+ − 391
definition
+ − 392
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"
+ − 393
+ − 394
instance
+ − 395
apply default
+ − 396
apply (simp add: permute_fun_def)
+ − 397
apply (simp add: permute_fun_def minus_add)
+ − 398
done
+ − 399
+ − 400
end
+ − 401
+ − 402
lemma permute_fun_app_eq:
+ − 403
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)"
1879
+ − 404
unfolding permute_fun_def by simp
1062
+ − 405
2663
+ − 406
1062
+ − 407
subsection {* Permutations for booleans *}
+ − 408
+ − 409
instantiation bool :: pt
+ − 410
begin
+ − 411
+ − 412
definition "p \<bullet> (b::bool) = b"
+ − 413
+ − 414
instance
+ − 415
apply(default)
+ − 416
apply(simp_all add: permute_bool_def)
+ − 417
done
+ − 418
+ − 419
end
+ − 420
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 421
lemma permute_boolE:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 422
fixes P::"bool"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 423
shows "p \<bullet> P \<Longrightarrow> P"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 424
by (simp add: permute_bool_def)
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 425
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 426
lemma permute_boolI:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 427
fixes P::"bool"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 428
shows "P \<Longrightarrow> p \<bullet> P"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 429
by(simp add: permute_bool_def)
1062
+ − 430
+ − 431
subsection {* Permutations for sets *}
+ − 432
+ − 433
lemma permute_set_eq:
+ − 434
fixes x::"'a::pt"
+ − 435
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}"
1879
+ − 436
unfolding permute_fun_def
+ − 437
unfolding permute_bool_def
+ − 438
apply(auto simp add: mem_def)
1062
+ − 439
apply(rule_tac x="- p \<bullet> x" in exI)
+ − 440
apply(simp)
+ − 441
done
+ − 442
+ − 443
lemma permute_set_eq_image:
+ − 444
shows "p \<bullet> X = permute p ` X"
1879
+ − 445
unfolding permute_set_eq by auto
1062
+ − 446
+ − 447
lemma permute_set_eq_vimage:
+ − 448
shows "p \<bullet> X = permute (- p) -` X"
1879
+ − 449
unfolding permute_fun_def permute_bool_def
+ − 450
unfolding vimage_def Collect_def mem_def ..
1062
+ − 451
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 452
lemma permute_finite [simp]:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 453
shows "finite (p \<bullet> X) = finite X"
2735
+ − 454
unfolding permute_set_eq_vimage
+ − 455
using bij_permute by (rule finite_vimage_iff)
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 456
1062
+ − 457
lemma swap_set_not_in:
+ − 458
assumes a: "a \<notin> S" "b \<notin> S"
+ − 459
shows "(a \<rightleftharpoons> b) \<bullet> S = S"
1879
+ − 460
unfolding permute_set_eq
+ − 461
using a by (auto simp add: swap_atom)
1062
+ − 462
+ − 463
lemma swap_set_in:
+ − 464
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b"
+ − 465
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S"
1879
+ − 466
unfolding permute_set_eq
+ − 467
using a by (auto simp add: swap_atom)
1062
+ − 468
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 469
lemma swap_set_in_eq:
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 470
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 471
shows "(a \<rightleftharpoons> b) \<bullet> S = (S - {a}) \<union> {b}"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 472
unfolding permute_set_eq
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 473
using a by (auto simp add: swap_atom)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 474
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 475
lemma swap_set_both_in:
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 476
assumes a: "a \<in> S" "b \<in> S"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 477
shows "(a \<rightleftharpoons> b) \<bullet> S = S"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 478
unfolding permute_set_eq
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 479
using a by (auto simp add: swap_atom)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 480
2470
+ − 481
lemma mem_permute_iff:
+ − 482
shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X"
+ − 483
unfolding mem_def permute_fun_def permute_bool_def
+ − 484
by simp
+ − 485
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 486
lemma empty_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 487
shows "p \<bullet> {} = {}"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 488
unfolding empty_def Collect_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 489
by (simp add: permute_fun_def permute_bool_def)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 490
2470
+ − 491
lemma insert_eqvt:
+ − 492
shows "p \<bullet> (insert x A) = insert (p \<bullet> x) (p \<bullet> A)"
+ − 493
unfolding permute_set_eq_image image_insert ..
+ − 494
2735
+ − 495
+ − 496
subsection {* Permutations for @{typ unit} *}
1062
+ − 497
+ − 498
instantiation unit :: pt
+ − 499
begin
+ − 500
+ − 501
definition "p \<bullet> (u::unit) = u"
+ − 502
1879
+ − 503
instance
+ − 504
by (default) (simp_all add: permute_unit_def)
1062
+ − 505
+ − 506
end
+ − 507
+ − 508
+ − 509
subsection {* Permutations for products *}
+ − 510
2378
+ − 511
instantiation prod :: (pt, pt) pt
1062
+ − 512
begin
+ − 513
+ − 514
primrec
+ − 515
permute_prod
+ − 516
where
+ − 517
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"
+ − 518
+ − 519
instance
+ − 520
by default auto
+ − 521
+ − 522
end
+ − 523
+ − 524
subsection {* Permutations for sums *}
+ − 525
2378
+ − 526
instantiation sum :: (pt, pt) pt
1062
+ − 527
begin
+ − 528
+ − 529
primrec
+ − 530
permute_sum
+ − 531
where
+ − 532
"p \<bullet> (Inl x) = Inl (p \<bullet> x)"
+ − 533
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)"
+ − 534
1879
+ − 535
instance
+ − 536
by (default) (case_tac [!] x, simp_all)
1062
+ − 537
+ − 538
end
+ − 539
2735
+ − 540
subsection {* Permutations for @{typ "'a list"} *}
1062
+ − 541
+ − 542
instantiation list :: (pt) pt
+ − 543
begin
+ − 544
+ − 545
primrec
+ − 546
permute_list
+ − 547
where
+ − 548
"p \<bullet> [] = []"
+ − 549
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"
+ − 550
1879
+ − 551
instance
+ − 552
by (default) (induct_tac [!] x, simp_all)
1062
+ − 553
+ − 554
end
+ − 555
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 556
lemma set_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 557
shows "p \<bullet> (set xs) = set (p \<bullet> xs)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 558
by (induct xs) (simp_all add: empty_eqvt insert_eqvt)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 559
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 560
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 561
2735
+ − 562
subsection {* Permutations for @{typ "'a option"} *}
1062
+ − 563
+ − 564
instantiation option :: (pt) pt
+ − 565
begin
+ − 566
+ − 567
primrec
+ − 568
permute_option
+ − 569
where
+ − 570
"p \<bullet> None = None"
+ − 571
| "p \<bullet> (Some x) = Some (p \<bullet> x)"
+ − 572
1879
+ − 573
instance
+ − 574
by (default) (induct_tac [!] x, simp_all)
1062
+ − 575
+ − 576
end
+ − 577
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 578
2735
+ − 579
subsection {* Permutations for @{typ "'a fset"} *}
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 580
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 581
lemma permute_fset_rsp[quot_respect]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 582
shows "(op = ===> list_eq ===> list_eq) permute permute"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 583
unfolding fun_rel_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 584
by (simp add: set_eqvt[symmetric])
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 585
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 586
instantiation fset :: (pt) pt
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 587
begin
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 588
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 589
quotient_definition
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 590
"permute_fset :: perm \<Rightarrow> 'a fset \<Rightarrow> 'a fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 591
is
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 592
"permute :: perm \<Rightarrow> 'a list \<Rightarrow> 'a list"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 593
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 594
instance
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 595
proof
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 596
fix x :: "'a fset" and p q :: "perm"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 597
show "0 \<bullet> x = x" by (descending) (simp)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 598
show "(p + q) \<bullet> x = p \<bullet> q \<bullet> x" by (descending) (simp)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 599
qed
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 600
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 601
end
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 602
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 603
lemma permute_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 604
fixes S::"('a::pt) fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 605
shows "(p \<bullet> {||}) = ({||} ::('a::pt) fset)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 606
and "(p \<bullet> insert_fset x S) = insert_fset (p \<bullet> x) (p \<bullet> S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 607
by (lifting permute_list.simps)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 608
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 609
lemma fset_eqvt:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 610
shows "p \<bullet> (fset S) = fset (p \<bullet> S)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 611
by (lifting set_eqvt)
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 612
2735
+ − 613
1062
+ − 614
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *}
+ − 615
+ − 616
instantiation char :: pt
+ − 617
begin
+ − 618
+ − 619
definition "p \<bullet> (c::char) = c"
+ − 620
1879
+ − 621
instance
+ − 622
by (default) (simp_all add: permute_char_def)
1062
+ − 623
+ − 624
end
+ − 625
+ − 626
instantiation nat :: pt
+ − 627
begin
+ − 628
+ − 629
definition "p \<bullet> (n::nat) = n"
+ − 630
1879
+ − 631
instance
+ − 632
by (default) (simp_all add: permute_nat_def)
1062
+ − 633
+ − 634
end
+ − 635
+ − 636
instantiation int :: pt
+ − 637
begin
+ − 638
+ − 639
definition "p \<bullet> (i::int) = i"
+ − 640
1879
+ − 641
instance
+ − 642
by (default) (simp_all add: permute_int_def)
1062
+ − 643
+ − 644
end
+ − 645
+ − 646
+ − 647
section {* Pure types *}
+ − 648
+ − 649
text {* Pure types will have always empty support. *}
+ − 650
+ − 651
class pure = pt +
+ − 652
assumes permute_pure: "p \<bullet> x = x"
+ − 653
+ − 654
text {* Types @{typ unit} and @{typ bool} are pure. *}
+ − 655
+ − 656
instance unit :: pure
+ − 657
proof qed (rule permute_unit_def)
+ − 658
+ − 659
instance bool :: pure
+ − 660
proof qed (rule permute_bool_def)
+ − 661
2635
+ − 662
1062
+ − 663
text {* Other type constructors preserve purity. *}
+ − 664
+ − 665
instance "fun" :: (pure, pure) pure
+ − 666
by default (simp add: permute_fun_def permute_pure)
+ − 667
2378
+ − 668
instance prod :: (pure, pure) pure
1062
+ − 669
by default (induct_tac x, simp add: permute_pure)
+ − 670
2378
+ − 671
instance sum :: (pure, pure) pure
1062
+ − 672
by default (induct_tac x, simp_all add: permute_pure)
+ − 673
+ − 674
instance list :: (pure) pure
+ − 675
by default (induct_tac x, simp_all add: permute_pure)
+ − 676
+ − 677
instance option :: (pure) pure
+ − 678
by default (induct_tac x, simp_all add: permute_pure)
+ − 679
+ − 680
+ − 681
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
+ − 682
+ − 683
instance char :: pure
+ − 684
proof qed (rule permute_char_def)
+ − 685
+ − 686
instance nat :: pure
+ − 687
proof qed (rule permute_nat_def)
+ − 688
+ − 689
instance int :: pure
+ − 690
proof qed (rule permute_int_def)
+ − 691
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 692
2735
+ − 693
section {* Infrastructure for Equivariance and Perm_simp *}
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 694
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 695
subsection {* Basic functions about permutations *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 696
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 697
use "nominal_basics.ML"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 698
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 699
2735
+ − 700
subsection {* Eqvt infrastructure *}
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 701
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 702
text {* Setup of the theorem attributes @{text eqvt} and @{text eqvt_raw} *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 703
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 704
use "nominal_thmdecls.ML"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 705
setup "Nominal_ThmDecls.setup"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 706
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 707
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 708
lemmas [eqvt] =
2735
+ − 709
(* pt types *)
+ − 710
permute_prod.simps
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 711
permute_list.simps
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 712
permute_option.simps
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 713
permute_sum.simps
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 714
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 715
(* sets *)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 716
empty_eqvt insert_eqvt set_eqvt
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 717
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 718
(* fsets *)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 719
permute_fset fset_eqvt
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 720
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 721
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 722
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 723
subsection {* perm_simp infrastructure *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 724
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 725
definition
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 726
"unpermute p = permute (- p)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 727
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 728
lemma eqvt_apply:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 729
fixes f :: "'a::pt \<Rightarrow> 'b::pt"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 730
and x :: "'a::pt"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 731
shows "p \<bullet> (f x) \<equiv> (p \<bullet> f) (p \<bullet> x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 732
unfolding permute_fun_def by simp
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 734
lemma eqvt_lambda:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 735
fixes f :: "'a::pt \<Rightarrow> 'b::pt"
2753
+ − 736
shows "p \<bullet> f \<equiv> (\<lambda>x. p \<bullet> (f (unpermute p x)))"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 737
unfolding permute_fun_def unpermute_def by simp
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 738
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 739
lemma eqvt_bound:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 740
shows "p \<bullet> unpermute p x \<equiv> x"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 741
unfolding unpermute_def by simp
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 742
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 743
text {* provides perm_simp methods *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 744
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 745
use "nominal_permeq.ML"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 746
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 747
method_setup perm_simp =
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 748
{* Nominal_Permeq.args_parser >> Nominal_Permeq.perm_simp_meth *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 749
{* pushes permutations inside. *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 750
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 751
method_setup perm_strict_simp =
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 752
{* Nominal_Permeq.args_parser >> Nominal_Permeq.perm_strict_simp_meth *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 753
{* pushes permutations inside, raises an error if it cannot solve all permutations. *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 754
2735
+ − 755
+ − 756
subsubsection {* Equivariance for permutations and swapping *}
+ − 757
+ − 758
lemma permute_eqvt:
+ − 759
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)"
+ − 760
unfolding permute_perm_def by simp
+ − 761
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 762
(* the normal version of this lemma would cause loops *)
2776
+ − 763
lemma permute_eqvt_raw [eqvt_raw]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 764
shows "p \<bullet> permute \<equiv> permute"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 765
apply(simp add: fun_eq_iff permute_fun_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 766
apply(subst permute_eqvt)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 767
apply(simp)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 768
done
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 769
2735
+ − 770
lemma zero_perm_eqvt [eqvt]:
+ − 771
shows "p \<bullet> (0::perm) = 0"
+ − 772
unfolding permute_perm_def by simp
+ − 773
+ − 774
lemma add_perm_eqvt [eqvt]:
+ − 775
fixes p p1 p2 :: perm
+ − 776
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2"
+ − 777
unfolding permute_perm_def
+ − 778
by (simp add: perm_eq_iff)
+ − 779
+ − 780
lemma swap_eqvt [eqvt]:
+ − 781
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)"
+ − 782
unfolding permute_perm_def
+ − 783
by (auto simp add: swap_atom perm_eq_iff)
+ − 784
+ − 785
lemma uminus_eqvt [eqvt]:
+ − 786
fixes p q::"perm"
+ − 787
shows "p \<bullet> (- q) = - (p \<bullet> q)"
+ − 788
unfolding permute_perm_def
+ − 789
by (simp add: diff_minus minus_add add_assoc)
+ − 790
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 791
subsubsection {* Equivariance of Logical Operators *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 792
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 793
lemma eq_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 794
shows "p \<bullet> (x = y) \<longleftrightarrow> (p \<bullet> x) = (p \<bullet> y)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 795
unfolding permute_eq_iff permute_bool_def ..
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 796
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 797
lemma Not_eqvt [eqvt]:
2735
+ − 798
shows "p \<bullet> (\<not> A) \<longleftrightarrow> \<not> (p \<bullet> A)"
+ − 799
by (simp add: permute_bool_def)
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 800
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 801
lemma conj_eqvt [eqvt]:
2735
+ − 802
shows "p \<bullet> (A \<and> B) \<longleftrightarrow> (p \<bullet> A) \<and> (p \<bullet> B)"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 803
by (simp add: permute_bool_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 804
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 805
lemma imp_eqvt [eqvt]:
2735
+ − 806
shows "p \<bullet> (A \<longrightarrow> B) \<longleftrightarrow> (p \<bullet> A) \<longrightarrow> (p \<bullet> B)"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 807
by (simp add: permute_bool_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 808
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 809
declare imp_eqvt[folded induct_implies_def, eqvt]
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 810
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 811
lemma all_eqvt [eqvt]:
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 812
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)"
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 813
unfolding All_def
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 814
by (perm_simp) (rule refl)
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 815
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 816
declare all_eqvt[folded induct_forall_def, eqvt]
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 817
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 818
lemma ex_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 819
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)"
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 820
unfolding Ex_def
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 821
by (perm_simp) (rule refl)
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 822
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 823
lemma ex1_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 824
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. (p \<bullet> P) x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 825
unfolding Ex1_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 826
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 827
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 828
lemma if_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 829
shows "p \<bullet> (if b then x else y) = (if p \<bullet> b then p \<bullet> x else p \<bullet> y)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 830
by (simp add: permute_fun_def permute_bool_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 831
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 832
lemma True_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 833
shows "p \<bullet> True = True"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 834
unfolding permute_bool_def ..
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 835
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 836
lemma False_eqvt [eqvt]:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 837
shows "p \<bullet> False = False"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 838
unfolding permute_bool_def ..
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 839
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 840
lemma disj_eqvt [eqvt]:
2735
+ − 841
shows "p \<bullet> (A \<or> B) \<longleftrightarrow> (p \<bullet> A) \<or> (p \<bullet> B)"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 842
by (simp add: permute_bool_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 843
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 844
lemma all_eqvt2:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 845
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. p \<bullet> P (- p \<bullet> x))"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 846
by (perm_simp add: permute_minus_cancel) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 847
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 848
lemma ex_eqvt2:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 849
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. p \<bullet> P (- p \<bullet> x))"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 850
by (perm_simp add: permute_minus_cancel) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 851
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 852
lemma ex1_eqvt2:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 853
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. p \<bullet> P (- p \<bullet> x))"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 854
by (perm_simp add: permute_minus_cancel) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 855
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 856
lemma the_eqvt:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 857
assumes unique: "\<exists>!x. P x"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 858
shows "(p \<bullet> (THE x. P x)) = (THE x. (p \<bullet> P) x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 859
apply(rule the1_equality [symmetric])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 860
apply(rule_tac p="-p" in permute_boolE)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 861
apply(perm_simp add: permute_minus_cancel)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 862
apply(rule unique)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 863
apply(rule_tac p="-p" in permute_boolE)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 864
apply(perm_simp add: permute_minus_cancel)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 865
apply(rule theI'[OF unique])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 866
done
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 867
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 868
lemma the_eqvt2:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 869
assumes unique: "\<exists>!x. P x"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 870
shows "(p \<bullet> (THE x. P x)) = (THE x. p \<bullet> P (- p \<bullet> x))"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 871
apply(rule the1_equality [symmetric])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 872
apply(simp add: ex1_eqvt2[symmetric])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 873
apply(simp add: permute_bool_def unique)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 874
apply(simp add: permute_bool_def)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 875
apply(rule theI'[OF unique])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 876
done
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 877
2776
+ − 878
subsubsection {* Equivariance of Set operators *}
+ − 879
+ − 880
lemma mem_eqvt [eqvt]:
+ − 881
shows "p \<bullet> (x \<in> A) \<longleftrightarrow> (p \<bullet> x) \<in> (p \<bullet> A)"
+ − 882
unfolding mem_def
+ − 883
by (rule permute_fun_app_eq)
+ − 884
+ − 885
lemma Collect_eqvt [eqvt]:
+ − 886
shows "p \<bullet> {x. P x} = {x. (p \<bullet> P) x}"
+ − 887
unfolding Collect_def permute_fun_def ..
+ − 888
+ − 889
lemma inter_eqvt [eqvt]:
+ − 890
shows "p \<bullet> (A \<inter> B) = (p \<bullet> A) \<inter> (p \<bullet> B)"
+ − 891
unfolding Int_def
+ − 892
by (perm_simp) (rule refl)
2735
+ − 893
+ − 894
lemma Bex_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 895
shows "p \<bullet> (\<exists>x \<in> S. P x) = (\<exists>x \<in> (p \<bullet> S). (p \<bullet> P) x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 896
unfolding Bex_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 897
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 898
2735
+ − 899
lemma Ball_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 900
shows "p \<bullet> (\<forall>x \<in> S. P x) = (\<forall>x \<in> (p \<bullet> S). (p \<bullet> P) x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 901
unfolding Ball_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 902
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 903
2776
+ − 904
lemma image_eqvt [eqvt]:
+ − 905
shows "p \<bullet> (f ` A) = (p \<bullet> f) ` (p \<bullet> A)"
+ − 906
unfolding image_def
+ − 907
by (perm_simp) (rule refl)
+ − 908
2735
+ − 909
lemma UNIV_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 910
shows "p \<bullet> UNIV = UNIV"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 911
unfolding UNIV_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 912
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 913
2735
+ − 914
lemma union_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 915
shows "p \<bullet> (A \<union> B) = (p \<bullet> A) \<union> (p \<bullet> B)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 916
unfolding Un_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 917
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 918
2735
+ − 919
lemma Diff_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 920
fixes A B :: "'a::pt set"
2735
+ − 921
shows "p \<bullet> (A - B) = (p \<bullet> A) - (p \<bullet> B)"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 922
unfolding set_diff_eq
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 923
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 924
2735
+ − 925
lemma Compl_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 926
fixes A :: "'a::pt set"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 927
shows "p \<bullet> (- A) = - (p \<bullet> A)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 928
unfolding Compl_eq_Diff_UNIV
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 929
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 930
2735
+ − 931
lemma subset_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 932
shows "p \<bullet> (S \<subseteq> T) \<longleftrightarrow> (p \<bullet> S) \<subseteq> (p \<bullet> T)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 933
unfolding subset_eq
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 934
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 935
2735
+ − 936
lemma psubset_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 937
shows "p \<bullet> (S \<subset> T) \<longleftrightarrow> (p \<bullet> S) \<subset> (p \<bullet> T)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 938
unfolding psubset_eq
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 939
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 940
2735
+ − 941
lemma vimage_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 942
shows "p \<bullet> (f -` A) = (p \<bullet> f) -` (p \<bullet> A)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 943
unfolding vimage_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 944
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 945
2735
+ − 946
lemma Union_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 947
shows "p \<bullet> (\<Union> S) = \<Union> (p \<bullet> S)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 948
unfolding Union_eq
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 949
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 950
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 951
lemma Inter_eqvt [eqvt]:
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 952
shows "p \<bullet> (\<Inter> S) = \<Inter> (p \<bullet> S)"
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 953
unfolding Inter_eq
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 954
by (perm_simp) (rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 955
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 956
2735
+ − 957
(* FIXME: eqvt attribute *)
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 958
lemma Sigma_eqvt:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 959
shows "(p \<bullet> (X \<times> Y)) = (p \<bullet> X) \<times> (p \<bullet> Y)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 960
unfolding Sigma_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 961
unfolding UNION_eq_Union_image
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 962
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 963
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 964
text {*
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 965
In order to prove that lfp is equivariant we need two
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 966
auxiliary classes which specify that (op <=) and
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 967
Inf are equivariant. Instances for bool and fun are
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 968
given.
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 969
*}
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 970
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 971
class le_eqvt = order +
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 972
assumes le_eqvt [eqvt]: "p \<bullet> (x \<le> y) = ((p \<bullet> x) \<le> (p \<bullet> (y::('a::{pt, order}))))"
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 973
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 974
class inf_eqvt = complete_lattice +
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 975
assumes inf_eqvt [eqvt]: "p \<bullet> (Inf X) = Inf (p \<bullet> (X::('a::{pt, Inf}) set))"
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 976
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 977
instantiation bool :: le_eqvt
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 978
begin
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 979
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 980
instance
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 981
apply(default)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 982
unfolding le_bool_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 983
apply(perm_simp)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 984
apply(rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 985
done
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 986
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 987
end
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 988
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 989
instantiation "fun" :: (pt, le_eqvt) le_eqvt
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 990
begin
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 991
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 992
instance
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 993
apply(default)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 994
unfolding le_fun_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 995
apply(perm_simp)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 996
apply(rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 997
done
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 998
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 999
end
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1000
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1001
instantiation bool :: inf_eqvt
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1002
begin
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1003
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1004
instance
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1005
apply(default)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1006
unfolding Inf_bool_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1007
apply(perm_simp)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1008
apply(rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1009
done
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1010
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1011
end
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1012
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1013
instantiation "fun" :: (pt, inf_eqvt) inf_eqvt
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1014
begin
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1015
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1016
instance
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1017
apply(default)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1018
unfolding Inf_fun_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1019
apply(perm_simp)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1020
apply(rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1021
done
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1022
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1023
end
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1024
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1025
lemma lfp_eqvt [eqvt]:
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1026
fixes F::"('a \<Rightarrow> 'b) \<Rightarrow> ('a::pt \<Rightarrow> 'b::{inf_eqvt, le_eqvt})"
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1027
shows "p \<bullet> (lfp F) = lfp (p \<bullet> F)"
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1028
unfolding lfp_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1029
by (perm_simp) (rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1030
2735
+ − 1031
lemma finite_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1032
shows "p \<bullet> finite A = finite (p \<bullet> A)"
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1033
unfolding finite_def
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1034
by (perm_simp) (rule refl)
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1035
2735
+ − 1036
+ − 1037
subsubsection {* Equivariance for product operations *}
+ − 1038
+ − 1039
lemma fst_eqvt [eqvt]:
2776
+ − 1040
shows "p \<bullet> (fst x) = fst (p \<bullet> x)"
+ − 1041
by (cases x) simp
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1042
2735
+ − 1043
lemma snd_eqvt [eqvt]:
2776
+ − 1044
shows "p \<bullet> (snd x) = snd (p \<bullet> x)"
+ − 1045
by (cases x) simp
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1046
2735
+ − 1047
lemma split_eqvt [eqvt]:
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1048
shows "p \<bullet> (split P x) = split (p \<bullet> P) (p \<bullet> x)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1049
unfolding split_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1050
by (perm_simp) (rule refl)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1051
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1052
2735
+ − 1053
subsubsection {* Equivariance for list operations *}
+ − 1054
+ − 1055
lemma append_eqvt [eqvt]:
+ − 1056
shows "p \<bullet> (xs @ ys) = (p \<bullet> xs) @ (p \<bullet> ys)"
+ − 1057
by (induct xs) auto
+ − 1058
+ − 1059
lemma rev_eqvt [eqvt]:
+ − 1060
shows "p \<bullet> (rev xs) = rev (p \<bullet> xs)"
+ − 1061
by (induct xs) (simp_all add: append_eqvt)
+ − 1062
+ − 1063
lemma map_eqvt [eqvt]:
+ − 1064
shows "p \<bullet> (map f xs) = map (p \<bullet> f) (p \<bullet> xs)"
+ − 1065
by (induct xs) (simp_all, simp only: permute_fun_app_eq)
+ − 1066
+ − 1067
lemma removeAll_eqvt [eqvt]:
+ − 1068
shows "p \<bullet> (removeAll x xs) = removeAll (p \<bullet> x) (p \<bullet> xs)"
+ − 1069
by (induct xs) (auto)
+ − 1070
+ − 1071
lemma filter_eqvt [eqvt]:
+ − 1072
shows "p \<bullet> (filter f xs) = filter (p \<bullet> f) (p \<bullet> xs)"
+ − 1073
apply(induct xs)
+ − 1074
apply(simp)
+ − 1075
apply(simp only: filter.simps permute_list.simps if_eqvt)
+ − 1076
apply(simp only: permute_fun_app_eq)
+ − 1077
done
+ − 1078
+ − 1079
lemma distinct_eqvt [eqvt]:
+ − 1080
shows "p \<bullet> (distinct xs) = distinct (p \<bullet> xs)"
+ − 1081
apply(induct xs)
+ − 1082
apply(simp add: permute_bool_def)
+ − 1083
apply(simp add: conj_eqvt Not_eqvt mem_eqvt set_eqvt)
+ − 1084
done
+ − 1085
+ − 1086
lemma length_eqvt [eqvt]:
+ − 1087
shows "p \<bullet> (length xs) = length (p \<bullet> xs)"
+ − 1088
by (induct xs) (simp_all add: permute_pure)
+ − 1089
+ − 1090
+ − 1091
subsubsection {* Equivariance for @{typ "'a fset"} *}
+ − 1092
+ − 1093
lemma in_fset_eqvt [eqvt]:
+ − 1094
shows "(p \<bullet> (x |\<in>| S)) = ((p \<bullet> x) |\<in>| (p \<bullet> S))"
+ − 1095
unfolding in_fset
+ − 1096
by (perm_simp) (simp)
+ − 1097
+ − 1098
lemma union_fset_eqvt [eqvt]:
+ − 1099
shows "(p \<bullet> (S |\<union>| T)) = ((p \<bullet> S) |\<union>| (p \<bullet> T))"
2776
+ − 1100
by (induct S) (simp_all)
2735
+ − 1101
+ − 1102
lemma map_fset_eqvt [eqvt]:
+ − 1103
shows "p \<bullet> (map_fset f S) = map_fset (p \<bullet> f) (p \<bullet> S)"
+ − 1104
by (lifting map_eqvt)
+ − 1105
+ − 1106
+ − 1107
section {* Supp, Freshness and Supports *}
1062
+ − 1108
+ − 1109
context pt
+ − 1110
begin
+ − 1111
+ − 1112
definition
+ − 1113
supp :: "'a \<Rightarrow> atom set"
+ − 1114
where
+ − 1115
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}"
+ − 1116
+ − 1117
definition
2732
+ − 1118
fresh :: "atom \<Rightarrow> 'a \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55)
1062
+ − 1119
where
+ − 1120
"a \<sharp> x \<equiv> a \<notin> supp x"
+ − 1121
2732
+ − 1122
end
+ − 1123
1062
+ − 1124
lemma supp_conv_fresh:
+ − 1125
shows "supp x = {a. \<not> a \<sharp> x}"
+ − 1126
unfolding fresh_def by simp
+ − 1127
+ − 1128
lemma swap_rel_trans:
+ − 1129
assumes "sort_of a = sort_of b"
+ − 1130
assumes "sort_of b = sort_of c"
+ − 1131
assumes "(a \<rightleftharpoons> c) \<bullet> x = x"
+ − 1132
assumes "(b \<rightleftharpoons> c) \<bullet> x = x"
+ − 1133
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 1134
proof (cases)
+ − 1135
assume "a = b \<or> c = b"
+ − 1136
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto
+ − 1137
next
+ − 1138
assume *: "\<not> (a = b \<or> c = b)"
+ − 1139
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x"
+ − 1140
using assms by simp
+ − 1141
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
+ − 1142
using assms * by (simp add: swap_triple)
+ − 1143
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" .
+ − 1144
qed
+ − 1145
+ − 1146
lemma swap_fresh_fresh:
+ − 1147
assumes a: "a \<sharp> x"
+ − 1148
and b: "b \<sharp> x"
+ − 1149
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 1150
proof (cases)
+ − 1151
assume asm: "sort_of a = sort_of b"
+ − 1152
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}"
+ − 1153
using a b unfolding fresh_def supp_def by simp_all
+ − 1154
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp
+ − 1155
then obtain c
+ − 1156
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b"
+ − 1157
by (rule obtain_atom) (auto)
+ − 1158
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all)
+ − 1159
next
+ − 1160
assume "sort_of a \<noteq> sort_of b"
+ − 1161
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp
+ − 1162
qed
+ − 1163
+ − 1164
+ − 1165
subsection {* supp and fresh are equivariant *}
+ − 1166
2760
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1167
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1168
lemma supp_eqvt [eqvt]:
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1169
shows "p \<bullet> (supp x) = supp (p \<bullet> x)"
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1170
unfolding supp_def
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1171
by (perm_simp)
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1172
(simp only: permute_eqvt[symmetric])
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1173
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1174
lemma fresh_eqvt [eqvt]:
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1175
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)"
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1176
unfolding fresh_def
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1177
by (perm_simp) (rule refl)
1062
+ − 1178
+ − 1179
lemma fresh_permute_iff:
+ − 1180
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x"
2760
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1181
by (simp only: fresh_eqvt[symmetric] permute_bool_def)
1062
+ − 1182
2683
+ − 1183
lemma fresh_permute_left:
+ − 1184
shows "a \<sharp> p \<bullet> x \<longleftrightarrow> - p \<bullet> a \<sharp> x"
+ − 1185
proof
+ − 1186
assume "a \<sharp> p \<bullet> x"
+ − 1187
then have "- p \<bullet> a \<sharp> - p \<bullet> p \<bullet> x" by (simp only: fresh_permute_iff)
+ − 1188
then show "- p \<bullet> a \<sharp> x" by simp
+ − 1189
next
+ − 1190
assume "- p \<bullet> a \<sharp> x"
+ − 1191
then have "p \<bullet> - p \<bullet> a \<sharp> p \<bullet> x" by (simp only: fresh_permute_iff)
+ − 1192
then show "a \<sharp> p \<bullet> x" by simp
+ − 1193
qed
+ − 1194
+ − 1195
2735
+ − 1196
section {* supports *}
1062
+ − 1197
+ − 1198
definition
+ − 1199
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80)
+ − 1200
where
+ − 1201
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)"
+ − 1202
+ − 1203
lemma supp_is_subset:
+ − 1204
fixes S :: "atom set"
+ − 1205
and x :: "'a::pt"
+ − 1206
assumes a1: "S supports x"
+ − 1207
and a2: "finite S"
+ − 1208
shows "(supp x) \<subseteq> S"
+ − 1209
proof (rule ccontr)
1879
+ − 1210
assume "\<not> (supp x \<subseteq> S)"
1062
+ − 1211
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto
1879
+ − 1212
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" unfolding supports_def by auto
+ − 1213
then have "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto
2732
+ − 1214
with a2 have "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" by (simp add: finite_subset)
1062
+ − 1215
then have "a \<notin> (supp x)" unfolding supp_def by simp
+ − 1216
with b1 show False by simp
+ − 1217
qed
+ − 1218
+ − 1219
lemma supports_finite:
+ − 1220
fixes S :: "atom set"
+ − 1221
and x :: "'a::pt"
+ − 1222
assumes a1: "S supports x"
+ − 1223
and a2: "finite S"
+ − 1224
shows "finite (supp x)"
+ − 1225
proof -
+ − 1226
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
+ − 1227
then show "finite (supp x)" using a2 by (simp add: finite_subset)
+ − 1228
qed
+ − 1229
+ − 1230
lemma supp_supports:
+ − 1231
fixes x :: "'a::pt"
+ − 1232
shows "(supp x) supports x"
1879
+ − 1233
unfolding supports_def
+ − 1234
proof (intro strip)
1062
+ − 1235
fix a b
+ − 1236
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)"
+ − 1237
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def)
1879
+ − 1238
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
1062
+ − 1239
qed
+ − 1240
+ − 1241
lemma supp_is_least_supports:
+ − 1242
fixes S :: "atom set"
+ − 1243
and x :: "'a::pt"
+ − 1244
assumes a1: "S supports x"
+ − 1245
and a2: "finite S"
+ − 1246
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'"
+ − 1247
shows "(supp x) = S"
+ − 1248
proof (rule equalityI)
+ − 1249
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
+ − 1250
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset)
+ − 1251
have "(supp x) supports x" by (rule supp_supports)
+ − 1252
with fin a3 show "S \<subseteq> supp x" by blast
+ − 1253
qed
+ − 1254
+ − 1255
lemma subsetCI:
+ − 1256
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B"
+ − 1257
by auto
+ − 1258
+ − 1259
lemma finite_supp_unique:
+ − 1260
assumes a1: "S supports x"
+ − 1261
assumes a2: "finite S"
+ − 1262
assumes a3: "\<And>a b. \<lbrakk>a \<in> S; b \<notin> S; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x \<noteq> x"
+ − 1263
shows "(supp x) = S"
+ − 1264
using a1 a2
+ − 1265
proof (rule supp_is_least_supports)
+ − 1266
fix S'
+ − 1267
assume "finite S'" and "S' supports x"
+ − 1268
show "S \<subseteq> S'"
+ − 1269
proof (rule subsetCI)
+ − 1270
fix a
+ − 1271
assume "a \<in> S" and "a \<notin> S'"
+ − 1272
have "finite (S \<union> S')"
+ − 1273
using `finite S` `finite S'` by simp
+ − 1274
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a"
+ − 1275
by (rule obtain_atom)
+ − 1276
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b"
+ − 1277
by simp_all
+ − 1278
then have "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 1279
using `a \<notin> S'` `S' supports x` by (simp add: supports_def)
+ − 1280
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"
+ − 1281
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b`
+ − 1282
by (rule a3)
+ − 1283
ultimately show "False" by simp
+ − 1284
qed
+ − 1285
qed
+ − 1286
2475
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1287
section {* Support w.r.t. relations *}
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1288
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1289
text {*
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1290
This definition is used for unquotient types, where
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1291
alpha-equivalence does not coincide with equality.
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1292
*}
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1293
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1294
definition
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1295
"supp_rel R x = {a. infinite {b. \<not>(R ((a \<rightleftharpoons> b) \<bullet> x) x)}}"
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1296
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1297
2735
+ − 1298
1062
+ − 1299
section {* Finitely-supported types *}
+ − 1300
+ − 1301
class fs = pt +
+ − 1302
assumes finite_supp: "finite (supp x)"
+ − 1303
+ − 1304
lemma pure_supp:
2735
+ − 1305
fixes x::"'a::pure"
+ − 1306
shows "supp x = {}"
1062
+ − 1307
unfolding supp_def by (simp add: permute_pure)
+ − 1308
+ − 1309
lemma pure_fresh:
+ − 1310
fixes x::"'a::pure"
+ − 1311
shows "a \<sharp> x"
+ − 1312
unfolding fresh_def by (simp add: pure_supp)
+ − 1313
+ − 1314
instance pure < fs
+ − 1315
by default (simp add: pure_supp)
+ − 1316
+ − 1317
+ − 1318
subsection {* Type @{typ atom} is finitely-supported. *}
+ − 1319
+ − 1320
lemma supp_atom:
+ − 1321
shows "supp a = {a}"
+ − 1322
apply (rule finite_supp_unique)
+ − 1323
apply (clarsimp simp add: supports_def)
+ − 1324
apply simp
+ − 1325
apply simp
+ − 1326
done
+ − 1327
+ − 1328
lemma fresh_atom:
+ − 1329
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"
+ − 1330
unfolding fresh_def supp_atom by simp
+ − 1331
+ − 1332
instance atom :: fs
+ − 1333
by default (simp add: supp_atom)
+ − 1334
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1335
1062
+ − 1336
section {* Type @{typ perm} is finitely-supported. *}
+ − 1337
+ − 1338
lemma perm_swap_eq:
+ − 1339
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)"
+ − 1340
unfolding permute_perm_def
+ − 1341
by (metis add_diff_cancel minus_perm_def)
+ − 1342
+ − 1343
lemma supports_perm:
+ − 1344
shows "{a. p \<bullet> a \<noteq> a} supports p"
+ − 1345
unfolding supports_def
1879
+ − 1346
unfolding perm_swap_eq
+ − 1347
by (simp add: swap_eqvt)
1062
+ − 1348
+ − 1349
lemma finite_perm_lemma:
+ − 1350
shows "finite {a::atom. p \<bullet> a \<noteq> a}"
+ − 1351
using finite_Rep_perm [of p]
+ − 1352
unfolding permute_atom_def .
+ − 1353
+ − 1354
lemma supp_perm:
+ − 1355
shows "supp p = {a. p \<bullet> a \<noteq> a}"
+ − 1356
apply (rule finite_supp_unique)
+ − 1357
apply (rule supports_perm)
+ − 1358
apply (rule finite_perm_lemma)
+ − 1359
apply (simp add: perm_swap_eq swap_eqvt)
2732
+ − 1360
apply (auto simp add: perm_eq_iff swap_atom)
1062
+ − 1361
done
+ − 1362
+ − 1363
lemma fresh_perm:
+ − 1364
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a"
1879
+ − 1365
unfolding fresh_def
+ − 1366
by (simp add: supp_perm)
1062
+ − 1367
+ − 1368
lemma supp_swap:
+ − 1369
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})"
+ − 1370
by (auto simp add: supp_perm swap_atom)
+ − 1371
+ − 1372
lemma fresh_zero_perm:
+ − 1373
shows "a \<sharp> (0::perm)"
+ − 1374
unfolding fresh_perm by simp
+ − 1375
+ − 1376
lemma supp_zero_perm:
+ − 1377
shows "supp (0::perm) = {}"
+ − 1378
unfolding supp_perm by simp
+ − 1379
1087
+ − 1380
lemma fresh_plus_perm:
+ − 1381
fixes p q::perm
+ − 1382
assumes "a \<sharp> p" "a \<sharp> q"
+ − 1383
shows "a \<sharp> (p + q)"
+ − 1384
using assms
+ − 1385
unfolding fresh_def
+ − 1386
by (auto simp add: supp_perm)
+ − 1387
1062
+ − 1388
lemma supp_plus_perm:
+ − 1389
fixes p q::perm
+ − 1390
shows "supp (p + q) \<subseteq> supp p \<union> supp q"
+ − 1391
by (auto simp add: supp_perm)
+ − 1392
1087
+ − 1393
lemma fresh_minus_perm:
+ − 1394
fixes p::perm
+ − 1395
shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p"
+ − 1396
unfolding fresh_def
1879
+ − 1397
unfolding supp_perm
+ − 1398
apply(simp)
+ − 1399
apply(metis permute_minus_cancel)
1087
+ − 1400
done
+ − 1401
1062
+ − 1402
lemma supp_minus_perm:
+ − 1403
fixes p::perm
+ − 1404
shows "supp (- p) = supp p"
1087
+ − 1405
unfolding supp_conv_fresh
+ − 1406
by (simp add: fresh_minus_perm)
1062
+ − 1407
1305
+ − 1408
lemma plus_perm_eq:
+ − 1409
fixes p q::"perm"
1879
+ − 1410
assumes asm: "supp p \<inter> supp q = {}"
2776
+ − 1411
shows "p + q = q + p"
2732
+ − 1412
unfolding perm_eq_iff
1305
+ − 1413
proof
+ − 1414
fix a::"atom"
+ − 1415
show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1416
proof -
+ − 1417
{ assume "a \<notin> supp p" "a \<notin> supp q"
+ − 1418
then have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1419
by (simp add: supp_perm)
+ − 1420
}
+ − 1421
moreover
+ − 1422
{ assume a: "a \<in> supp p" "a \<notin> supp q"
+ − 1423
then have "p \<bullet> a \<in> supp p" by (simp add: supp_perm)
+ − 1424
then have "p \<bullet> a \<notin> supp q" using asm by auto
+ − 1425
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1426
by (simp add: supp_perm)
+ − 1427
}
+ − 1428
moreover
+ − 1429
{ assume a: "a \<notin> supp p" "a \<in> supp q"
+ − 1430
then have "q \<bullet> a \<in> supp q" by (simp add: supp_perm)
+ − 1431
then have "q \<bullet> a \<notin> supp p" using asm by auto
+ − 1432
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1433
by (simp add: supp_perm)
+ − 1434
}
+ − 1435
ultimately show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1436
using asm by blast
+ − 1437
qed
+ − 1438
qed
1062
+ − 1439
2614
+ − 1440
lemma supp_plus_perm_eq:
+ − 1441
fixes p q::perm
+ − 1442
assumes asm: "supp p \<inter> supp q = {}"
+ − 1443
shows "supp (p + q) = supp p \<union> supp q"
+ − 1444
proof -
+ − 1445
{ fix a::"atom"
+ − 1446
assume "a \<in> supp p"
+ − 1447
then have "a \<notin> supp q" using asm by auto
+ − 1448
then have "a \<in> supp (p + q)" using `a \<in> supp p`
+ − 1449
by (simp add: supp_perm)
+ − 1450
}
+ − 1451
moreover
+ − 1452
{ fix a::"atom"
+ − 1453
assume "a \<in> supp q"
+ − 1454
then have "a \<notin> supp p" using asm by auto
+ − 1455
then have "a \<in> supp (q + p)" using `a \<in> supp q`
+ − 1456
by (simp add: supp_perm)
+ − 1457
then have "a \<in> supp (p + q)" using asm plus_perm_eq
+ − 1458
by metis
+ − 1459
}
+ − 1460
ultimately have "supp p \<union> supp q \<subseteq> supp (p + q)"
+ − 1461
by blast
+ − 1462
then show "supp (p + q) = supp p \<union> supp q" using supp_plus_perm
+ − 1463
by blast
+ − 1464
qed
+ − 1465
2735
+ − 1466
instance perm :: fs
+ − 1467
by default (simp add: supp_perm finite_perm_lemma)
+ − 1468
+ − 1469
2614
+ − 1470
1062
+ − 1471
section {* Finite Support instances for other types *}
+ − 1472
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1473
1062
+ − 1474
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *}
+ − 1475
+ − 1476
lemma supp_Pair:
+ − 1477
shows "supp (x, y) = supp x \<union> supp y"
+ − 1478
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1479
+ − 1480
lemma fresh_Pair:
+ − 1481
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y"
+ − 1482
by (simp add: fresh_def supp_Pair)
+ − 1483
2470
+ − 1484
lemma supp_Unit:
+ − 1485
shows "supp () = {}"
+ − 1486
by (simp add: supp_def)
+ − 1487
+ − 1488
lemma fresh_Unit:
+ − 1489
shows "a \<sharp> ()"
+ − 1490
by (simp add: fresh_def supp_Unit)
+ − 1491
2378
+ − 1492
instance prod :: (fs, fs) fs
1062
+ − 1493
apply default
2776
+ − 1494
apply (case_tac x)
1062
+ − 1495
apply (simp add: supp_Pair finite_supp)
+ − 1496
done
+ − 1497
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1498
1062
+ − 1499
subsection {* Type @{typ "'a + 'b"} is finitely supported *}
+ − 1500
+ − 1501
lemma supp_Inl:
+ − 1502
shows "supp (Inl x) = supp x"
+ − 1503
by (simp add: supp_def)
+ − 1504
+ − 1505
lemma supp_Inr:
+ − 1506
shows "supp (Inr x) = supp x"
+ − 1507
by (simp add: supp_def)
+ − 1508
+ − 1509
lemma fresh_Inl:
+ − 1510
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x"
+ − 1511
by (simp add: fresh_def supp_Inl)
+ − 1512
+ − 1513
lemma fresh_Inr:
+ − 1514
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
+ − 1515
by (simp add: fresh_def supp_Inr)
+ − 1516
2378
+ − 1517
instance sum :: (fs, fs) fs
1062
+ − 1518
apply default
2776
+ − 1519
apply (case_tac x)
1062
+ − 1520
apply (simp_all add: supp_Inl supp_Inr finite_supp)
+ − 1521
done
+ − 1522
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1523
1062
+ − 1524
subsection {* Type @{typ "'a option"} is finitely supported *}
+ − 1525
+ − 1526
lemma supp_None:
+ − 1527
shows "supp None = {}"
+ − 1528
by (simp add: supp_def)
+ − 1529
+ − 1530
lemma supp_Some:
+ − 1531
shows "supp (Some x) = supp x"
+ − 1532
by (simp add: supp_def)
+ − 1533
+ − 1534
lemma fresh_None:
+ − 1535
shows "a \<sharp> None"
+ − 1536
by (simp add: fresh_def supp_None)
+ − 1537
+ − 1538
lemma fresh_Some:
+ − 1539
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
+ − 1540
by (simp add: fresh_def supp_Some)
+ − 1541
+ − 1542
instance option :: (fs) fs
+ − 1543
apply default
+ − 1544
apply (induct_tac x)
+ − 1545
apply (simp_all add: supp_None supp_Some finite_supp)
+ − 1546
done
+ − 1547
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1548
1062
+ − 1549
subsubsection {* Type @{typ "'a list"} is finitely supported *}
+ − 1550
+ − 1551
lemma supp_Nil:
+ − 1552
shows "supp [] = {}"
+ − 1553
by (simp add: supp_def)
+ − 1554
2776
+ − 1555
lemma fresh_Nil:
+ − 1556
shows "a \<sharp> []"
+ − 1557
by (simp add: fresh_def supp_Nil)
+ − 1558
1062
+ − 1559
lemma supp_Cons:
+ − 1560
shows "supp (x # xs) = supp x \<union> supp xs"
+ − 1561
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1562
2776
+ − 1563
lemma fresh_Cons:
+ − 1564
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs"
+ − 1565
by (simp add: fresh_def supp_Cons)
+ − 1566
2591
+ − 1567
lemma supp_append:
+ − 1568
shows "supp (xs @ ys) = supp xs \<union> supp ys"
+ − 1569
by (induct xs) (auto simp add: supp_Nil supp_Cons)
+ − 1570
+ − 1571
lemma fresh_append:
+ − 1572
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys"
+ − 1573
by (induct xs) (simp_all add: fresh_Nil fresh_Cons)
+ − 1574
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1575
lemma supp_rev:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1576
shows "supp (rev xs) = supp xs"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1577
by (induct xs) (auto simp add: supp_append supp_Cons supp_Nil)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1578
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1579
lemma fresh_rev:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1580
shows "a \<sharp> rev xs \<longleftrightarrow> a \<sharp> xs"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1581
by (induct xs) (auto simp add: fresh_append fresh_Cons fresh_Nil)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1582
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1583
lemma supp_removeAll:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1584
fixes x::"atom"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1585
shows "supp (removeAll x xs) = supp xs - {x}"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1586
by (induct xs)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1587
(auto simp add: supp_Nil supp_Cons supp_atom)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1588
2735
+ − 1589
lemma supp_of_atom_list:
+ − 1590
fixes as::"atom list"
+ − 1591
shows "supp as = set as"
+ − 1592
by (induct as)
+ − 1593
(simp_all add: supp_Nil supp_Cons supp_atom)
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1594
1062
+ − 1595
instance list :: (fs) fs
+ − 1596
apply default
+ − 1597
apply (induct_tac x)
+ − 1598
apply (simp_all add: supp_Nil supp_Cons finite_supp)
+ − 1599
done
+ − 1600
2466
+ − 1601
2470
+ − 1602
section {* Support and Freshness for Applications *}
1062
+ − 1603
1879
+ − 1604
lemma fresh_conv_MOST:
+ − 1605
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)"
+ − 1606
unfolding fresh_def supp_def
+ − 1607
unfolding MOST_iff_cofinite by simp
+ − 1608
+ − 1609
lemma fresh_fun_app:
+ − 1610
assumes "a \<sharp> f" and "a \<sharp> x"
+ − 1611
shows "a \<sharp> f x"
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1612
using assms
1879
+ − 1613
unfolding fresh_conv_MOST
2732
+ − 1614
unfolding permute_fun_app_eq
2776
+ − 1615
by (elim MOST_rev_mp) (simp)
1879
+ − 1616
1062
+ − 1617
lemma supp_fun_app:
+ − 1618
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)"
1879
+ − 1619
using fresh_fun_app
+ − 1620
unfolding fresh_def
+ − 1621
by auto
+ − 1622
2732
+ − 1623
2735
+ − 1624
subsection {* Equivariance Predicate @{text eqvt} and @{text eqvt_at}*}
2663
+ − 1625
+ − 1626
definition
+ − 1627
"eqvt f \<equiv> \<forall>p. p \<bullet> f = f"
+ − 1628
2868
+ − 1629
lemma eqvt_boolI:
+ − 1630
fixes f::"bool"
+ − 1631
shows "eqvt f"
+ − 1632
unfolding eqvt_def by (simp add: permute_bool_def)
+ − 1633
+ − 1634
2735
+ − 1635
text {* equivariance of a function at a given argument *}
+ − 1636
+ − 1637
definition
+ − 1638
"eqvt_at f x \<equiv> \<forall>p. p \<bullet> (f x) = f (p \<bullet> x)"
+ − 1639
2663
+ − 1640
lemma eqvtI:
+ − 1641
shows "(\<And>p. p \<bullet> f \<equiv> f) \<Longrightarrow> eqvt f"
+ − 1642
unfolding eqvt_def
+ − 1643
by simp
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1644
1941
+ − 1645
lemma supp_fun_eqvt:
2663
+ − 1646
assumes a: "eqvt f"
1941
+ − 1647
shows "supp f = {}"
2663
+ − 1648
using a
+ − 1649
unfolding eqvt_def
1941
+ − 1650
unfolding supp_def
2663
+ − 1651
by simp
1941
+ − 1652
1062
+ − 1653
lemma fresh_fun_eqvt_app:
2663
+ − 1654
assumes a: "eqvt f"
1062
+ − 1655
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
+ − 1656
proof -
1941
+ − 1657
from a have "supp f = {}" by (simp add: supp_fun_eqvt)
1879
+ − 1658
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
1062
+ − 1659
unfolding fresh_def
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1660
using supp_fun_app by auto
1062
+ − 1661
qed
+ − 1662
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1663
lemma supp_fun_app_eqvt:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1664
assumes a: "eqvt f"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1665
shows "supp (f x) \<subseteq> supp x"
2735
+ − 1666
using fresh_fun_eqvt_app[OF a]
+ − 1667
unfolding fresh_def
+ − 1668
by auto
2663
+ − 1669
+ − 1670
lemma supp_eqvt_at:
+ − 1671
assumes asm: "eqvt_at f x"
+ − 1672
and fin: "finite (supp x)"
+ − 1673
shows "supp (f x) \<subseteq> supp x"
+ − 1674
apply(rule supp_is_subset)
+ − 1675
unfolding supports_def
+ − 1676
unfolding fresh_def[symmetric]
+ − 1677
using asm
+ − 1678
apply(simp add: eqvt_at_def)
+ − 1679
apply(simp add: swap_fresh_fresh)
+ − 1680
apply(rule fin)
+ − 1681
done
+ − 1682
+ − 1683
lemma finite_supp_eqvt_at:
+ − 1684
assumes asm: "eqvt_at f x"
+ − 1685
and fin: "finite (supp x)"
+ − 1686
shows "finite (supp (f x))"
+ − 1687
apply(rule finite_subset)
+ − 1688
apply(rule supp_eqvt_at[OF asm fin])
+ − 1689
apply(rule fin)
+ − 1690
done
+ − 1691
+ − 1692
lemma fresh_eqvt_at:
+ − 1693
assumes asm: "eqvt_at f x"
+ − 1694
and fin: "finite (supp x)"
+ − 1695
and fresh: "a \<sharp> x"
+ − 1696
shows "a \<sharp> f x"
+ − 1697
using fresh
+ − 1698
unfolding fresh_def
+ − 1699
using supp_eqvt_at[OF asm fin]
+ − 1700
by auto
+ − 1701
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1702
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1703
subsection {* helper functions for nominal_functions *}
2663
+ − 1704
2818
+ − 1705
lemma THE_defaultI2:
2849
+ − 1706
assumes "\<exists>!x. P x" "\<And>x. P x \<Longrightarrow> Q x"
2818
+ − 1707
shows "Q (THE_default d P)"
+ − 1708
by (iprover intro: assms THE_defaultI')
+ − 1709
2663
+ − 1710
lemma the_default_eqvt:
+ − 1711
assumes unique: "\<exists>!x. P x"
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1712
shows "(p \<bullet> (THE_default d P)) = (THE_default (p \<bullet> d) (p \<bullet> P))"
2663
+ − 1713
apply(rule THE_default1_equality [symmetric])
+ − 1714
apply(rule_tac p="-p" in permute_boolE)
+ − 1715
apply(simp add: ex1_eqvt)
+ − 1716
apply(rule unique)
+ − 1717
apply(rule_tac p="-p" in permute_boolE)
+ − 1718
apply(rule subst[OF permute_fun_app_eq])
+ − 1719
apply(simp)
+ − 1720
apply(rule THE_defaultI'[OF unique])
+ − 1721
done
+ − 1722
+ − 1723
lemma fundef_ex1_eqvt:
+ − 1724
fixes x::"'a::pt"
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1725
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))"
2663
+ − 1726
assumes eqvt: "eqvt G"
+ − 1727
assumes ex1: "\<exists>!y. G x y"
+ − 1728
shows "(p \<bullet> (f x)) = f (p \<bullet> x)"
+ − 1729
apply(simp only: f_def)
+ − 1730
apply(subst the_default_eqvt)
+ − 1731
apply(rule ex1)
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1732
apply(rule THE_default1_equality [symmetric])
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1733
apply(rule_tac p="-p" in permute_boolE)
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1734
apply(perm_simp add: permute_minus_cancel)
2849
+ − 1735
using eqvt[simplified eqvt_def]
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1736
apply(simp)
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1737
apply(rule ex1)
2849
+ − 1738
apply(rule THE_defaultI2)
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1739
apply(rule_tac p="-p" in permute_boolE)
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1740
apply(perm_simp add: permute_minus_cancel)
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1741
apply(rule ex1)
2849
+ − 1742
apply(perm_simp)
+ − 1743
using eqvt[simplified eqvt_def]
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1744
apply(simp)
2663
+ − 1745
done
+ − 1746
+ − 1747
lemma fundef_ex1_eqvt_at:
+ − 1748
fixes x::"'a::pt"
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1749
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))"
2663
+ − 1750
assumes eqvt: "eqvt G"
+ − 1751
assumes ex1: "\<exists>!y. G x y"
+ − 1752
shows "eqvt_at f x"
+ − 1753
unfolding eqvt_at_def
+ − 1754
using assms
+ − 1755
by (auto intro: fundef_ex1_eqvt)
+ − 1756
2818
+ − 1757
lemma fundef_ex1_prop:
+ − 1758
fixes x::"'a::pt"
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1759
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))"
2820
+ − 1760
assumes P_all: "\<And>x y. G x y \<Longrightarrow> P x y"
2818
+ − 1761
assumes ex1: "\<exists>!y. G x y"
2820
+ − 1762
shows "P x (f x)"
2818
+ − 1763
unfolding f_def
+ − 1764
using ex1
+ − 1765
apply(erule_tac ex1E)
+ − 1766
apply(rule THE_defaultI2)
+ − 1767
apply(blast)
+ − 1768
apply(rule P_all)
+ − 1769
apply(assumption)
+ − 1770
done
+ − 1771
2735
+ − 1772
2466
+ − 1773
section {* Support of Finite Sets of Finitely Supported Elements *}
+ − 1774
2657
+ − 1775
text {* support and freshness for atom sets *}
+ − 1776
+ − 1777
lemma supp_finite_atom_set:
+ − 1778
fixes S::"atom set"
+ − 1779
assumes "finite S"
+ − 1780
shows "supp S = S"
+ − 1781
apply(rule finite_supp_unique)
+ − 1782
apply(simp add: supports_def)
+ − 1783
apply(simp add: swap_set_not_in)
+ − 1784
apply(rule assms)
+ − 1785
apply(simp add: swap_set_in)
+ − 1786
done
+ − 1787
2742
+ − 1788
lemma supp_cofinite_atom_set:
+ − 1789
fixes S::"atom set"
+ − 1790
assumes "finite (UNIV - S)"
+ − 1791
shows "supp S = (UNIV - S)"
+ − 1792
apply(rule finite_supp_unique)
+ − 1793
apply(simp add: supports_def)
+ − 1794
apply(simp add: swap_set_both_in)
+ − 1795
apply(rule assms)
+ − 1796
apply(subst swap_commute)
+ − 1797
apply(simp add: swap_set_in)
+ − 1798
done
+ − 1799
2657
+ − 1800
lemma fresh_finite_atom_set:
+ − 1801
fixes S::"atom set"
+ − 1802
assumes "finite S"
+ − 1803
shows "a \<sharp> S \<longleftrightarrow> a \<notin> S"
+ − 1804
unfolding fresh_def
+ − 1805
by (simp add: supp_finite_atom_set[OF assms])
+ − 1806
2679
+ − 1807
lemma fresh_minus_atom_set:
+ − 1808
fixes S::"atom set"
+ − 1809
assumes "finite S"
+ − 1810
shows "a \<sharp> S - T \<longleftrightarrow> (a \<notin> T \<longrightarrow> a \<sharp> S)"
+ − 1811
unfolding fresh_def
+ − 1812
by (auto simp add: supp_finite_atom_set assms)
+ − 1813
2466
+ − 1814
lemma Union_supports_set:
+ − 1815
shows "(\<Union>x \<in> S. supp x) supports S"
+ − 1816
proof -
+ − 1817
{ fix a b
+ − 1818
have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S"
+ − 1819
unfolding permute_set_eq by force
+ − 1820
}
+ − 1821
then show "(\<Union>x \<in> S. supp x) supports S"
+ − 1822
unfolding supports_def
+ − 1823
by (simp add: fresh_def[symmetric] swap_fresh_fresh)
+ − 1824
qed
+ − 1825
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1826
lemma Union_of_finite_supp_sets:
2466
+ − 1827
fixes S::"('a::fs set)"
+ − 1828
assumes fin: "finite S"
+ − 1829
shows "finite (\<Union>x\<in>S. supp x)"
+ − 1830
using fin by (induct) (auto simp add: finite_supp)
+ − 1831
+ − 1832
lemma Union_included_in_supp:
+ − 1833
fixes S::"('a::fs set)"
+ − 1834
assumes fin: "finite S"
+ − 1835
shows "(\<Union>x\<in>S. supp x) \<subseteq> supp S"
+ − 1836
proof -
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1837
have eqvt: "eqvt (\<lambda>S. \<Union> supp ` S)"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1838
unfolding eqvt_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1839
by (perm_simp) (simp)
2466
+ − 1840
have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)"
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1841
by (rule supp_finite_atom_set[symmetric]) (rule Union_of_finite_supp_sets[OF fin])
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1842
also have "\<dots> = supp ((\<lambda>S. \<Union> supp ` S) S)" by simp
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1843
also have "\<dots> \<subseteq> supp S" using eqvt
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1844
by (rule supp_fun_app_eqvt)
2466
+ − 1845
finally show "(\<Union>x\<in>S. supp x) \<subseteq> supp S" .
+ − 1846
qed
+ − 1847
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1848
lemma supp_of_finite_sets:
2466
+ − 1849
fixes S::"('a::fs set)"
+ − 1850
assumes fin: "finite S"
+ − 1851
shows "(supp S) = (\<Union>x\<in>S. supp x)"
+ − 1852
apply(rule subset_antisym)
+ − 1853
apply(rule supp_is_subset)
+ − 1854
apply(rule Union_supports_set)
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1855
apply(rule Union_of_finite_supp_sets[OF fin])
2466
+ − 1856
apply(rule Union_included_in_supp[OF fin])
+ − 1857
done
+ − 1858
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1859
lemma finite_sets_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1860
fixes S::"('a::fs set)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1861
assumes "finite S"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1862
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1863
using assms
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1864
by (simp only: supp_of_finite_sets Union_of_finite_supp_sets)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1865
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1866
lemma supp_of_finite_union:
2466
+ − 1867
fixes S T::"('a::fs) set"
+ − 1868
assumes fin1: "finite S"
+ − 1869
and fin2: "finite T"
+ − 1870
shows "supp (S \<union> T) = supp S \<union> supp T"
+ − 1871
using fin1 fin2
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1872
by (simp add: supp_of_finite_sets)
2466
+ − 1873
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1874
lemma supp_of_finite_insert:
2466
+ − 1875
fixes S::"('a::fs) set"
+ − 1876
assumes fin: "finite S"
+ − 1877
shows "supp (insert x S) = supp x \<union> supp S"
+ − 1878
using fin
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1879
by (simp add: supp_of_finite_sets)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1880
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1881
lemma fresh_finite_insert:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1882
fixes S::"('a::fs) set"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1883
assumes fin: "finite S"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1884
shows "a \<sharp> (insert x S) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1885
using fin unfolding fresh_def
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1886
by (simp add: supp_of_finite_insert)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1887
2591
+ − 1888
lemma supp_set_empty:
+ − 1889
shows "supp {} = {}"
+ − 1890
unfolding supp_def
+ − 1891
by (simp add: empty_eqvt)
+ − 1892
+ − 1893
lemma fresh_set_empty:
+ − 1894
shows "a \<sharp> {}"
+ − 1895
by (simp add: fresh_def supp_set_empty)
+ − 1896
+ − 1897
lemma supp_set:
+ − 1898
fixes xs :: "('a::fs) list"
+ − 1899
shows "supp (set xs) = supp xs"
+ − 1900
apply(induct xs)
+ − 1901
apply(simp add: supp_set_empty supp_Nil)
+ − 1902
apply(simp add: supp_Cons supp_of_finite_insert)
+ − 1903
done
+ − 1904
+ − 1905
lemma fresh_set:
+ − 1906
fixes xs :: "('a::fs) list"
+ − 1907
shows "a \<sharp> (set xs) \<longleftrightarrow> a \<sharp> xs"
+ − 1908
unfolding fresh_def
+ − 1909
by (simp add: supp_set)
+ − 1910
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1911
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1912
subsection {* Type @{typ "'a fset"} is finitely supported *}
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1913
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1914
lemma supp_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1915
shows "supp (fset S) = supp S"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1916
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1917
by (simp add: fset_eqvt fset_cong)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1918
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1919
lemma supp_empty_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1920
shows "supp {||} = {}"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1921
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1922
by simp
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1923
2641
+ − 1924
lemma fresh_empty_fset:
+ − 1925
shows "a \<sharp> {||}"
+ − 1926
unfolding fresh_def
+ − 1927
by (simp)
+ − 1928
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1929
lemma supp_insert_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1930
fixes x::"'a::fs"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1931
and S::"'a fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1932
shows "supp (insert_fset x S) = supp x \<union> supp S"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1933
apply(subst supp_fset[symmetric])
2587
+ − 1934
apply(simp add: supp_of_finite_insert)
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1935
done
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1936
2641
+ − 1937
lemma fresh_insert_fset:
+ − 1938
fixes x::"'a::fs"
+ − 1939
and S::"'a fset"
+ − 1940
shows "a \<sharp> insert_fset x S \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S"
+ − 1941
unfolding fresh_def
+ − 1942
by (simp)
+ − 1943
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1944
lemma fset_finite_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1945
fixes S::"('a::fs) fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1946
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1947
by (induct S) (simp_all add: finite_supp)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1948
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1949
lemma supp_union_fset:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1950
fixes S T::"'a::fs fset"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1951
shows "supp (S |\<union>| T) = supp S \<union> supp T"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1952
by (induct S) (auto)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1953
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1954
lemma fresh_union_fset:
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1955
fixes S T::"'a::fs fset"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1956
shows "a \<sharp> S |\<union>| T \<longleftrightarrow> a \<sharp> S \<and> a \<sharp> T"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1957
unfolding fresh_def
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1958
by (simp add: supp_union_fset)
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1959
2735
+ − 1960
instance fset :: (fs) fs
+ − 1961
apply (default)
+ − 1962
apply (rule fset_finite_supp)
+ − 1963
done
+ − 1964
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1965
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1966
section {* Freshness and Fresh-Star *}
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1967
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1968
lemma fresh_Unit_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1969
shows "(a \<sharp> () \<Longrightarrow> PROP C) \<equiv> PROP C"
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1970
by (simp add: fresh_Unit)
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1971
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1972
lemma fresh_Pair_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1973
shows "(a \<sharp> (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> a \<sharp> y \<Longrightarrow> PROP C)"
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1974
by rule (simp_all add: fresh_Pair)
2470
+ − 1975
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1976
(* this rule needs to be added before the fresh_prodD is *)
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1977
(* added to the simplifier with mksimps *)
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1978
lemma [simp]:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1979
shows "a \<sharp> x1 \<Longrightarrow> a \<sharp> x2 \<Longrightarrow> a \<sharp> (x1, x2)"
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1980
by (simp add: fresh_Pair)
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1981
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1982
lemma fresh_PairD:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1983
shows "a \<sharp> (x, y) \<Longrightarrow> a \<sharp> x"
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1984
and "a \<sharp> (x, y) \<Longrightarrow> a \<sharp> y"
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1985
by (simp_all add: fresh_Pair)
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1986
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1987
ML {*
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1988
val mksimps_pairs = (@{const_name Nominal2_Base.fresh}, @{thms fresh_PairD}) :: mksimps_pairs;
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1989
*}
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1990
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1991
declaration {* fn _ =>
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1992
Simplifier.map_ss (fn ss => ss setmksimps (mksimps mksimps_pairs))
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1993
*}
2470
+ − 1994
+ − 1995
text {* The fresh-star generalisation of fresh is used in strong
+ − 1996
induction principles. *}
+ − 1997
+ − 1998
definition
+ − 1999
fresh_star :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp>* _" [80,80] 80)
+ − 2000
where
+ − 2001
"as \<sharp>* x \<equiv> \<forall>a \<in> as. a \<sharp> x"
+ − 2002
2507
+ − 2003
lemma fresh_star_supp_conv:
+ − 2004
shows "supp x \<sharp>* y \<Longrightarrow> supp y \<sharp>* x"
+ − 2005
by (auto simp add: fresh_star_def fresh_def)
+ − 2006
2675
+ − 2007
lemma fresh_star_perm_set_conv:
+ − 2008
fixes p::"perm"
+ − 2009
assumes fresh: "as \<sharp>* p"
+ − 2010
and fin: "finite as"
+ − 2011
shows "supp p \<sharp>* as"
+ − 2012
apply(rule fresh_star_supp_conv)
+ − 2013
apply(simp add: supp_finite_atom_set fin fresh)
+ − 2014
done
+ − 2015
2679
+ − 2016
lemma fresh_star_atom_set_conv:
+ − 2017
assumes fresh: "as \<sharp>* bs"
+ − 2018
and fin: "finite as" "finite bs"
+ − 2019
shows "bs \<sharp>* as"
+ − 2020
using fresh
+ − 2021
unfolding fresh_star_def fresh_def
+ − 2022
by (auto simp add: supp_finite_atom_set fin)
+ − 2023
2730
+ − 2024
lemma atom_fresh_star_disjoint:
+ − 2025
assumes fin: "finite bs"
+ − 2026
shows "as \<sharp>* bs \<longleftrightarrow> (as \<inter> bs = {})"
+ − 2027
+ − 2028
unfolding fresh_star_def fresh_def
+ − 2029
by (auto simp add: supp_finite_atom_set fin)
+ − 2030
2675
+ − 2031
2591
+ − 2032
lemma fresh_star_Pair:
2470
+ − 2033
shows "as \<sharp>* (x, y) = (as \<sharp>* x \<and> as \<sharp>* y)"
+ − 2034
by (auto simp add: fresh_star_def fresh_Pair)
+ − 2035
2591
+ − 2036
lemma fresh_star_list:
+ − 2037
shows "as \<sharp>* (xs @ ys) \<longleftrightarrow> as \<sharp>* xs \<and> as \<sharp>* ys"
+ − 2038
and "as \<sharp>* (x # xs) \<longleftrightarrow> as \<sharp>* x \<and> as \<sharp>* xs"
+ − 2039
and "as \<sharp>* []"
+ − 2040
by (auto simp add: fresh_star_def fresh_Nil fresh_Cons fresh_append)
+ − 2041
+ − 2042
lemma fresh_star_set:
+ − 2043
fixes xs::"('a::fs) list"
+ − 2044
shows "as \<sharp>* set xs \<longleftrightarrow> as \<sharp>* xs"
+ − 2045
unfolding fresh_star_def
+ − 2046
by (simp add: fresh_set)
+ − 2047
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2048
lemma fresh_star_singleton:
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2049
fixes a::"atom"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2050
shows "as \<sharp>* {a} \<longleftrightarrow> as \<sharp>* a"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2051
by (simp add: fresh_star_def fresh_finite_insert fresh_set_empty)
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2052
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2053
lemma fresh_star_fset:
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2054
fixes xs::"('a::fs) list"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2055
shows "as \<sharp>* fset S \<longleftrightarrow> as \<sharp>* S"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2056
by (simp add: fresh_star_def fresh_def)
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2057
2591
+ − 2058
lemma fresh_star_Un:
2470
+ − 2059
shows "(as \<union> bs) \<sharp>* x = (as \<sharp>* x \<and> bs \<sharp>* x)"
+ − 2060
by (auto simp add: fresh_star_def)
+ − 2061
+ − 2062
lemma fresh_star_insert:
+ − 2063
shows "(insert a as) \<sharp>* x = (a \<sharp> x \<and> as \<sharp>* x)"
+ − 2064
by (auto simp add: fresh_star_def)
+ − 2065
+ − 2066
lemma fresh_star_Un_elim:
+ − 2067
"((as \<union> bs) \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (as \<sharp>* x \<Longrightarrow> bs \<sharp>* x \<Longrightarrow> PROP C)"
+ − 2068
unfolding fresh_star_def
+ − 2069
apply(rule)
+ − 2070
apply(erule meta_mp)
+ − 2071
apply(auto)
+ − 2072
done
+ − 2073
+ − 2074
lemma fresh_star_insert_elim:
+ − 2075
"(insert a as \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> as \<sharp>* x \<Longrightarrow> PROP C)"
+ − 2076
unfolding fresh_star_def
+ − 2077
by rule (simp_all add: fresh_star_def)
+ − 2078
+ − 2079
lemma fresh_star_empty_elim:
+ − 2080
"({} \<sharp>* x \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 2081
by (simp add: fresh_star_def)
+ − 2082
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2083
lemma fresh_star_Unit_elim:
2470
+ − 2084
shows "(a \<sharp>* () \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 2085
by (simp add: fresh_star_def fresh_Unit)
+ − 2086
2591
+ − 2087
lemma fresh_star_Pair_elim:
2470
+ − 2088
shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)"
2591
+ − 2089
by (rule, simp_all add: fresh_star_Pair)
2470
+ − 2090
+ − 2091
lemma fresh_star_zero:
+ − 2092
shows "as \<sharp>* (0::perm)"
+ − 2093
unfolding fresh_star_def
+ − 2094
by (simp add: fresh_zero_perm)
+ − 2095
+ − 2096
lemma fresh_star_plus:
+ − 2097
fixes p q::perm
+ − 2098
shows "\<lbrakk>a \<sharp>* p; a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
+ − 2099
unfolding fresh_star_def
+ − 2100
by (simp add: fresh_plus_perm)
+ − 2101
+ − 2102
lemma fresh_star_permute_iff:
+ − 2103
shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
+ − 2104
unfolding fresh_star_def
+ − 2105
by (metis mem_permute_iff permute_minus_cancel(1) fresh_permute_iff)
+ − 2106
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2107
lemma fresh_star_eqvt [eqvt]:
2663
+ − 2108
shows "p \<bullet> (as \<sharp>* x) \<longleftrightarrow> (p \<bullet> as) \<sharp>* (p \<bullet> x)"
2470
+ − 2109
unfolding fresh_star_def
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2110
by (perm_simp) (rule refl)
2591
+ − 2111
2470
+ − 2112
2735
+ − 2113
2470
+ − 2114
section {* Induction principle for permutations *}
+ − 2115
2776
+ − 2116
lemma smaller_supp:
+ − 2117
assumes a: "a \<in> supp p"
+ − 2118
shows "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subset> supp p"
+ − 2119
proof -
+ − 2120
have "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subseteq> supp p"
+ − 2121
unfolding supp_perm by (auto simp add: swap_atom)
+ − 2122
moreover
+ − 2123
have "a \<notin> supp ((p \<bullet> a \<rightleftharpoons> a) + p)" by (simp add: supp_perm)
+ − 2124
then have "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<noteq> supp p" using a by auto
+ − 2125
ultimately
+ − 2126
show "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subset> supp p" by auto
+ − 2127
qed
+ − 2128
2470
+ − 2129
+ − 2130
lemma perm_struct_induct[consumes 1, case_names zero swap]:
+ − 2131
assumes S: "supp p \<subseteq> S"
+ − 2132
and zero: "P 0"
+ − 2133
and swap: "\<And>p a b. \<lbrakk>P p; supp p \<subseteq> S; a \<in> S; b \<in> S; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)"
+ − 2134
shows "P p"
+ − 2135
proof -
+ − 2136
have "finite (supp p)" by (simp add: finite_supp)
+ − 2137
then show "P p" using S
+ − 2138
proof(induct A\<equiv>"supp p" arbitrary: p rule: finite_psubset_induct)
+ − 2139
case (psubset p)
+ − 2140
then have ih: "\<And>q. supp q \<subset> supp p \<Longrightarrow> P q" by auto
+ − 2141
have as: "supp p \<subseteq> S" by fact
+ − 2142
{ assume "supp p = {}"
2732
+ − 2143
then have "p = 0" by (simp add: supp_perm perm_eq_iff)
2470
+ − 2144
then have "P p" using zero by simp
+ − 2145
}
+ − 2146
moreover
+ − 2147
{ assume "supp p \<noteq> {}"
+ − 2148
then obtain a where a0: "a \<in> supp p" by blast
+ − 2149
then have a1: "p \<bullet> a \<in> S" "a \<in> S" "sort_of (p \<bullet> a) = sort_of a" "p \<bullet> a \<noteq> a"
+ − 2150
using as by (auto simp add: supp_atom supp_perm swap_atom)
+ − 2151
let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p"
2776
+ − 2152
have a2: "supp ?q \<subset> supp p" using a0 smaller_supp by simp
2470
+ − 2153
then have "P ?q" using ih by simp
+ − 2154
moreover
+ − 2155
have "supp ?q \<subseteq> S" using as a2 by simp
+ − 2156
ultimately have "P ((p \<bullet> a \<rightleftharpoons> a) + ?q)" using as a1 swap by simp
+ − 2157
moreover
2732
+ − 2158
have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: perm_eq_iff)
2470
+ − 2159
ultimately have "P p" by simp
+ − 2160
}
+ − 2161
ultimately show "P p" by blast
+ − 2162
qed
+ − 2163
qed
+ − 2164
+ − 2165
lemma perm_simple_struct_induct[case_names zero swap]:
+ − 2166
assumes zero: "P 0"
+ − 2167
and swap: "\<And>p a b. \<lbrakk>P p; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)"
+ − 2168
shows "P p"
+ − 2169
by (rule_tac S="supp p" in perm_struct_induct)
+ − 2170
(auto intro: zero swap)
+ − 2171
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2172
lemma perm_struct_induct2[consumes 1, case_names zero swap plus]:
2470
+ − 2173
assumes S: "supp p \<subseteq> S"
+ − 2174
assumes zero: "P 0"
+ − 2175
assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)"
+ − 2176
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2; supp p1 \<subseteq> S; supp p2 \<subseteq> S\<rbrakk> \<Longrightarrow> P (p1 + p2)"
+ − 2177
shows "P p"
+ − 2178
using S
+ − 2179
by (induct p rule: perm_struct_induct)
+ − 2180
(auto intro: zero plus swap simp add: supp_swap)
+ − 2181
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2182
lemma perm_simple_struct_induct2[case_names zero swap plus]:
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2183
assumes zero: "P 0"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2184
assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2185
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2186
shows "P p"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2187
by (rule_tac S="supp p" in perm_struct_induct2)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2188
(auto intro: zero swap plus)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2189
2679
+ − 2190
lemma supp_perm_singleton:
+ − 2191
fixes p::"perm"
+ − 2192
shows "supp p \<subseteq> {b} \<longleftrightarrow> p = 0"
+ − 2193
proof -
+ − 2194
{ assume "supp p \<subseteq> {b}"
+ − 2195
then have "p = 0"
+ − 2196
by (induct p rule: perm_struct_induct) (simp_all)
+ − 2197
}
+ − 2198
then show "supp p \<subseteq> {b} \<longleftrightarrow> p = 0" by (auto simp add: supp_zero_perm)
+ − 2199
qed
+ − 2200
+ − 2201
lemma supp_perm_pair:
+ − 2202
fixes p::"perm"
+ − 2203
shows "supp p \<subseteq> {a, b} \<longleftrightarrow> p = 0 \<or> p = (b \<rightleftharpoons> a)"
+ − 2204
proof -
+ − 2205
{ assume "supp p \<subseteq> {a, b}"
+ − 2206
then have "p = 0 \<or> p = (b \<rightleftharpoons> a)"
+ − 2207
apply (induct p rule: perm_struct_induct)
+ − 2208
apply (auto simp add: swap_cancel supp_zero_perm supp_swap)
+ − 2209
apply (simp add: swap_commute)
+ − 2210
done
+ − 2211
}
+ − 2212
then show "supp p \<subseteq> {a, b} \<longleftrightarrow> p = 0 \<or> p = (b \<rightleftharpoons> a)"
+ − 2213
by (auto simp add: supp_zero_perm supp_swap split: if_splits)
+ − 2214
qed
+ − 2215
2470
+ − 2216
lemma supp_perm_eq:
+ − 2217
assumes "(supp x) \<sharp>* p"
+ − 2218
shows "p \<bullet> x = x"
+ − 2219
proof -
+ − 2220
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 2221
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 2222
then show "p \<bullet> x = x"
+ − 2223
proof (induct p rule: perm_struct_induct)
+ − 2224
case zero
+ − 2225
show "0 \<bullet> x = x" by simp
+ − 2226
next
+ − 2227
case (swap p a b)
+ − 2228
then have "a \<sharp> x" "b \<sharp> x" "p \<bullet> x = x" by simp_all
+ − 2229
then show "((a \<rightleftharpoons> b) + p) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 2230
qed
+ − 2231
qed
+ − 2232
2776
+ − 2233
text {* same lemma as above, but proved with a different induction principle *}
2470
+ − 2234
lemma supp_perm_eq_test:
+ − 2235
assumes "(supp x) \<sharp>* p"
+ − 2236
shows "p \<bullet> x = x"
+ − 2237
proof -
+ − 2238
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 2239
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 2240
then show "p \<bullet> x = x"
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2241
proof (induct p rule: perm_struct_induct2)
2470
+ − 2242
case zero
+ − 2243
show "0 \<bullet> x = x" by simp
+ − 2244
next
+ − 2245
case (swap a b)
+ − 2246
then have "a \<sharp> x" "b \<sharp> x" by simp_all
+ − 2247
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 2248
next
+ − 2249
case (plus p1 p2)
+ − 2250
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+
+ − 2251
then show "(p1 + p2) \<bullet> x = x" by simp
+ − 2252
qed
+ − 2253
qed
+ − 2254
2591
+ − 2255
lemma perm_supp_eq:
+ − 2256
assumes a: "(supp p) \<sharp>* x"
+ − 2257
shows "p \<bullet> x = x"
2776
+ − 2258
proof -
+ − 2259
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 2260
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 2261
then show "p \<bullet> x = x"
+ − 2262
proof (induct p rule: perm_struct_induct2)
+ − 2263
case zero
+ − 2264
show "0 \<bullet> x = x" by simp
+ − 2265
next
+ − 2266
case (swap a b)
+ − 2267
then have "a \<sharp> x" "b \<sharp> x" by simp_all
+ − 2268
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 2269
next
+ − 2270
case (plus p1 p2)
+ − 2271
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+
+ − 2272
then show "(p1 + p2) \<bullet> x = x" by simp
+ − 2273
qed
+ − 2274
qed
+ − 2275
2659
+ − 2276
lemma supp_perm_perm_eq:
+ − 2277
assumes a: "\<forall>a \<in> supp x. p \<bullet> a = q \<bullet> a"
+ − 2278
shows "p \<bullet> x = q \<bullet> x"
+ − 2279
proof -
+ − 2280
from a have "\<forall>a \<in> supp x. (-q + p) \<bullet> a = a" by simp
+ − 2281
then have "\<forall>a \<in> supp x. a \<notin> supp (-q + p)"
+ − 2282
unfolding supp_perm by simp
+ − 2283
then have "supp x \<sharp>* (-q + p)"
+ − 2284
unfolding fresh_star_def fresh_def by simp
+ − 2285
then have "(-q + p) \<bullet> x = x" by (simp only: supp_perm_eq)
+ − 2286
then show "p \<bullet> x = q \<bullet> x"
+ − 2287
by (metis permute_minus_cancel permute_plus)
+ − 2288
qed
2907
+ − 2289
+ − 2290
text {* disagreement set *}
+ − 2291
+ − 2292
definition
2908
+ − 2293
dset :: "perm \<Rightarrow> perm \<Rightarrow> atom set"
2907
+ − 2294
where
2908
+ − 2295
"dset p q = {a::atom. p \<bullet> a \<noteq> q \<bullet> a}"
2907
+ − 2296
+ − 2297
lemma ds_fresh:
2908
+ − 2298
assumes "dset p q \<sharp>* x"
2907
+ − 2299
shows "p \<bullet> x = q \<bullet> x"
+ − 2300
using assms
2908
+ − 2301
unfolding dset_def fresh_star_def fresh_def
2907
+ − 2302
by (auto intro: supp_perm_perm_eq)
+ − 2303
2668
+ − 2304
lemma atom_set_perm_eq:
+ − 2305
assumes a: "as \<sharp>* p"
+ − 2306
shows "p \<bullet> as = as"
+ − 2307
proof -
+ − 2308
from a have "supp p \<subseteq> {a. a \<notin> as}"
+ − 2309
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 2310
then show "p \<bullet> as = as"
+ − 2311
proof (induct p rule: perm_struct_induct)
+ − 2312
case zero
+ − 2313
show "0 \<bullet> as = as" by simp
+ − 2314
next
+ − 2315
case (swap p a b)
+ − 2316
then have "a \<notin> as" "b \<notin> as" "p \<bullet> as = as" by simp_all
+ − 2317
then show "((a \<rightleftharpoons> b) + p) \<bullet> as = as" by (simp add: swap_set_not_in)
+ − 2318
qed
+ − 2319
qed
2470
+ − 2320
+ − 2321
section {* Avoiding of atom sets *}
+ − 2322
+ − 2323
text {*
+ − 2324
For every set of atoms, there is another set of atoms
+ − 2325
avoiding a finitely supported c and there is a permutation
+ − 2326
which 'translates' between both sets.
+ − 2327
*}
+ − 2328
+ − 2329
lemma at_set_avoiding_aux:
+ − 2330
fixes Xs::"atom set"
+ − 2331
and As::"atom set"
+ − 2332
assumes b: "Xs \<subseteq> As"
+ − 2333
and c: "finite As"
2614
+ − 2334
shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 2335
proof -
+ − 2336
from b c have "finite Xs" by (rule finite_subset)
+ − 2337
then show ?thesis using b
+ − 2338
proof (induct rule: finite_subset_induct)
+ − 2339
case empty
+ − 2340
have "0 \<bullet> {} \<inter> As = {}" by simp
+ − 2341
moreover
2614
+ − 2342
have "supp (0::perm) = {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm)
2470
+ − 2343
ultimately show ?case by blast
+ − 2344
next
+ − 2345
case (insert x Xs)
+ − 2346
then obtain p where
+ − 2347
p1: "(p \<bullet> Xs) \<inter> As = {}" and
2614
+ − 2348
p2: "supp p = (Xs \<union> (p \<bullet> Xs))" by blast
2470
+ − 2349
from `x \<in> As` p1 have "x \<notin> p \<bullet> Xs" by fast
+ − 2350
with `x \<notin> Xs` p2 have "x \<notin> supp p" by fast
+ − 2351
hence px: "p \<bullet> x = x" unfolding supp_perm by simp
2614
+ − 2352
have "finite (As \<union> p \<bullet> Xs \<union> supp p)"
2470
+ − 2353
using `finite As` `finite Xs`
2614
+ − 2354
by (simp add: permute_set_eq_image finite_supp)
+ − 2355
then obtain y where "y \<notin> (As \<union> p \<bullet> Xs \<union> supp p)" "sort_of y = sort_of x"
2470
+ − 2356
by (rule obtain_atom)
2614
+ − 2357
hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "y \<notin> supp p" "sort_of y = sort_of x"
2470
+ − 2358
by simp_all
2614
+ − 2359
hence py: "p \<bullet> y = y" "x \<noteq> y" using `x \<in> As`
+ − 2360
by (auto simp add: supp_perm)
2470
+ − 2361
let ?q = "(x \<rightleftharpoons> y) + p"
+ − 2362
have q: "?q \<bullet> insert x Xs = insert y (p \<bullet> Xs)"
+ − 2363
unfolding insert_eqvt
+ − 2364
using `p \<bullet> x = x` `sort_of y = sort_of x`
+ − 2365
using `x \<notin> p \<bullet> Xs` `y \<notin> p \<bullet> Xs`
+ − 2366
by (simp add: swap_atom swap_set_not_in)
+ − 2367
have "?q \<bullet> insert x Xs \<inter> As = {}"
+ − 2368
using `y \<notin> As` `p \<bullet> Xs \<inter> As = {}`
+ − 2369
unfolding q by simp
+ − 2370
moreover
2614
+ − 2371
have "supp (x \<rightleftharpoons> y) \<inter> supp p = {}" using px py `sort_of y = sort_of x`
+ − 2372
unfolding supp_swap by (simp add: supp_perm)
+ − 2373
then have "supp ?q = (supp (x \<rightleftharpoons> y) \<union> supp p)"
+ − 2374
by (simp add: supp_plus_perm_eq)
+ − 2375
then have "supp ?q = insert x Xs \<union> ?q \<bullet> insert x Xs"
+ − 2376
using p2 `sort_of y = sort_of x` `x \<noteq> y` unfolding q supp_swap
+ − 2377
by auto
2470
+ − 2378
ultimately show ?case by blast
+ − 2379
qed
+ − 2380
qed
+ − 2381
+ − 2382
lemma at_set_avoiding:
+ − 2383
assumes a: "finite Xs"
+ − 2384
and b: "finite (supp c)"
2614
+ − 2385
obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 2386
using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \<union> supp c"]
+ − 2387
unfolding fresh_star_def fresh_def by blast
+ − 2388
2589
+ − 2389
lemma at_set_avoiding1:
+ − 2390
assumes "finite xs"
+ − 2391
and "finite (supp c)"
+ − 2392
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c"
+ − 2393
using assms
+ − 2394
apply(erule_tac c="c" in at_set_avoiding)
+ − 2395
apply(auto)
+ − 2396
done
+ − 2397
2470
+ − 2398
lemma at_set_avoiding2:
+ − 2399
assumes "finite xs"
+ − 2400
and "finite (supp c)" "finite (supp x)"
+ − 2401
and "xs \<sharp>* x"
+ − 2402
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p"
+ − 2403
using assms
+ − 2404
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 2405
apply(simp add: supp_Pair)
+ − 2406
apply(rule_tac x="p" in exI)
2591
+ − 2407
apply(simp add: fresh_star_Pair)
2507
+ − 2408
apply(rule fresh_star_supp_conv)
+ − 2409
apply(auto simp add: fresh_star_def)
2470
+ − 2410
done
+ − 2411
2573
+ − 2412
lemma at_set_avoiding3:
+ − 2413
assumes "finite xs"
+ − 2414
and "finite (supp c)" "finite (supp x)"
+ − 2415
and "xs \<sharp>* x"
2614
+ − 2416
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p \<and> supp p = xs \<union> (p \<bullet> xs)"
2586
+ − 2417
using assms
+ − 2418
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 2419
apply(simp add: supp_Pair)
+ − 2420
apply(rule_tac x="p" in exI)
2591
+ − 2421
apply(simp add: fresh_star_Pair)
2586
+ − 2422
apply(rule fresh_star_supp_conv)
+ − 2423
apply(auto simp add: fresh_star_def)
+ − 2424
done
2573
+ − 2425
2470
+ − 2426
lemma at_set_avoiding2_atom:
+ − 2427
assumes "finite (supp c)" "finite (supp x)"
+ − 2428
and b: "a \<sharp> x"
+ − 2429
shows "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p"
+ − 2430
proof -
+ − 2431
have a: "{a} \<sharp>* x" unfolding fresh_star_def by (simp add: b)
+ − 2432
obtain p where p1: "(p \<bullet> {a}) \<sharp>* c" and p2: "supp x \<sharp>* p"
+ − 2433
using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast
+ − 2434
have c: "(p \<bullet> a) \<sharp> c" using p1
+ − 2435
unfolding fresh_star_def Ball_def
+ − 2436
by(erule_tac x="p \<bullet> a" in allE) (simp add: permute_set_eq)
+ − 2437
hence "p \<bullet> a \<sharp> c \<and> supp x \<sharp>* p" using p2 by blast
+ − 2438
then show "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" by blast
+ − 2439
qed
+ − 2440
2614
+ − 2441
2599
+ − 2442
section {* Renaming permutations *}
+ − 2443
+ − 2444
lemma set_renaming_perm:
2659
+ − 2445
assumes b: "finite bs"
2668
+ − 2446
shows "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)"
2659
+ − 2447
using b
2599
+ − 2448
proof (induct)
+ − 2449
case empty
2668
+ − 2450
have "(\<forall>b \<in> {}. 0 \<bullet> b = p \<bullet> b) \<and> supp (0::perm) \<subseteq> {} \<union> p \<bullet> {}"
2599
+ − 2451
by (simp add: permute_set_eq supp_perm)
2668
+ − 2452
then show "\<exists>q. (\<forall>b \<in> {}. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> {} \<union> p \<bullet> {}" by blast
2599
+ − 2453
next
+ − 2454
case (insert a bs)
2668
+ − 2455
then have " \<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> p \<bullet> bs" by simp
+ − 2456
then obtain q where *: "\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> bs \<union> p \<bullet> bs"
+ − 2457
by (metis empty_subsetI insert(3) supp_swap)
2599
+ − 2458
{ assume 1: "q \<bullet> a = p \<bullet> a"
2668
+ − 2459
have "\<forall>b \<in> (insert a bs). q \<bullet> b = p \<bullet> b" using 1 * by simp
2599
+ − 2460
moreover
+ − 2461
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 2462
using ** by (auto simp add: insert_eqvt)
+ − 2463
ultimately
2668
+ − 2464
have "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast
2599
+ − 2465
}
+ − 2466
moreover
+ − 2467
{ assume 2: "q \<bullet> a \<noteq> p \<bullet> a"
+ − 2468
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
2668
+ − 2469
have "\<forall>b \<in> insert a bs. q' \<bullet> b = p \<bullet> b" using 2 * `a \<notin> bs` unfolding q'_def
+ − 2470
by (auto simp add: swap_atom)
2599
+ − 2471
moreover
+ − 2472
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
2659
+ − 2473
using **
+ − 2474
apply (auto simp add: supp_perm insert_eqvt)
+ − 2475
apply (subgoal_tac "q \<bullet> a \<in> bs \<union> p \<bullet> bs")
+ − 2476
apply(auto)[1]
+ − 2477
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}")
+ − 2478
apply(blast)
+ − 2479
apply(simp)
+ − 2480
done
2599
+ − 2481
then have "supp (q \<bullet> a \<rightleftharpoons> p \<bullet> a) \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by (simp add: supp_swap)
+ − 2482
moreover
+ − 2483
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 2484
using ** by (auto simp add: insert_eqvt)
+ − 2485
ultimately
+ − 2486
have "supp q' \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 2487
unfolding q'_def using supp_plus_perm by blast
+ − 2488
}
+ − 2489
ultimately
2668
+ − 2490
have "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast
2599
+ − 2491
}
2668
+ − 2492
ultimately show "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
2599
+ − 2493
by blast
+ − 2494
qed
+ − 2495
2672
+ − 2496
lemma set_renaming_perm2:
+ − 2497
shows "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)"
+ − 2498
proof -
+ − 2499
have "finite (bs \<inter> supp p)" by (simp add: finite_supp)
+ − 2500
then obtain q
+ − 2501
where *: "\<forall>b \<in> bs \<inter> supp p. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> (bs \<inter> supp p) \<union> (p \<bullet> (bs \<inter> supp p))"
+ − 2502
using set_renaming_perm by blast
+ − 2503
from ** have "supp q \<subseteq> bs \<union> (p \<bullet> bs)" by (auto simp add: inter_eqvt)
+ − 2504
moreover
+ − 2505
have "\<forall>b \<in> bs - supp p. q \<bullet> b = p \<bullet> b"
+ − 2506
apply(auto)
+ − 2507
apply(subgoal_tac "b \<notin> supp q")
+ − 2508
apply(simp add: fresh_def[symmetric])
+ − 2509
apply(simp add: fresh_perm)
+ − 2510
apply(clarify)
+ − 2511
apply(rotate_tac 2)
+ − 2512
apply(drule subsetD[OF **])
+ − 2513
apply(simp add: inter_eqvt supp_eqvt permute_self)
+ − 2514
done
+ − 2515
ultimately have "(\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" using * by auto
+ − 2516
then show "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" by blast
+ − 2517
qed
+ − 2518
2599
+ − 2519
lemma list_renaming_perm:
2668
+ − 2520
shows "\<exists>q. (\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set bs \<union> (p \<bullet> set bs)"
2599
+ − 2521
proof (induct bs)
+ − 2522
case (Cons a bs)
2668
+ − 2523
then have " \<exists>q. (\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" by simp
+ − 2524
then obtain q where *: "\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> set bs \<union> p \<bullet> (set bs)"
+ − 2525
by (blast)
2599
+ − 2526
{ assume 1: "a \<in> set bs"
+ − 2527
have "q \<bullet> a = p \<bullet> a" using * 1 by (induct bs) (auto)
2668
+ − 2528
then have "\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b" using * by simp
2599
+ − 2529
moreover
+ − 2530
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" using ** by (auto simp add: insert_eqvt)
+ − 2531
ultimately
2668
+ − 2532
have "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast
2599
+ − 2533
}
+ − 2534
moreover
+ − 2535
{ assume 2: "a \<notin> set bs"
+ − 2536
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
2668
+ − 2537
have "\<forall>b \<in> set (a # bs). q' \<bullet> b = p \<bullet> b"
+ − 2538
unfolding q'_def using 2 * `a \<notin> set bs` by (auto simp add: swap_atom)
2599
+ − 2539
moreover
+ − 2540
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
2659
+ − 2541
using **
+ − 2542
apply (auto simp add: supp_perm insert_eqvt)
+ − 2543
apply (subgoal_tac "q \<bullet> a \<in> set bs \<union> p \<bullet> set bs")
+ − 2544
apply(auto)[1]
+ − 2545
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}")
+ − 2546
apply(blast)
+ − 2547
apply(simp)
+ − 2548
done
2599
+ − 2549
then have "supp (q \<bullet> a \<rightleftharpoons> p \<bullet> a) \<subseteq> set (a # bs) \<union> p \<bullet> set (a # bs)" by (simp add: supp_swap)
+ − 2550
moreover
+ − 2551
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 2552
using ** by (auto simp add: insert_eqvt)
+ − 2553
ultimately
+ − 2554
have "supp q' \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 2555
unfolding q'_def using supp_plus_perm by blast
+ − 2556
}
+ − 2557
ultimately
2668
+ − 2558
have "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast
2599
+ − 2559
}
2668
+ − 2560
ultimately show "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
2599
+ − 2561
by blast
2771
+ − 2562
next
+ − 2563
case Nil
+ − 2564
have "(\<forall>b \<in> set []. 0 \<bullet> b = p \<bullet> b) \<and> supp (0::perm) \<subseteq> set [] \<union> p \<bullet> set []"
+ − 2565
by (simp add: supp_zero_perm)
+ − 2566
then show "\<exists>q. (\<forall>b \<in> set []. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set [] \<union> p \<bullet> (set [])" by blast
2599
+ − 2567
qed
+ − 2568
+ − 2569
2470
+ − 2570
section {* Concrete Atoms Types *}
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2571
1972
+ − 2572
text {*
+ − 2573
Class @{text at_base} allows types containing multiple sorts of atoms.
+ − 2574
Class @{text at} only allows types with a single sort.
+ − 2575
*}
+ − 2576
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2577
class at_base = pt +
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2578
fixes atom :: "'a \<Rightarrow> atom"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2579
assumes atom_eq_iff [simp]: "atom a = atom b \<longleftrightarrow> a = b"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2580
assumes atom_eqvt: "p \<bullet> (atom a) = atom (p \<bullet> a)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2581
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2582
declare atom_eqvt[eqvt]
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2583
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2584
class at = at_base +
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2585
assumes sort_of_atom_eq [simp]: "sort_of (atom a) = sort_of (atom b)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2586
2900
d66430c7c4f1
an alternative FCB for Abs_lst1; seems simpler but not as simple as I thought; not sure whether it generalises to multiple binders.
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2587
lemma sort_ineq [simp]:
d66430c7c4f1
an alternative FCB for Abs_lst1; seems simpler but not as simple as I thought; not sure whether it generalises to multiple binders.
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2588
assumes "sort_of (atom a) \<noteq> sort_of (atom b)"
d66430c7c4f1
an alternative FCB for Abs_lst1; seems simpler but not as simple as I thought; not sure whether it generalises to multiple binders.
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2589
shows "atom a \<noteq> atom b"
d66430c7c4f1
an alternative FCB for Abs_lst1; seems simpler but not as simple as I thought; not sure whether it generalises to multiple binders.
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2590
using assms by metis
d66430c7c4f1
an alternative FCB for Abs_lst1; seems simpler but not as simple as I thought; not sure whether it generalises to multiple binders.
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2591
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2592
lemma supp_at_base:
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2593
fixes a::"'a::at_base"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2594
shows "supp a = {atom a}"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2595
by (simp add: supp_atom [symmetric] supp_def atom_eqvt)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2596
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2597
lemma fresh_at_base:
2891
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2598
shows "sort_of a \<noteq> sort_of (atom b) \<Longrightarrow> a \<sharp> b"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2599
and "a \<sharp> b \<longleftrightarrow> a \<noteq> atom b"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2600
unfolding fresh_def
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2601
apply(simp_all add: supp_at_base)
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2602
apply(metis)
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2603
done
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2604
2609
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2605
lemma fresh_atom_at_base:
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2606
fixes b::"'a::at_base"
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2607
shows "a \<sharp> atom b \<longleftrightarrow> a \<sharp> b"
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2608
by (simp add: fresh_def supp_at_base supp_atom)
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2609
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2610
lemma fresh_star_atom_at_base:
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2611
fixes b::"'a::at_base"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2612
shows "as \<sharp>* atom b \<longleftrightarrow> as \<sharp>* b"
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2613
by (simp add: fresh_star_def fresh_atom_at_base)
2609
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2614
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2615
instance at_base < fs
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2616
proof qed (simp add: supp_at_base)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2617
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2618
lemma at_base_infinite [simp]:
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2619
shows "infinite (UNIV :: 'a::at_base set)" (is "infinite ?U")
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2620
proof
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2621
obtain a :: 'a where "True" by auto
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2622
assume "finite ?U"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2623
hence "finite (atom ` ?U)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2624
by (rule finite_imageI)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2625
then obtain b where b: "b \<notin> atom ` ?U" "sort_of b = sort_of (atom a)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2626
by (rule obtain_atom)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2627
from b(2) have "b = atom ((atom a \<rightleftharpoons> b) \<bullet> a)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2628
unfolding atom_eqvt [symmetric]
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2629
by (simp add: swap_atom)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2630
hence "b \<in> atom ` ?U" by simp
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2631
with b(1) show "False" by simp
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2632
qed
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2633
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2634
lemma swap_at_base_simps [simp]:
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2635
fixes x y::"'a::at_base"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2636
shows "sort_of (atom x) = sort_of (atom y) \<Longrightarrow> (atom x \<rightleftharpoons> atom y) \<bullet> x = y"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2637
and "sort_of (atom x) = sort_of (atom y) \<Longrightarrow> (atom x \<rightleftharpoons> atom y) \<bullet> y = x"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2638
and "atom x \<noteq> a \<Longrightarrow> atom x \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2639
unfolding atom_eq_iff [symmetric]
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2640
unfolding atom_eqvt [symmetric]
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2641
by simp_all
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2642
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2643
lemma obtain_at_base:
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2644
assumes X: "finite X"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2645
obtains a::"'a::at_base" where "atom a \<notin> X"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2646
proof -
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2647
have "inj (atom :: 'a \<Rightarrow> atom)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2648
by (simp add: inj_on_def)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2649
with X have "finite (atom -` X :: 'a set)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2650
by (rule finite_vimageI)
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2651
with at_base_infinite have "atom -` X \<noteq> (UNIV :: 'a set)"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2652
by auto
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2653
then obtain a :: 'a where "atom a \<notin> X"
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2654
by auto
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2655
thus ?thesis ..
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2656
qed
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2657
2685
+ − 2658
lemma obtain_fresh':
+ − 2659
assumes fin: "finite (supp x)"
+ − 2660
obtains a::"'a::at_base" where "atom a \<sharp> x"
+ − 2661
using obtain_at_base[where X="supp x"]
+ − 2662
by (auto simp add: fresh_def fin)
+ − 2663
+ − 2664
lemma obtain_fresh:
+ − 2665
fixes x::"'b::fs"
+ − 2666
obtains a::"'a::at_base" where "atom a \<sharp> x"
+ − 2667
by (rule obtain_fresh') (auto simp add: finite_supp)
+ − 2668
1973
+ − 2669
lemma supp_finite_set_at_base:
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2670
assumes a: "finite S"
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2671
shows "supp S = atom ` S"
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2672
apply(simp add: supp_of_finite_sets[OF a])
2466
+ − 2673
apply(simp add: supp_at_base)
+ − 2674
apply(auto)
+ − 2675
done
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2676
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2677
(* FIXME
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2678
lemma supp_cofinite_set_at_base:
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2679
assumes a: "finite (UNIV - S)"
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2680
shows "supp S = atom ` (UNIV - S)"
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2681
apply(rule finite_supp_unique)
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2682
*)
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2683
2657
+ − 2684
lemma fresh_finite_set_at_base:
+ − 2685
fixes a::"'a::at_base"
+ − 2686
assumes a: "finite S"
+ − 2687
shows "atom a \<sharp> S \<longleftrightarrow> a \<notin> S"
+ − 2688
unfolding fresh_def
+ − 2689
apply(simp add: supp_finite_set_at_base[OF a])
+ − 2690
apply(subst inj_image_mem_iff)
+ − 2691
apply(simp add: inj_on_def)
+ − 2692
apply(simp)
+ − 2693
done
+ − 2694
2776
+ − 2695
lemma fresh_at_base_permute_iff [simp]:
2683
+ − 2696
fixes a::"'a::at_base"
+ − 2697
shows "atom (p \<bullet> a) \<sharp> p \<bullet> x \<longleftrightarrow> atom a \<sharp> x"
+ − 2698
unfolding atom_eqvt[symmetric]
+ − 2699
by (simp add: fresh_permute_iff)
+ − 2700
2657
+ − 2701
2467
+ − 2702
section {* Infrastructure for concrete atom types *}
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2703
2467
+ − 2704
definition
+ − 2705
flip :: "'a::at_base \<Rightarrow> 'a \<Rightarrow> perm" ("'(_ \<leftrightarrow> _')")
+ − 2706
where
+ − 2707
"(a \<leftrightarrow> b) = (atom a \<rightleftharpoons> atom b)"
+ − 2708
+ − 2709
lemma flip_self [simp]: "(a \<leftrightarrow> a) = 0"
+ − 2710
unfolding flip_def by (rule swap_self)
+ − 2711
+ − 2712
lemma flip_commute: "(a \<leftrightarrow> b) = (b \<leftrightarrow> a)"
+ − 2713
unfolding flip_def by (rule swap_commute)
+ − 2714
+ − 2715
lemma minus_flip [simp]: "- (a \<leftrightarrow> b) = (a \<leftrightarrow> b)"
+ − 2716
unfolding flip_def by (rule minus_swap)
+ − 2717
+ − 2718
lemma add_flip_cancel: "(a \<leftrightarrow> b) + (a \<leftrightarrow> b) = 0"
+ − 2719
unfolding flip_def by (rule swap_cancel)
+ − 2720
+ − 2721
lemma permute_flip_cancel [simp]: "(a \<leftrightarrow> b) \<bullet> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 2722
unfolding permute_plus [symmetric] add_flip_cancel by simp
+ − 2723
+ − 2724
lemma permute_flip_cancel2 [simp]: "(a \<leftrightarrow> b) \<bullet> (b \<leftrightarrow> a) \<bullet> x = x"
+ − 2725
by (simp add: flip_commute)
+ − 2726
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2727
lemma flip_eqvt [eqvt]:
2467
+ − 2728
fixes a b c::"'a::at_base"
+ − 2729
shows "p \<bullet> (a \<leftrightarrow> b) = (p \<bullet> a \<leftrightarrow> p \<bullet> b)"
+ − 2730
unfolding flip_def
+ − 2731
by (simp add: swap_eqvt atom_eqvt)
+ − 2732
+ − 2733
lemma flip_at_base_simps [simp]:
+ − 2734
shows "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> a = b"
+ − 2735
and "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> b = a"
+ − 2736
and "\<lbrakk>a \<noteq> c; b \<noteq> c\<rbrakk> \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> c = c"
+ − 2737
and "sort_of (atom a) \<noteq> sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 2738
unfolding flip_def
+ − 2739
unfolding atom_eq_iff [symmetric]
+ − 2740
unfolding atom_eqvt [symmetric]
+ − 2741
by simp_all
+ − 2742
+ − 2743
text {* the following two lemmas do not hold for at_base,
+ − 2744
only for single sort atoms from at *}
+ − 2745
+ − 2746
lemma permute_flip_at:
+ − 2747
fixes a b c::"'a::at"
+ − 2748
shows "(a \<leftrightarrow> b) \<bullet> c = (if c = a then b else if c = b then a else c)"
+ − 2749
unfolding flip_def
+ − 2750
apply (rule atom_eq_iff [THEN iffD1])
+ − 2751
apply (subst atom_eqvt [symmetric])
+ − 2752
apply (simp add: swap_atom)
+ − 2753
done
+ − 2754
+ − 2755
lemma flip_at_simps [simp]:
+ − 2756
fixes a b::"'a::at"
+ − 2757
shows "(a \<leftrightarrow> b) \<bullet> a = b"
+ − 2758
and "(a \<leftrightarrow> b) \<bullet> b = a"
+ − 2759
unfolding permute_flip_at by simp_all
+ − 2760
+ − 2761
lemma flip_fresh_fresh:
+ − 2762
fixes a b::"'a::at_base"
+ − 2763
assumes "atom a \<sharp> x" "atom b \<sharp> x"
+ − 2764
shows "(a \<leftrightarrow> b) \<bullet> x = x"
+ − 2765
using assms
+ − 2766
by (simp add: flip_def swap_fresh_fresh)
+ − 2767
2683
+ − 2768
+ − 2769
2467
+ − 2770
subsection {* Syntax for coercing at-elements to the atom-type *}
+ − 2771
+ − 2772
syntax
+ − 2773
"_atom_constrain" :: "logic \<Rightarrow> type \<Rightarrow> logic" ("_:::_" [4, 0] 3)
+ − 2774
+ − 2775
translations
+ − 2776
"_atom_constrain a t" => "CONST atom (_constrain a t)"
+ − 2777
+ − 2778
+ − 2779
subsection {* A lemma for proving instances of class @{text at}. *}
+ − 2780
+ − 2781
setup {* Sign.add_const_constraint (@{const_name "permute"}, NONE) *}
+ − 2782
setup {* Sign.add_const_constraint (@{const_name "atom"}, NONE) *}
+ − 2783
+ − 2784
text {*
+ − 2785
New atom types are defined as subtypes of @{typ atom}.
+ − 2786
*}
+ − 2787
+ − 2788
lemma exists_eq_simple_sort:
+ − 2789
shows "\<exists>a. a \<in> {a. sort_of a = s}"
+ − 2790
by (rule_tac x="Atom s 0" in exI, simp)
+ − 2791
+ − 2792
lemma exists_eq_sort:
+ − 2793
shows "\<exists>a. a \<in> {a. sort_of a \<in> range sort_fun}"
+ − 2794
by (rule_tac x="Atom (sort_fun x) y" in exI, simp)
+ − 2795
+ − 2796
lemma at_base_class:
2847
+ − 2797
fixes sort_fun :: "'b \<Rightarrow> atom_sort"
2467
+ − 2798
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2799
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range sort_fun}"
+ − 2800
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2801
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2802
shows "OFCLASS('a, at_base_class)"
+ − 2803
proof
+ − 2804
interpret type_definition Rep Abs "{a. sort_of a \<in> range sort_fun}" by (rule type)
+ − 2805
have sort_of_Rep: "\<And>a. sort_of (Rep a) \<in> range sort_fun" using Rep by simp
+ − 2806
fix a b :: 'a and p p1 p2 :: perm
+ − 2807
show "0 \<bullet> a = a"
+ − 2808
unfolding permute_def by (simp add: Rep_inverse)
+ − 2809
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2810
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2811
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2812
unfolding atom_def by (simp add: Rep_inject)
+ − 2813
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2814
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2815
qed
+ − 2816
+ − 2817
(*
+ − 2818
lemma at_class:
+ − 2819
fixes s :: atom_sort
+ − 2820
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2821
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range (\<lambda>x::unit. s)}"
+ − 2822
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2823
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2824
shows "OFCLASS('a, at_class)"
+ − 2825
proof
+ − 2826
interpret type_definition Rep Abs "{a. sort_of a \<in> range (\<lambda>x::unit. s)}" by (rule type)
+ − 2827
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2828
fix a b :: 'a and p p1 p2 :: perm
+ − 2829
show "0 \<bullet> a = a"
+ − 2830
unfolding permute_def by (simp add: Rep_inverse)
+ − 2831
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2832
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2833
show "sort_of (atom a) = sort_of (atom b)"
+ − 2834
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2835
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2836
unfolding atom_def by (simp add: Rep_inject)
+ − 2837
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2838
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2839
qed
+ − 2840
*)
+ − 2841
+ − 2842
lemma at_class:
+ − 2843
fixes s :: atom_sort
+ − 2844
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2845
assumes type: "type_definition Rep Abs {a. sort_of a = s}"
+ − 2846
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2847
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2848
shows "OFCLASS('a, at_class)"
+ − 2849
proof
+ − 2850
interpret type_definition Rep Abs "{a. sort_of a = s}" by (rule type)
+ − 2851
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2852
fix a b :: 'a and p p1 p2 :: perm
+ − 2853
show "0 \<bullet> a = a"
+ − 2854
unfolding permute_def by (simp add: Rep_inverse)
+ − 2855
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2856
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2857
show "sort_of (atom a) = sort_of (atom b)"
+ − 2858
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2859
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2860
unfolding atom_def by (simp add: Rep_inject)
+ − 2861
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2862
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2863
qed
+ − 2864
2891
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2865
lemma at_class_sort:
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2866
fixes s :: atom_sort
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2867
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2868
fixes a::"'a"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2869
assumes type: "type_definition Rep Abs {a. sort_of a = s}"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2870
assumes atom_def: "\<And>a. atom a = Rep a"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2871
shows "sort_of (atom a) = s"
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2872
using atom_def type
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2873
unfolding type_definition_def by simp
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2874
304dfe6cc83a
the simplifier can simplify "sort (atom a)" if a is a concrete atom type declared with atom_decl
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2875
2467
+ − 2876
setup {* Sign.add_const_constraint
+ − 2877
(@{const_name "permute"}, SOME @{typ "perm \<Rightarrow> 'a::pt \<Rightarrow> 'a"}) *}
+ − 2878
setup {* Sign.add_const_constraint
+ − 2879
(@{const_name "atom"}, SOME @{typ "'a::at_base \<Rightarrow> atom"}) *}
+ − 2880
2470
+ − 2881
section {* The freshness lemma according to Andy Pitts *}
+ − 2882
+ − 2883
lemma freshness_lemma:
+ − 2884
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2885
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2886
shows "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2887
proof -
+ − 2888
from a obtain b where a1: "atom b \<sharp> h" and a2: "atom b \<sharp> h b"
+ − 2889
by (auto simp add: fresh_Pair)
+ − 2890
show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2891
proof (intro exI allI impI)
+ − 2892
fix a :: 'a
+ − 2893
assume a3: "atom a \<sharp> h"
+ − 2894
show "h a = h b"
+ − 2895
proof (cases "a = b")
+ − 2896
assume "a = b"
+ − 2897
thus "h a = h b" by simp
+ − 2898
next
+ − 2899
assume "a \<noteq> b"
+ − 2900
hence "atom a \<sharp> b" by (simp add: fresh_at_base)
+ − 2901
with a3 have "atom a \<sharp> h b"
+ − 2902
by (rule fresh_fun_app)
+ − 2903
with a2 have d1: "(atom b \<rightleftharpoons> atom a) \<bullet> (h b) = (h b)"
+ − 2904
by (rule swap_fresh_fresh)
+ − 2905
from a1 a3 have d2: "(atom b \<rightleftharpoons> atom a) \<bullet> h = h"
+ − 2906
by (rule swap_fresh_fresh)
+ − 2907
from d1 have "h b = (atom b \<rightleftharpoons> atom a) \<bullet> (h b)" by simp
+ − 2908
also have "\<dots> = ((atom b \<rightleftharpoons> atom a) \<bullet> h) ((atom b \<rightleftharpoons> atom a) \<bullet> b)"
+ − 2909
by (rule permute_fun_app_eq)
+ − 2910
also have "\<dots> = h a"
+ − 2911
using d2 by simp
+ − 2912
finally show "h a = h b" by simp
+ − 2913
qed
+ − 2914
qed
+ − 2915
qed
+ − 2916
+ − 2917
lemma freshness_lemma_unique:
+ − 2918
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2919
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2920
shows "\<exists>!x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2921
proof (rule ex_ex1I)
+ − 2922
from a show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2923
by (rule freshness_lemma)
+ − 2924
next
+ − 2925
fix x y
+ − 2926
assume x: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2927
assume y: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = y"
+ − 2928
from a x y show "x = y"
+ − 2929
by (auto simp add: fresh_Pair)
+ − 2930
qed
+ − 2931
+ − 2932
text {* packaging the freshness lemma into a function *}
+ − 2933
+ − 2934
definition
+ − 2935
fresh_fun :: "('a::at \<Rightarrow> 'b::pt) \<Rightarrow> 'b"
+ − 2936
where
+ − 2937
"fresh_fun h = (THE x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x)"
+ − 2938
+ − 2939
lemma fresh_fun_apply:
+ − 2940
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2941
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2942
assumes b: "atom a \<sharp> h"
+ − 2943
shows "fresh_fun h = h a"
+ − 2944
unfolding fresh_fun_def
+ − 2945
proof (rule the_equality)
+ − 2946
show "\<forall>a'. atom a' \<sharp> h \<longrightarrow> h a' = h a"
+ − 2947
proof (intro strip)
+ − 2948
fix a':: 'a
+ − 2949
assume c: "atom a' \<sharp> h"
+ − 2950
from a have "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" by (rule freshness_lemma)
+ − 2951
with b c show "h a' = h a" by auto
+ − 2952
qed
+ − 2953
next
+ − 2954
fix fr :: 'b
+ − 2955
assume "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = fr"
+ − 2956
with b show "fr = h a" by auto
+ − 2957
qed
+ − 2958
+ − 2959
lemma fresh_fun_apply':
+ − 2960
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2961
assumes a: "atom a \<sharp> h" "atom a \<sharp> h a"
+ − 2962
shows "fresh_fun h = h a"
+ − 2963
apply (rule fresh_fun_apply)
+ − 2964
apply (auto simp add: fresh_Pair intro: a)
+ − 2965
done
+ − 2966
+ − 2967
lemma fresh_fun_eqvt:
+ − 2968
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2969
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2970
shows "p \<bullet> (fresh_fun h) = fresh_fun (p \<bullet> h)"
+ − 2971
using a
+ − 2972
apply (clarsimp simp add: fresh_Pair)
+ − 2973
apply (subst fresh_fun_apply', assumption+)
+ − 2974
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
+ − 2975
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
2683
+ − 2976
apply (simp only: atom_eqvt permute_fun_app_eq [where f=h])
2470
+ − 2977
apply (erule (1) fresh_fun_apply' [symmetric])
+ − 2978
done
+ − 2979
+ − 2980
lemma fresh_fun_supports:
+ − 2981
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2982
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2983
shows "(supp h) supports (fresh_fun h)"
+ − 2984
apply (simp add: supports_def fresh_def [symmetric])
+ − 2985
apply (simp add: fresh_fun_eqvt [OF a] swap_fresh_fresh)
+ − 2986
done
+ − 2987
+ − 2988
notation fresh_fun (binder "FRESH " 10)
+ − 2989
+ − 2990
lemma FRESH_f_iff:
+ − 2991
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 2992
fixes f :: "'b \<Rightarrow> 'c::pure"
+ − 2993
assumes P: "finite (supp P)"
+ − 2994
shows "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2995
proof -
2685
+ − 2996
obtain a::'a where "atom a \<sharp> P" using P by (rule obtain_fresh')
2470
+ − 2997
show "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2998
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 2999
apply (cut_tac `atom a \<sharp> P`)
+ − 3000
apply (simp add: fresh_conv_MOST)
+ − 3001
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 3002
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 3003
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 3004
apply (rule refl)
+ − 3005
done
+ − 3006
qed
+ − 3007
+ − 3008
lemma FRESH_binop_iff:
+ − 3009
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 3010
fixes Q :: "'a::at \<Rightarrow> 'c::pure"
+ − 3011
fixes binop :: "'b \<Rightarrow> 'c \<Rightarrow> 'd::pure"
+ − 3012
assumes P: "finite (supp P)"
+ − 3013
and Q: "finite (supp Q)"
+ − 3014
shows "(FRESH x. binop (P x) (Q x)) = binop (FRESH x. P x) (FRESH x. Q x)"
+ − 3015
proof -
2685
+ − 3016
from assms have "finite (supp (P, Q))" by (simp add: supp_Pair)
+ − 3017
then obtain a::'a where "atom a \<sharp> (P, Q)" by (rule obtain_fresh')
+ − 3018
then have "atom a \<sharp> P" and "atom a \<sharp> Q" by (simp_all add: fresh_Pair)
2470
+ − 3019
show ?thesis
+ − 3020
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 3021
apply (cut_tac `atom a \<sharp> P` `atom a \<sharp> Q`)
+ − 3022
apply (simp add: fresh_conv_MOST)
+ − 3023
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 3024
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 3025
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 3026
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> Q` pure_fresh])
+ − 3027
apply (rule refl)
+ − 3028
done
+ − 3029
qed
+ − 3030
+ − 3031
lemma FRESH_conj_iff:
+ − 3032
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 3033
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 3034
shows "(FRESH x. P x \<and> Q x) \<longleftrightarrow> (FRESH x. P x) \<and> (FRESH x. Q x)"
+ − 3035
using P Q by (rule FRESH_binop_iff)
+ − 3036
+ − 3037
lemma FRESH_disj_iff:
+ − 3038
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 3039
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 3040
shows "(FRESH x. P x \<or> Q x) \<longleftrightarrow> (FRESH x. P x) \<or> (FRESH x. Q x)"
+ − 3041
using P Q by (rule FRESH_binop_iff)
+ − 3042
+ − 3043
2467
+ − 3044
section {* Library functions for the nominal infrastructure *}
+ − 3045
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3046
use "nominal_library.ML"
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3047
2466
+ − 3048
2467
+ − 3049
section {* Automation for creating concrete atom types *}
+ − 3050
+ − 3051
text {* at the moment only single-sort concrete atoms are supported *}
+ − 3052
+ − 3053
use "nominal_atoms.ML"
+ − 3054
+ − 3055
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3056
section {* automatic equivariance procedure for inductive definitions *}
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3057
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3058
use "nominal_eqvt.ML"
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3059
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 3060
2466
+ − 3061
1062
+ − 3062
end