diff -r a0c7290a4e27 -r 27cdc0a3a763 Nominal-General/Nominal2_Base.thy --- a/Nominal-General/Nominal2_Base.thy Wed Apr 21 12:25:52 2010 +0200 +++ b/Nominal-General/Nominal2_Base.thy Mon Apr 26 10:01:13 2010 +0200 @@ -29,6 +29,11 @@ where "sort_of (Atom s i) = s" +primrec + nat_of :: "atom \ nat" +where + "nat_of (Atom s n) = n" + text {* There are infinitely many atoms of each sort. *} lemma INFM_sort_of_eq: @@ -63,6 +68,11 @@ then show ?thesis .. qed +lemma atom_components_eq_iff: + fixes a b :: atom + shows "a = b \ sort_of a = sort_of b \ nat_of a = nat_of b" + by (induct a, induct b, simp) + section {* Sort-Respecting Permutations *} typedef perm = @@ -459,7 +469,6 @@ unfolding permute_set_eq using a by (auto simp add: swap_atom) - subsection {* Permutations for units *} instantiation unit :: pt @@ -835,6 +844,24 @@ instance atom :: fs by default (simp add: supp_atom) +section {* Support for finite sets of atoms *} + +lemma supp_finite_atom_set: + fixes S::"atom set" + assumes "finite S" + shows "supp S = S" + apply(rule finite_supp_unique) + apply(simp add: supports_def) + apply(simp add: swap_set_not_in) + apply(rule assms) + apply(simp add: swap_set_in) +done + +lemma supp_atom_insert: + fixes S::"atom set" + assumes a: "finite S" + shows "supp (insert a S) = supp a \ supp S" + using a by (simp add: supp_finite_atom_set supp_atom) section {* Type @{typ perm} is finitely-supported. *} @@ -1054,32 +1081,18 @@ unfolding fresh_def by auto -(* alternative proof *) -lemma - shows "supp (f x) \ (supp f) \ (supp x)" -proof (rule subsetCI) - fix a::"atom" - assume a: "a \ supp (f x)" - assume b: "a \ supp f \ supp x" - then have "finite {b. (a \ b) \ f \ f}" "finite {b. (a \ b) \ x \ x}" - unfolding supp_def by auto - then have "finite ({b. (a \ b) \ f \ f} \ {b. (a \ b) \ x \ x})" by simp - moreover - have "{b. ((a \ b) \ f) ((a \ b) \ x) \ f x} \ ({b. (a \ b) \ f \ f} \ {b. (a \ b) \ x \ x})" - by auto - ultimately have "finite {b. ((a \ b) \ f) ((a \ b) \ x) \ f x}" - using finite_subset by auto - then have "a \ supp (f x)" unfolding supp_def - by (simp add: permute_fun_app_eq) - with a show "False" by simp -qed - +lemma supp_fun_eqvt: + assumes a: "\p. p \ f = f" + shows "supp f = {}" + unfolding supp_def + using a by simp + + lemma fresh_fun_eqvt_app: assumes a: "\p. p \ f = f" shows "a \ x \ a \ f x" proof - - from a have "supp f = {}" - unfolding supp_def by simp + from a have "supp f = {}" by (simp add: supp_fun_eqvt) then show "a \ x \ a \ f x" unfolding fresh_def using supp_fun_app