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