947
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 1
(* Title: Nominal2_Base
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 2
Authors: Brian Huffman, Christian Urban
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 3
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 4
Basic definitions and lemma infrastructure for
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 5
Nominal Isabelle.
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 6
*)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 7
theory Nominal2_Base
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 8
imports Main Infinite_Set
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 9
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 10
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 11
section {* Atoms and Sorts *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 12
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 13
text {* A simple implementation for atom_sorts is strings. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 14
(* types atom_sort = string *)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 15
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 16
text {* To deal with Church-like binding we use trees of
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 17
strings as sorts. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 18
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 19
datatype atom_sort = Sort "string" "atom_sort list"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 20
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 21
datatype atom = Atom atom_sort nat
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 22
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 23
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 24
text {* Basic projection function. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 25
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 26
primrec
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 27
sort_of :: "atom \<Rightarrow> atom_sort"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 28
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 29
"sort_of (Atom s i) = s"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 30
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 31
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 32
text {* There are infinitely many atoms of each sort. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 33
lemma INFM_sort_of_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 34
shows "INFM a. sort_of a = s"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 35
proof -
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 36
have "INFM i. sort_of (Atom s i) = s" by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 37
moreover have "inj (Atom s)" by (simp add: inj_on_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 38
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 39
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 40
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 41
lemma infinite_sort_of_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 42
shows "infinite {a. sort_of a = s}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 43
using INFM_sort_of_eq unfolding INFM_iff_infinite .
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 44
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 45
lemma atom_infinite [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 46
shows "infinite (UNIV :: atom set)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 47
using subset_UNIV infinite_sort_of_eq
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 48
by (rule infinite_super)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 49
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 50
lemma obtain_atom:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 51
fixes X :: "atom set"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 52
assumes X: "finite X"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 53
obtains a where "a \<notin> X" "sort_of a = s"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 54
proof -
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 55
from X have "MOST a. a \<notin> X"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 56
unfolding MOST_iff_cofinite by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 57
with INFM_sort_of_eq
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 58
have "INFM a. sort_of a = s \<and> a \<notin> X"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 59
by (rule INFM_conjI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 60
then obtain a where "a \<notin> X" "sort_of a = s"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 61
by (auto elim: INFM_E)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 62
then show ?thesis ..
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 63
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 64
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 65
section {* Sort-Respecting Permutations *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 66
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 67
typedef perm =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 68
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 69
proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 70
show "id \<in> ?perm" by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 71
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 72
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 73
lemma permI:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 74
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 75
shows "f \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 76
using assms unfolding perm_def MOST_iff_cofinite by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 77
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 78
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 79
unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 80
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 81
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 82
unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 83
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 84
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 85
unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 86
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 87
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 88
unfolding perm_def MOST_iff_cofinite by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 89
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 90
lemma perm_id: "id \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 91
unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 92
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 93
lemma perm_comp:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 94
assumes f: "f \<in> perm" and g: "g \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 95
shows "(f \<circ> g) \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 96
apply (rule permI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 97
apply (rule bij_comp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 98
apply (rule perm_is_bij [OF g])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 99
apply (rule perm_is_bij [OF f])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 100
apply (rule MOST_rev_mp [OF perm_MOST [OF g]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 101
apply (rule MOST_rev_mp [OF perm_MOST [OF f]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 102
apply (simp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 103
apply (simp add: perm_is_sort_respecting [OF f])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 104
apply (simp add: perm_is_sort_respecting [OF g])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 105
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 106
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 107
lemma perm_inv:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 108
assumes f: "f \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 109
shows "(inv f) \<in> perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 110
apply (rule permI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 111
apply (rule bij_imp_bij_inv)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 112
apply (rule perm_is_bij [OF f])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 113
apply (rule MOST_mono [OF perm_MOST [OF f]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 114
apply (erule subst, rule inv_f_f)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 115
apply (rule bij_is_inj [OF perm_is_bij [OF f]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 116
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 117
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 118
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 119
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 120
lemma bij_Rep_perm: "bij (Rep_perm p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 121
using Rep_perm [of p] unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 122
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 123
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 124
using Rep_perm [of p] unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 125
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 126
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 127
using Rep_perm [of p] unfolding perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 128
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 129
lemma Rep_perm_ext:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 130
"Rep_perm p1 = Rep_perm p2 \<Longrightarrow> p1 = p2"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 131
by (simp add: expand_fun_eq Rep_perm_inject [symmetric])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 132
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 133
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 134
subsection {* Permutations form a group *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 135
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 136
instantiation perm :: group_add
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 137
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 138
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 139
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 140
"0 = Abs_perm id"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 141
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 142
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 143
"- p = Abs_perm (inv (Rep_perm p))"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 144
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 145
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 146
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 147
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 148
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 149
"(p1::perm) - p2 = p1 + - p2"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 150
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 151
lemma Rep_perm_0: "Rep_perm 0 = id"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 152
unfolding zero_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 153
by (simp add: Abs_perm_inverse perm_id)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 154
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 155
lemma Rep_perm_add:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 156
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 157
unfolding plus_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 158
by (simp add: Abs_perm_inverse perm_comp Rep_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 159
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 160
lemma Rep_perm_uminus:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 161
"Rep_perm (- p) = inv (Rep_perm p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 162
unfolding uminus_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 163
by (simp add: Abs_perm_inverse perm_inv Rep_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 164
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 165
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 166
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 167
unfolding Rep_perm_inject [symmetric]
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 168
unfolding minus_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 169
unfolding Rep_perm_add
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 170
unfolding Rep_perm_uminus
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 171
unfolding Rep_perm_0
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 172
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 173
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 174
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 175
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 176
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 177
section {* Implementation of swappings *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 178
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 179
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 180
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')")
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 181
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 182
"(a \<rightleftharpoons> b) =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 183
Abs_perm (if sort_of a = sort_of b
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 184
then (\<lambda>c. if a = c then b else if b = c then a else c)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 185
else id)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 186
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 187
lemma Rep_perm_swap:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 188
"Rep_perm (a \<rightleftharpoons> b) =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 189
(if sort_of a = sort_of b
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 190
then (\<lambda>c. if a = c then b else if b = c then a else c)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 191
else id)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 192
unfolding swap_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 193
apply (rule Abs_perm_inverse)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 194
apply (rule permI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 195
apply (auto simp add: bij_def inj_on_def surj_def)[1]
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 196
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 197
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 198
apply (simp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 199
apply (simp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 200
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 201
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 202
lemmas Rep_perm_simps =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 203
Rep_perm_0
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 204
Rep_perm_add
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 205
Rep_perm_uminus
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 206
Rep_perm_swap
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 207
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 208
lemma swap_different_sorts [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 209
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 210
by (rule Rep_perm_ext) (simp add: Rep_perm_simps)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 211
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 212
lemma swap_cancel:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 213
"(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 214
by (rule Rep_perm_ext)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 215
(simp add: Rep_perm_simps expand_fun_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 216
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 217
lemma swap_self [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 218
"(a \<rightleftharpoons> a) = 0"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 219
by (rule Rep_perm_ext, simp add: Rep_perm_simps expand_fun_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 220
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 221
lemma minus_swap [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 222
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 223
by (rule minus_unique [OF swap_cancel])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 224
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 225
lemma swap_commute:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 226
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 227
by (rule Rep_perm_ext)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 228
(simp add: Rep_perm_swap expand_fun_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 229
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 230
lemma swap_triple:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 231
assumes "a \<noteq> b" and "c \<noteq> b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 232
assumes "sort_of a = sort_of b" "sort_of b = sort_of c"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 233
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 234
using assms
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 235
by (rule_tac Rep_perm_ext)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 236
(auto simp add: Rep_perm_simps expand_fun_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 237
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 238
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 239
section {* Permutation Types *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 240
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 241
text {*
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 242
Infix syntax for @{text permute} has higher precedence than
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 243
addition, but lower than unary minus.
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 244
*}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 245
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 246
class pt =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 247
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 248
assumes permute_zero [simp]: "0 \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 249
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 250
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 251
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 252
lemma permute_diff [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 253
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 254
unfolding diff_minus by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 255
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 256
lemma permute_minus_cancel [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 257
shows "p \<bullet> - p \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 258
and "- p \<bullet> p \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 259
unfolding permute_plus [symmetric] by simp_all
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 260
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 261
lemma permute_swap_cancel [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 262
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 263
unfolding permute_plus [symmetric]
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 264
by (simp add: swap_cancel)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 265
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 266
lemma permute_swap_cancel2 [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 267
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 268
unfolding permute_plus [symmetric]
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 269
by (simp add: swap_commute)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 270
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 271
lemma inj_permute [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 272
shows "inj (permute p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 273
by (rule inj_on_inverseI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 274
(rule permute_minus_cancel)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 275
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 276
lemma surj_permute [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 277
shows "surj (permute p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 278
by (rule surjI, rule permute_minus_cancel)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 279
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 280
lemma bij_permute [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 281
shows "bij (permute p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 282
by (rule bijI [OF inj_permute surj_permute])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 283
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 284
lemma inv_permute:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 285
shows "inv (permute p) = permute (- p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 286
by (rule inv_equality) (simp_all)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 287
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 288
lemma permute_minus:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 289
shows "permute (- p) = inv (permute p)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 290
by (simp add: inv_permute)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 291
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 292
lemma permute_eq_iff [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 293
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 294
by (rule inj_permute [THEN inj_eq])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 295
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 296
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 297
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 298
subsection {* Permutations for atoms *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 299
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 300
instantiation atom :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 301
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 302
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 303
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 304
"p \<bullet> a = Rep_perm p a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 305
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 306
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 307
apply(default)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 308
apply(simp_all add: permute_atom_def Rep_perm_simps)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 309
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 310
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 311
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 312
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 313
lemma sort_of_permute [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 314
shows "sort_of (p \<bullet> a) = sort_of a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 315
unfolding permute_atom_def by (rule sort_of_Rep_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 316
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 317
lemma swap_atom:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 318
shows "(a \<rightleftharpoons> b) \<bullet> c =
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 319
(if sort_of a = sort_of b
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 320
then (if c = a then b else if c = b then a else c) else c)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 321
unfolding permute_atom_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 322
by (simp add: Rep_perm_swap)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 323
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 324
lemma swap_atom_simps [simp]:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 325
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 326
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 327
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 328
unfolding swap_atom by simp_all
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 329
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 330
lemma expand_perm_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 331
fixes p q :: "perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 332
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 333
unfolding permute_atom_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 334
by (metis Rep_perm_ext ext)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 335
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 336
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 337
subsection {* Permutations for permutations *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 338
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 339
instantiation perm :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 340
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 341
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 342
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 343
"p \<bullet> q = p + q - p"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 344
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 345
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 346
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 347
apply (simp add: permute_perm_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 348
apply (simp add: permute_perm_def diff_minus minus_add add_assoc)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 349
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 350
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 351
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 352
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 353
lemma permute_self: "p \<bullet> p = p"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 354
unfolding permute_perm_def by (simp add: diff_minus add_assoc)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 355
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 356
lemma permute_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 357
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 358
unfolding permute_perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 359
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 360
lemma zero_perm_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 361
shows "p \<bullet> (0::perm) = 0"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 362
unfolding permute_perm_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 363
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 364
lemma add_perm_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 365
fixes p p1 p2 :: perm
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 366
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 367
unfolding permute_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 368
by (simp add: expand_perm_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 369
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 370
lemma swap_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 371
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 372
unfolding permute_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 373
by (auto simp add: swap_atom expand_perm_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 374
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 375
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 376
subsection {* Permutations for functions *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 377
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 378
instantiation "fun" :: (pt, pt) pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 379
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 380
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 381
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 382
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 383
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 384
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 385
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 386
apply (simp add: permute_fun_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 387
apply (simp add: permute_fun_def minus_add)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 388
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 389
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 390
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 391
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 392
lemma permute_fun_app_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 393
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 394
unfolding permute_fun_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 395
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 396
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 397
subsection {* Permutations for booleans *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 398
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 399
instantiation bool :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 400
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 401
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 402
definition "p \<bullet> (b::bool) = b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 403
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 404
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 405
apply(default)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 406
apply(simp_all add: permute_bool_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 407
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 408
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 409
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 410
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 411
lemma Not_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 412
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 413
by (simp add: permute_bool_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 414
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 415
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 416
subsection {* Permutations for sets *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 417
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 418
lemma permute_set_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 419
fixes x::"'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 420
and p::"perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 421
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 422
apply(auto simp add: permute_fun_def permute_bool_def mem_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 423
apply(rule_tac x="- p \<bullet> x" in exI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 424
apply(simp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 425
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 426
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 427
lemma permute_set_eq_image:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 428
shows "p \<bullet> X = permute p ` X"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 429
unfolding permute_set_eq by auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 430
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 431
lemma permute_set_eq_vimage:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 432
shows "p \<bullet> X = permute (- p) -` X"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 433
unfolding permute_fun_def permute_bool_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 434
unfolding vimage_def Collect_def mem_def ..
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 435
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 436
subsection {* Permutations for units *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 437
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 438
instantiation unit :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 439
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 440
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 441
definition "p \<bullet> (u::unit) = u"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 442
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 443
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 444
qed (simp_all add: permute_unit_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 445
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 446
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 447
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 448
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 449
subsection {* Permutations for products *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 450
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 451
instantiation "*" :: (pt, pt) pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 452
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 453
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 454
primrec
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 455
permute_prod
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 456
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 457
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 458
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 459
instance
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 460
by default auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 461
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 462
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 463
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 464
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 465
subsection {* Permutations for sums *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 466
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 467
instantiation "+" :: (pt, pt) pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 468
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 469
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 470
primrec
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 471
permute_sum
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 472
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 473
"p \<bullet> (Inl x) = Inl (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 474
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 475
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 476
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 477
qed (case_tac [!] x, simp_all)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 478
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 479
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 480
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 481
subsection {* Permutations for lists *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 482
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 483
instantiation list :: (pt) pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 484
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 485
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 486
primrec
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 487
permute_list
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 488
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 489
"p \<bullet> [] = []"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 490
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 491
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 492
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 493
qed (induct_tac [!] x, simp_all)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 494
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 495
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 496
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 497
subsection {* Permutations for options *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 498
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 499
instantiation option :: (pt) pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 500
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 501
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 502
primrec
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 503
permute_option
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 504
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 505
"p \<bullet> None = None"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 506
| "p \<bullet> (Some x) = Some (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 507
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 508
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 509
qed (induct_tac [!] x, simp_all)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 510
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 511
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 512
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 513
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 514
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 515
instantiation char :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 516
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 517
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 518
definition "p \<bullet> (c::char) = c"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 519
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 520
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 521
qed (simp_all add: permute_char_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 522
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 523
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 524
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 525
instantiation nat :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 526
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 527
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 528
definition "p \<bullet> (n::nat) = n"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 529
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 530
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 531
qed (simp_all add: permute_nat_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 532
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 533
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 534
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 535
instantiation int :: pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 536
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 537
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 538
definition "p \<bullet> (i::int) = i"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 539
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 540
instance proof
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 541
qed (simp_all add: permute_int_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 542
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 543
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 544
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 545
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 546
section {* Pure types *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 547
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 548
text {* Pure types will have always empty support. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 549
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 550
class pure = pt +
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 551
assumes permute_pure: "p \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 552
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 553
text {* Types @{typ unit} and @{typ bool} are pure. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 554
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 555
instance unit :: pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 556
proof qed (rule permute_unit_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 557
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 558
instance bool :: pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 559
proof qed (rule permute_bool_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 560
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 561
text {* Other type constructors preserve purity. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 562
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 563
instance "fun" :: (pure, pure) pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 564
by default (simp add: permute_fun_def permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 565
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 566
instance "*" :: (pure, pure) pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 567
by default (induct_tac x, simp add: permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 568
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 569
instance "+" :: (pure, pure) pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 570
by default (induct_tac x, simp_all add: permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 571
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 572
instance list :: (pure) pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 573
by default (induct_tac x, simp_all add: permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 574
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 575
instance option :: (pure) pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 576
by default (induct_tac x, simp_all add: permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 577
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 578
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 579
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 580
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 581
instance char :: pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 582
proof qed (rule permute_char_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 583
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 584
instance nat :: pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 585
proof qed (rule permute_nat_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 586
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 587
instance int :: pure
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 588
proof qed (rule permute_int_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 589
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 590
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 591
subsection {* Supp, Freshness and Supports *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 592
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 593
context pt
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 594
begin
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 595
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 596
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 597
supp :: "'a \<Rightarrow> atom set"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 598
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 599
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 600
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 601
end
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 602
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 603
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 604
fresh :: "atom \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 605
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 606
"a \<sharp> x \<equiv> a \<notin> supp x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 607
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 608
lemma supp_conv_fresh:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 609
shows "supp x = {a. \<not> a \<sharp> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 610
unfolding fresh_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 611
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 612
lemma swap_rel_trans:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 613
assumes "sort_of a = sort_of b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 614
assumes "sort_of b = sort_of c"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 615
assumes "(a \<rightleftharpoons> c) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 616
assumes "(b \<rightleftharpoons> c) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 617
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 618
proof (cases)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 619
assume "a = b \<or> c = b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 620
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 621
next
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 622
assume *: "\<not> (a = b \<or> c = b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 623
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 624
using assms by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 625
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 626
using assms * by (simp add: swap_triple)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 627
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" .
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 628
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 629
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 630
lemma swap_fresh_fresh:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 631
assumes a: "a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 632
and b: "b \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 633
shows "(a \<rightleftharpoons> b) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 634
proof (cases)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 635
assume asm: "sort_of a = sort_of b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 636
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 637
using a b unfolding fresh_def supp_def by simp_all
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 638
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 639
then obtain c
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 640
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 641
by (rule obtain_atom) (auto)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 642
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 643
next
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 644
assume "sort_of a \<noteq> sort_of b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 645
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 646
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 647
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 648
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 649
subsection {* supp and fresh are equivariant *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 650
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 651
lemma finite_Collect_bij:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 652
assumes a: "bij f"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 653
shows "finite {x. P (f x)} = finite {x. P x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 654
by (metis a finite_vimage_iff vimage_Collect_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 655
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 656
lemma fresh_permute_iff:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 657
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 658
proof -
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 659
have "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 660
unfolding fresh_def supp_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 661
also have "\<dots> \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> p \<bullet> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 662
using bij_permute by (rule finite_Collect_bij [symmetric])
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 663
also have "\<dots> \<longleftrightarrow> finite {b. p \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> p \<bullet> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 664
by (simp only: permute_eqvt [of p] swap_eqvt)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 665
also have "\<dots> \<longleftrightarrow> finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 666
by (simp only: permute_eq_iff)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 667
also have "\<dots> \<longleftrightarrow> a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 668
unfolding fresh_def supp_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 669
finally show ?thesis .
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 670
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 671
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 672
lemma fresh_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 673
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 674
by (simp add: permute_bool_def fresh_permute_iff)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 675
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 676
lemma supp_eqvt:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 677
fixes p :: "perm"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 678
and x :: "'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 679
shows "p \<bullet> (supp x) = supp (p \<bullet> x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 680
unfolding supp_conv_fresh
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 681
unfolding permute_fun_def Collect_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 682
by (simp add: Not_eqvt fresh_eqvt)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 683
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 684
subsection {* supports *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 685
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 686
definition
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 687
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 688
where
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 689
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 690
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 691
lemma supp_is_subset:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 692
fixes S :: "atom set"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 693
and x :: "'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 694
assumes a1: "S supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 695
and a2: "finite S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 696
shows "(supp x) \<subseteq> S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 697
proof (rule ccontr)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 698
assume "\<not>(supp x \<subseteq> S)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 699
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 700
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" by (unfold supports_def) (auto)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 701
hence "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 702
with a2 have "finite {b. (a \<rightleftharpoons> b)\<bullet>x \<noteq> x}" by (simp add: finite_subset)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 703
then have "a \<notin> (supp x)" unfolding supp_def by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 704
with b1 show False by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 705
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 706
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 707
lemma supports_finite:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 708
fixes S :: "atom set"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 709
and x :: "'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 710
assumes a1: "S supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 711
and a2: "finite S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 712
shows "finite (supp x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 713
proof -
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 714
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 715
then show "finite (supp x)" using a2 by (simp add: finite_subset)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 716
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 717
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 718
lemma supp_supports:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 719
fixes x :: "'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 720
shows "(supp x) supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 721
proof (unfold supports_def, intro strip)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 722
fix a b
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 723
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 724
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 725
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (rule swap_fresh_fresh)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 726
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 727
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 728
lemma supp_is_least_supports:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 729
fixes S :: "atom set"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 730
and x :: "'a::pt"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 731
assumes a1: "S supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 732
and a2: "finite S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 733
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 734
shows "(supp x) = S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 735
proof (rule equalityI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 736
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 737
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 738
have "(supp x) supports x" by (rule supp_supports)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 739
with fin a3 show "S \<subseteq> supp x" by blast
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 740
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 741
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 742
lemma subsetCI:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 743
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 744
by auto
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 745
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 746
lemma finite_supp_unique:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 747
assumes a1: "S supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 748
assumes a2: "finite S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 749
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"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 750
shows "(supp x) = S"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 751
using a1 a2
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 752
proof (rule supp_is_least_supports)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 753
fix S'
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 754
assume "finite S'" and "S' supports x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 755
show "S \<subseteq> S'"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 756
proof (rule subsetCI)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 757
fix a
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 758
assume "a \<in> S" and "a \<notin> S'"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 759
have "finite (S \<union> S')"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 760
using `finite S` `finite S'` by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 761
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 762
by (rule obtain_atom)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 763
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 764
by simp_all
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 765
then have "(a \<rightleftharpoons> b) \<bullet> x = x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 766
using `a \<notin> S'` `S' supports x` by (simp add: supports_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 767
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 768
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b`
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 769
by (rule a3)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 770
ultimately show "False" by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 771
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 772
qed
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 773
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 774
section {* Finitely-supported types *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 775
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 776
class fs = pt +
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 777
assumes finite_supp: "finite (supp x)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 778
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 779
lemma pure_supp:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 780
shows "supp (x::'a::pure) = {}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 781
unfolding supp_def by (simp add: permute_pure)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 782
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 783
lemma pure_fresh:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 784
fixes x::"'a::pure"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 785
shows "a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 786
unfolding fresh_def by (simp add: pure_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 787
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 788
instance pure < fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 789
by default (simp add: pure_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 790
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 791
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 792
subsection {* Type @{typ atom} is finitely-supported. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 793
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 794
lemma supp_atom:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 795
shows "supp a = {a}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 796
apply (rule finite_supp_unique)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 797
apply (clarsimp simp add: supports_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 798
apply simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 799
apply simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 800
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 801
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 802
lemma fresh_atom:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 803
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 804
unfolding fresh_def supp_atom by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 805
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 806
instance atom :: fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 807
by default (simp add: supp_atom)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 808
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 809
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 810
section {* Type @{typ perm} is finitely-supported. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 811
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 812
lemma perm_swap_eq:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 813
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 814
unfolding permute_perm_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 815
by (metis add_diff_cancel minus_perm_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 816
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 817
lemma supports_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 818
shows "{a. p \<bullet> a \<noteq> a} supports p"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 819
unfolding supports_def
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 820
by (simp add: perm_swap_eq swap_eqvt)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 821
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 822
lemma finite_perm_lemma:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 823
shows "finite {a::atom. p \<bullet> a \<noteq> a}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 824
using finite_Rep_perm [of p]
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 825
unfolding permute_atom_def .
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 826
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 827
lemma supp_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 828
shows "supp p = {a. p \<bullet> a \<noteq> a}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 829
apply (rule finite_supp_unique)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 830
apply (rule supports_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 831
apply (rule finite_perm_lemma)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 832
apply (simp add: perm_swap_eq swap_eqvt)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 833
apply (auto simp add: expand_perm_eq swap_atom)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 834
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 835
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 836
lemma fresh_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 837
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 838
unfolding fresh_def by (simp add: supp_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 839
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 840
lemma supp_swap:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 841
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 842
by (auto simp add: supp_perm swap_atom)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 843
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 844
lemma fresh_zero_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 845
shows "a \<sharp> (0::perm)"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 846
unfolding fresh_perm by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 847
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 848
lemma supp_zero_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 849
shows "supp (0::perm) = {}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 850
unfolding supp_perm by simp
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 851
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 852
lemma supp_plus_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 853
fixes p q::perm
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 854
shows "supp (p + q) \<subseteq> supp p \<union> supp q"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 855
by (auto simp add: supp_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 856
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 857
lemma supp_minus_perm:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 858
fixes p::perm
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 859
shows "supp (- p) = supp p"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 860
apply(auto simp add: supp_perm)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 861
apply(metis permute_minus_cancel)+
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 862
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 863
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 864
instance perm :: fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 865
by default (simp add: supp_perm finite_perm_lemma)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 866
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 867
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 868
section {* Finite Support instances for other types *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 869
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 870
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 871
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 872
lemma supp_Pair:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 873
shows "supp (x, y) = supp x \<union> supp y"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 874
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 875
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 876
lemma fresh_Pair:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 877
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 878
by (simp add: fresh_def supp_Pair)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 879
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 880
instance "*" :: (fs, fs) fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 881
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 882
apply (induct_tac x)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 883
apply (simp add: supp_Pair finite_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 884
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 885
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 886
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 887
subsection {* Type @{typ "'a + 'b"} is finitely supported *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 888
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 889
lemma supp_Inl:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 890
shows "supp (Inl x) = supp x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 891
by (simp add: supp_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 892
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 893
lemma supp_Inr:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 894
shows "supp (Inr x) = supp x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 895
by (simp add: supp_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 896
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 897
lemma fresh_Inl:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 898
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 899
by (simp add: fresh_def supp_Inl)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 900
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 901
lemma fresh_Inr:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 902
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 903
by (simp add: fresh_def supp_Inr)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 904
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 905
instance "+" :: (fs, fs) fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 906
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 907
apply (induct_tac x)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 908
apply (simp_all add: supp_Inl supp_Inr finite_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 909
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 910
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 911
subsection {* Type @{typ "'a option"} is finitely supported *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 912
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 913
lemma supp_None:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 914
shows "supp None = {}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 915
by (simp add: supp_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 916
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 917
lemma supp_Some:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 918
shows "supp (Some x) = supp x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 919
by (simp add: supp_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 920
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 921
lemma fresh_None:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 922
shows "a \<sharp> None"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 923
by (simp add: fresh_def supp_None)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 924
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 925
lemma fresh_Some:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 926
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 927
by (simp add: fresh_def supp_Some)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 928
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 929
instance option :: (fs) fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 930
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 931
apply (induct_tac x)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 932
apply (simp_all add: supp_None supp_Some finite_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 933
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 934
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 935
subsubsection {* Type @{typ "'a list"} is finitely supported *}
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 936
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 937
lemma supp_Nil:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 938
shows "supp [] = {}"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 939
by (simp add: supp_def)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 940
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 941
lemma supp_Cons:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 942
shows "supp (x # xs) = supp x \<union> supp xs"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 943
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 944
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 945
lemma fresh_Nil:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 946
shows "a \<sharp> []"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 947
by (simp add: fresh_def supp_Nil)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 948
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 949
lemma fresh_Cons:
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 950
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs"
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 951
by (simp add: fresh_def supp_Cons)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 952
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 953
instance list :: (fs) fs
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 954
apply default
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 955
apply (induct_tac x)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 956
apply (simp_all add: supp_Nil supp_Cons finite_supp)
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 957
done
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 958
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 959
end