diff -r 494b859bfc16 -r e003e5e36bae Nominal/Nominal2_Abs.thy --- a/Nominal/Nominal2_Abs.thy Wed Jan 19 07:06:47 2011 +0100 +++ b/Nominal/Nominal2_Abs.thy Wed Jan 19 17:11:10 2011 +0100 @@ -491,6 +491,7 @@ prod.exhaust[where 'a="atom set" and 'b="'a"] prod.exhaust[where 'a="atom list" and 'b="'a"]) + instantiation abs_set :: (pt) pt begin @@ -723,6 +724,101 @@ unfolding fresh_star_def by(auto simp add: Abs_fresh_iff) +lemma Abs1_eq: + fixes x::"'a::fs" + shows "Abs_set {a} x = Abs_set {a} y \ x = y" + and "Abs_res {a} x = Abs_res {a} y \ x = y" + and "Abs_lst [c] x = Abs_lst [c] y \ x = y" +unfolding Abs_eq_iff2 alphas +apply(simp_all add: supp_perm_singleton fresh_star_def fresh_zero_perm) +apply(blast)+ +done + + +lemma Abs1_eq_iff: + fixes x::"'a::fs" + assumes "sort_of a = sort_of b" + and "sort_of c = sort_of d" + shows "Abs_set {a} x = Abs_set {b} y \ (a = b \ x = y) \ (a \ b \ x = (a \ b) \ y \ a \ y)" + and "Abs_res {a} x = Abs_res {b} y \ (a = b \ x = y) \ (a \ b \ x = (a \ b) \ y \ a \ y)" + and "Abs_lst [c] x = Abs_lst [d] y \ (c = d \ x = y) \ (c \ d \ x = (c \ d) \ y \ c \ y)" +proof - + { assume "a = b" + then have "Abs_set {a} x = Abs_set {b} y \ (a = b \ x = y)" + by (simp add: Abs1_eq) + } + moreover + { assume *: "a \ b" and **: "Abs_set {a} x = Abs_set {b} y" + have #: "a \ Abs_set {b} y" by (simp add: **[symmetric] Abs_fresh_iff) + have "Abs_set {a} ((a \ b) \ y) = (a \ b) \ (Abs_set {b} y)" by (simp add: permute_set_eq assms) + also have "\ = Abs_set {b} y" + by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff) + also have "\ = Abs_set {a} x" using ** by simp + finally have "a \ b \ x = (a \ b) \ y \ a \ y" using # * by (simp add: Abs1_eq Abs_fresh_iff) + } + moreover + { assume *: "a \ b" and **: "x = (a \ b) \ y \ a \ y" + have "Abs_set {a} x = Abs_set {a} ((a \ b) \ y)" using ** by simp + also have "\ = (a \ b) \ Abs_set {b} y" by (simp add: permute_set_eq assms) + also have "\ = Abs_set {b} y" + by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff) + finally have "Abs_set {a} x = Abs_set {b} y" . + } + ultimately + show "Abs_set {a} x = Abs_set {b} y \ (a = b \ x = y) \ (a \ b \ x = (a \ b) \ y \ a \ y)" + by blast +next + { assume "a = b" + then have "Abs_res {a} x = Abs_res {b} y \ (a = b \ x = y)" + by (simp add: Abs1_eq) + } + moreover + { assume *: "a \ b" and **: "Abs_res {a} x = Abs_res {b} y" + have #: "a \ Abs_res {b} y" by (simp add: **[symmetric] Abs_fresh_iff) + have "Abs_res {a} ((a \ b) \ y) = (a \ b) \ (Abs_res {b} y)" by (simp add: permute_set_eq assms) + also have "\ = Abs_res {b} y" + by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff) + also have "\ = Abs_res {a} x" using ** by simp + finally have "a \ b \ x = (a \ b) \ y \ a \ y" using # * by (simp add: Abs1_eq Abs_fresh_iff) + } + moreover + { assume *: "a \ b" and **: "x = (a \ b) \ y \ a \ y" + have "Abs_res {a} x = Abs_res {a} ((a \ b) \ y)" using ** by simp + also have "\ = (a \ b) \ Abs_res {b} y" by (simp add: permute_set_eq assms) + also have "\ = Abs_res {b} y" + by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff) + finally have "Abs_res {a} x = Abs_res {b} y" . + } + ultimately + show "Abs_res {a} x = Abs_res {b} y \ (a = b \ x = y) \ (a \ b \ x = (a \ b) \ y \ a \ y)" + by blast +next + { assume "c = d" + then have "Abs_lst [c] x = Abs_lst [d] y \ (c = d \ x = y)" + by (simp add: Abs1_eq) + } + moreover + { assume *: "c \ d" and **: "Abs_lst [c] x = Abs_lst [d] y" + have #: "c \ Abs_lst [d] y" by (simp add: **[symmetric] Abs_fresh_iff) + have "Abs_lst [c] ((c \ d) \ y) = (c \ d) \ (Abs_lst [d] y)" by (simp add: assms) + also have "\ = Abs_lst [d] y" + by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff) + also have "\ = Abs_lst [c] x" using ** by simp + finally have "c \ d \ x = (c \ d) \ y \ c \ y" using # * by (simp add: Abs1_eq Abs_fresh_iff) + } + moreover + { assume *: "c \ d" and **: "x = (c \ d) \ y \ c \ y" + have "Abs_lst [c] x = Abs_lst [c] ((c \ d) \ y)" using ** by simp + also have "\ = (c \ d) \ Abs_lst [d] y" by (simp add: assms) + also have "\ = Abs_lst [d] y" + by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff) + finally have "Abs_lst [c] x = Abs_lst [d] y" . + } + ultimately + show "Abs_lst [c] x = Abs_lst [d] y \ (c = d \ x = y) \ (c \ d \ x = (c \ d) \ y \ c \ y)" + by blast +qed + subsection {* Renaming of bodies of abstractions *}