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
+ − 8
imports Main Infinite_Set
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 9
"~~/src/HOL/Quotient_Examples/FSet"
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 10
uses ("nominal_library.ML")
2467
+ − 11
("nominal_atoms.ML")
1062
+ − 12
begin
+ − 13
+ − 14
section {* Atoms and Sorts *}
+ − 15
+ − 16
text {* A simple implementation for atom_sorts is strings. *}
+ − 17
(* types atom_sort = string *)
+ − 18
+ − 19
text {* To deal with Church-like binding we use trees of
+ − 20
strings as sorts. *}
+ − 21
+ − 22
datatype atom_sort = Sort "string" "atom_sort list"
+ − 23
+ − 24
datatype atom = Atom atom_sort nat
+ − 25
+ − 26
+ − 27
text {* Basic projection function. *}
+ − 28
+ − 29
primrec
+ − 30
sort_of :: "atom \<Rightarrow> atom_sort"
+ − 31
where
+ − 32
"sort_of (Atom s i) = s"
+ − 33
1930
+ − 34
primrec
+ − 35
nat_of :: "atom \<Rightarrow> nat"
+ − 36
where
+ − 37
"nat_of (Atom s n) = n"
+ − 38
1062
+ − 39
+ − 40
text {* There are infinitely many atoms of each sort. *}
+ − 41
lemma INFM_sort_of_eq:
+ − 42
shows "INFM a. sort_of a = s"
+ − 43
proof -
+ − 44
have "INFM i. sort_of (Atom s i) = s" by simp
+ − 45
moreover have "inj (Atom s)" by (simp add: inj_on_def)
+ − 46
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj)
+ − 47
qed
+ − 48
+ − 49
lemma infinite_sort_of_eq:
+ − 50
shows "infinite {a. sort_of a = s}"
+ − 51
using INFM_sort_of_eq unfolding INFM_iff_infinite .
+ − 52
+ − 53
lemma atom_infinite [simp]:
+ − 54
shows "infinite (UNIV :: atom set)"
+ − 55
using subset_UNIV infinite_sort_of_eq
+ − 56
by (rule infinite_super)
+ − 57
+ − 58
lemma obtain_atom:
+ − 59
fixes X :: "atom set"
+ − 60
assumes X: "finite X"
+ − 61
obtains a where "a \<notin> X" "sort_of a = s"
+ − 62
proof -
+ − 63
from X have "MOST a. a \<notin> X"
+ − 64
unfolding MOST_iff_cofinite by simp
+ − 65
with INFM_sort_of_eq
+ − 66
have "INFM a. sort_of a = s \<and> a \<notin> X"
+ − 67
by (rule INFM_conjI)
+ − 68
then obtain a where "a \<notin> X" "sort_of a = s"
+ − 69
by (auto elim: INFM_E)
+ − 70
then show ?thesis ..
+ − 71
qed
+ − 72
1930
+ − 73
lemma atom_components_eq_iff:
+ − 74
fixes a b :: atom
+ − 75
shows "a = b \<longleftrightarrow> sort_of a = sort_of b \<and> nat_of a = nat_of b"
+ − 76
by (induct a, induct b, simp)
+ − 77
1062
+ − 78
section {* Sort-Respecting Permutations *}
+ − 79
+ − 80
typedef perm =
+ − 81
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}"
+ − 82
proof
+ − 83
show "id \<in> ?perm" by simp
+ − 84
qed
+ − 85
+ − 86
lemma permI:
+ − 87
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a"
+ − 88
shows "f \<in> perm"
+ − 89
using assms unfolding perm_def MOST_iff_cofinite by simp
+ − 90
+ − 91
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f"
+ − 92
unfolding perm_def by simp
+ − 93
+ − 94
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}"
+ − 95
unfolding perm_def by simp
+ − 96
+ − 97
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a"
+ − 98
unfolding perm_def by simp
+ − 99
+ − 100
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x"
+ − 101
unfolding perm_def MOST_iff_cofinite by simp
+ − 102
+ − 103
lemma perm_id: "id \<in> perm"
+ − 104
unfolding perm_def by simp
+ − 105
+ − 106
lemma perm_comp:
+ − 107
assumes f: "f \<in> perm" and g: "g \<in> perm"
+ − 108
shows "(f \<circ> g) \<in> perm"
+ − 109
apply (rule permI)
+ − 110
apply (rule bij_comp)
+ − 111
apply (rule perm_is_bij [OF g])
+ − 112
apply (rule perm_is_bij [OF f])
+ − 113
apply (rule MOST_rev_mp [OF perm_MOST [OF g]])
+ − 114
apply (rule MOST_rev_mp [OF perm_MOST [OF f]])
+ − 115
apply (simp)
+ − 116
apply (simp add: perm_is_sort_respecting [OF f])
+ − 117
apply (simp add: perm_is_sort_respecting [OF g])
+ − 118
done
+ − 119
+ − 120
lemma perm_inv:
+ − 121
assumes f: "f \<in> perm"
+ − 122
shows "(inv f) \<in> perm"
+ − 123
apply (rule permI)
+ − 124
apply (rule bij_imp_bij_inv)
+ − 125
apply (rule perm_is_bij [OF f])
+ − 126
apply (rule MOST_mono [OF perm_MOST [OF f]])
+ − 127
apply (erule subst, rule inv_f_f)
+ − 128
apply (rule bij_is_inj [OF perm_is_bij [OF f]])
+ − 129
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans])
+ − 130
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]])
+ − 131
done
+ − 132
+ − 133
lemma bij_Rep_perm: "bij (Rep_perm p)"
+ − 134
using Rep_perm [of p] unfolding perm_def by simp
+ − 135
+ − 136
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}"
+ − 137
using Rep_perm [of p] unfolding perm_def by simp
+ − 138
+ − 139
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a"
+ − 140
using Rep_perm [of p] unfolding perm_def by simp
+ − 141
+ − 142
lemma Rep_perm_ext:
+ − 143
"Rep_perm p1 = Rep_perm p2 \<Longrightarrow> p1 = p2"
2479
+ − 144
by (simp add: fun_eq_iff Rep_perm_inject [symmetric])
1062
+ − 145
2560
+ − 146
instance perm :: size ..
1062
+ − 147
+ − 148
subsection {* Permutations form a group *}
+ − 149
+ − 150
instantiation perm :: group_add
+ − 151
begin
+ − 152
+ − 153
definition
+ − 154
"0 = Abs_perm id"
+ − 155
+ − 156
definition
+ − 157
"- p = Abs_perm (inv (Rep_perm p))"
+ − 158
+ − 159
definition
+ − 160
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)"
+ − 161
+ − 162
definition
+ − 163
"(p1::perm) - p2 = p1 + - p2"
+ − 164
+ − 165
lemma Rep_perm_0: "Rep_perm 0 = id"
+ − 166
unfolding zero_perm_def
+ − 167
by (simp add: Abs_perm_inverse perm_id)
+ − 168
+ − 169
lemma Rep_perm_add:
+ − 170
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2"
+ − 171
unfolding plus_perm_def
+ − 172
by (simp add: Abs_perm_inverse perm_comp Rep_perm)
+ − 173
+ − 174
lemma Rep_perm_uminus:
+ − 175
"Rep_perm (- p) = inv (Rep_perm p)"
+ − 176
unfolding uminus_perm_def
+ − 177
by (simp add: Abs_perm_inverse perm_inv Rep_perm)
+ − 178
+ − 179
instance
+ − 180
apply default
+ − 181
unfolding Rep_perm_inject [symmetric]
+ − 182
unfolding minus_perm_def
+ − 183
unfolding Rep_perm_add
+ − 184
unfolding Rep_perm_uminus
+ − 185
unfolding Rep_perm_0
+ − 186
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]])
+ − 187
+ − 188
end
+ − 189
+ − 190
+ − 191
section {* Implementation of swappings *}
+ − 192
+ − 193
definition
+ − 194
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')")
+ − 195
where
+ − 196
"(a \<rightleftharpoons> b) =
+ − 197
Abs_perm (if sort_of a = sort_of b
+ − 198
then (\<lambda>c. if a = c then b else if b = c then a else c)
+ − 199
else id)"
+ − 200
+ − 201
lemma Rep_perm_swap:
+ − 202
"Rep_perm (a \<rightleftharpoons> b) =
+ − 203
(if sort_of a = sort_of b
+ − 204
then (\<lambda>c. if a = c then b else if b = c then a else c)
+ − 205
else id)"
+ − 206
unfolding swap_def
+ − 207
apply (rule Abs_perm_inverse)
+ − 208
apply (rule permI)
+ − 209
apply (auto simp add: bij_def inj_on_def surj_def)[1]
+ − 210
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]])
+ − 211
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]])
+ − 212
apply (simp)
+ − 213
apply (simp)
+ − 214
done
+ − 215
+ − 216
lemmas Rep_perm_simps =
+ − 217
Rep_perm_0
+ − 218
Rep_perm_add
+ − 219
Rep_perm_uminus
+ − 220
Rep_perm_swap
+ − 221
+ − 222
lemma swap_different_sorts [simp]:
+ − 223
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0"
+ − 224
by (rule Rep_perm_ext) (simp add: Rep_perm_simps)
+ − 225
+ − 226
lemma swap_cancel:
+ − 227
"(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0"
1879
+ − 228
by (rule Rep_perm_ext)
2479
+ − 229
(simp add: Rep_perm_simps fun_eq_iff)
1062
+ − 230
+ − 231
lemma swap_self [simp]:
+ − 232
"(a \<rightleftharpoons> a) = 0"
2479
+ − 233
by (rule Rep_perm_ext, simp add: Rep_perm_simps fun_eq_iff)
1062
+ − 234
+ − 235
lemma minus_swap [simp]:
+ − 236
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)"
+ − 237
by (rule minus_unique [OF swap_cancel])
+ − 238
+ − 239
lemma swap_commute:
+ − 240
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)"
+ − 241
by (rule Rep_perm_ext)
2479
+ − 242
(simp add: Rep_perm_swap fun_eq_iff)
1062
+ − 243
+ − 244
lemma swap_triple:
+ − 245
assumes "a \<noteq> b" and "c \<noteq> b"
+ − 246
assumes "sort_of a = sort_of b" "sort_of b = sort_of c"
+ − 247
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
+ − 248
using assms
+ − 249
by (rule_tac Rep_perm_ext)
2479
+ − 250
(auto simp add: Rep_perm_simps fun_eq_iff)
1062
+ − 251
+ − 252
+ − 253
section {* Permutation Types *}
+ − 254
+ − 255
text {*
+ − 256
Infix syntax for @{text permute} has higher precedence than
+ − 257
addition, but lower than unary minus.
+ − 258
*}
+ − 259
+ − 260
class pt =
+ − 261
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75)
+ − 262
assumes permute_zero [simp]: "0 \<bullet> x = x"
+ − 263
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)"
+ − 264
begin
+ − 265
+ − 266
lemma permute_diff [simp]:
+ − 267
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x"
+ − 268
unfolding diff_minus by simp
+ − 269
+ − 270
lemma permute_minus_cancel [simp]:
+ − 271
shows "p \<bullet> - p \<bullet> x = x"
+ − 272
and "- p \<bullet> p \<bullet> x = x"
+ − 273
unfolding permute_plus [symmetric] by simp_all
+ − 274
+ − 275
lemma permute_swap_cancel [simp]:
+ − 276
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x"
+ − 277
unfolding permute_plus [symmetric]
+ − 278
by (simp add: swap_cancel)
+ − 279
+ − 280
lemma permute_swap_cancel2 [simp]:
+ − 281
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x"
+ − 282
unfolding permute_plus [symmetric]
+ − 283
by (simp add: swap_commute)
+ − 284
+ − 285
lemma inj_permute [simp]:
+ − 286
shows "inj (permute p)"
+ − 287
by (rule inj_on_inverseI)
+ − 288
(rule permute_minus_cancel)
+ − 289
+ − 290
lemma surj_permute [simp]:
+ − 291
shows "surj (permute p)"
+ − 292
by (rule surjI, rule permute_minus_cancel)
+ − 293
+ − 294
lemma bij_permute [simp]:
+ − 295
shows "bij (permute p)"
+ − 296
by (rule bijI [OF inj_permute surj_permute])
+ − 297
+ − 298
lemma inv_permute:
+ − 299
shows "inv (permute p) = permute (- p)"
+ − 300
by (rule inv_equality) (simp_all)
+ − 301
+ − 302
lemma permute_minus:
+ − 303
shows "permute (- p) = inv (permute p)"
+ − 304
by (simp add: inv_permute)
+ − 305
+ − 306
lemma permute_eq_iff [simp]:
+ − 307
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y"
+ − 308
by (rule inj_permute [THEN inj_eq])
+ − 309
+ − 310
end
+ − 311
+ − 312
subsection {* Permutations for atoms *}
+ − 313
+ − 314
instantiation atom :: pt
+ − 315
begin
+ − 316
+ − 317
definition
1879
+ − 318
"p \<bullet> a = (Rep_perm p) a"
1062
+ − 319
+ − 320
instance
+ − 321
apply(default)
+ − 322
apply(simp_all add: permute_atom_def Rep_perm_simps)
+ − 323
done
+ − 324
+ − 325
end
+ − 326
+ − 327
lemma sort_of_permute [simp]:
+ − 328
shows "sort_of (p \<bullet> a) = sort_of a"
+ − 329
unfolding permute_atom_def by (rule sort_of_Rep_perm)
+ − 330
+ − 331
lemma swap_atom:
+ − 332
shows "(a \<rightleftharpoons> b) \<bullet> c =
+ − 333
(if sort_of a = sort_of b
+ − 334
then (if c = a then b else if c = b then a else c) else c)"
+ − 335
unfolding permute_atom_def
+ − 336
by (simp add: Rep_perm_swap)
+ − 337
+ − 338
lemma swap_atom_simps [simp]:
+ − 339
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b"
+ − 340
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a"
+ − 341
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c"
+ − 342
unfolding swap_atom by simp_all
+ − 343
+ − 344
lemma expand_perm_eq:
+ − 345
fixes p q :: "perm"
+ − 346
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)"
+ − 347
unfolding permute_atom_def
+ − 348
by (metis Rep_perm_ext ext)
+ − 349
+ − 350
+ − 351
subsection {* Permutations for permutations *}
+ − 352
+ − 353
instantiation perm :: pt
+ − 354
begin
+ − 355
+ − 356
definition
+ − 357
"p \<bullet> q = p + q - p"
+ − 358
+ − 359
instance
+ − 360
apply default
+ − 361
apply (simp add: permute_perm_def)
+ − 362
apply (simp add: permute_perm_def diff_minus minus_add add_assoc)
+ − 363
done
+ − 364
+ − 365
end
+ − 366
1879
+ − 367
lemma permute_self:
+ − 368
shows "p \<bullet> p = p"
+ − 369
unfolding permute_perm_def
+ − 370
by (simp add: diff_minus add_assoc)
1062
+ − 371
+ − 372
lemma permute_eqvt:
+ − 373
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)"
+ − 374
unfolding permute_perm_def by simp
+ − 375
+ − 376
lemma zero_perm_eqvt:
+ − 377
shows "p \<bullet> (0::perm) = 0"
+ − 378
unfolding permute_perm_def by simp
+ − 379
+ − 380
lemma add_perm_eqvt:
+ − 381
fixes p p1 p2 :: perm
+ − 382
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2"
+ − 383
unfolding permute_perm_def
+ − 384
by (simp add: expand_perm_eq)
+ − 385
+ − 386
lemma swap_eqvt:
+ − 387
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)"
+ − 388
unfolding permute_perm_def
+ − 389
by (auto simp add: swap_atom expand_perm_eq)
+ − 390
2310
+ − 391
lemma uminus_eqvt:
+ − 392
fixes p q::"perm"
+ − 393
shows "p \<bullet> (- q) = - (p \<bullet> q)"
+ − 394
unfolding permute_perm_def
+ − 395
by (simp add: diff_minus minus_add add_assoc)
1062
+ − 396
+ − 397
subsection {* Permutations for functions *}
+ − 398
+ − 399
instantiation "fun" :: (pt, pt) pt
+ − 400
begin
+ − 401
+ − 402
definition
+ − 403
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"
+ − 404
+ − 405
instance
+ − 406
apply default
+ − 407
apply (simp add: permute_fun_def)
+ − 408
apply (simp add: permute_fun_def minus_add)
+ − 409
done
+ − 410
+ − 411
end
+ − 412
+ − 413
lemma permute_fun_app_eq:
+ − 414
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)"
1879
+ − 415
unfolding permute_fun_def by simp
1062
+ − 416
+ − 417
subsection {* Permutations for booleans *}
+ − 418
+ − 419
instantiation bool :: pt
+ − 420
begin
+ − 421
+ − 422
definition "p \<bullet> (b::bool) = b"
+ − 423
+ − 424
instance
+ − 425
apply(default)
+ − 426
apply(simp_all add: permute_bool_def)
+ − 427
done
+ − 428
+ − 429
end
+ − 430
+ − 431
lemma Not_eqvt:
+ − 432
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))"
+ − 433
by (simp add: permute_bool_def)
+ − 434
2466
+ − 435
lemma conj_eqvt:
+ − 436
shows "p \<bullet> (A \<and> B) = ((p \<bullet> A) \<and> (p \<bullet> B))"
+ − 437
by (simp add: permute_bool_def)
+ − 438
+ − 439
lemma imp_eqvt:
+ − 440
shows "p \<bullet> (A \<longrightarrow> B) = ((p \<bullet> A) \<longrightarrow> (p \<bullet> B))"
+ − 441
by (simp add: permute_bool_def)
+ − 442
+ − 443
lemma ex_eqvt:
+ − 444
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)"
+ − 445
unfolding permute_fun_def permute_bool_def
+ − 446
by (auto, rule_tac x="p \<bullet> x" in exI, simp)
+ − 447
2470
+ − 448
lemma all_eqvt:
+ − 449
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)"
+ − 450
unfolding permute_fun_def permute_bool_def
+ − 451
by (auto, drule_tac x="p \<bullet> x" in spec, simp)
+ − 452
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 453
lemma permute_boolE:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 454
fixes P::"bool"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 455
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
+ − 456
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
+ − 457
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 458
lemma permute_boolI:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 459
fixes P::"bool"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 460
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
+ − 461
by(simp add: permute_bool_def)
1062
+ − 462
+ − 463
subsection {* Permutations for sets *}
+ − 464
+ − 465
lemma permute_set_eq:
+ − 466
fixes x::"'a::pt"
+ − 467
and p::"perm"
+ − 468
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}"
1879
+ − 469
unfolding permute_fun_def
+ − 470
unfolding permute_bool_def
+ − 471
apply(auto simp add: mem_def)
1062
+ − 472
apply(rule_tac x="- p \<bullet> x" in exI)
+ − 473
apply(simp)
+ − 474
done
+ − 475
+ − 476
lemma permute_set_eq_image:
+ − 477
shows "p \<bullet> X = permute p ` X"
1879
+ − 478
unfolding permute_set_eq by auto
1062
+ − 479
+ − 480
lemma permute_set_eq_vimage:
+ − 481
shows "p \<bullet> X = permute (- p) -` X"
1879
+ − 482
unfolding permute_fun_def permute_bool_def
+ − 483
unfolding vimage_def Collect_def mem_def ..
1062
+ − 484
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 485
lemma permute_finite [simp]:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 486
shows "finite (p \<bullet> X) = finite X"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 487
apply(simp add: permute_set_eq_image)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 488
apply(rule iffI)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 489
apply(drule finite_imageD)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 490
using inj_permute[where p="p"]
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 491
apply(simp add: inj_on_def)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 492
apply(assumption)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 493
apply(rule finite_imageI)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 494
apply(assumption)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 495
done
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 496
1062
+ − 497
lemma swap_set_not_in:
+ − 498
assumes a: "a \<notin> S" "b \<notin> S"
+ − 499
shows "(a \<rightleftharpoons> b) \<bullet> S = S"
1879
+ − 500
unfolding permute_set_eq
+ − 501
using a by (auto simp add: swap_atom)
1062
+ − 502
+ − 503
lemma swap_set_in:
+ − 504
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b"
+ − 505
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S"
1879
+ − 506
unfolding permute_set_eq
+ − 507
using a by (auto simp add: swap_atom)
1062
+ − 508
2470
+ − 509
lemma mem_permute_iff:
+ − 510
shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X"
+ − 511
unfolding mem_def permute_fun_def permute_bool_def
+ − 512
by simp
+ − 513
+ − 514
lemma mem_eqvt:
+ − 515
shows "p \<bullet> (x \<in> A) \<longleftrightarrow> (p \<bullet> x) \<in> (p \<bullet> A)"
+ − 516
unfolding mem_def
+ − 517
by (simp add: permute_fun_app_eq)
+ − 518
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 519
lemma empty_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 520
shows "p \<bullet> {} = {}"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 521
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
+ − 522
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
+ − 523
2470
+ − 524
lemma insert_eqvt:
+ − 525
shows "p \<bullet> (insert x A) = insert (p \<bullet> x) (p \<bullet> A)"
+ − 526
unfolding permute_set_eq_image image_insert ..
+ − 527
+ − 528
1062
+ − 529
subsection {* Permutations for units *}
+ − 530
+ − 531
instantiation unit :: pt
+ − 532
begin
+ − 533
+ − 534
definition "p \<bullet> (u::unit) = u"
+ − 535
1879
+ − 536
instance
+ − 537
by (default) (simp_all add: permute_unit_def)
1062
+ − 538
+ − 539
end
+ − 540
+ − 541
+ − 542
subsection {* Permutations for products *}
+ − 543
2378
+ − 544
instantiation prod :: (pt, pt) pt
1062
+ − 545
begin
+ − 546
+ − 547
primrec
+ − 548
permute_prod
+ − 549
where
+ − 550
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"
+ − 551
+ − 552
instance
+ − 553
by default auto
+ − 554
+ − 555
end
+ − 556
+ − 557
subsection {* Permutations for sums *}
+ − 558
2378
+ − 559
instantiation sum :: (pt, pt) pt
1062
+ − 560
begin
+ − 561
+ − 562
primrec
+ − 563
permute_sum
+ − 564
where
+ − 565
"p \<bullet> (Inl x) = Inl (p \<bullet> x)"
+ − 566
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)"
+ − 567
1879
+ − 568
instance
+ − 569
by (default) (case_tac [!] x, simp_all)
1062
+ − 570
+ − 571
end
+ − 572
+ − 573
subsection {* Permutations for lists *}
+ − 574
+ − 575
instantiation list :: (pt) pt
+ − 576
begin
+ − 577
+ − 578
primrec
+ − 579
permute_list
+ − 580
where
+ − 581
"p \<bullet> [] = []"
+ − 582
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"
+ − 583
1879
+ − 584
instance
+ − 585
by (default) (induct_tac [!] x, simp_all)
1062
+ − 586
+ − 587
end
+ − 588
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 589
lemma set_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 590
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
+ − 591
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
+ − 592
1062
+ − 593
subsection {* Permutations for options *}
+ − 594
+ − 595
instantiation option :: (pt) pt
+ − 596
begin
+ − 597
+ − 598
primrec
+ − 599
permute_option
+ − 600
where
+ − 601
"p \<bullet> None = None"
+ − 602
| "p \<bullet> (Some x) = Some (p \<bullet> x)"
+ − 603
1879
+ − 604
instance
+ − 605
by (default) (induct_tac [!] x, simp_all)
1062
+ − 606
+ − 607
end
+ − 608
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 609
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 610
subsection {* Permutations for fsets *}
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 611
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 612
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
+ − 613
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
+ − 614
unfolding fun_rel_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 615
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
+ − 616
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 617
instantiation fset :: (pt) pt
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 618
begin
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 619
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 620
quotient_definition
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 621
"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
+ − 622
is
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 623
"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
+ − 624
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 625
instance
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 626
proof
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 627
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
+ − 628
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
+ − 629
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
+ − 630
qed
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 631
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 632
end
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 633
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 634
lemma permute_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 635
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
+ − 636
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
+ − 637
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
+ − 638
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
+ − 639
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 640
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 641
1062
+ − 642
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *}
+ − 643
+ − 644
instantiation char :: pt
+ − 645
begin
+ − 646
+ − 647
definition "p \<bullet> (c::char) = c"
+ − 648
1879
+ − 649
instance
+ − 650
by (default) (simp_all add: permute_char_def)
1062
+ − 651
+ − 652
end
+ − 653
+ − 654
instantiation nat :: pt
+ − 655
begin
+ − 656
+ − 657
definition "p \<bullet> (n::nat) = n"
+ − 658
1879
+ − 659
instance
+ − 660
by (default) (simp_all add: permute_nat_def)
1062
+ − 661
+ − 662
end
+ − 663
+ − 664
instantiation int :: pt
+ − 665
begin
+ − 666
+ − 667
definition "p \<bullet> (i::int) = i"
+ − 668
1879
+ − 669
instance
+ − 670
by (default) (simp_all add: permute_int_def)
1062
+ − 671
+ − 672
end
+ − 673
+ − 674
+ − 675
section {* Pure types *}
+ − 676
+ − 677
text {* Pure types will have always empty support. *}
+ − 678
+ − 679
class pure = pt +
+ − 680
assumes permute_pure: "p \<bullet> x = x"
+ − 681
+ − 682
text {* Types @{typ unit} and @{typ bool} are pure. *}
+ − 683
+ − 684
instance unit :: pure
+ − 685
proof qed (rule permute_unit_def)
+ − 686
+ − 687
instance bool :: pure
+ − 688
proof qed (rule permute_bool_def)
+ − 689
+ − 690
text {* Other type constructors preserve purity. *}
+ − 691
+ − 692
instance "fun" :: (pure, pure) pure
+ − 693
by default (simp add: permute_fun_def permute_pure)
+ − 694
2378
+ − 695
instance prod :: (pure, pure) pure
1062
+ − 696
by default (induct_tac x, simp add: permute_pure)
+ − 697
2378
+ − 698
instance sum :: (pure, pure) pure
1062
+ − 699
by default (induct_tac x, simp_all add: permute_pure)
+ − 700
+ − 701
instance list :: (pure) pure
+ − 702
by default (induct_tac x, simp_all add: permute_pure)
+ − 703
+ − 704
instance option :: (pure) pure
+ − 705
by default (induct_tac x, simp_all add: permute_pure)
+ − 706
+ − 707
+ − 708
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
+ − 709
+ − 710
instance char :: pure
+ − 711
proof qed (rule permute_char_def)
+ − 712
+ − 713
instance nat :: pure
+ − 714
proof qed (rule permute_nat_def)
+ − 715
+ − 716
instance int :: pure
+ − 717
proof qed (rule permute_int_def)
+ − 718
+ − 719
+ − 720
subsection {* Supp, Freshness and Supports *}
+ − 721
+ − 722
context pt
+ − 723
begin
+ − 724
+ − 725
definition
+ − 726
supp :: "'a \<Rightarrow> atom set"
+ − 727
where
+ − 728
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}"
+ − 729
+ − 730
end
+ − 731
+ − 732
definition
+ − 733
fresh :: "atom \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55)
+ − 734
where
+ − 735
"a \<sharp> x \<equiv> a \<notin> supp x"
+ − 736
+ − 737
lemma supp_conv_fresh:
+ − 738
shows "supp x = {a. \<not> a \<sharp> x}"
+ − 739
unfolding fresh_def by simp
+ − 740
+ − 741
lemma swap_rel_trans:
+ − 742
assumes "sort_of a = sort_of b"
+ − 743
assumes "sort_of b = sort_of c"
+ − 744
assumes "(a \<rightleftharpoons> c) \<bullet> x = x"
+ − 745
assumes "(b \<rightleftharpoons> c) \<bullet> x = x"
+ − 746
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 747
proof (cases)
+ − 748
assume "a = b \<or> c = b"
+ − 749
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto
+ − 750
next
+ − 751
assume *: "\<not> (a = b \<or> c = b)"
+ − 752
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x"
+ − 753
using assms by simp
+ − 754
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
+ − 755
using assms * by (simp add: swap_triple)
+ − 756
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" .
+ − 757
qed
+ − 758
+ − 759
lemma swap_fresh_fresh:
+ − 760
assumes a: "a \<sharp> x"
+ − 761
and b: "b \<sharp> x"
+ − 762
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 763
proof (cases)
+ − 764
assume asm: "sort_of a = sort_of b"
+ − 765
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}"
+ − 766
using a b unfolding fresh_def supp_def by simp_all
+ − 767
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp
+ − 768
then obtain c
+ − 769
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b"
+ − 770
by (rule obtain_atom) (auto)
+ − 771
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all)
+ − 772
next
+ − 773
assume "sort_of a \<noteq> sort_of b"
+ − 774
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp
+ − 775
qed
+ − 776
+ − 777
+ − 778
subsection {* supp and fresh are equivariant *}
+ − 779
+ − 780
lemma finite_Collect_bij:
+ − 781
assumes a: "bij f"
+ − 782
shows "finite {x. P (f x)} = finite {x. P x}"
+ − 783
by (metis a finite_vimage_iff vimage_Collect_eq)
+ − 784
+ − 785
lemma fresh_permute_iff:
+ − 786
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x"
+ − 787
proof -
+ − 788
have "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
+ − 789
unfolding fresh_def supp_def by simp
+ − 790
also have "\<dots> \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> p \<bullet> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
1879
+ − 791
using bij_permute by (rule finite_Collect_bij[symmetric])
1062
+ − 792
also have "\<dots> \<longleftrightarrow> finite {b. p \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> p \<bullet> x}"
+ − 793
by (simp only: permute_eqvt [of p] swap_eqvt)
+ − 794
also have "\<dots> \<longleftrightarrow> finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}"
+ − 795
by (simp only: permute_eq_iff)
+ − 796
also have "\<dots> \<longleftrightarrow> a \<sharp> x"
+ − 797
unfolding fresh_def supp_def by simp
1879
+ − 798
finally show "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" .
1062
+ − 799
qed
+ − 800
+ − 801
lemma fresh_eqvt:
+ − 802
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)"
1879
+ − 803
unfolding permute_bool_def
+ − 804
by (simp add: fresh_permute_iff)
1062
+ − 805
+ − 806
lemma supp_eqvt:
+ − 807
fixes p :: "perm"
+ − 808
and x :: "'a::pt"
+ − 809
shows "p \<bullet> (supp x) = supp (p \<bullet> x)"
+ − 810
unfolding supp_conv_fresh
1879
+ − 811
unfolding Collect_def
+ − 812
unfolding permute_fun_def
1062
+ − 813
by (simp add: Not_eqvt fresh_eqvt)
+ − 814
+ − 815
subsection {* supports *}
+ − 816
+ − 817
definition
+ − 818
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80)
+ − 819
where
+ − 820
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)"
+ − 821
+ − 822
lemma supp_is_subset:
+ − 823
fixes S :: "atom set"
+ − 824
and x :: "'a::pt"
+ − 825
assumes a1: "S supports x"
+ − 826
and a2: "finite S"
+ − 827
shows "(supp x) \<subseteq> S"
+ − 828
proof (rule ccontr)
1879
+ − 829
assume "\<not> (supp x \<subseteq> S)"
1062
+ − 830
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto
1879
+ − 831
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" unfolding supports_def by auto
+ − 832
then have "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto
1062
+ − 833
with a2 have "finite {b. (a \<rightleftharpoons> b)\<bullet>x \<noteq> x}" by (simp add: finite_subset)
+ − 834
then have "a \<notin> (supp x)" unfolding supp_def by simp
+ − 835
with b1 show False by simp
+ − 836
qed
+ − 837
+ − 838
lemma supports_finite:
+ − 839
fixes S :: "atom set"
+ − 840
and x :: "'a::pt"
+ − 841
assumes a1: "S supports x"
+ − 842
and a2: "finite S"
+ − 843
shows "finite (supp x)"
+ − 844
proof -
+ − 845
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
+ − 846
then show "finite (supp x)" using a2 by (simp add: finite_subset)
+ − 847
qed
+ − 848
+ − 849
lemma supp_supports:
+ − 850
fixes x :: "'a::pt"
+ − 851
shows "(supp x) supports x"
1879
+ − 852
unfolding supports_def
+ − 853
proof (intro strip)
1062
+ − 854
fix a b
+ − 855
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)"
+ − 856
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def)
1879
+ − 857
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
1062
+ − 858
qed
+ − 859
+ − 860
lemma supp_is_least_supports:
+ − 861
fixes S :: "atom set"
+ − 862
and x :: "'a::pt"
+ − 863
assumes a1: "S supports x"
+ − 864
and a2: "finite S"
+ − 865
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'"
+ − 866
shows "(supp x) = S"
+ − 867
proof (rule equalityI)
+ − 868
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
+ − 869
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset)
+ − 870
have "(supp x) supports x" by (rule supp_supports)
+ − 871
with fin a3 show "S \<subseteq> supp x" by blast
+ − 872
qed
+ − 873
+ − 874
lemma subsetCI:
+ − 875
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B"
+ − 876
by auto
+ − 877
+ − 878
lemma finite_supp_unique:
+ − 879
assumes a1: "S supports x"
+ − 880
assumes a2: "finite S"
+ − 881
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"
+ − 882
shows "(supp x) = S"
+ − 883
using a1 a2
+ − 884
proof (rule supp_is_least_supports)
+ − 885
fix S'
+ − 886
assume "finite S'" and "S' supports x"
+ − 887
show "S \<subseteq> S'"
+ − 888
proof (rule subsetCI)
+ − 889
fix a
+ − 890
assume "a \<in> S" and "a \<notin> S'"
+ − 891
have "finite (S \<union> S')"
+ − 892
using `finite S` `finite S'` by simp
+ − 893
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a"
+ − 894
by (rule obtain_atom)
+ − 895
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b"
+ − 896
by simp_all
+ − 897
then have "(a \<rightleftharpoons> b) \<bullet> x = x"
+ − 898
using `a \<notin> S'` `S' supports x` by (simp add: supports_def)
+ − 899
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"
+ − 900
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b`
+ − 901
by (rule a3)
+ − 902
ultimately show "False" by simp
+ − 903
qed
+ − 904
qed
+ − 905
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
+ − 906
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
+ − 907
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
+ − 908
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
+ − 909
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
+ − 910
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
+ − 911
*}
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
+ − 912
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
+ − 913
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
+ − 914
"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
+ − 915
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
+ − 916
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
+ − 917
1062
+ − 918
section {* Finitely-supported types *}
+ − 919
+ − 920
class fs = pt +
+ − 921
assumes finite_supp: "finite (supp x)"
+ − 922
+ − 923
lemma pure_supp:
+ − 924
shows "supp (x::'a::pure) = {}"
+ − 925
unfolding supp_def by (simp add: permute_pure)
+ − 926
+ − 927
lemma pure_fresh:
+ − 928
fixes x::"'a::pure"
+ − 929
shows "a \<sharp> x"
+ − 930
unfolding fresh_def by (simp add: pure_supp)
+ − 931
+ − 932
instance pure < fs
+ − 933
by default (simp add: pure_supp)
+ − 934
+ − 935
+ − 936
subsection {* Type @{typ atom} is finitely-supported. *}
+ − 937
+ − 938
lemma supp_atom:
+ − 939
shows "supp a = {a}"
+ − 940
apply (rule finite_supp_unique)
+ − 941
apply (clarsimp simp add: supports_def)
+ − 942
apply simp
+ − 943
apply simp
+ − 944
done
+ − 945
+ − 946
lemma fresh_atom:
+ − 947
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"
+ − 948
unfolding fresh_def supp_atom by simp
+ − 949
+ − 950
instance atom :: fs
+ − 951
by default (simp add: supp_atom)
+ − 952
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
+ − 953
section {* Support for finite sets of atoms *}
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
+ − 954
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
+ − 955
lemma supp_finite_atom_set:
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
+ − 956
fixes S::"atom set"
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
+ − 957
assumes "finite S"
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
+ − 958
shows "supp S = S"
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
+ − 959
apply(rule finite_supp_unique)
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
+ − 960
apply(simp add: supports_def)
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
+ − 961
apply(simp add: swap_set_not_in)
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
+ − 962
apply(rule assms)
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
+ − 963
apply(simp add: swap_set_in)
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
+ − 964
done
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
+ − 965
1062
+ − 966
section {* Type @{typ perm} is finitely-supported. *}
+ − 967
+ − 968
lemma perm_swap_eq:
+ − 969
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)"
+ − 970
unfolding permute_perm_def
+ − 971
by (metis add_diff_cancel minus_perm_def)
+ − 972
+ − 973
lemma supports_perm:
+ − 974
shows "{a. p \<bullet> a \<noteq> a} supports p"
+ − 975
unfolding supports_def
1879
+ − 976
unfolding perm_swap_eq
+ − 977
by (simp add: swap_eqvt)
1062
+ − 978
+ − 979
lemma finite_perm_lemma:
+ − 980
shows "finite {a::atom. p \<bullet> a \<noteq> a}"
+ − 981
using finite_Rep_perm [of p]
+ − 982
unfolding permute_atom_def .
+ − 983
+ − 984
lemma supp_perm:
+ − 985
shows "supp p = {a. p \<bullet> a \<noteq> a}"
+ − 986
apply (rule finite_supp_unique)
+ − 987
apply (rule supports_perm)
+ − 988
apply (rule finite_perm_lemma)
+ − 989
apply (simp add: perm_swap_eq swap_eqvt)
+ − 990
apply (auto simp add: expand_perm_eq swap_atom)
+ − 991
done
+ − 992
+ − 993
lemma fresh_perm:
+ − 994
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a"
1879
+ − 995
unfolding fresh_def
+ − 996
by (simp add: supp_perm)
1062
+ − 997
+ − 998
lemma supp_swap:
+ − 999
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})"
+ − 1000
by (auto simp add: supp_perm swap_atom)
+ − 1001
+ − 1002
lemma fresh_zero_perm:
+ − 1003
shows "a \<sharp> (0::perm)"
+ − 1004
unfolding fresh_perm by simp
+ − 1005
+ − 1006
lemma supp_zero_perm:
+ − 1007
shows "supp (0::perm) = {}"
+ − 1008
unfolding supp_perm by simp
+ − 1009
1087
+ − 1010
lemma fresh_plus_perm:
+ − 1011
fixes p q::perm
+ − 1012
assumes "a \<sharp> p" "a \<sharp> q"
+ − 1013
shows "a \<sharp> (p + q)"
+ − 1014
using assms
+ − 1015
unfolding fresh_def
+ − 1016
by (auto simp add: supp_perm)
+ − 1017
1062
+ − 1018
lemma supp_plus_perm:
+ − 1019
fixes p q::perm
+ − 1020
shows "supp (p + q) \<subseteq> supp p \<union> supp q"
+ − 1021
by (auto simp add: supp_perm)
+ − 1022
1087
+ − 1023
lemma fresh_minus_perm:
+ − 1024
fixes p::perm
+ − 1025
shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p"
+ − 1026
unfolding fresh_def
1879
+ − 1027
unfolding supp_perm
+ − 1028
apply(simp)
+ − 1029
apply(metis permute_minus_cancel)
1087
+ − 1030
done
+ − 1031
1062
+ − 1032
lemma supp_minus_perm:
+ − 1033
fixes p::perm
+ − 1034
shows "supp (- p) = supp p"
1087
+ − 1035
unfolding supp_conv_fresh
+ − 1036
by (simp add: fresh_minus_perm)
1062
+ − 1037
+ − 1038
instance perm :: fs
+ − 1039
by default (simp add: supp_perm finite_perm_lemma)
+ − 1040
1305
+ − 1041
lemma plus_perm_eq:
+ − 1042
fixes p q::"perm"
1879
+ − 1043
assumes asm: "supp p \<inter> supp q = {}"
1305
+ − 1044
shows "p + q = q + p"
+ − 1045
unfolding expand_perm_eq
+ − 1046
proof
+ − 1047
fix a::"atom"
+ − 1048
show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1049
proof -
+ − 1050
{ assume "a \<notin> supp p" "a \<notin> supp q"
+ − 1051
then have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1052
by (simp add: supp_perm)
+ − 1053
}
+ − 1054
moreover
+ − 1055
{ assume a: "a \<in> supp p" "a \<notin> supp q"
+ − 1056
then have "p \<bullet> a \<in> supp p" by (simp add: supp_perm)
+ − 1057
then have "p \<bullet> a \<notin> supp q" using asm by auto
+ − 1058
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1059
by (simp add: supp_perm)
+ − 1060
}
+ − 1061
moreover
+ − 1062
{ assume a: "a \<notin> supp p" "a \<in> supp q"
+ − 1063
then have "q \<bullet> a \<in> supp q" by (simp add: supp_perm)
+ − 1064
then have "q \<bullet> a \<notin> supp p" using asm by auto
+ − 1065
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1066
by (simp add: supp_perm)
+ − 1067
}
+ − 1068
ultimately show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1069
using asm by blast
+ − 1070
qed
+ − 1071
qed
1062
+ − 1072
2614
+ − 1073
lemma supp_plus_perm_eq:
+ − 1074
fixes p q::perm
+ − 1075
assumes asm: "supp p \<inter> supp q = {}"
+ − 1076
shows "supp (p + q) = supp p \<union> supp q"
+ − 1077
proof -
+ − 1078
{ fix a::"atom"
+ − 1079
assume "a \<in> supp p"
+ − 1080
then have "a \<notin> supp q" using asm by auto
+ − 1081
then have "a \<in> supp (p + q)" using `a \<in> supp p`
+ − 1082
by (simp add: supp_perm)
+ − 1083
}
+ − 1084
moreover
+ − 1085
{ fix a::"atom"
+ − 1086
assume "a \<in> supp q"
+ − 1087
then have "a \<notin> supp p" using asm by auto
+ − 1088
then have "a \<in> supp (q + p)" using `a \<in> supp q`
+ − 1089
by (simp add: supp_perm)
+ − 1090
then have "a \<in> supp (p + q)" using asm plus_perm_eq
+ − 1091
by metis
+ − 1092
}
+ − 1093
ultimately have "supp p \<union> supp q \<subseteq> supp (p + q)"
+ − 1094
by blast
+ − 1095
then show "supp (p + q) = supp p \<union> supp q" using supp_plus_perm
+ − 1096
by blast
+ − 1097
qed
+ − 1098
+ − 1099
1062
+ − 1100
section {* Finite Support instances for other types *}
+ − 1101
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1102
1062
+ − 1103
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *}
+ − 1104
+ − 1105
lemma supp_Pair:
+ − 1106
shows "supp (x, y) = supp x \<union> supp y"
+ − 1107
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1108
+ − 1109
lemma fresh_Pair:
+ − 1110
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y"
+ − 1111
by (simp add: fresh_def supp_Pair)
+ − 1112
2470
+ − 1113
lemma supp_Unit:
+ − 1114
shows "supp () = {}"
+ − 1115
by (simp add: supp_def)
+ − 1116
+ − 1117
lemma fresh_Unit:
+ − 1118
shows "a \<sharp> ()"
+ − 1119
by (simp add: fresh_def supp_Unit)
+ − 1120
2378
+ − 1121
instance prod :: (fs, fs) fs
1062
+ − 1122
apply default
+ − 1123
apply (induct_tac x)
+ − 1124
apply (simp add: supp_Pair finite_supp)
+ − 1125
done
+ − 1126
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1127
1062
+ − 1128
subsection {* Type @{typ "'a + 'b"} is finitely supported *}
+ − 1129
+ − 1130
lemma supp_Inl:
+ − 1131
shows "supp (Inl x) = supp x"
+ − 1132
by (simp add: supp_def)
+ − 1133
+ − 1134
lemma supp_Inr:
+ − 1135
shows "supp (Inr x) = supp x"
+ − 1136
by (simp add: supp_def)
+ − 1137
+ − 1138
lemma fresh_Inl:
+ − 1139
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x"
+ − 1140
by (simp add: fresh_def supp_Inl)
+ − 1141
+ − 1142
lemma fresh_Inr:
+ − 1143
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
+ − 1144
by (simp add: fresh_def supp_Inr)
+ − 1145
2378
+ − 1146
instance sum :: (fs, fs) fs
1062
+ − 1147
apply default
+ − 1148
apply (induct_tac x)
+ − 1149
apply (simp_all add: supp_Inl supp_Inr finite_supp)
+ − 1150
done
+ − 1151
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1152
1062
+ − 1153
subsection {* Type @{typ "'a option"} is finitely supported *}
+ − 1154
+ − 1155
lemma supp_None:
+ − 1156
shows "supp None = {}"
+ − 1157
by (simp add: supp_def)
+ − 1158
+ − 1159
lemma supp_Some:
+ − 1160
shows "supp (Some x) = supp x"
+ − 1161
by (simp add: supp_def)
+ − 1162
+ − 1163
lemma fresh_None:
+ − 1164
shows "a \<sharp> None"
+ − 1165
by (simp add: fresh_def supp_None)
+ − 1166
+ − 1167
lemma fresh_Some:
+ − 1168
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
+ − 1169
by (simp add: fresh_def supp_Some)
+ − 1170
+ − 1171
instance option :: (fs) fs
+ − 1172
apply default
+ − 1173
apply (induct_tac x)
+ − 1174
apply (simp_all add: supp_None supp_Some finite_supp)
+ − 1175
done
+ − 1176
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1177
1062
+ − 1178
subsubsection {* Type @{typ "'a list"} is finitely supported *}
+ − 1179
+ − 1180
lemma supp_Nil:
+ − 1181
shows "supp [] = {}"
+ − 1182
by (simp add: supp_def)
+ − 1183
+ − 1184
lemma supp_Cons:
+ − 1185
shows "supp (x # xs) = supp x \<union> supp xs"
+ − 1186
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1187
2591
+ − 1188
lemma supp_append:
+ − 1189
shows "supp (xs @ ys) = supp xs \<union> supp ys"
+ − 1190
by (induct xs) (auto simp add: supp_Nil supp_Cons)
+ − 1191
1062
+ − 1192
lemma fresh_Nil:
+ − 1193
shows "a \<sharp> []"
+ − 1194
by (simp add: fresh_def supp_Nil)
+ − 1195
+ − 1196
lemma fresh_Cons:
+ − 1197
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs"
+ − 1198
by (simp add: fresh_def supp_Cons)
+ − 1199
2591
+ − 1200
lemma fresh_append:
+ − 1201
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys"
+ − 1202
by (induct xs) (simp_all add: fresh_Nil fresh_Cons)
+ − 1203
+ − 1204
1062
+ − 1205
instance list :: (fs) fs
+ − 1206
apply default
+ − 1207
apply (induct_tac x)
+ − 1208
apply (simp_all add: supp_Nil supp_Cons finite_supp)
+ − 1209
done
+ − 1210
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1211
lemma supp_of_atom_list:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1212
fixes as::"atom list"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1213
shows "supp as = set as"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1214
by (induct as)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1215
(simp_all add: supp_Nil supp_Cons supp_atom)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1216
2466
+ − 1217
2470
+ − 1218
section {* Support and Freshness for Applications *}
1062
+ − 1219
1879
+ − 1220
lemma fresh_conv_MOST:
+ − 1221
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)"
+ − 1222
unfolding fresh_def supp_def
+ − 1223
unfolding MOST_iff_cofinite by simp
+ − 1224
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1225
lemma supp_subset_fresh:
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1226
assumes a: "\<And>a. a \<sharp> x \<Longrightarrow> a \<sharp> y"
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1227
shows "supp y \<subseteq> supp x"
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1228
using a
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1229
unfolding fresh_def
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1230
by blast
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1231
1879
+ − 1232
lemma fresh_fun_app:
+ − 1233
assumes "a \<sharp> f" and "a \<sharp> x"
+ − 1234
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
+ − 1235
using assms
1879
+ − 1236
unfolding fresh_conv_MOST
+ − 1237
unfolding permute_fun_app_eq
+ − 1238
by (elim MOST_rev_mp, simp)
+ − 1239
1062
+ − 1240
lemma supp_fun_app:
+ − 1241
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)"
1879
+ − 1242
using fresh_fun_app
+ − 1243
unfolding fresh_def
+ − 1244
by auto
+ − 1245
2470
+ − 1246
text {* Support of Equivariant Functions *}
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1247
1941
+ − 1248
lemma supp_fun_eqvt:
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1249
assumes a: "\<And>p. p \<bullet> f = f"
1941
+ − 1250
shows "supp f = {}"
+ − 1251
unfolding supp_def
+ − 1252
using a by simp
+ − 1253
1062
+ − 1254
lemma fresh_fun_eqvt_app:
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1255
assumes a: "\<And>p. p \<bullet> f = f"
1062
+ − 1256
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
+ − 1257
proof -
1941
+ − 1258
from a have "supp f = {}" by (simp add: supp_fun_eqvt)
1879
+ − 1259
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
1062
+ − 1260
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
+ − 1261
using supp_fun_app by auto
1062
+ − 1262
qed
+ − 1263
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
+ − 1264
2466
+ − 1265
section {* Support of Finite Sets of Finitely Supported Elements *}
+ − 1266
+ − 1267
lemma Union_fresh:
+ − 1268
shows "a \<sharp> S \<Longrightarrow> a \<sharp> (\<Union>x \<in> S. supp x)"
+ − 1269
unfolding Union_image_eq[symmetric]
+ − 1270
apply(rule_tac f="\<lambda>S. \<Union> supp ` S" in fresh_fun_eqvt_app)
+ − 1271
apply(simp add: permute_fun_def UNION_def Collect_def Bex_def ex_eqvt mem_def conj_eqvt)
+ − 1272
apply(subst permute_fun_app_eq)
+ − 1273
back
+ − 1274
apply(simp add: supp_eqvt)
+ − 1275
apply(assumption)
+ − 1276
done
+ − 1277
+ − 1278
lemma Union_supports_set:
+ − 1279
shows "(\<Union>x \<in> S. supp x) supports S"
+ − 1280
proof -
+ − 1281
{ fix a b
+ − 1282
have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S"
+ − 1283
unfolding permute_set_eq by force
+ − 1284
}
+ − 1285
then show "(\<Union>x \<in> S. supp x) supports S"
+ − 1286
unfolding supports_def
+ − 1287
by (simp add: fresh_def[symmetric] swap_fresh_fresh)
+ − 1288
qed
+ − 1289
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1290
lemma Union_of_finite_supp_sets:
2466
+ − 1291
fixes S::"('a::fs set)"
+ − 1292
assumes fin: "finite S"
+ − 1293
shows "finite (\<Union>x\<in>S. supp x)"
+ − 1294
using fin by (induct) (auto simp add: finite_supp)
+ − 1295
+ − 1296
lemma Union_included_in_supp:
+ − 1297
fixes S::"('a::fs set)"
+ − 1298
assumes fin: "finite S"
+ − 1299
shows "(\<Union>x\<in>S. supp x) \<subseteq> supp S"
+ − 1300
proof -
+ − 1301
have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)"
+ − 1302
by (rule supp_finite_atom_set[symmetric])
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1303
(rule Union_of_finite_supp_sets[OF fin])
2466
+ − 1304
also have "\<dots> \<subseteq> supp S"
+ − 1305
by (rule supp_subset_fresh)
+ − 1306
(simp add: Union_fresh)
+ − 1307
finally show "(\<Union>x\<in>S. supp x) \<subseteq> supp S" .
+ − 1308
qed
+ − 1309
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1310
lemma supp_of_finite_sets:
2466
+ − 1311
fixes S::"('a::fs set)"
+ − 1312
assumes fin: "finite S"
+ − 1313
shows "(supp S) = (\<Union>x\<in>S. supp x)"
+ − 1314
apply(rule subset_antisym)
+ − 1315
apply(rule supp_is_subset)
+ − 1316
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
+ − 1317
apply(rule Union_of_finite_supp_sets[OF fin])
2466
+ − 1318
apply(rule Union_included_in_supp[OF fin])
+ − 1319
done
+ − 1320
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1321
lemma finite_sets_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1322
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
+ − 1323
assumes "finite S"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1324
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1325
using assms
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1326
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
+ − 1327
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1328
lemma supp_of_finite_union:
2466
+ − 1329
fixes S T::"('a::fs) set"
+ − 1330
assumes fin1: "finite S"
+ − 1331
and fin2: "finite T"
+ − 1332
shows "supp (S \<union> T) = supp S \<union> supp T"
+ − 1333
using fin1 fin2
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1334
by (simp add: supp_of_finite_sets)
2466
+ − 1335
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1336
lemma supp_of_finite_insert:
2466
+ − 1337
fixes S::"('a::fs) set"
+ − 1338
assumes fin: "finite S"
+ − 1339
shows "supp (insert x S) = supp x \<union> supp S"
+ − 1340
using fin
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1341
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
+ − 1342
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1343
lemma fresh_finite_insert:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1344
fixes S::"('a::fs) set"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1345
assumes fin: "finite S"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1346
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
+ − 1347
using fin unfolding fresh_def
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1348
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
+ − 1349
2591
+ − 1350
lemma supp_set_empty:
+ − 1351
shows "supp {} = {}"
+ − 1352
unfolding supp_def
+ − 1353
by (simp add: empty_eqvt)
+ − 1354
+ − 1355
lemma fresh_set_empty:
+ − 1356
shows "a \<sharp> {}"
+ − 1357
by (simp add: fresh_def supp_set_empty)
+ − 1358
+ − 1359
lemma supp_set:
+ − 1360
fixes xs :: "('a::fs) list"
+ − 1361
shows "supp (set xs) = supp xs"
+ − 1362
apply(induct xs)
+ − 1363
apply(simp add: supp_set_empty supp_Nil)
+ − 1364
apply(simp add: supp_Cons supp_of_finite_insert)
+ − 1365
done
+ − 1366
+ − 1367
lemma fresh_set:
+ − 1368
fixes xs :: "('a::fs) list"
+ − 1369
shows "a \<sharp> (set xs) \<longleftrightarrow> a \<sharp> xs"
+ − 1370
unfolding fresh_def
+ − 1371
by (simp add: supp_set)
+ − 1372
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1373
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1374
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
+ − 1375
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1376
lemma fset_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1377
shows "p \<bullet> (fset S) = fset (p \<bullet> S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1378
by (lifting set_eqvt)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1379
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1380
lemma supp_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1381
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
+ − 1382
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1383
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
+ − 1384
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1385
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
+ − 1386
shows "supp {||} = {}"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1387
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1388
by simp
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1389
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1390
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
+ − 1391
fixes x::"'a::fs"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1392
and S::"'a fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1393
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
+ − 1394
apply(subst supp_fset[symmetric])
2587
+ − 1395
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
+ − 1396
done
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1397
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1398
lemma fset_finite_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1399
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
+ − 1400
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1401
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
+ − 1402
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1403
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1404
instance fset :: (fs) fs
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1405
apply (default)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1406
apply (rule fset_finite_supp)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1407
done
2466
+ − 1408
+ − 1409
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1410
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
+ − 1411
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1412
lemma fresh_Unit_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1413
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
+ − 1414
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
+ − 1415
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1416
lemma fresh_Pair_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1417
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
+ − 1418
by rule (simp_all add: fresh_Pair)
2470
+ − 1419
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1420
(* 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
+ − 1421
(* 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
+ − 1422
lemma [simp]:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1423
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
+ − 1424
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
+ − 1425
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1426
lemma fresh_PairD:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1427
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
+ − 1428
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
+ − 1429
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
+ − 1430
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1431
ML {*
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1432
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
+ − 1433
*}
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1434
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1435
declaration {* fn _ =>
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1436
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
+ − 1437
*}
2470
+ − 1438
+ − 1439
text {* The fresh-star generalisation of fresh is used in strong
+ − 1440
induction principles. *}
+ − 1441
+ − 1442
definition
+ − 1443
fresh_star :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp>* _" [80,80] 80)
+ − 1444
where
+ − 1445
"as \<sharp>* x \<equiv> \<forall>a \<in> as. a \<sharp> x"
+ − 1446
2507
+ − 1447
lemma fresh_star_supp_conv:
+ − 1448
shows "supp x \<sharp>* y \<Longrightarrow> supp y \<sharp>* x"
+ − 1449
by (auto simp add: fresh_star_def fresh_def)
+ − 1450
2591
+ − 1451
lemma fresh_star_Pair:
2470
+ − 1452
shows "as \<sharp>* (x, y) = (as \<sharp>* x \<and> as \<sharp>* y)"
+ − 1453
by (auto simp add: fresh_star_def fresh_Pair)
+ − 1454
2591
+ − 1455
lemma fresh_star_list:
+ − 1456
shows "as \<sharp>* (xs @ ys) \<longleftrightarrow> as \<sharp>* xs \<and> as \<sharp>* ys"
+ − 1457
and "as \<sharp>* (x # xs) \<longleftrightarrow> as \<sharp>* x \<and> as \<sharp>* xs"
+ − 1458
and "as \<sharp>* []"
+ − 1459
by (auto simp add: fresh_star_def fresh_Nil fresh_Cons fresh_append)
+ − 1460
+ − 1461
lemma fresh_star_set:
+ − 1462
fixes xs::"('a::fs) list"
+ − 1463
shows "as \<sharp>* set xs \<longleftrightarrow> as \<sharp>* xs"
+ − 1464
unfolding fresh_star_def
+ − 1465
by (simp add: fresh_set)
+ − 1466
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1467
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
+ − 1468
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
+ − 1469
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
+ − 1470
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
+ − 1471
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1472
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
+ − 1473
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
+ − 1474
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
+ − 1475
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
+ − 1476
2591
+ − 1477
lemma fresh_star_Un:
2470
+ − 1478
shows "(as \<union> bs) \<sharp>* x = (as \<sharp>* x \<and> bs \<sharp>* x)"
+ − 1479
by (auto simp add: fresh_star_def)
+ − 1480
+ − 1481
lemma fresh_star_insert:
+ − 1482
shows "(insert a as) \<sharp>* x = (a \<sharp> x \<and> as \<sharp>* x)"
+ − 1483
by (auto simp add: fresh_star_def)
+ − 1484
+ − 1485
lemma fresh_star_Un_elim:
+ − 1486
"((as \<union> bs) \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (as \<sharp>* x \<Longrightarrow> bs \<sharp>* x \<Longrightarrow> PROP C)"
+ − 1487
unfolding fresh_star_def
+ − 1488
apply(rule)
+ − 1489
apply(erule meta_mp)
+ − 1490
apply(auto)
+ − 1491
done
+ − 1492
+ − 1493
lemma fresh_star_insert_elim:
+ − 1494
"(insert a as \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> as \<sharp>* x \<Longrightarrow> PROP C)"
+ − 1495
unfolding fresh_star_def
+ − 1496
by rule (simp_all add: fresh_star_def)
+ − 1497
+ − 1498
lemma fresh_star_empty_elim:
+ − 1499
"({} \<sharp>* x \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 1500
by (simp add: fresh_star_def)
+ − 1501
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1502
lemma fresh_star_Unit_elim:
2470
+ − 1503
shows "(a \<sharp>* () \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 1504
by (simp add: fresh_star_def fresh_Unit)
+ − 1505
2591
+ − 1506
lemma fresh_star_Pair_elim:
2470
+ − 1507
shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)"
2591
+ − 1508
by (rule, simp_all add: fresh_star_Pair)
2470
+ − 1509
+ − 1510
lemma fresh_star_zero:
+ − 1511
shows "as \<sharp>* (0::perm)"
+ − 1512
unfolding fresh_star_def
+ − 1513
by (simp add: fresh_zero_perm)
+ − 1514
+ − 1515
lemma fresh_star_plus:
+ − 1516
fixes p q::perm
+ − 1517
shows "\<lbrakk>a \<sharp>* p; a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
+ − 1518
unfolding fresh_star_def
+ − 1519
by (simp add: fresh_plus_perm)
+ − 1520
+ − 1521
lemma fresh_star_permute_iff:
+ − 1522
shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
+ − 1523
unfolding fresh_star_def
+ − 1524
by (metis mem_permute_iff permute_minus_cancel(1) fresh_permute_iff)
+ − 1525
+ − 1526
lemma fresh_star_eqvt:
+ − 1527
shows "(p \<bullet> (as \<sharp>* x)) = (p \<bullet> as) \<sharp>* (p \<bullet> x)"
+ − 1528
unfolding fresh_star_def
+ − 1529
unfolding Ball_def
+ − 1530
apply(simp add: all_eqvt)
+ − 1531
apply(subst permute_fun_def)
+ − 1532
apply(simp add: imp_eqvt fresh_eqvt mem_eqvt)
+ − 1533
done
+ − 1534
2591
+ − 1535
lemma at_fresh_star_inter:
+ − 1536
assumes a: "(p \<bullet> bs) \<sharp>* bs"
+ − 1537
and b: "finite bs"
+ − 1538
shows "p \<bullet> bs \<inter> bs = {}"
+ − 1539
using a b
+ − 1540
unfolding fresh_star_def
+ − 1541
unfolding fresh_def
+ − 1542
by (auto simp add: supp_finite_atom_set)
+ − 1543
2470
+ − 1544
+ − 1545
section {* Induction principle for permutations *}
+ − 1546
+ − 1547
+ − 1548
lemma perm_struct_induct[consumes 1, case_names zero swap]:
+ − 1549
assumes S: "supp p \<subseteq> S"
+ − 1550
and zero: "P 0"
+ − 1551
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)"
+ − 1552
shows "P p"
+ − 1553
proof -
+ − 1554
have "finite (supp p)" by (simp add: finite_supp)
+ − 1555
then show "P p" using S
+ − 1556
proof(induct A\<equiv>"supp p" arbitrary: p rule: finite_psubset_induct)
+ − 1557
case (psubset p)
+ − 1558
then have ih: "\<And>q. supp q \<subset> supp p \<Longrightarrow> P q" by auto
+ − 1559
have as: "supp p \<subseteq> S" by fact
+ − 1560
{ assume "supp p = {}"
+ − 1561
then have "p = 0" by (simp add: supp_perm expand_perm_eq)
+ − 1562
then have "P p" using zero by simp
+ − 1563
}
+ − 1564
moreover
+ − 1565
{ assume "supp p \<noteq> {}"
+ − 1566
then obtain a where a0: "a \<in> supp p" by blast
+ − 1567
then have a1: "p \<bullet> a \<in> S" "a \<in> S" "sort_of (p \<bullet> a) = sort_of a" "p \<bullet> a \<noteq> a"
+ − 1568
using as by (auto simp add: supp_atom supp_perm swap_atom)
+ − 1569
let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p"
+ − 1570
have a2: "supp ?q \<subseteq> supp p" unfolding supp_perm by (auto simp add: swap_atom)
+ − 1571
moreover
+ − 1572
have "a \<notin> supp ?q" by (simp add: supp_perm)
+ − 1573
then have "supp ?q \<noteq> supp p" using a0 by auto
+ − 1574
ultimately have "supp ?q \<subset> supp p" using a2 by auto
+ − 1575
then have "P ?q" using ih by simp
+ − 1576
moreover
+ − 1577
have "supp ?q \<subseteq> S" using as a2 by simp
+ − 1578
ultimately have "P ((p \<bullet> a \<rightleftharpoons> a) + ?q)" using as a1 swap by simp
+ − 1579
moreover
+ − 1580
have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: expand_perm_eq)
+ − 1581
ultimately have "P p" by simp
+ − 1582
}
+ − 1583
ultimately show "P p" by blast
+ − 1584
qed
+ − 1585
qed
+ − 1586
+ − 1587
lemma perm_simple_struct_induct[case_names zero swap]:
+ − 1588
assumes zero: "P 0"
+ − 1589
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)"
+ − 1590
shows "P p"
+ − 1591
by (rule_tac S="supp p" in perm_struct_induct)
+ − 1592
(auto intro: zero swap)
+ − 1593
+ − 1594
lemma perm_subset_induct[consumes 1, case_names zero swap plus]:
+ − 1595
assumes S: "supp p \<subseteq> S"
+ − 1596
assumes zero: "P 0"
+ − 1597
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)"
+ − 1598
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2; supp p1 \<subseteq> S; supp p2 \<subseteq> S\<rbrakk> \<Longrightarrow> P (p1 + p2)"
+ − 1599
shows "P p"
+ − 1600
using S
+ − 1601
by (induct p rule: perm_struct_induct)
+ − 1602
(auto intro: zero plus swap simp add: supp_swap)
+ − 1603
+ − 1604
lemma supp_perm_eq:
+ − 1605
assumes "(supp x) \<sharp>* p"
+ − 1606
shows "p \<bullet> x = x"
+ − 1607
proof -
+ − 1608
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 1609
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 1610
then show "p \<bullet> x = x"
+ − 1611
proof (induct p rule: perm_struct_induct)
+ − 1612
case zero
+ − 1613
show "0 \<bullet> x = x" by simp
+ − 1614
next
+ − 1615
case (swap p a b)
+ − 1616
then have "a \<sharp> x" "b \<sharp> x" "p \<bullet> x = x" by simp_all
+ − 1617
then show "((a \<rightleftharpoons> b) + p) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 1618
qed
+ − 1619
qed
+ − 1620
+ − 1621
lemma supp_perm_eq_test:
+ − 1622
assumes "(supp x) \<sharp>* p"
+ − 1623
shows "p \<bullet> x = x"
+ − 1624
proof -
+ − 1625
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 1626
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 1627
then show "p \<bullet> x = x"
+ − 1628
proof (induct p rule: perm_subset_induct)
+ − 1629
case zero
+ − 1630
show "0 \<bullet> x = x" by simp
+ − 1631
next
+ − 1632
case (swap a b)
+ − 1633
then have "a \<sharp> x" "b \<sharp> x" by simp_all
+ − 1634
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 1635
next
+ − 1636
case (plus p1 p2)
+ − 1637
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+
+ − 1638
then show "(p1 + p2) \<bullet> x = x" by simp
+ − 1639
qed
+ − 1640
qed
+ − 1641
2591
+ − 1642
lemma perm_supp_eq:
+ − 1643
assumes a: "(supp p) \<sharp>* x"
+ − 1644
shows "p \<bullet> x = x"
+ − 1645
by (rule supp_perm_eq)
+ − 1646
(simp add: fresh_star_supp_conv a)
+ − 1647
2470
+ − 1648
+ − 1649
section {* Avoiding of atom sets *}
+ − 1650
+ − 1651
text {*
+ − 1652
For every set of atoms, there is another set of atoms
+ − 1653
avoiding a finitely supported c and there is a permutation
+ − 1654
which 'translates' between both sets.
+ − 1655
*}
+ − 1656
+ − 1657
lemma at_set_avoiding_aux:
+ − 1658
fixes Xs::"atom set"
+ − 1659
and As::"atom set"
+ − 1660
assumes b: "Xs \<subseteq> As"
+ − 1661
and c: "finite As"
2614
+ − 1662
shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 1663
proof -
+ − 1664
from b c have "finite Xs" by (rule finite_subset)
+ − 1665
then show ?thesis using b
+ − 1666
proof (induct rule: finite_subset_induct)
+ − 1667
case empty
+ − 1668
have "0 \<bullet> {} \<inter> As = {}" by simp
+ − 1669
moreover
2614
+ − 1670
have "supp (0::perm) = {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm)
2470
+ − 1671
ultimately show ?case by blast
+ − 1672
next
+ − 1673
case (insert x Xs)
+ − 1674
then obtain p where
+ − 1675
p1: "(p \<bullet> Xs) \<inter> As = {}" and
2614
+ − 1676
p2: "supp p = (Xs \<union> (p \<bullet> Xs))" by blast
2470
+ − 1677
from `x \<in> As` p1 have "x \<notin> p \<bullet> Xs" by fast
+ − 1678
with `x \<notin> Xs` p2 have "x \<notin> supp p" by fast
+ − 1679
hence px: "p \<bullet> x = x" unfolding supp_perm by simp
2614
+ − 1680
have "finite (As \<union> p \<bullet> Xs \<union> supp p)"
2470
+ − 1681
using `finite As` `finite Xs`
2614
+ − 1682
by (simp add: permute_set_eq_image finite_supp)
+ − 1683
then obtain y where "y \<notin> (As \<union> p \<bullet> Xs \<union> supp p)" "sort_of y = sort_of x"
2470
+ − 1684
by (rule obtain_atom)
2614
+ − 1685
hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "y \<notin> supp p" "sort_of y = sort_of x"
2470
+ − 1686
by simp_all
2614
+ − 1687
hence py: "p \<bullet> y = y" "x \<noteq> y" using `x \<in> As`
+ − 1688
by (auto simp add: supp_perm)
2470
+ − 1689
let ?q = "(x \<rightleftharpoons> y) + p"
+ − 1690
have q: "?q \<bullet> insert x Xs = insert y (p \<bullet> Xs)"
+ − 1691
unfolding insert_eqvt
+ − 1692
using `p \<bullet> x = x` `sort_of y = sort_of x`
+ − 1693
using `x \<notin> p \<bullet> Xs` `y \<notin> p \<bullet> Xs`
+ − 1694
by (simp add: swap_atom swap_set_not_in)
+ − 1695
have "?q \<bullet> insert x Xs \<inter> As = {}"
+ − 1696
using `y \<notin> As` `p \<bullet> Xs \<inter> As = {}`
+ − 1697
unfolding q by simp
+ − 1698
moreover
2614
+ − 1699
have "supp (x \<rightleftharpoons> y) \<inter> supp p = {}" using px py `sort_of y = sort_of x`
+ − 1700
unfolding supp_swap by (simp add: supp_perm)
+ − 1701
then have "supp ?q = (supp (x \<rightleftharpoons> y) \<union> supp p)"
+ − 1702
by (simp add: supp_plus_perm_eq)
+ − 1703
then have "supp ?q = insert x Xs \<union> ?q \<bullet> insert x Xs"
+ − 1704
using p2 `sort_of y = sort_of x` `x \<noteq> y` unfolding q supp_swap
+ − 1705
by auto
2470
+ − 1706
ultimately show ?case by blast
+ − 1707
qed
+ − 1708
qed
+ − 1709
+ − 1710
lemma at_set_avoiding:
+ − 1711
assumes a: "finite Xs"
+ − 1712
and b: "finite (supp c)"
2614
+ − 1713
obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 1714
using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \<union> supp c"]
+ − 1715
unfolding fresh_star_def fresh_def by blast
+ − 1716
2589
+ − 1717
lemma at_set_avoiding1:
+ − 1718
assumes "finite xs"
+ − 1719
and "finite (supp c)"
+ − 1720
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c"
+ − 1721
using assms
+ − 1722
apply(erule_tac c="c" in at_set_avoiding)
+ − 1723
apply(auto)
+ − 1724
done
+ − 1725
2470
+ − 1726
lemma at_set_avoiding2:
+ − 1727
assumes "finite xs"
+ − 1728
and "finite (supp c)" "finite (supp x)"
+ − 1729
and "xs \<sharp>* x"
+ − 1730
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p"
+ − 1731
using assms
+ − 1732
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 1733
apply(simp add: supp_Pair)
+ − 1734
apply(rule_tac x="p" in exI)
2591
+ − 1735
apply(simp add: fresh_star_Pair)
2507
+ − 1736
apply(rule fresh_star_supp_conv)
+ − 1737
apply(auto simp add: fresh_star_def)
2470
+ − 1738
done
+ − 1739
2573
+ − 1740
lemma at_set_avoiding3:
+ − 1741
assumes "finite xs"
+ − 1742
and "finite (supp c)" "finite (supp x)"
+ − 1743
and "xs \<sharp>* x"
2614
+ − 1744
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p \<and> supp p = xs \<union> (p \<bullet> xs)"
2586
+ − 1745
using assms
+ − 1746
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 1747
apply(simp add: supp_Pair)
+ − 1748
apply(rule_tac x="p" in exI)
2591
+ − 1749
apply(simp add: fresh_star_Pair)
2586
+ − 1750
apply(rule fresh_star_supp_conv)
+ − 1751
apply(auto simp add: fresh_star_def)
+ − 1752
done
2573
+ − 1753
2470
+ − 1754
lemma at_set_avoiding2_atom:
+ − 1755
assumes "finite (supp c)" "finite (supp x)"
+ − 1756
and b: "a \<sharp> x"
+ − 1757
shows "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p"
+ − 1758
proof -
+ − 1759
have a: "{a} \<sharp>* x" unfolding fresh_star_def by (simp add: b)
+ − 1760
obtain p where p1: "(p \<bullet> {a}) \<sharp>* c" and p2: "supp x \<sharp>* p"
+ − 1761
using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast
+ − 1762
have c: "(p \<bullet> a) \<sharp> c" using p1
+ − 1763
unfolding fresh_star_def Ball_def
+ − 1764
by(erule_tac x="p \<bullet> a" in allE) (simp add: permute_set_eq)
+ − 1765
hence "p \<bullet> a \<sharp> c \<and> supp x \<sharp>* p" using p2 by blast
+ − 1766
then show "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" by blast
+ − 1767
qed
+ − 1768
2614
+ − 1769
2599
+ − 1770
section {* Renaming permutations *}
+ − 1771
+ − 1772
lemma set_renaming_perm:
+ − 1773
assumes a: "p \<bullet> bs \<inter> bs = {}"
+ − 1774
and b: "finite bs"
+ − 1775
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)"
+ − 1776
using b a
+ − 1777
proof (induct)
+ − 1778
case empty
+ − 1779
have "0 \<bullet> {} = p \<bullet> {} \<and> supp (0::perm) \<subseteq> {} \<union> p \<bullet> {}"
+ − 1780
by (simp add: permute_set_eq supp_perm)
+ − 1781
then show "\<exists>q. q \<bullet> {} = p \<bullet> {} \<and> supp q \<subseteq> {} \<union> p \<bullet> {}" by blast
+ − 1782
next
+ − 1783
case (insert a bs)
+ − 1784
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> p \<bullet> bs"
+ − 1785
by (simp add: insert_eqvt)
+ − 1786
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> bs \<union> p \<bullet> bs" by blast
+ − 1787
{ assume 1: "q \<bullet> a = p \<bullet> a"
+ − 1788
have "q \<bullet> insert a bs = p \<bullet> insert a bs" using 1 * by (simp add: insert_eqvt)
+ − 1789
moreover
+ − 1790
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1791
using ** by (auto simp add: insert_eqvt)
+ − 1792
ultimately
+ − 1793
have "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast
+ − 1794
}
+ − 1795
moreover
+ − 1796
{ assume 2: "q \<bullet> a \<noteq> p \<bullet> a"
+ − 1797
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
+ − 1798
{ have "(q \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` *[symmetric] by (simp add: mem_permute_iff)
+ − 1799
moreover
+ − 1800
have "(p \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` by (simp add: mem_permute_iff)
+ − 1801
ultimately
+ − 1802
have "q' \<bullet> insert a bs = p \<bullet> insert a bs" using 2 * unfolding q'_def
+ − 1803
by (simp add: insert_eqvt swap_set_not_in)
+ − 1804
}
+ − 1805
moreover
+ − 1806
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1807
using ** `a \<notin> bs` `p \<bullet> insert a bs \<inter> insert a bs = {}`
+ − 1808
by (auto simp add: supp_perm insert_eqvt)
+ − 1809
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)
+ − 1810
moreover
+ − 1811
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1812
using ** by (auto simp add: insert_eqvt)
+ − 1813
ultimately
+ − 1814
have "supp q' \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1815
unfolding q'_def using supp_plus_perm by blast
+ − 1816
}
+ − 1817
ultimately
+ − 1818
have "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast
+ − 1819
}
+ − 1820
ultimately show "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1821
by blast
+ − 1822
qed
+ − 1823
+ − 1824
+ − 1825
lemma list_renaming_perm:
+ − 1826
fixes bs::"atom list"
+ − 1827
assumes a: "(p \<bullet> (set bs)) \<inter> (set bs) = {}"
+ − 1828
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> (set bs) \<union> (p \<bullet> (set bs))"
+ − 1829
using a
+ − 1830
proof (induct bs)
+ − 1831
case Nil
+ − 1832
have "0 \<bullet> [] = p \<bullet> [] \<and> supp (0::perm) \<subseteq> set [] \<union> p \<bullet> set []"
+ − 1833
by (simp add: permute_set_eq supp_perm)
+ − 1834
then show "\<exists>q. q \<bullet> [] = p \<bullet> [] \<and> supp q \<subseteq> set [] \<union> p \<bullet> (set [])" by blast
+ − 1835
next
+ − 1836
case (Cons a bs)
+ − 1837
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> set bs \<union> p \<bullet> (set bs)"
+ − 1838
by (simp add: insert_eqvt)
+ − 1839
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" by blast
+ − 1840
{ assume 1: "a \<in> set bs"
+ − 1841
have "q \<bullet> a = p \<bullet> a" using * 1 by (induct bs) (auto)
+ − 1842
then have "q \<bullet> (a # bs) = p \<bullet> (a # bs)" using * by simp
+ − 1843
moreover
+ − 1844
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" using ** by (auto simp add: insert_eqvt)
+ − 1845
ultimately
+ − 1846
have "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast
+ − 1847
}
+ − 1848
moreover
+ − 1849
{ assume 2: "a \<notin> set bs"
+ − 1850
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
+ − 1851
{ have "(q \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs` *[symmetric]
+ − 1852
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list)
+ − 1853
moreover
+ − 1854
have "(p \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs`
+ − 1855
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list)
+ − 1856
ultimately
+ − 1857
have "q' \<bullet> (a # bs) = p \<bullet> (a # bs)" using 2 * unfolding q'_def
+ − 1858
by (simp add: swap_fresh_fresh)
+ − 1859
}
+ − 1860
moreover
+ − 1861
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1862
using ** `a \<notin> set bs` `p \<bullet> (set (a # bs)) \<inter> set (a # bs) = {}`
+ − 1863
by (auto simp add: supp_perm insert_eqvt)
+ − 1864
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)
+ − 1865
moreover
+ − 1866
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1867
using ** by (auto simp add: insert_eqvt)
+ − 1868
ultimately
+ − 1869
have "supp q' \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1870
unfolding q'_def using supp_plus_perm by blast
+ − 1871
}
+ − 1872
ultimately
+ − 1873
have "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast
+ − 1874
}
+ − 1875
ultimately show "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1876
by blast
+ − 1877
qed
+ − 1878
+ − 1879
2470
+ − 1880
+ − 1881
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
+ − 1882
1972
+ − 1883
text {*
+ − 1884
Class @{text at_base} allows types containing multiple sorts of atoms.
+ − 1885
Class @{text at} only allows types with a single sort.
+ − 1886
*}
+ − 1887
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
+ − 1888
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
+ − 1889
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
+ − 1890
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
+ − 1891
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
+ − 1892
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
+ − 1893
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
+ − 1894
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
+ − 1895
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
+ − 1896
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
+ − 1897
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
+ − 1898
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
+ − 1899
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
+ − 1900
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
+ − 1901
lemma fresh_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
+ − 1902
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> 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
+ − 1903
unfolding fresh_def by (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
+ − 1904
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
+ − 1905
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
+ − 1906
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
+ − 1907
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
+ − 1908
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
+ − 1909
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1910
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
+ − 1911
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
+ − 1912
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
+ − 1913
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
+ − 1914
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
+ − 1915
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
+ − 1916
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
+ − 1917
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
+ − 1918
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
+ − 1919
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
+ − 1920
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
+ − 1921
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
+ − 1922
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
+ − 1923
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
+ − 1924
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
+ − 1925
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
+ − 1926
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
+ − 1927
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
+ − 1928
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
+ − 1929
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
+ − 1930
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
+ − 1931
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
+ − 1932
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
+ − 1933
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
+ − 1934
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
+ − 1935
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
+ − 1936
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
+ − 1937
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
+ − 1938
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
+ − 1939
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
+ − 1940
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
+ − 1941
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
+ − 1942
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
+ − 1943
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
+ − 1944
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
+ − 1945
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
+ − 1946
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
+ − 1947
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
+ − 1948
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
+ − 1949
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
+ − 1950
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
+ − 1951
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
+ − 1952
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
+ − 1953
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
+ − 1954
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
+ − 1955
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
+ − 1956
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
+ − 1957
1973
+ − 1958
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
+ − 1959
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
+ − 1960
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
+ − 1961
apply(simp add: supp_of_finite_sets[OF a])
2466
+ − 1962
apply(simp add: supp_at_base)
+ − 1963
apply(auto)
+ − 1964
done
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1965
2467
+ − 1966
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
+ − 1967
2467
+ − 1968
section {* A swapping operation for concrete atoms *}
+ − 1969
+ − 1970
definition
+ − 1971
flip :: "'a::at_base \<Rightarrow> 'a \<Rightarrow> perm" ("'(_ \<leftrightarrow> _')")
+ − 1972
where
+ − 1973
"(a \<leftrightarrow> b) = (atom a \<rightleftharpoons> atom b)"
+ − 1974
+ − 1975
lemma flip_self [simp]: "(a \<leftrightarrow> a) = 0"
+ − 1976
unfolding flip_def by (rule swap_self)
+ − 1977
+ − 1978
lemma flip_commute: "(a \<leftrightarrow> b) = (b \<leftrightarrow> a)"
+ − 1979
unfolding flip_def by (rule swap_commute)
+ − 1980
+ − 1981
lemma minus_flip [simp]: "- (a \<leftrightarrow> b) = (a \<leftrightarrow> b)"
+ − 1982
unfolding flip_def by (rule minus_swap)
+ − 1983
+ − 1984
lemma add_flip_cancel: "(a \<leftrightarrow> b) + (a \<leftrightarrow> b) = 0"
+ − 1985
unfolding flip_def by (rule swap_cancel)
+ − 1986
+ − 1987
lemma permute_flip_cancel [simp]: "(a \<leftrightarrow> b) \<bullet> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 1988
unfolding permute_plus [symmetric] add_flip_cancel by simp
+ − 1989
+ − 1990
lemma permute_flip_cancel2 [simp]: "(a \<leftrightarrow> b) \<bullet> (b \<leftrightarrow> a) \<bullet> x = x"
+ − 1991
by (simp add: flip_commute)
+ − 1992
+ − 1993
lemma flip_eqvt:
+ − 1994
fixes a b c::"'a::at_base"
+ − 1995
shows "p \<bullet> (a \<leftrightarrow> b) = (p \<bullet> a \<leftrightarrow> p \<bullet> b)"
+ − 1996
unfolding flip_def
+ − 1997
by (simp add: swap_eqvt atom_eqvt)
+ − 1998
+ − 1999
lemma flip_at_base_simps [simp]:
+ − 2000
shows "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> a = b"
+ − 2001
and "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> b = a"
+ − 2002
and "\<lbrakk>a \<noteq> c; b \<noteq> c\<rbrakk> \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> c = c"
+ − 2003
and "sort_of (atom a) \<noteq> sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 2004
unfolding flip_def
+ − 2005
unfolding atom_eq_iff [symmetric]
+ − 2006
unfolding atom_eqvt [symmetric]
+ − 2007
by simp_all
+ − 2008
+ − 2009
text {* the following two lemmas do not hold for at_base,
+ − 2010
only for single sort atoms from at *}
+ − 2011
+ − 2012
lemma permute_flip_at:
+ − 2013
fixes a b c::"'a::at"
+ − 2014
shows "(a \<leftrightarrow> b) \<bullet> c = (if c = a then b else if c = b then a else c)"
+ − 2015
unfolding flip_def
+ − 2016
apply (rule atom_eq_iff [THEN iffD1])
+ − 2017
apply (subst atom_eqvt [symmetric])
+ − 2018
apply (simp add: swap_atom)
+ − 2019
done
+ − 2020
+ − 2021
lemma flip_at_simps [simp]:
+ − 2022
fixes a b::"'a::at"
+ − 2023
shows "(a \<leftrightarrow> b) \<bullet> a = b"
+ − 2024
and "(a \<leftrightarrow> b) \<bullet> b = a"
+ − 2025
unfolding permute_flip_at by simp_all
+ − 2026
+ − 2027
lemma flip_fresh_fresh:
+ − 2028
fixes a b::"'a::at_base"
+ − 2029
assumes "atom a \<sharp> x" "atom b \<sharp> x"
+ − 2030
shows "(a \<leftrightarrow> b) \<bullet> x = x"
+ − 2031
using assms
+ − 2032
by (simp add: flip_def swap_fresh_fresh)
+ − 2033
+ − 2034
subsection {* Syntax for coercing at-elements to the atom-type *}
+ − 2035
+ − 2036
syntax
+ − 2037
"_atom_constrain" :: "logic \<Rightarrow> type \<Rightarrow> logic" ("_:::_" [4, 0] 3)
+ − 2038
+ − 2039
translations
+ − 2040
"_atom_constrain a t" => "CONST atom (_constrain a t)"
+ − 2041
+ − 2042
+ − 2043
subsection {* A lemma for proving instances of class @{text at}. *}
+ − 2044
+ − 2045
setup {* Sign.add_const_constraint (@{const_name "permute"}, NONE) *}
+ − 2046
setup {* Sign.add_const_constraint (@{const_name "atom"}, NONE) *}
+ − 2047
+ − 2048
text {*
+ − 2049
New atom types are defined as subtypes of @{typ atom}.
+ − 2050
*}
+ − 2051
+ − 2052
lemma exists_eq_simple_sort:
+ − 2053
shows "\<exists>a. a \<in> {a. sort_of a = s}"
+ − 2054
by (rule_tac x="Atom s 0" in exI, simp)
+ − 2055
+ − 2056
lemma exists_eq_sort:
+ − 2057
shows "\<exists>a. a \<in> {a. sort_of a \<in> range sort_fun}"
+ − 2058
by (rule_tac x="Atom (sort_fun x) y" in exI, simp)
+ − 2059
+ − 2060
lemma at_base_class:
+ − 2061
fixes sort_fun :: "'b \<Rightarrow>atom_sort"
+ − 2062
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2063
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range sort_fun}"
+ − 2064
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2065
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2066
shows "OFCLASS('a, at_base_class)"
+ − 2067
proof
+ − 2068
interpret type_definition Rep Abs "{a. sort_of a \<in> range sort_fun}" by (rule type)
+ − 2069
have sort_of_Rep: "\<And>a. sort_of (Rep a) \<in> range sort_fun" using Rep by simp
+ − 2070
fix a b :: 'a and p p1 p2 :: perm
+ − 2071
show "0 \<bullet> a = a"
+ − 2072
unfolding permute_def by (simp add: Rep_inverse)
+ − 2073
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2074
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2075
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2076
unfolding atom_def by (simp add: Rep_inject)
+ − 2077
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2078
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2079
qed
+ − 2080
+ − 2081
(*
+ − 2082
lemma at_class:
+ − 2083
fixes s :: atom_sort
+ − 2084
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2085
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range (\<lambda>x::unit. s)}"
+ − 2086
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2087
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2088
shows "OFCLASS('a, at_class)"
+ − 2089
proof
+ − 2090
interpret type_definition Rep Abs "{a. sort_of a \<in> range (\<lambda>x::unit. s)}" by (rule type)
+ − 2091
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2092
fix a b :: 'a and p p1 p2 :: perm
+ − 2093
show "0 \<bullet> a = a"
+ − 2094
unfolding permute_def by (simp add: Rep_inverse)
+ − 2095
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2096
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2097
show "sort_of (atom a) = sort_of (atom b)"
+ − 2098
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2099
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2100
unfolding atom_def by (simp add: Rep_inject)
+ − 2101
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2102
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2103
qed
+ − 2104
*)
+ − 2105
+ − 2106
lemma at_class:
+ − 2107
fixes s :: atom_sort
+ − 2108
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2109
assumes type: "type_definition Rep Abs {a. sort_of a = s}"
+ − 2110
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2111
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2112
shows "OFCLASS('a, at_class)"
+ − 2113
proof
+ − 2114
interpret type_definition Rep Abs "{a. sort_of a = s}" by (rule type)
+ − 2115
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2116
fix a b :: 'a and p p1 p2 :: perm
+ − 2117
show "0 \<bullet> a = a"
+ − 2118
unfolding permute_def by (simp add: Rep_inverse)
+ − 2119
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2120
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2121
show "sort_of (atom a) = sort_of (atom b)"
+ − 2122
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2123
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2124
unfolding atom_def by (simp add: Rep_inject)
+ − 2125
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2126
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2127
qed
+ − 2128
+ − 2129
setup {* Sign.add_const_constraint
+ − 2130
(@{const_name "permute"}, SOME @{typ "perm \<Rightarrow> 'a::pt \<Rightarrow> 'a"}) *}
+ − 2131
setup {* Sign.add_const_constraint
+ − 2132
(@{const_name "atom"}, SOME @{typ "'a::at_base \<Rightarrow> atom"}) *}
+ − 2133
+ − 2134
2470
+ − 2135
+ − 2136
section {* The freshness lemma according to Andy Pitts *}
+ − 2137
+ − 2138
lemma freshness_lemma:
+ − 2139
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2140
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2141
shows "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2142
proof -
+ − 2143
from a obtain b where a1: "atom b \<sharp> h" and a2: "atom b \<sharp> h b"
+ − 2144
by (auto simp add: fresh_Pair)
+ − 2145
show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2146
proof (intro exI allI impI)
+ − 2147
fix a :: 'a
+ − 2148
assume a3: "atom a \<sharp> h"
+ − 2149
show "h a = h b"
+ − 2150
proof (cases "a = b")
+ − 2151
assume "a = b"
+ − 2152
thus "h a = h b" by simp
+ − 2153
next
+ − 2154
assume "a \<noteq> b"
+ − 2155
hence "atom a \<sharp> b" by (simp add: fresh_at_base)
+ − 2156
with a3 have "atom a \<sharp> h b"
+ − 2157
by (rule fresh_fun_app)
+ − 2158
with a2 have d1: "(atom b \<rightleftharpoons> atom a) \<bullet> (h b) = (h b)"
+ − 2159
by (rule swap_fresh_fresh)
+ − 2160
from a1 a3 have d2: "(atom b \<rightleftharpoons> atom a) \<bullet> h = h"
+ − 2161
by (rule swap_fresh_fresh)
+ − 2162
from d1 have "h b = (atom b \<rightleftharpoons> atom a) \<bullet> (h b)" by simp
+ − 2163
also have "\<dots> = ((atom b \<rightleftharpoons> atom a) \<bullet> h) ((atom b \<rightleftharpoons> atom a) \<bullet> b)"
+ − 2164
by (rule permute_fun_app_eq)
+ − 2165
also have "\<dots> = h a"
+ − 2166
using d2 by simp
+ − 2167
finally show "h a = h b" by simp
+ − 2168
qed
+ − 2169
qed
+ − 2170
qed
+ − 2171
+ − 2172
lemma freshness_lemma_unique:
+ − 2173
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2174
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2175
shows "\<exists>!x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2176
proof (rule ex_ex1I)
+ − 2177
from a show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2178
by (rule freshness_lemma)
+ − 2179
next
+ − 2180
fix x y
+ − 2181
assume x: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2182
assume y: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = y"
+ − 2183
from a x y show "x = y"
+ − 2184
by (auto simp add: fresh_Pair)
+ − 2185
qed
+ − 2186
+ − 2187
text {* packaging the freshness lemma into a function *}
+ − 2188
+ − 2189
definition
+ − 2190
fresh_fun :: "('a::at \<Rightarrow> 'b::pt) \<Rightarrow> 'b"
+ − 2191
where
+ − 2192
"fresh_fun h = (THE x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x)"
+ − 2193
+ − 2194
lemma fresh_fun_apply:
+ − 2195
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2196
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2197
assumes b: "atom a \<sharp> h"
+ − 2198
shows "fresh_fun h = h a"
+ − 2199
unfolding fresh_fun_def
+ − 2200
proof (rule the_equality)
+ − 2201
show "\<forall>a'. atom a' \<sharp> h \<longrightarrow> h a' = h a"
+ − 2202
proof (intro strip)
+ − 2203
fix a':: 'a
+ − 2204
assume c: "atom a' \<sharp> h"
+ − 2205
from a have "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" by (rule freshness_lemma)
+ − 2206
with b c show "h a' = h a" by auto
+ − 2207
qed
+ − 2208
next
+ − 2209
fix fr :: 'b
+ − 2210
assume "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = fr"
+ − 2211
with b show "fr = h a" by auto
+ − 2212
qed
+ − 2213
+ − 2214
lemma fresh_fun_apply':
+ − 2215
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2216
assumes a: "atom a \<sharp> h" "atom a \<sharp> h a"
+ − 2217
shows "fresh_fun h = h a"
+ − 2218
apply (rule fresh_fun_apply)
+ − 2219
apply (auto simp add: fresh_Pair intro: a)
+ − 2220
done
+ − 2221
+ − 2222
lemma fresh_fun_eqvt:
+ − 2223
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2224
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2225
shows "p \<bullet> (fresh_fun h) = fresh_fun (p \<bullet> h)"
+ − 2226
using a
+ − 2227
apply (clarsimp simp add: fresh_Pair)
+ − 2228
apply (subst fresh_fun_apply', assumption+)
+ − 2229
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
+ − 2230
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
+ − 2231
apply (simp add: atom_eqvt permute_fun_app_eq [where f=h])
+ − 2232
apply (erule (1) fresh_fun_apply' [symmetric])
+ − 2233
done
+ − 2234
+ − 2235
lemma fresh_fun_supports:
+ − 2236
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2237
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2238
shows "(supp h) supports (fresh_fun h)"
+ − 2239
apply (simp add: supports_def fresh_def [symmetric])
+ − 2240
apply (simp add: fresh_fun_eqvt [OF a] swap_fresh_fresh)
+ − 2241
done
+ − 2242
+ − 2243
notation fresh_fun (binder "FRESH " 10)
+ − 2244
+ − 2245
lemma FRESH_f_iff:
+ − 2246
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 2247
fixes f :: "'b \<Rightarrow> 'c::pure"
+ − 2248
assumes P: "finite (supp P)"
+ − 2249
shows "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2250
proof -
+ − 2251
obtain a::'a where "atom a \<notin> supp P"
+ − 2252
using P by (rule obtain_at_base)
+ − 2253
hence "atom a \<sharp> P"
+ − 2254
by (simp add: fresh_def)
+ − 2255
show "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2256
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 2257
apply (cut_tac `atom a \<sharp> P`)
+ − 2258
apply (simp add: fresh_conv_MOST)
+ − 2259
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 2260
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 2261
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 2262
apply (rule refl)
+ − 2263
done
+ − 2264
qed
+ − 2265
+ − 2266
lemma FRESH_binop_iff:
+ − 2267
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 2268
fixes Q :: "'a::at \<Rightarrow> 'c::pure"
+ − 2269
fixes binop :: "'b \<Rightarrow> 'c \<Rightarrow> 'd::pure"
+ − 2270
assumes P: "finite (supp P)"
+ − 2271
and Q: "finite (supp Q)"
+ − 2272
shows "(FRESH x. binop (P x) (Q x)) = binop (FRESH x. P x) (FRESH x. Q x)"
+ − 2273
proof -
+ − 2274
from assms have "finite (supp P \<union> supp Q)" by simp
+ − 2275
then obtain a::'a where "atom a \<notin> (supp P \<union> supp Q)"
+ − 2276
by (rule obtain_at_base)
+ − 2277
hence "atom a \<sharp> P" and "atom a \<sharp> Q"
+ − 2278
by (simp_all add: fresh_def)
+ − 2279
show ?thesis
+ − 2280
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 2281
apply (cut_tac `atom a \<sharp> P` `atom a \<sharp> Q`)
+ − 2282
apply (simp add: fresh_conv_MOST)
+ − 2283
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 2284
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 2285
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 2286
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> Q` pure_fresh])
+ − 2287
apply (rule refl)
+ − 2288
done
+ − 2289
qed
+ − 2290
+ − 2291
lemma FRESH_conj_iff:
+ − 2292
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 2293
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 2294
shows "(FRESH x. P x \<and> Q x) \<longleftrightarrow> (FRESH x. P x) \<and> (FRESH x. Q x)"
+ − 2295
using P Q by (rule FRESH_binop_iff)
+ − 2296
+ − 2297
lemma FRESH_disj_iff:
+ − 2298
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 2299
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 2300
shows "(FRESH x. P x \<or> Q x) \<longleftrightarrow> (FRESH x. P x) \<or> (FRESH x. Q x)"
+ − 2301
using P Q by (rule FRESH_binop_iff)
+ − 2302
+ − 2303
2467
+ − 2304
section {* Library functions for the nominal infrastructure *}
+ − 2305
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2306
use "nominal_library.ML"
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2307
2466
+ − 2308
2467
+ − 2309
section {* Automation for creating concrete atom types *}
+ − 2310
+ − 2311
text {* at the moment only single-sort concrete atoms are supported *}
+ − 2312
+ − 2313
use "nominal_atoms.ML"
+ − 2314
+ − 2315
2466
+ − 2316
1062
+ − 2317
end