diff -r 9a63d90d1752 -r f7c4b8e6918b Nominal/Nominal2_Base.thy --- a/Nominal/Nominal2_Base.thy Tue Jan 03 01:42:10 2012 +0000 +++ b/Nominal/Nominal2_Base.thy Tue Jan 03 11:43:27 2012 +0000 @@ -430,25 +430,33 @@ subsection {* Permutations for sets *} +instantiation "set" :: (pt) pt +begin + +definition + "p \ X = {p \ x | x. x \ X}" + +instance +apply default +apply (auto simp add: permute_set_def) +done + +end + lemma permute_set_eq: - fixes x::"'a::pt" - shows "(p \ X) = {p \ x | x. x \ X}" - unfolding permute_fun_def - unfolding permute_bool_def - apply(auto simp add: mem_def) - apply(rule_tac x="- p \ x" in exI) - apply(simp) - done + shows "p \ X = {x. - p \ x \ X}" +unfolding permute_set_def +by (auto) (metis permute_minus_cancel(1)) lemma permute_set_eq_image: shows "p \ X = permute p ` X" - unfolding permute_set_eq by auto + unfolding permute_set_def by auto lemma permute_set_eq_vimage: shows "p \ X = permute (- p) -` X" - unfolding permute_fun_def permute_bool_def - unfolding vimage_def Collect_def mem_def .. - + unfolding permute_set_eq vimage_def + by simp + lemma permute_finite [simp]: shows "finite (p \ X) = finite X" unfolding permute_set_eq_vimage @@ -457,36 +465,36 @@ lemma swap_set_not_in: assumes a: "a \ S" "b \ S" shows "(a \ b) \ S = S" - unfolding permute_set_eq + unfolding permute_set_def using a by (auto simp add: swap_atom) lemma swap_set_in: assumes a: "a \ S" "b \ S" "sort_of a = sort_of b" shows "(a \ b) \ S \ S" - unfolding permute_set_eq + unfolding permute_set_def using a by (auto simp add: swap_atom) lemma swap_set_in_eq: assumes a: "a \ S" "b \ S" "sort_of a = sort_of b" shows "(a \ b) \ S = (S - {a}) \ {b}" - unfolding permute_set_eq + unfolding permute_set_def using a by (auto simp add: swap_atom) lemma swap_set_both_in: assumes a: "a \ S" "b \ S" shows "(a \ b) \ S = S" - unfolding permute_set_eq + unfolding permute_set_def using a by (auto simp add: swap_atom) lemma mem_permute_iff: shows "(p \ x) \ (p \ X) \ x \ X" - unfolding mem_def permute_fun_def permute_bool_def - by simp + unfolding permute_set_def + by auto lemma empty_eqvt: shows "p \ {} = {}" - unfolding empty_def Collect_def - by (simp add: permute_fun_def permute_bool_def) + unfolding permute_set_def + by (simp) lemma insert_eqvt: shows "p \ (insert x A) = insert (p \ x) (p \ A)" @@ -665,6 +673,9 @@ instance "fun" :: (pure, pure) pure by default (simp add: permute_fun_def permute_pure) +instance set :: (pure) pure +by default (simp add: permute_set_def permute_pure) + instance prod :: (pure, pure) pure by default (induct_tac x, simp add: permute_pure) @@ -879,12 +890,13 @@ lemma mem_eqvt [eqvt]: shows "p \ (x \ A) \ (p \ x) \ (p \ A)" - unfolding mem_def - by (rule permute_fun_app_eq) + unfolding permute_bool_def permute_set_def + by (auto) lemma Collect_eqvt [eqvt]: shows "p \ {x. P x} = {x. (p \ P) x}" - unfolding Collect_def permute_fun_def .. + unfolding permute_set_eq permute_fun_def + by (auto simp add: permute_bool_def) lemma inter_eqvt [eqvt]: shows "p \ (A \ B) = (p \ A) \ (p \ B)" @@ -1871,7 +1883,7 @@ proof - { fix a b have "\x \ S. (a \ b) \ x = x \ (a \ b) \ S = S" - unfolding permute_set_eq by force + unfolding permute_set_def by force } then show "(\x \ S. supp x) supports S" unfolding supports_def @@ -2491,7 +2503,7 @@ using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast have c: "(p \ a) \ c" using p1 unfolding fresh_star_def Ball_def - by(erule_tac x="p \ a" in allE) (simp add: permute_set_eq) + by(erule_tac x="p \ a" in allE) (simp add: permute_set_def) hence "p \ a \ c \ supp x \* p" using p2 by blast then show "\p. (p \ a) \ c \ supp x \* p" by blast qed @@ -2506,7 +2518,7 @@ proof (induct) case empty have "(\b \ {}. 0 \ b = p \ b) \ supp (0::perm) \ {} \ p \ {}" - by (simp add: permute_set_eq supp_perm) + by (simp add: permute_set_def supp_perm) then show "\q. (\b \ {}. q \ b = p \ b) \ supp q \ {} \ p \ {}" by blast next case (insert a bs)