diff -r 1803104d76c9 -r 0d7a1703fe28 Nominal/Nominal2_Base.thy --- a/Nominal/Nominal2_Base.thy Fri Dec 17 01:01:44 2010 +0000 +++ b/Nominal/Nominal2_Base.thy Sun Dec 19 07:43:32 2010 +0000 @@ -1070,6 +1070,33 @@ qed qed +lemma supp_plus_perm_eq: + fixes p q::perm + assumes asm: "supp p \ supp q = {}" + shows "supp (p + q) = supp p \ supp q" +proof - + { fix a::"atom" + assume "a \ supp p" + then have "a \ supp q" using asm by auto + then have "a \ supp (p + q)" using `a \ supp p` + by (simp add: supp_perm) + } + moreover + { fix a::"atom" + assume "a \ supp q" + then have "a \ supp p" using asm by auto + then have "a \ supp (q + p)" using `a \ supp q` + by (simp add: supp_perm) + then have "a \ supp (p + q)" using asm plus_perm_eq + by metis + } + ultimately have "supp p \ supp q \ supp (p + q)" + by blast + then show "supp (p + q) = supp p \ supp q" using supp_plus_perm + by blast +qed + + section {* Finite Support instances for other types *} @@ -1606,7 +1633,7 @@ and As::"atom set" assumes b: "Xs \ As" and c: "finite As" - shows "\p. (p \ Xs) \ As = {} \ (supp p) \ (Xs \ (p \ Xs))" + shows "\p. (p \ Xs) \ As = {} \ (supp p) = (Xs \ (p \ Xs))" proof - from b c have "finite Xs" by (rule finite_subset) then show ?thesis using b @@ -1614,23 +1641,25 @@ case empty have "0 \ {} \ As = {}" by simp moreover - have "supp (0::perm) \ {} \ 0 \ {}" by (simp add: supp_zero_perm) + have "supp (0::perm) = {} \ 0 \ {}" by (simp add: supp_zero_perm) ultimately show ?case by blast next case (insert x Xs) then obtain p where p1: "(p \ Xs) \ As = {}" and - p2: "supp p \ (Xs \ (p \ Xs))" by blast + p2: "supp p = (Xs \ (p \ Xs))" by blast from `x \ As` p1 have "x \ p \ Xs" by fast with `x \ Xs` p2 have "x \ supp p" by fast hence px: "p \ x = x" unfolding supp_perm by simp - have "finite (As \ p \ Xs)" + have "finite (As \ p \ Xs \ supp p)" using `finite As` `finite Xs` - by (simp add: permute_set_eq_image) - then obtain y where "y \ (As \ p \ Xs)" "sort_of y = sort_of x" + by (simp add: permute_set_eq_image finite_supp) + then obtain y where "y \ (As \ p \ Xs \ supp p)" "sort_of y = sort_of x" by (rule obtain_atom) - hence y: "y \ As" "y \ p \ Xs" "sort_of y = sort_of x" + hence y: "y \ As" "y \ p \ Xs" "y \ supp p" "sort_of y = sort_of x" by simp_all + hence py: "p \ y = y" "x \ y" using `x \ As` + by (auto simp add: supp_perm) let ?q = "(x \ y) + p" have q: "?q \ insert x Xs = insert y (p \ Xs)" unfolding insert_eqvt @@ -1641,10 +1670,13 @@ using `y \ As` `p \ Xs \ As = {}` unfolding q by simp moreover - have "supp ?q \ insert x Xs \ ?q \ insert x Xs" - using p2 unfolding q - by (intro subset_trans [OF supp_plus_perm]) - (auto simp add: supp_swap) + have "supp (x \ y) \ supp p = {}" using px py `sort_of y = sort_of x` + unfolding supp_swap by (simp add: supp_perm) + then have "supp ?q = (supp (x \ y) \ supp p)" + by (simp add: supp_plus_perm_eq) + then have "supp ?q = insert x Xs \ ?q \ insert x Xs" + using p2 `sort_of y = sort_of x` `x \ y` unfolding q supp_swap + by auto ultimately show ?case by blast qed qed @@ -1652,7 +1684,7 @@ lemma at_set_avoiding: assumes a: "finite Xs" and b: "finite (supp c)" - obtains p::"perm" where "(p \ Xs)\*c" and "(supp p) \ (Xs \ (p \ Xs))" + obtains p::"perm" where "(p \ Xs)\*c" and "(supp p) = (Xs \ (p \ Xs))" using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \ supp c"] unfolding fresh_star_def fresh_def by blast @@ -1683,7 +1715,7 @@ assumes "finite xs" and "finite (supp c)" "finite (supp x)" and "xs \* x" - shows "\p. (p \ xs) \* c \ supp x \* p \ supp p \ xs \ (p \ xs)" + shows "\p. (p \ xs) \* c \ supp x \* p \ supp p = xs \ (p \ xs)" using assms apply(erule_tac c="(c, x)" in at_set_avoiding) apply(simp add: supp_Pair) @@ -1693,7 +1725,6 @@ apply(auto simp add: fresh_star_def) done - lemma at_set_avoiding2_atom: assumes "finite (supp c)" "finite (supp x)" and b: "a \ x" @@ -1709,6 +1740,7 @@ then show "\p. (p \ a) \ c \ supp x \* p" by blast qed + section {* Renaming permutations *} lemma set_renaming_perm: