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
1062
+ − 956
section {* Type @{typ perm} is finitely-supported. *}
+ − 957
+ − 958
lemma perm_swap_eq:
+ − 959
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)"
+ − 960
unfolding permute_perm_def
+ − 961
by (metis add_diff_cancel minus_perm_def)
+ − 962
+ − 963
lemma supports_perm:
+ − 964
shows "{a. p \<bullet> a \<noteq> a} supports p"
+ − 965
unfolding supports_def
1879
+ − 966
unfolding perm_swap_eq
+ − 967
by (simp add: swap_eqvt)
1062
+ − 968
+ − 969
lemma finite_perm_lemma:
+ − 970
shows "finite {a::atom. p \<bullet> a \<noteq> a}"
+ − 971
using finite_Rep_perm [of p]
+ − 972
unfolding permute_atom_def .
+ − 973
+ − 974
lemma supp_perm:
+ − 975
shows "supp p = {a. p \<bullet> a \<noteq> a}"
+ − 976
apply (rule finite_supp_unique)
+ − 977
apply (rule supports_perm)
+ − 978
apply (rule finite_perm_lemma)
+ − 979
apply (simp add: perm_swap_eq swap_eqvt)
+ − 980
apply (auto simp add: expand_perm_eq swap_atom)
+ − 981
done
+ − 982
+ − 983
lemma fresh_perm:
+ − 984
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a"
1879
+ − 985
unfolding fresh_def
+ − 986
by (simp add: supp_perm)
1062
+ − 987
+ − 988
lemma supp_swap:
+ − 989
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})"
+ − 990
by (auto simp add: supp_perm swap_atom)
+ − 991
+ − 992
lemma fresh_zero_perm:
+ − 993
shows "a \<sharp> (0::perm)"
+ − 994
unfolding fresh_perm by simp
+ − 995
+ − 996
lemma supp_zero_perm:
+ − 997
shows "supp (0::perm) = {}"
+ − 998
unfolding supp_perm by simp
+ − 999
1087
+ − 1000
lemma fresh_plus_perm:
+ − 1001
fixes p q::perm
+ − 1002
assumes "a \<sharp> p" "a \<sharp> q"
+ − 1003
shows "a \<sharp> (p + q)"
+ − 1004
using assms
+ − 1005
unfolding fresh_def
+ − 1006
by (auto simp add: supp_perm)
+ − 1007
1062
+ − 1008
lemma supp_plus_perm:
+ − 1009
fixes p q::perm
+ − 1010
shows "supp (p + q) \<subseteq> supp p \<union> supp q"
+ − 1011
by (auto simp add: supp_perm)
+ − 1012
1087
+ − 1013
lemma fresh_minus_perm:
+ − 1014
fixes p::perm
+ − 1015
shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p"
+ − 1016
unfolding fresh_def
1879
+ − 1017
unfolding supp_perm
+ − 1018
apply(simp)
+ − 1019
apply(metis permute_minus_cancel)
1087
+ − 1020
done
+ − 1021
1062
+ − 1022
lemma supp_minus_perm:
+ − 1023
fixes p::perm
+ − 1024
shows "supp (- p) = supp p"
1087
+ − 1025
unfolding supp_conv_fresh
+ − 1026
by (simp add: fresh_minus_perm)
1062
+ − 1027
+ − 1028
instance perm :: fs
+ − 1029
by default (simp add: supp_perm finite_perm_lemma)
+ − 1030
1305
+ − 1031
lemma plus_perm_eq:
+ − 1032
fixes p q::"perm"
1879
+ − 1033
assumes asm: "supp p \<inter> supp q = {}"
1305
+ − 1034
shows "p + q = q + p"
+ − 1035
unfolding expand_perm_eq
+ − 1036
proof
+ − 1037
fix a::"atom"
+ − 1038
show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1039
proof -
+ − 1040
{ assume "a \<notin> supp p" "a \<notin> supp q"
+ − 1041
then have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1042
by (simp add: supp_perm)
+ − 1043
}
+ − 1044
moreover
+ − 1045
{ assume a: "a \<in> supp p" "a \<notin> supp q"
+ − 1046
then have "p \<bullet> a \<in> supp p" by (simp add: supp_perm)
+ − 1047
then have "p \<bullet> a \<notin> supp q" using asm by auto
+ − 1048
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1049
by (simp add: supp_perm)
+ − 1050
}
+ − 1051
moreover
+ − 1052
{ assume a: "a \<notin> supp p" "a \<in> supp q"
+ − 1053
then have "q \<bullet> a \<in> supp q" by (simp add: supp_perm)
+ − 1054
then have "q \<bullet> a \<notin> supp p" using asm by auto
+ − 1055
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1056
by (simp add: supp_perm)
+ − 1057
}
+ − 1058
ultimately show "(p + q) \<bullet> a = (q + p) \<bullet> a"
+ − 1059
using asm by blast
+ − 1060
qed
+ − 1061
qed
1062
+ − 1062
2614
+ − 1063
lemma supp_plus_perm_eq:
+ − 1064
fixes p q::perm
+ − 1065
assumes asm: "supp p \<inter> supp q = {}"
+ − 1066
shows "supp (p + q) = supp p \<union> supp q"
+ − 1067
proof -
+ − 1068
{ fix a::"atom"
+ − 1069
assume "a \<in> supp p"
+ − 1070
then have "a \<notin> supp q" using asm by auto
+ − 1071
then have "a \<in> supp (p + q)" using `a \<in> supp p`
+ − 1072
by (simp add: supp_perm)
+ − 1073
}
+ − 1074
moreover
+ − 1075
{ fix a::"atom"
+ − 1076
assume "a \<in> supp q"
+ − 1077
then have "a \<notin> supp p" using asm by auto
+ − 1078
then have "a \<in> supp (q + p)" using `a \<in> supp q`
+ − 1079
by (simp add: supp_perm)
+ − 1080
then have "a \<in> supp (p + q)" using asm plus_perm_eq
+ − 1081
by metis
+ − 1082
}
+ − 1083
ultimately have "supp p \<union> supp q \<subseteq> supp (p + q)"
+ − 1084
by blast
+ − 1085
then show "supp (p + q) = supp p \<union> supp q" using supp_plus_perm
+ − 1086
by blast
+ − 1087
qed
+ − 1088
+ − 1089
1062
+ − 1090
section {* Finite Support instances for other types *}
+ − 1091
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1092
1062
+ − 1093
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *}
+ − 1094
+ − 1095
lemma supp_Pair:
+ − 1096
shows "supp (x, y) = supp x \<union> supp y"
+ − 1097
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1098
+ − 1099
lemma fresh_Pair:
+ − 1100
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y"
+ − 1101
by (simp add: fresh_def supp_Pair)
+ − 1102
2470
+ − 1103
lemma supp_Unit:
+ − 1104
shows "supp () = {}"
+ − 1105
by (simp add: supp_def)
+ − 1106
+ − 1107
lemma fresh_Unit:
+ − 1108
shows "a \<sharp> ()"
+ − 1109
by (simp add: fresh_def supp_Unit)
+ − 1110
2378
+ − 1111
instance prod :: (fs, fs) fs
1062
+ − 1112
apply default
+ − 1113
apply (induct_tac x)
+ − 1114
apply (simp add: supp_Pair finite_supp)
+ − 1115
done
+ − 1116
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1117
1062
+ − 1118
subsection {* Type @{typ "'a + 'b"} is finitely supported *}
+ − 1119
+ − 1120
lemma supp_Inl:
+ − 1121
shows "supp (Inl x) = supp x"
+ − 1122
by (simp add: supp_def)
+ − 1123
+ − 1124
lemma supp_Inr:
+ − 1125
shows "supp (Inr x) = supp x"
+ − 1126
by (simp add: supp_def)
+ − 1127
+ − 1128
lemma fresh_Inl:
+ − 1129
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x"
+ − 1130
by (simp add: fresh_def supp_Inl)
+ − 1131
+ − 1132
lemma fresh_Inr:
+ − 1133
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
+ − 1134
by (simp add: fresh_def supp_Inr)
+ − 1135
2378
+ − 1136
instance sum :: (fs, fs) fs
1062
+ − 1137
apply default
+ − 1138
apply (induct_tac x)
+ − 1139
apply (simp_all add: supp_Inl supp_Inr finite_supp)
+ − 1140
done
+ − 1141
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1142
1062
+ − 1143
subsection {* Type @{typ "'a option"} is finitely supported *}
+ − 1144
+ − 1145
lemma supp_None:
+ − 1146
shows "supp None = {}"
+ − 1147
by (simp add: supp_def)
+ − 1148
+ − 1149
lemma supp_Some:
+ − 1150
shows "supp (Some x) = supp x"
+ − 1151
by (simp add: supp_def)
+ − 1152
+ − 1153
lemma fresh_None:
+ − 1154
shows "a \<sharp> None"
+ − 1155
by (simp add: fresh_def supp_None)
+ − 1156
+ − 1157
lemma fresh_Some:
+ − 1158
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
+ − 1159
by (simp add: fresh_def supp_Some)
+ − 1160
+ − 1161
instance option :: (fs) fs
+ − 1162
apply default
+ − 1163
apply (induct_tac x)
+ − 1164
apply (simp_all add: supp_None supp_Some finite_supp)
+ − 1165
done
+ − 1166
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1167
1062
+ − 1168
subsubsection {* Type @{typ "'a list"} is finitely supported *}
+ − 1169
+ − 1170
lemma supp_Nil:
+ − 1171
shows "supp [] = {}"
+ − 1172
by (simp add: supp_def)
+ − 1173
+ − 1174
lemma supp_Cons:
+ − 1175
shows "supp (x # xs) = supp x \<union> supp xs"
+ − 1176
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
+ − 1177
2591
+ − 1178
lemma supp_append:
+ − 1179
shows "supp (xs @ ys) = supp xs \<union> supp ys"
+ − 1180
by (induct xs) (auto simp add: supp_Nil supp_Cons)
+ − 1181
1062
+ − 1182
lemma fresh_Nil:
+ − 1183
shows "a \<sharp> []"
+ − 1184
by (simp add: fresh_def supp_Nil)
+ − 1185
+ − 1186
lemma fresh_Cons:
+ − 1187
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs"
+ − 1188
by (simp add: fresh_def supp_Cons)
+ − 1189
2591
+ − 1190
lemma fresh_append:
+ − 1191
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys"
+ − 1192
by (induct xs) (simp_all add: fresh_Nil fresh_Cons)
+ − 1193
+ − 1194
1062
+ − 1195
instance list :: (fs) fs
+ − 1196
apply default
+ − 1197
apply (induct_tac x)
+ − 1198
apply (simp_all add: supp_Nil supp_Cons finite_supp)
+ − 1199
done
+ − 1200
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1201
lemma supp_of_atom_list:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1202
fixes as::"atom list"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1203
shows "supp as = set as"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1204
by (induct as)
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1205
(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
+ − 1206
2466
+ − 1207
2470
+ − 1208
section {* Support and Freshness for Applications *}
1062
+ − 1209
1879
+ − 1210
lemma fresh_conv_MOST:
+ − 1211
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)"
+ − 1212
unfolding fresh_def supp_def
+ − 1213
unfolding MOST_iff_cofinite by simp
+ − 1214
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1215
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
+ − 1216
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
+ − 1217
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
+ − 1218
using a
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1219
unfolding fresh_def
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1220
by blast
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1221
1879
+ − 1222
lemma fresh_fun_app:
+ − 1223
assumes "a \<sharp> f" and "a \<sharp> x"
+ − 1224
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
+ − 1225
using assms
1879
+ − 1226
unfolding fresh_conv_MOST
+ − 1227
unfolding permute_fun_app_eq
+ − 1228
by (elim MOST_rev_mp, simp)
+ − 1229
1062
+ − 1230
lemma supp_fun_app:
+ − 1231
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)"
1879
+ − 1232
using fresh_fun_app
+ − 1233
unfolding fresh_def
+ − 1234
by auto
+ − 1235
2470
+ − 1236
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
+ − 1237
1941
+ − 1238
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
+ − 1239
assumes a: "\<And>p. p \<bullet> f = f"
1941
+ − 1240
shows "supp f = {}"
+ − 1241
unfolding supp_def
+ − 1242
using a by simp
+ − 1243
1062
+ − 1244
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
+ − 1245
assumes a: "\<And>p. p \<bullet> f = f"
1062
+ − 1246
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
+ − 1247
proof -
1941
+ − 1248
from a have "supp f = {}" by (simp add: supp_fun_eqvt)
1879
+ − 1249
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
1062
+ − 1250
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
+ − 1251
using supp_fun_app by auto
1062
+ − 1252
qed
+ − 1253
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
+ − 1254
2466
+ − 1255
section {* Support of Finite Sets of Finitely Supported Elements *}
+ − 1256
2657
+ − 1257
text {* support and freshness for atom sets *}
+ − 1258
+ − 1259
lemma supp_finite_atom_set:
+ − 1260
fixes S::"atom set"
+ − 1261
assumes "finite S"
+ − 1262
shows "supp S = S"
+ − 1263
apply(rule finite_supp_unique)
+ − 1264
apply(simp add: supports_def)
+ − 1265
apply(simp add: swap_set_not_in)
+ − 1266
apply(rule assms)
+ − 1267
apply(simp add: swap_set_in)
+ − 1268
done
+ − 1269
+ − 1270
lemma fresh_finite_atom_set:
+ − 1271
fixes S::"atom set"
+ − 1272
assumes "finite S"
+ − 1273
shows "a \<sharp> S \<longleftrightarrow> a \<notin> S"
+ − 1274
unfolding fresh_def
+ − 1275
by (simp add: supp_finite_atom_set[OF assms])
+ − 1276
+ − 1277
2466
+ − 1278
lemma Union_fresh:
+ − 1279
shows "a \<sharp> S \<Longrightarrow> a \<sharp> (\<Union>x \<in> S. supp x)"
+ − 1280
unfolding Union_image_eq[symmetric]
+ − 1281
apply(rule_tac f="\<lambda>S. \<Union> supp ` S" in fresh_fun_eqvt_app)
+ − 1282
apply(simp add: permute_fun_def UNION_def Collect_def Bex_def ex_eqvt mem_def conj_eqvt)
+ − 1283
apply(subst permute_fun_app_eq)
+ − 1284
back
+ − 1285
apply(simp add: supp_eqvt)
+ − 1286
apply(assumption)
+ − 1287
done
+ − 1288
+ − 1289
lemma Union_supports_set:
+ − 1290
shows "(\<Union>x \<in> S. supp x) supports S"
+ − 1291
proof -
+ − 1292
{ fix a b
+ − 1293
have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S"
+ − 1294
unfolding permute_set_eq by force
+ − 1295
}
+ − 1296
then show "(\<Union>x \<in> S. supp x) supports S"
+ − 1297
unfolding supports_def
+ − 1298
by (simp add: fresh_def[symmetric] swap_fresh_fresh)
+ − 1299
qed
+ − 1300
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1301
lemma Union_of_finite_supp_sets:
2466
+ − 1302
fixes S::"('a::fs set)"
+ − 1303
assumes fin: "finite S"
+ − 1304
shows "finite (\<Union>x\<in>S. supp x)"
+ − 1305
using fin by (induct) (auto simp add: finite_supp)
+ − 1306
+ − 1307
lemma Union_included_in_supp:
+ − 1308
fixes S::"('a::fs set)"
+ − 1309
assumes fin: "finite S"
+ − 1310
shows "(\<Union>x\<in>S. supp x) \<subseteq> supp S"
+ − 1311
proof -
+ − 1312
have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)"
+ − 1313
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
+ − 1314
(rule Union_of_finite_supp_sets[OF fin])
2466
+ − 1315
also have "\<dots> \<subseteq> supp S"
+ − 1316
by (rule supp_subset_fresh)
+ − 1317
(simp add: Union_fresh)
+ − 1318
finally show "(\<Union>x\<in>S. supp x) \<subseteq> supp S" .
+ − 1319
qed
+ − 1320
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1321
lemma supp_of_finite_sets:
2466
+ − 1322
fixes S::"('a::fs set)"
+ − 1323
assumes fin: "finite S"
+ − 1324
shows "(supp S) = (\<Union>x\<in>S. supp x)"
+ − 1325
apply(rule subset_antisym)
+ − 1326
apply(rule supp_is_subset)
+ − 1327
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
+ − 1328
apply(rule Union_of_finite_supp_sets[OF fin])
2466
+ − 1329
apply(rule Union_included_in_supp[OF fin])
+ − 1330
done
+ − 1331
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1332
lemma finite_sets_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1333
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
+ − 1334
assumes "finite S"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1335
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1336
using assms
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1337
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
+ − 1338
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1339
lemma supp_of_finite_union:
2466
+ − 1340
fixes S T::"('a::fs) set"
+ − 1341
assumes fin1: "finite S"
+ − 1342
and fin2: "finite T"
+ − 1343
shows "supp (S \<union> T) = supp S \<union> supp T"
+ − 1344
using fin1 fin2
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1345
by (simp add: supp_of_finite_sets)
2466
+ − 1346
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1347
lemma supp_of_finite_insert:
2466
+ − 1348
fixes S::"('a::fs) set"
+ − 1349
assumes fin: "finite S"
+ − 1350
shows "supp (insert x S) = supp x \<union> supp S"
+ − 1351
using fin
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1352
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
+ − 1353
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1354
lemma fresh_finite_insert:
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1355
fixes S::"('a::fs) set"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1356
assumes fin: "finite S"
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1357
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
+ − 1358
using fin unfolding fresh_def
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1359
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
+ − 1360
2591
+ − 1361
lemma supp_set_empty:
+ − 1362
shows "supp {} = {}"
+ − 1363
unfolding supp_def
+ − 1364
by (simp add: empty_eqvt)
+ − 1365
+ − 1366
lemma fresh_set_empty:
+ − 1367
shows "a \<sharp> {}"
+ − 1368
by (simp add: fresh_def supp_set_empty)
+ − 1369
+ − 1370
lemma supp_set:
+ − 1371
fixes xs :: "('a::fs) list"
+ − 1372
shows "supp (set xs) = supp xs"
+ − 1373
apply(induct xs)
+ − 1374
apply(simp add: supp_set_empty supp_Nil)
+ − 1375
apply(simp add: supp_Cons supp_of_finite_insert)
+ − 1376
done
+ − 1377
+ − 1378
lemma fresh_set:
+ − 1379
fixes xs :: "('a::fs) list"
+ − 1380
shows "a \<sharp> (set xs) \<longleftrightarrow> a \<sharp> xs"
+ − 1381
unfolding fresh_def
+ − 1382
by (simp add: supp_set)
+ − 1383
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1384
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1385
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
+ − 1386
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1387
lemma fset_eqvt:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1388
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
+ − 1389
by (lifting set_eqvt)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1390
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1391
lemma supp_fset [simp]:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1392
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
+ − 1393
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1394
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
+ − 1395
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1396
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
+ − 1397
shows "supp {||} = {}"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1398
unfolding supp_def
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1399
by simp
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1400
2641
+ − 1401
lemma fresh_empty_fset:
+ − 1402
shows "a \<sharp> {||}"
+ − 1403
unfolding fresh_def
+ − 1404
by (simp)
+ − 1405
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1406
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
+ − 1407
fixes x::"'a::fs"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1408
and S::"'a fset"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1409
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
+ − 1410
apply(subst supp_fset[symmetric])
2587
+ − 1411
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
+ − 1412
done
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1413
2641
+ − 1414
lemma fresh_insert_fset:
+ − 1415
fixes x::"'a::fs"
+ − 1416
and S::"'a fset"
+ − 1417
shows "a \<sharp> insert_fset x S \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S"
+ − 1418
unfolding fresh_def
+ − 1419
by (simp)
+ − 1420
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1421
lemma fset_finite_supp:
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1422
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
+ − 1423
shows "finite (supp S)"
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1424
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
+ − 1425
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1426
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1427
instance fset :: (fs) fs
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1428
apply (default)
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1429
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
+ − 1430
done
2466
+ − 1431
+ − 1432
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1433
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
+ − 1434
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1435
lemma fresh_Unit_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1436
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
+ − 1437
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
+ − 1438
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1439
lemma fresh_Pair_elim:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1440
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
+ − 1441
by rule (simp_all add: fresh_Pair)
2470
+ − 1442
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1443
(* 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
+ − 1444
(* 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
+ − 1445
lemma [simp]:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1446
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
+ − 1447
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
+ − 1448
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1449
lemma fresh_PairD:
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1450
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
+ − 1451
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
+ − 1452
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
+ − 1453
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1454
ML {*
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1455
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
+ − 1456
*}
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1457
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1458
declaration {* fn _ =>
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1459
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
+ − 1460
*}
2470
+ − 1461
+ − 1462
text {* The fresh-star generalisation of fresh is used in strong
+ − 1463
induction principles. *}
+ − 1464
+ − 1465
definition
+ − 1466
fresh_star :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp>* _" [80,80] 80)
+ − 1467
where
+ − 1468
"as \<sharp>* x \<equiv> \<forall>a \<in> as. a \<sharp> x"
+ − 1469
2507
+ − 1470
lemma fresh_star_supp_conv:
+ − 1471
shows "supp x \<sharp>* y \<Longrightarrow> supp y \<sharp>* x"
+ − 1472
by (auto simp add: fresh_star_def fresh_def)
+ − 1473
2591
+ − 1474
lemma fresh_star_Pair:
2470
+ − 1475
shows "as \<sharp>* (x, y) = (as \<sharp>* x \<and> as \<sharp>* y)"
+ − 1476
by (auto simp add: fresh_star_def fresh_Pair)
+ − 1477
2591
+ − 1478
lemma fresh_star_list:
+ − 1479
shows "as \<sharp>* (xs @ ys) \<longleftrightarrow> as \<sharp>* xs \<and> as \<sharp>* ys"
+ − 1480
and "as \<sharp>* (x # xs) \<longleftrightarrow> as \<sharp>* x \<and> as \<sharp>* xs"
+ − 1481
and "as \<sharp>* []"
+ − 1482
by (auto simp add: fresh_star_def fresh_Nil fresh_Cons fresh_append)
+ − 1483
+ − 1484
lemma fresh_star_set:
+ − 1485
fixes xs::"('a::fs) list"
+ − 1486
shows "as \<sharp>* set xs \<longleftrightarrow> as \<sharp>* xs"
+ − 1487
unfolding fresh_star_def
+ − 1488
by (simp add: fresh_set)
+ − 1489
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1490
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
+ − 1491
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
+ − 1492
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
+ − 1493
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
+ − 1494
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1495
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
+ − 1496
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
+ − 1497
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
+ − 1498
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
+ − 1499
2591
+ − 1500
lemma fresh_star_Un:
2470
+ − 1501
shows "(as \<union> bs) \<sharp>* x = (as \<sharp>* x \<and> bs \<sharp>* x)"
+ − 1502
by (auto simp add: fresh_star_def)
+ − 1503
+ − 1504
lemma fresh_star_insert:
+ − 1505
shows "(insert a as) \<sharp>* x = (a \<sharp> x \<and> as \<sharp>* x)"
+ − 1506
by (auto simp add: fresh_star_def)
+ − 1507
+ − 1508
lemma fresh_star_Un_elim:
+ − 1509
"((as \<union> bs) \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (as \<sharp>* x \<Longrightarrow> bs \<sharp>* x \<Longrightarrow> PROP C)"
+ − 1510
unfolding fresh_star_def
+ − 1511
apply(rule)
+ − 1512
apply(erule meta_mp)
+ − 1513
apply(auto)
+ − 1514
done
+ − 1515
+ − 1516
lemma fresh_star_insert_elim:
+ − 1517
"(insert a as \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> as \<sharp>* x \<Longrightarrow> PROP C)"
+ − 1518
unfolding fresh_star_def
+ − 1519
by rule (simp_all add: fresh_star_def)
+ − 1520
+ − 1521
lemma fresh_star_empty_elim:
+ − 1522
"({} \<sharp>* x \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 1523
by (simp add: fresh_star_def)
+ − 1524
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1525
lemma fresh_star_Unit_elim:
2470
+ − 1526
shows "(a \<sharp>* () \<Longrightarrow> PROP C) \<equiv> PROP C"
+ − 1527
by (simp add: fresh_star_def fresh_Unit)
+ − 1528
2591
+ − 1529
lemma fresh_star_Pair_elim:
2470
+ − 1530
shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)"
2591
+ − 1531
by (rule, simp_all add: fresh_star_Pair)
2470
+ − 1532
+ − 1533
lemma fresh_star_zero:
+ − 1534
shows "as \<sharp>* (0::perm)"
+ − 1535
unfolding fresh_star_def
+ − 1536
by (simp add: fresh_zero_perm)
+ − 1537
+ − 1538
lemma fresh_star_plus:
+ − 1539
fixes p q::perm
+ − 1540
shows "\<lbrakk>a \<sharp>* p; a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
+ − 1541
unfolding fresh_star_def
+ − 1542
by (simp add: fresh_plus_perm)
+ − 1543
+ − 1544
lemma fresh_star_permute_iff:
+ − 1545
shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
+ − 1546
unfolding fresh_star_def
+ − 1547
by (metis mem_permute_iff permute_minus_cancel(1) fresh_permute_iff)
+ − 1548
+ − 1549
lemma fresh_star_eqvt:
+ − 1550
shows "(p \<bullet> (as \<sharp>* x)) = (p \<bullet> as) \<sharp>* (p \<bullet> x)"
+ − 1551
unfolding fresh_star_def
+ − 1552
unfolding Ball_def
+ − 1553
apply(simp add: all_eqvt)
+ − 1554
apply(subst permute_fun_def)
+ − 1555
apply(simp add: imp_eqvt fresh_eqvt mem_eqvt)
+ − 1556
done
+ − 1557
2591
+ − 1558
lemma at_fresh_star_inter:
+ − 1559
assumes a: "(p \<bullet> bs) \<sharp>* bs"
+ − 1560
and b: "finite bs"
+ − 1561
shows "p \<bullet> bs \<inter> bs = {}"
+ − 1562
using a b
+ − 1563
unfolding fresh_star_def
+ − 1564
unfolding fresh_def
+ − 1565
by (auto simp add: supp_finite_atom_set)
+ − 1566
2470
+ − 1567
+ − 1568
section {* Induction principle for permutations *}
+ − 1569
+ − 1570
+ − 1571
lemma perm_struct_induct[consumes 1, case_names zero swap]:
+ − 1572
assumes S: "supp p \<subseteq> S"
+ − 1573
and zero: "P 0"
+ − 1574
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)"
+ − 1575
shows "P p"
+ − 1576
proof -
+ − 1577
have "finite (supp p)" by (simp add: finite_supp)
+ − 1578
then show "P p" using S
+ − 1579
proof(induct A\<equiv>"supp p" arbitrary: p rule: finite_psubset_induct)
+ − 1580
case (psubset p)
+ − 1581
then have ih: "\<And>q. supp q \<subset> supp p \<Longrightarrow> P q" by auto
+ − 1582
have as: "supp p \<subseteq> S" by fact
+ − 1583
{ assume "supp p = {}"
+ − 1584
then have "p = 0" by (simp add: supp_perm expand_perm_eq)
+ − 1585
then have "P p" using zero by simp
+ − 1586
}
+ − 1587
moreover
+ − 1588
{ assume "supp p \<noteq> {}"
+ − 1589
then obtain a where a0: "a \<in> supp p" by blast
+ − 1590
then have a1: "p \<bullet> a \<in> S" "a \<in> S" "sort_of (p \<bullet> a) = sort_of a" "p \<bullet> a \<noteq> a"
+ − 1591
using as by (auto simp add: supp_atom supp_perm swap_atom)
+ − 1592
let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p"
+ − 1593
have a2: "supp ?q \<subseteq> supp p" unfolding supp_perm by (auto simp add: swap_atom)
+ − 1594
moreover
+ − 1595
have "a \<notin> supp ?q" by (simp add: supp_perm)
+ − 1596
then have "supp ?q \<noteq> supp p" using a0 by auto
+ − 1597
ultimately have "supp ?q \<subset> supp p" using a2 by auto
+ − 1598
then have "P ?q" using ih by simp
+ − 1599
moreover
+ − 1600
have "supp ?q \<subseteq> S" using as a2 by simp
+ − 1601
ultimately have "P ((p \<bullet> a \<rightleftharpoons> a) + ?q)" using as a1 swap by simp
+ − 1602
moreover
+ − 1603
have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: expand_perm_eq)
+ − 1604
ultimately have "P p" by simp
+ − 1605
}
+ − 1606
ultimately show "P p" by blast
+ − 1607
qed
+ − 1608
qed
+ − 1609
+ − 1610
lemma perm_simple_struct_induct[case_names zero swap]:
+ − 1611
assumes zero: "P 0"
+ − 1612
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)"
+ − 1613
shows "P p"
+ − 1614
by (rule_tac S="supp p" in perm_struct_induct)
+ − 1615
(auto intro: zero swap)
+ − 1616
+ − 1617
lemma perm_subset_induct[consumes 1, case_names zero swap plus]:
+ − 1618
assumes S: "supp p \<subseteq> S"
+ − 1619
assumes zero: "P 0"
+ − 1620
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)"
+ − 1621
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2; supp p1 \<subseteq> S; supp p2 \<subseteq> S\<rbrakk> \<Longrightarrow> P (p1 + p2)"
+ − 1622
shows "P p"
+ − 1623
using S
+ − 1624
by (induct p rule: perm_struct_induct)
+ − 1625
(auto intro: zero plus swap simp add: supp_swap)
+ − 1626
+ − 1627
lemma supp_perm_eq:
+ − 1628
assumes "(supp x) \<sharp>* p"
+ − 1629
shows "p \<bullet> x = x"
+ − 1630
proof -
+ − 1631
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 1632
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 1633
then show "p \<bullet> x = x"
+ − 1634
proof (induct p rule: perm_struct_induct)
+ − 1635
case zero
+ − 1636
show "0 \<bullet> x = x" by simp
+ − 1637
next
+ − 1638
case (swap p a b)
+ − 1639
then have "a \<sharp> x" "b \<sharp> x" "p \<bullet> x = x" by simp_all
+ − 1640
then show "((a \<rightleftharpoons> b) + p) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 1641
qed
+ − 1642
qed
+ − 1643
+ − 1644
lemma supp_perm_eq_test:
+ − 1645
assumes "(supp x) \<sharp>* p"
+ − 1646
shows "p \<bullet> x = x"
+ − 1647
proof -
+ − 1648
from assms have "supp p \<subseteq> {a. a \<sharp> x}"
+ − 1649
unfolding supp_perm fresh_star_def fresh_def by auto
+ − 1650
then show "p \<bullet> x = x"
+ − 1651
proof (induct p rule: perm_subset_induct)
+ − 1652
case zero
+ − 1653
show "0 \<bullet> x = x" by simp
+ − 1654
next
+ − 1655
case (swap a b)
+ − 1656
then have "a \<sharp> x" "b \<sharp> x" by simp_all
+ − 1657
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh)
+ − 1658
next
+ − 1659
case (plus p1 p2)
+ − 1660
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+
+ − 1661
then show "(p1 + p2) \<bullet> x = x" by simp
+ − 1662
qed
+ − 1663
qed
+ − 1664
2591
+ − 1665
lemma perm_supp_eq:
+ − 1666
assumes a: "(supp p) \<sharp>* x"
+ − 1667
shows "p \<bullet> x = x"
+ − 1668
by (rule supp_perm_eq)
+ − 1669
(simp add: fresh_star_supp_conv a)
+ − 1670
2659
+ − 1671
lemma supp_perm_perm_eq:
+ − 1672
assumes a: "\<forall>a \<in> supp x. p \<bullet> a = q \<bullet> a"
+ − 1673
shows "p \<bullet> x = q \<bullet> x"
+ − 1674
proof -
+ − 1675
from a have "\<forall>a \<in> supp x. (-q + p) \<bullet> a = a" by simp
+ − 1676
then have "\<forall>a \<in> supp x. a \<notin> supp (-q + p)"
+ − 1677
unfolding supp_perm by simp
+ − 1678
then have "supp x \<sharp>* (-q + p)"
+ − 1679
unfolding fresh_star_def fresh_def by simp
+ − 1680
then have "(-q + p) \<bullet> x = x" by (simp only: supp_perm_eq)
+ − 1681
then show "p \<bullet> x = q \<bullet> x"
+ − 1682
by (metis permute_minus_cancel permute_plus)
+ − 1683
qed
+ − 1684
+ − 1685
2470
+ − 1686
+ − 1687
section {* Avoiding of atom sets *}
+ − 1688
+ − 1689
text {*
+ − 1690
For every set of atoms, there is another set of atoms
+ − 1691
avoiding a finitely supported c and there is a permutation
+ − 1692
which 'translates' between both sets.
+ − 1693
*}
+ − 1694
+ − 1695
lemma at_set_avoiding_aux:
+ − 1696
fixes Xs::"atom set"
+ − 1697
and As::"atom set"
+ − 1698
assumes b: "Xs \<subseteq> As"
+ − 1699
and c: "finite As"
2614
+ − 1700
shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 1701
proof -
+ − 1702
from b c have "finite Xs" by (rule finite_subset)
+ − 1703
then show ?thesis using b
+ − 1704
proof (induct rule: finite_subset_induct)
+ − 1705
case empty
+ − 1706
have "0 \<bullet> {} \<inter> As = {}" by simp
+ − 1707
moreover
2614
+ − 1708
have "supp (0::perm) = {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm)
2470
+ − 1709
ultimately show ?case by blast
+ − 1710
next
+ − 1711
case (insert x Xs)
+ − 1712
then obtain p where
+ − 1713
p1: "(p \<bullet> Xs) \<inter> As = {}" and
2614
+ − 1714
p2: "supp p = (Xs \<union> (p \<bullet> Xs))" by blast
2470
+ − 1715
from `x \<in> As` p1 have "x \<notin> p \<bullet> Xs" by fast
+ − 1716
with `x \<notin> Xs` p2 have "x \<notin> supp p" by fast
+ − 1717
hence px: "p \<bullet> x = x" unfolding supp_perm by simp
2614
+ − 1718
have "finite (As \<union> p \<bullet> Xs \<union> supp p)"
2470
+ − 1719
using `finite As` `finite Xs`
2614
+ − 1720
by (simp add: permute_set_eq_image finite_supp)
+ − 1721
then obtain y where "y \<notin> (As \<union> p \<bullet> Xs \<union> supp p)" "sort_of y = sort_of x"
2470
+ − 1722
by (rule obtain_atom)
2614
+ − 1723
hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "y \<notin> supp p" "sort_of y = sort_of x"
2470
+ − 1724
by simp_all
2614
+ − 1725
hence py: "p \<bullet> y = y" "x \<noteq> y" using `x \<in> As`
+ − 1726
by (auto simp add: supp_perm)
2470
+ − 1727
let ?q = "(x \<rightleftharpoons> y) + p"
+ − 1728
have q: "?q \<bullet> insert x Xs = insert y (p \<bullet> Xs)"
+ − 1729
unfolding insert_eqvt
+ − 1730
using `p \<bullet> x = x` `sort_of y = sort_of x`
+ − 1731
using `x \<notin> p \<bullet> Xs` `y \<notin> p \<bullet> Xs`
+ − 1732
by (simp add: swap_atom swap_set_not_in)
+ − 1733
have "?q \<bullet> insert x Xs \<inter> As = {}"
+ − 1734
using `y \<notin> As` `p \<bullet> Xs \<inter> As = {}`
+ − 1735
unfolding q by simp
+ − 1736
moreover
2614
+ − 1737
have "supp (x \<rightleftharpoons> y) \<inter> supp p = {}" using px py `sort_of y = sort_of x`
+ − 1738
unfolding supp_swap by (simp add: supp_perm)
+ − 1739
then have "supp ?q = (supp (x \<rightleftharpoons> y) \<union> supp p)"
+ − 1740
by (simp add: supp_plus_perm_eq)
+ − 1741
then have "supp ?q = insert x Xs \<union> ?q \<bullet> insert x Xs"
+ − 1742
using p2 `sort_of y = sort_of x` `x \<noteq> y` unfolding q supp_swap
+ − 1743
by auto
2470
+ − 1744
ultimately show ?case by blast
+ − 1745
qed
+ − 1746
qed
+ − 1747
+ − 1748
lemma at_set_avoiding:
+ − 1749
assumes a: "finite Xs"
+ − 1750
and b: "finite (supp c)"
2614
+ − 1751
obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) = (Xs \<union> (p \<bullet> Xs))"
2470
+ − 1752
using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \<union> supp c"]
+ − 1753
unfolding fresh_star_def fresh_def by blast
+ − 1754
2589
+ − 1755
lemma at_set_avoiding1:
+ − 1756
assumes "finite xs"
+ − 1757
and "finite (supp c)"
+ − 1758
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c"
+ − 1759
using assms
+ − 1760
apply(erule_tac c="c" in at_set_avoiding)
+ − 1761
apply(auto)
+ − 1762
done
+ − 1763
2470
+ − 1764
lemma at_set_avoiding2:
+ − 1765
assumes "finite xs"
+ − 1766
and "finite (supp c)" "finite (supp x)"
+ − 1767
and "xs \<sharp>* x"
+ − 1768
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p"
+ − 1769
using assms
+ − 1770
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 1771
apply(simp add: supp_Pair)
+ − 1772
apply(rule_tac x="p" in exI)
2591
+ − 1773
apply(simp add: fresh_star_Pair)
2507
+ − 1774
apply(rule fresh_star_supp_conv)
+ − 1775
apply(auto simp add: fresh_star_def)
2470
+ − 1776
done
+ − 1777
2573
+ − 1778
lemma at_set_avoiding3:
+ − 1779
assumes "finite xs"
+ − 1780
and "finite (supp c)" "finite (supp x)"
+ − 1781
and "xs \<sharp>* x"
2614
+ − 1782
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p \<and> supp p = xs \<union> (p \<bullet> xs)"
2586
+ − 1783
using assms
+ − 1784
apply(erule_tac c="(c, x)" in at_set_avoiding)
+ − 1785
apply(simp add: supp_Pair)
+ − 1786
apply(rule_tac x="p" in exI)
2591
+ − 1787
apply(simp add: fresh_star_Pair)
2586
+ − 1788
apply(rule fresh_star_supp_conv)
+ − 1789
apply(auto simp add: fresh_star_def)
+ − 1790
done
2573
+ − 1791
2470
+ − 1792
lemma at_set_avoiding2_atom:
+ − 1793
assumes "finite (supp c)" "finite (supp x)"
+ − 1794
and b: "a \<sharp> x"
+ − 1795
shows "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p"
+ − 1796
proof -
+ − 1797
have a: "{a} \<sharp>* x" unfolding fresh_star_def by (simp add: b)
+ − 1798
obtain p where p1: "(p \<bullet> {a}) \<sharp>* c" and p2: "supp x \<sharp>* p"
+ − 1799
using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast
+ − 1800
have c: "(p \<bullet> a) \<sharp> c" using p1
+ − 1801
unfolding fresh_star_def Ball_def
+ − 1802
by(erule_tac x="p \<bullet> a" in allE) (simp add: permute_set_eq)
+ − 1803
hence "p \<bullet> a \<sharp> c \<and> supp x \<sharp>* p" using p2 by blast
+ − 1804
then show "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" by blast
+ − 1805
qed
+ − 1806
2614
+ − 1807
2599
+ − 1808
section {* Renaming permutations *}
+ − 1809
+ − 1810
lemma set_renaming_perm:
2659
+ − 1811
assumes b: "finite bs"
2599
+ − 1812
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)"
2659
+ − 1813
using b
2599
+ − 1814
proof (induct)
+ − 1815
case empty
+ − 1816
have "0 \<bullet> {} = p \<bullet> {} \<and> supp (0::perm) \<subseteq> {} \<union> p \<bullet> {}"
+ − 1817
by (simp add: permute_set_eq supp_perm)
+ − 1818
then show "\<exists>q. q \<bullet> {} = p \<bullet> {} \<and> supp q \<subseteq> {} \<union> p \<bullet> {}" by blast
+ − 1819
next
+ − 1820
case (insert a bs)
+ − 1821
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> p \<bullet> bs"
+ − 1822
by (simp add: insert_eqvt)
+ − 1823
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> bs \<union> p \<bullet> bs" by blast
+ − 1824
{ assume 1: "q \<bullet> a = p \<bullet> a"
+ − 1825
have "q \<bullet> insert a bs = p \<bullet> insert a bs" using 1 * by (simp add: insert_eqvt)
+ − 1826
moreover
+ − 1827
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1828
using ** by (auto simp add: insert_eqvt)
+ − 1829
ultimately
+ − 1830
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
+ − 1831
}
+ − 1832
moreover
+ − 1833
{ assume 2: "q \<bullet> a \<noteq> p \<bullet> a"
+ − 1834
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
+ − 1835
{ have "(q \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` *[symmetric] by (simp add: mem_permute_iff)
+ − 1836
moreover
+ − 1837
have "(p \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` by (simp add: mem_permute_iff)
+ − 1838
ultimately
+ − 1839
have "q' \<bullet> insert a bs = p \<bullet> insert a bs" using 2 * unfolding q'_def
+ − 1840
by (simp add: insert_eqvt swap_set_not_in)
+ − 1841
}
+ − 1842
moreover
+ − 1843
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
2659
+ − 1844
using **
+ − 1845
apply (auto simp add: supp_perm insert_eqvt)
+ − 1846
apply (subgoal_tac "q \<bullet> a \<in> bs \<union> p \<bullet> bs")
+ − 1847
apply(auto)[1]
+ − 1848
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}")
+ − 1849
apply(blast)
+ − 1850
apply(simp)
+ − 1851
done
2599
+ − 1852
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)
+ − 1853
moreover
+ − 1854
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1855
using ** by (auto simp add: insert_eqvt)
+ − 1856
ultimately
+ − 1857
have "supp q' \<subseteq> insert a bs \<union> p \<bullet> insert a bs"
+ − 1858
unfolding q'_def using supp_plus_perm by blast
+ − 1859
}
+ − 1860
ultimately
+ − 1861
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
+ − 1862
}
+ − 1863
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"
+ − 1864
by blast
+ − 1865
qed
+ − 1866
+ − 1867
lemma list_renaming_perm:
+ − 1868
fixes bs::"atom list"
+ − 1869
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> (set bs) \<union> (p \<bullet> (set bs))"
+ − 1870
proof (induct bs)
+ − 1871
case Nil
+ − 1872
have "0 \<bullet> [] = p \<bullet> [] \<and> supp (0::perm) \<subseteq> set [] \<union> p \<bullet> set []"
+ − 1873
by (simp add: permute_set_eq supp_perm)
+ − 1874
then show "\<exists>q. q \<bullet> [] = p \<bullet> [] \<and> supp q \<subseteq> set [] \<union> p \<bullet> (set [])" by blast
+ − 1875
next
+ − 1876
case (Cons a bs)
+ − 1877
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> set bs \<union> p \<bullet> (set bs)"
+ − 1878
by (simp add: insert_eqvt)
+ − 1879
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" by blast
+ − 1880
{ assume 1: "a \<in> set bs"
+ − 1881
have "q \<bullet> a = p \<bullet> a" using * 1 by (induct bs) (auto)
+ − 1882
then have "q \<bullet> (a # bs) = p \<bullet> (a # bs)" using * by simp
+ − 1883
moreover
+ − 1884
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" using ** by (auto simp add: insert_eqvt)
+ − 1885
ultimately
+ − 1886
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
+ − 1887
}
+ − 1888
moreover
+ − 1889
{ assume 2: "a \<notin> set bs"
+ − 1890
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q"
+ − 1891
{ have "(q \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs` *[symmetric]
+ − 1892
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list)
+ − 1893
moreover
+ − 1894
have "(p \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs`
+ − 1895
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list)
+ − 1896
ultimately
+ − 1897
have "q' \<bullet> (a # bs) = p \<bullet> (a # bs)" using 2 * unfolding q'_def
+ − 1898
by (simp add: swap_fresh_fresh)
+ − 1899
}
+ − 1900
moreover
+ − 1901
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
2659
+ − 1902
using **
+ − 1903
apply (auto simp add: supp_perm insert_eqvt)
+ − 1904
apply (subgoal_tac "q \<bullet> a \<in> set bs \<union> p \<bullet> set bs")
+ − 1905
apply(auto)[1]
+ − 1906
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}")
+ − 1907
apply(blast)
+ − 1908
apply(simp)
+ − 1909
done
2599
+ − 1910
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)
+ − 1911
moreover
+ − 1912
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1913
using ** by (auto simp add: insert_eqvt)
+ − 1914
ultimately
+ − 1915
have "supp q' \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))"
+ − 1916
unfolding q'_def using supp_plus_perm by blast
+ − 1917
}
+ − 1918
ultimately
+ − 1919
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
+ − 1920
}
+ − 1921
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))"
+ − 1922
by blast
+ − 1923
qed
+ − 1924
+ − 1925
2470
+ − 1926
+ − 1927
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
+ − 1928
1972
+ − 1929
text {*
+ − 1930
Class @{text at_base} allows types containing multiple sorts of atoms.
+ − 1931
Class @{text at} only allows types with a single sort.
+ − 1932
*}
+ − 1933
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
+ − 1934
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
+ − 1935
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
+ − 1936
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
+ − 1937
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
+ − 1938
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
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
+ − 1940
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
+ − 1941
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
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
+ − 1943
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
+ − 1944
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
+ − 1945
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
+ − 1946
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
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
+ − 1948
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
+ − 1949
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
+ − 1950
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
+ − 1951
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
+ − 1952
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
+ − 1953
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
+ − 1954
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
+ − 1955
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1956
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
+ − 1957
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
+ − 1958
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
+ − 1959
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
+ − 1960
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
+ − 1961
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
+ − 1962
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
+ − 1963
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
+ − 1964
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
+ − 1965
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
+ − 1966
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
+ − 1967
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
+ − 1968
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
+ − 1969
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
+ − 1970
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
+ − 1971
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
+ − 1972
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
+ − 1973
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
+ − 1974
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
+ − 1975
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
+ − 1976
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
+ − 1977
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
+ − 1978
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
+ − 1979
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
+ − 1980
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
+ − 1981
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
+ − 1982
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
+ − 1983
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
+ − 1984
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
+ − 1985
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
+ − 1986
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
+ − 1987
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
+ − 1988
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
+ − 1989
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
+ − 1990
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
+ − 1991
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
+ − 1992
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
+ − 1993
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
+ − 1994
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
+ − 1995
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
+ − 1996
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
+ − 1997
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
+ − 1998
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
+ − 1999
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
+ − 2000
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
+ − 2001
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
+ − 2002
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
+ − 2003
1973
+ − 2004
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
+ − 2005
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
+ − 2006
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
+ − 2007
apply(simp add: supp_of_finite_sets[OF a])
2466
+ − 2008
apply(simp add: supp_at_base)
+ − 2009
apply(auto)
+ − 2010
done
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2011
2657
+ − 2012
lemma fresh_finite_set_at_base:
+ − 2013
fixes a::"'a::at_base"
+ − 2014
assumes a: "finite S"
+ − 2015
shows "atom a \<sharp> S \<longleftrightarrow> a \<notin> S"
+ − 2016
unfolding fresh_def
+ − 2017
apply(simp add: supp_finite_set_at_base[OF a])
+ − 2018
apply(subst inj_image_mem_iff)
+ − 2019
apply(simp add: inj_on_def)
+ − 2020
apply(simp)
+ − 2021
done
+ − 2022
+ − 2023
2467
+ − 2024
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
+ − 2025
2467
+ − 2026
section {* A swapping operation for concrete atoms *}
+ − 2027
+ − 2028
definition
+ − 2029
flip :: "'a::at_base \<Rightarrow> 'a \<Rightarrow> perm" ("'(_ \<leftrightarrow> _')")
+ − 2030
where
+ − 2031
"(a \<leftrightarrow> b) = (atom a \<rightleftharpoons> atom b)"
+ − 2032
+ − 2033
lemma flip_self [simp]: "(a \<leftrightarrow> a) = 0"
+ − 2034
unfolding flip_def by (rule swap_self)
+ − 2035
+ − 2036
lemma flip_commute: "(a \<leftrightarrow> b) = (b \<leftrightarrow> a)"
+ − 2037
unfolding flip_def by (rule swap_commute)
+ − 2038
+ − 2039
lemma minus_flip [simp]: "- (a \<leftrightarrow> b) = (a \<leftrightarrow> b)"
+ − 2040
unfolding flip_def by (rule minus_swap)
+ − 2041
+ − 2042
lemma add_flip_cancel: "(a \<leftrightarrow> b) + (a \<leftrightarrow> b) = 0"
+ − 2043
unfolding flip_def by (rule swap_cancel)
+ − 2044
+ − 2045
lemma permute_flip_cancel [simp]: "(a \<leftrightarrow> b) \<bullet> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 2046
unfolding permute_plus [symmetric] add_flip_cancel by simp
+ − 2047
+ − 2048
lemma permute_flip_cancel2 [simp]: "(a \<leftrightarrow> b) \<bullet> (b \<leftrightarrow> a) \<bullet> x = x"
+ − 2049
by (simp add: flip_commute)
+ − 2050
+ − 2051
lemma flip_eqvt:
+ − 2052
fixes a b c::"'a::at_base"
+ − 2053
shows "p \<bullet> (a \<leftrightarrow> b) = (p \<bullet> a \<leftrightarrow> p \<bullet> b)"
+ − 2054
unfolding flip_def
+ − 2055
by (simp add: swap_eqvt atom_eqvt)
+ − 2056
+ − 2057
lemma flip_at_base_simps [simp]:
+ − 2058
shows "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> a = b"
+ − 2059
and "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> b = a"
+ − 2060
and "\<lbrakk>a \<noteq> c; b \<noteq> c\<rbrakk> \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> c = c"
+ − 2061
and "sort_of (atom a) \<noteq> sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> x = x"
+ − 2062
unfolding flip_def
+ − 2063
unfolding atom_eq_iff [symmetric]
+ − 2064
unfolding atom_eqvt [symmetric]
+ − 2065
by simp_all
+ − 2066
+ − 2067
text {* the following two lemmas do not hold for at_base,
+ − 2068
only for single sort atoms from at *}
+ − 2069
+ − 2070
lemma permute_flip_at:
+ − 2071
fixes a b c::"'a::at"
+ − 2072
shows "(a \<leftrightarrow> b) \<bullet> c = (if c = a then b else if c = b then a else c)"
+ − 2073
unfolding flip_def
+ − 2074
apply (rule atom_eq_iff [THEN iffD1])
+ − 2075
apply (subst atom_eqvt [symmetric])
+ − 2076
apply (simp add: swap_atom)
+ − 2077
done
+ − 2078
+ − 2079
lemma flip_at_simps [simp]:
+ − 2080
fixes a b::"'a::at"
+ − 2081
shows "(a \<leftrightarrow> b) \<bullet> a = b"
+ − 2082
and "(a \<leftrightarrow> b) \<bullet> b = a"
+ − 2083
unfolding permute_flip_at by simp_all
+ − 2084
+ − 2085
lemma flip_fresh_fresh:
+ − 2086
fixes a b::"'a::at_base"
+ − 2087
assumes "atom a \<sharp> x" "atom b \<sharp> x"
+ − 2088
shows "(a \<leftrightarrow> b) \<bullet> x = x"
+ − 2089
using assms
+ − 2090
by (simp add: flip_def swap_fresh_fresh)
+ − 2091
+ − 2092
subsection {* Syntax for coercing at-elements to the atom-type *}
+ − 2093
+ − 2094
syntax
+ − 2095
"_atom_constrain" :: "logic \<Rightarrow> type \<Rightarrow> logic" ("_:::_" [4, 0] 3)
+ − 2096
+ − 2097
translations
+ − 2098
"_atom_constrain a t" => "CONST atom (_constrain a t)"
+ − 2099
+ − 2100
+ − 2101
subsection {* A lemma for proving instances of class @{text at}. *}
+ − 2102
+ − 2103
setup {* Sign.add_const_constraint (@{const_name "permute"}, NONE) *}
+ − 2104
setup {* Sign.add_const_constraint (@{const_name "atom"}, NONE) *}
+ − 2105
+ − 2106
text {*
+ − 2107
New atom types are defined as subtypes of @{typ atom}.
+ − 2108
*}
+ − 2109
+ − 2110
lemma exists_eq_simple_sort:
+ − 2111
shows "\<exists>a. a \<in> {a. sort_of a = s}"
+ − 2112
by (rule_tac x="Atom s 0" in exI, simp)
+ − 2113
+ − 2114
lemma exists_eq_sort:
+ − 2115
shows "\<exists>a. a \<in> {a. sort_of a \<in> range sort_fun}"
+ − 2116
by (rule_tac x="Atom (sort_fun x) y" in exI, simp)
+ − 2117
+ − 2118
lemma at_base_class:
+ − 2119
fixes sort_fun :: "'b \<Rightarrow>atom_sort"
+ − 2120
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2121
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range sort_fun}"
+ − 2122
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2123
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2124
shows "OFCLASS('a, at_base_class)"
+ − 2125
proof
+ − 2126
interpret type_definition Rep Abs "{a. sort_of a \<in> range sort_fun}" by (rule type)
+ − 2127
have sort_of_Rep: "\<And>a. sort_of (Rep a) \<in> range sort_fun" using Rep by simp
+ − 2128
fix a b :: 'a and p p1 p2 :: perm
+ − 2129
show "0 \<bullet> a = a"
+ − 2130
unfolding permute_def by (simp add: Rep_inverse)
+ − 2131
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2132
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2133
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2134
unfolding atom_def by (simp add: Rep_inject)
+ − 2135
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2136
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2137
qed
+ − 2138
+ − 2139
(*
+ − 2140
lemma at_class:
+ − 2141
fixes s :: atom_sort
+ − 2142
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2143
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range (\<lambda>x::unit. s)}"
+ − 2144
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2145
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2146
shows "OFCLASS('a, at_class)"
+ − 2147
proof
+ − 2148
interpret type_definition Rep Abs "{a. sort_of a \<in> range (\<lambda>x::unit. s)}" by (rule type)
+ − 2149
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2150
fix a b :: 'a and p p1 p2 :: perm
+ − 2151
show "0 \<bullet> a = a"
+ − 2152
unfolding permute_def by (simp add: Rep_inverse)
+ − 2153
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2154
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2155
show "sort_of (atom a) = sort_of (atom b)"
+ − 2156
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2157
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2158
unfolding atom_def by (simp add: Rep_inject)
+ − 2159
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2160
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2161
qed
+ − 2162
*)
+ − 2163
+ − 2164
lemma at_class:
+ − 2165
fixes s :: atom_sort
+ − 2166
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a"
+ − 2167
assumes type: "type_definition Rep Abs {a. sort_of a = s}"
+ − 2168
assumes atom_def: "\<And>a. atom a = Rep a"
+ − 2169
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)"
+ − 2170
shows "OFCLASS('a, at_class)"
+ − 2171
proof
+ − 2172
interpret type_definition Rep Abs "{a. sort_of a = s}" by (rule type)
+ − 2173
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def)
+ − 2174
fix a b :: 'a and p p1 p2 :: perm
+ − 2175
show "0 \<bullet> a = a"
+ − 2176
unfolding permute_def by (simp add: Rep_inverse)
+ − 2177
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a"
+ − 2178
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2179
show "sort_of (atom a) = sort_of (atom b)"
+ − 2180
unfolding atom_def by (simp add: sort_of_Rep)
+ − 2181
show "atom a = atom b \<longleftrightarrow> a = b"
+ − 2182
unfolding atom_def by (simp add: Rep_inject)
+ − 2183
show "p \<bullet> atom a = atom (p \<bullet> a)"
+ − 2184
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep)
+ − 2185
qed
+ − 2186
+ − 2187
setup {* Sign.add_const_constraint
+ − 2188
(@{const_name "permute"}, SOME @{typ "perm \<Rightarrow> 'a::pt \<Rightarrow> 'a"}) *}
+ − 2189
setup {* Sign.add_const_constraint
+ − 2190
(@{const_name "atom"}, SOME @{typ "'a::at_base \<Rightarrow> atom"}) *}
+ − 2191
+ − 2192
2470
+ − 2193
+ − 2194
section {* The freshness lemma according to Andy Pitts *}
+ − 2195
+ − 2196
lemma freshness_lemma:
+ − 2197
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2198
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2199
shows "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2200
proof -
+ − 2201
from a obtain b where a1: "atom b \<sharp> h" and a2: "atom b \<sharp> h b"
+ − 2202
by (auto simp add: fresh_Pair)
+ − 2203
show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2204
proof (intro exI allI impI)
+ − 2205
fix a :: 'a
+ − 2206
assume a3: "atom a \<sharp> h"
+ − 2207
show "h a = h b"
+ − 2208
proof (cases "a = b")
+ − 2209
assume "a = b"
+ − 2210
thus "h a = h b" by simp
+ − 2211
next
+ − 2212
assume "a \<noteq> b"
+ − 2213
hence "atom a \<sharp> b" by (simp add: fresh_at_base)
+ − 2214
with a3 have "atom a \<sharp> h b"
+ − 2215
by (rule fresh_fun_app)
+ − 2216
with a2 have d1: "(atom b \<rightleftharpoons> atom a) \<bullet> (h b) = (h b)"
+ − 2217
by (rule swap_fresh_fresh)
+ − 2218
from a1 a3 have d2: "(atom b \<rightleftharpoons> atom a) \<bullet> h = h"
+ − 2219
by (rule swap_fresh_fresh)
+ − 2220
from d1 have "h b = (atom b \<rightleftharpoons> atom a) \<bullet> (h b)" by simp
+ − 2221
also have "\<dots> = ((atom b \<rightleftharpoons> atom a) \<bullet> h) ((atom b \<rightleftharpoons> atom a) \<bullet> b)"
+ − 2222
by (rule permute_fun_app_eq)
+ − 2223
also have "\<dots> = h a"
+ − 2224
using d2 by simp
+ − 2225
finally show "h a = h b" by simp
+ − 2226
qed
+ − 2227
qed
+ − 2228
qed
+ − 2229
+ − 2230
lemma freshness_lemma_unique:
+ − 2231
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2232
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2233
shows "\<exists>!x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2234
proof (rule ex_ex1I)
+ − 2235
from a show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2236
by (rule freshness_lemma)
+ − 2237
next
+ − 2238
fix x y
+ − 2239
assume x: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = x"
+ − 2240
assume y: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = y"
+ − 2241
from a x y show "x = y"
+ − 2242
by (auto simp add: fresh_Pair)
+ − 2243
qed
+ − 2244
+ − 2245
text {* packaging the freshness lemma into a function *}
+ − 2246
+ − 2247
definition
+ − 2248
fresh_fun :: "('a::at \<Rightarrow> 'b::pt) \<Rightarrow> 'b"
+ − 2249
where
+ − 2250
"fresh_fun h = (THE x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x)"
+ − 2251
+ − 2252
lemma fresh_fun_apply:
+ − 2253
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2254
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2255
assumes b: "atom a \<sharp> h"
+ − 2256
shows "fresh_fun h = h a"
+ − 2257
unfolding fresh_fun_def
+ − 2258
proof (rule the_equality)
+ − 2259
show "\<forall>a'. atom a' \<sharp> h \<longrightarrow> h a' = h a"
+ − 2260
proof (intro strip)
+ − 2261
fix a':: 'a
+ − 2262
assume c: "atom a' \<sharp> h"
+ − 2263
from a have "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" by (rule freshness_lemma)
+ − 2264
with b c show "h a' = h a" by auto
+ − 2265
qed
+ − 2266
next
+ − 2267
fix fr :: 'b
+ − 2268
assume "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = fr"
+ − 2269
with b show "fr = h a" by auto
+ − 2270
qed
+ − 2271
+ − 2272
lemma fresh_fun_apply':
+ − 2273
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2274
assumes a: "atom a \<sharp> h" "atom a \<sharp> h a"
+ − 2275
shows "fresh_fun h = h a"
+ − 2276
apply (rule fresh_fun_apply)
+ − 2277
apply (auto simp add: fresh_Pair intro: a)
+ − 2278
done
+ − 2279
+ − 2280
lemma fresh_fun_eqvt:
+ − 2281
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2282
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2283
shows "p \<bullet> (fresh_fun h) = fresh_fun (p \<bullet> h)"
+ − 2284
using a
+ − 2285
apply (clarsimp simp add: fresh_Pair)
+ − 2286
apply (subst fresh_fun_apply', assumption+)
+ − 2287
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
+ − 2288
apply (drule fresh_permute_iff [where p=p, THEN iffD2])
+ − 2289
apply (simp add: atom_eqvt permute_fun_app_eq [where f=h])
+ − 2290
apply (erule (1) fresh_fun_apply' [symmetric])
+ − 2291
done
+ − 2292
+ − 2293
lemma fresh_fun_supports:
+ − 2294
fixes h :: "'a::at \<Rightarrow> 'b::pt"
+ − 2295
assumes a: "\<exists>a. atom a \<sharp> (h, h a)"
+ − 2296
shows "(supp h) supports (fresh_fun h)"
+ − 2297
apply (simp add: supports_def fresh_def [symmetric])
+ − 2298
apply (simp add: fresh_fun_eqvt [OF a] swap_fresh_fresh)
+ − 2299
done
+ − 2300
+ − 2301
notation fresh_fun (binder "FRESH " 10)
+ − 2302
+ − 2303
lemma FRESH_f_iff:
+ − 2304
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 2305
fixes f :: "'b \<Rightarrow> 'c::pure"
+ − 2306
assumes P: "finite (supp P)"
+ − 2307
shows "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2308
proof -
+ − 2309
obtain a::'a where "atom a \<notin> supp P"
+ − 2310
using P by (rule obtain_at_base)
+ − 2311
hence "atom a \<sharp> P"
+ − 2312
by (simp add: fresh_def)
+ − 2313
show "(FRESH x. f (P x)) = f (FRESH x. P x)"
+ − 2314
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 2315
apply (cut_tac `atom a \<sharp> P`)
+ − 2316
apply (simp add: fresh_conv_MOST)
+ − 2317
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 2318
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 2319
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 2320
apply (rule refl)
+ − 2321
done
+ − 2322
qed
+ − 2323
+ − 2324
lemma FRESH_binop_iff:
+ − 2325
fixes P :: "'a::at \<Rightarrow> 'b::pure"
+ − 2326
fixes Q :: "'a::at \<Rightarrow> 'c::pure"
+ − 2327
fixes binop :: "'b \<Rightarrow> 'c \<Rightarrow> 'd::pure"
+ − 2328
assumes P: "finite (supp P)"
+ − 2329
and Q: "finite (supp Q)"
+ − 2330
shows "(FRESH x. binop (P x) (Q x)) = binop (FRESH x. P x) (FRESH x. Q x)"
+ − 2331
proof -
+ − 2332
from assms have "finite (supp P \<union> supp Q)" by simp
+ − 2333
then obtain a::'a where "atom a \<notin> (supp P \<union> supp Q)"
+ − 2334
by (rule obtain_at_base)
+ − 2335
hence "atom a \<sharp> P" and "atom a \<sharp> Q"
+ − 2336
by (simp_all add: fresh_def)
+ − 2337
show ?thesis
+ − 2338
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh])
+ − 2339
apply (cut_tac `atom a \<sharp> P` `atom a \<sharp> Q`)
+ − 2340
apply (simp add: fresh_conv_MOST)
+ − 2341
apply (elim MOST_rev_mp, rule MOST_I, clarify)
2479
+ − 2342
apply (simp add: permute_fun_def permute_pure fun_eq_iff)
2470
+ − 2343
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh])
+ − 2344
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> Q` pure_fresh])
+ − 2345
apply (rule refl)
+ − 2346
done
+ − 2347
qed
+ − 2348
+ − 2349
lemma FRESH_conj_iff:
+ − 2350
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 2351
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 2352
shows "(FRESH x. P x \<and> Q x) \<longleftrightarrow> (FRESH x. P x) \<and> (FRESH x. Q x)"
+ − 2353
using P Q by (rule FRESH_binop_iff)
+ − 2354
+ − 2355
lemma FRESH_disj_iff:
+ − 2356
fixes P Q :: "'a::at \<Rightarrow> bool"
+ − 2357
assumes P: "finite (supp P)" and Q: "finite (supp Q)"
+ − 2358
shows "(FRESH x. P x \<or> Q x) \<longleftrightarrow> (FRESH x. P x) \<or> (FRESH x. Q x)"
+ − 2359
using P Q by (rule FRESH_binop_iff)
+ − 2360
+ − 2361
2467
+ − 2362
section {* Library functions for the nominal infrastructure *}
+ − 2363
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2364
use "nominal_library.ML"
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2365
2466
+ − 2366
2467
+ − 2367
section {* Automation for creating concrete atom types *}
+ − 2368
+ − 2369
text {* at the moment only single-sort concrete atoms are supported *}
+ − 2370
+ − 2371
use "nominal_atoms.ML"
+ − 2372
+ − 2373
2466
+ − 2374
1062
+ − 2375
end