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