# HG changeset patch # User Christian Urban # Date 1296701824 0 # Node ID e8c1a19e13d22a8033fea2e07ea6168fc5653953 # Parent cd336163f270679a92aeda34d483d8e3083ff51b# Parent 08bc1aa259d9e5b20457e93631dd29fa13359ee7 merged diff -r cd336163f270 -r e8c1a19e13d2 Nominal/Ex/Lambda.thy --- a/Nominal/Ex/Lambda.thy Thu Feb 03 02:51:57 2011 +0000 +++ b/Nominal/Ex/Lambda.thy Thu Feb 03 02:57:04 2011 +0000 @@ -140,7 +140,7 @@ apply(rule_tac y="a" and c="(aa, b)" in lam.strong_exhaust) apply(blast)+ apply(simp add: fresh_star_def) -apply(subgoal_tac "atom xa \ [[atom x]]lst. t \ atom x \ [[atom xa]]lst. ta") +apply(subgoal_tac "atom xa \ [[atom x]]lst. t") apply(subst (asm) Abs_eq_iff2) apply(simp add: alphas atom_eqvt) apply(clarify) @@ -168,9 +168,6 @@ apply(auto simp add: fresh_star_def fresh_Pair)[1] apply(rule perm_supp_eq) apply(auto simp add: fresh_star_def fresh_Pair)[1] -apply(rule conjI) -apply(simp add: Abs_fresh_iff) -apply(drule sym) apply(simp add: Abs_fresh_iff) apply(subgoal_tac "\p x r. subst_graph x r \ subst_graph (p \ x) (p \ r)") unfolding eqvt_def diff -r cd336163f270 -r e8c1a19e13d2 Nominal/Ex/TypeSchemes.thy --- a/Nominal/Ex/TypeSchemes.thy Thu Feb 03 02:51:57 2011 +0000 +++ b/Nominal/Ex/TypeSchemes.thy Thu Feb 03 02:57:04 2011 +0000 @@ -15,7 +15,6 @@ apply(subst permute_fun_def) sorry - nominal_primrec even :: "nat \ A" and odd :: "nat \ B" @@ -258,8 +257,11 @@ --"This is exactly the assumption for the properly defined function" defer apply (simp add: ty_tys.eq_iff) +apply (simp only: Abs_eq_res_set) +apply (subgoal_tac "(atom ` fset xsa \ supp T - atom ` fset xs \ supp Ta) \* ([atom ` fset xs \ supp (subst \' T)]set. T)") apply (subst (asm) Abs_eq_iff2) -apply (simp add: alpha_res.simps) +apply (clarify) +apply (simp add: alphas) apply (clarify) apply (rule trans) apply(rule_tac p="p" in supp_perm_eq[symmetric]) @@ -268,22 +270,48 @@ apply(drule fresh_star_perm_set_conv) apply (rule finite_Diff) apply (rule finite_supp) -apply (subgoal_tac "(atom ` fset xs \ atom ` fset xsa) \* ([atom ` fset xs]res. subst \' T)") +apply (subgoal_tac "(atom ` fset xs \ supp T \ atom ` fset xsa \ supp (p \ T)) \* ([atom ` fset xs \ supp (subst \' T)]set. subst \' T)") apply (metis Un_absorb2 fresh_star_Un) apply (simp add: fresh_star_Un) apply (rule conjI) -apply (simp add: fresh_star_def) +apply (simp (no_asm) add: fresh_star_def) + apply rule apply(simp (no_asm) only: Abs_fresh_iff) apply(clarify) -apply blast -defer +apply auto[1] +apply (simp add: fresh_star_def fresh_def) +--"HERE" +apply (simp (no_asm) add: fresh_star_def) +apply rule +apply auto[1] +apply(simp (no_asm) only: Abs_fresh_iff) +apply(clarify) +apply auto[1] +prefer 2 +apply (simp add: fresh_def) +apply(drule_tac a="atom x" in fresh_eqvt_at) +apply (simp add: supp_Pair finite_supp) +apply (simp add: fresh_Pair) +apply(auto simp add: Abs_fresh_iff fresh_star_def)[1] +prefer 2 +apply auto[1] +apply (erule_tac x="atom x" in ballE) +apply auto[1] +apply (auto simp add: fresh_def)[1] + apply (subgoal_tac "p \ \' = \'") prefer 2 apply (rule perm_supp_eq) -apply (metis Un_absorb2 fresh_star_Un) -apply simp ---"Would work for 'set' and 'list' bindings, not sure how to do 'set+'." +apply (subgoal_tac "(atom ` fset xs \ supp T \ atom ` fset xsa \ supp (p \ T)) \* \'") +apply (auto simp add: fresh_star_def)[1] +apply (simp add: fresh_star_Un fresh_star_def) +apply blast +apply(simp add: eqvt_at_def inter_eqvt supp_eqvt) +apply (simp only: Abs_eq_res_set[symmetric]) + +apply (rule_tac s="[p \ atom ` fset xs \ supp (\', p \ T)]res. subst \' (p \ T)" in trans) +--"What if (p \ xs) is not fresh for \' ?" oops diff -r cd336163f270 -r e8c1a19e13d2 Nominal/Nominal2_Abs.thy --- a/Nominal/Nominal2_Abs.thy Thu Feb 03 02:51:57 2011 +0000 +++ b/Nominal/Nominal2_Abs.thy Thu Feb 03 02:57:04 2011 +0000 @@ -285,7 +285,7 @@ then have "(supp x' - as') \ (p \ (supp x \ as)) = {}" using a by (simp add: alphas) ultimately show "p \ (supp x \ as) = supp x' \ as'" by (auto dest: disjoint_right_eq) -qed +qed lemma alpha_abs_res_stronger1_aux: assumes asm: "(as, x) \res (op =) supp p' (as', x')" @@ -320,6 +320,31 @@ show "\p. (as, x) \res (op =) supp p (as', x') \ supp p \ (supp x \ as) \ (supp x' \ as')" by blast qed +lemma alpha_abs_res_minimal: + assumes asm: "(as, x) \res (op =) supp p (as', x')" + shows "(as \ supp x, x) \res (op =) supp p (as' \ supp x', x')" + using asm unfolding alpha_res by (auto simp add: Diff_Int) + +lemma alpha_abs_res_abs_set: + assumes asm: "(as, x) \res (op =) supp p (as', x')" + shows "(as \ supp x, x) \set (op =) supp p (as' \ supp x', x')" +proof - + have c: "p \ x = x'" + using alpha_abs_res_minimal[OF asm] unfolding alpha_res by clarify + then have a: "supp x - as \ supp x = supp (p \ x) - as' \ supp (p \ x)" + using alpha_abs_res_minimal[OF asm] by (simp add: alpha_res) + have b: "(supp x - as \ supp x) \* p" + using alpha_abs_res_minimal[OF asm] unfolding alpha_res by clarify + have "p \ (as \ supp x) = as' \ supp (p \ x)" + by (metis Int_commute asm c supp_property_res) + then show ?thesis using a b c unfolding alpha_set by simp +qed + +lemma alpha_abs_set_abs_res: + assumes asm: "(as \ supp x, x) \set (op =) supp p (as' \ supp x', x')" + shows "(as, x) \res (op =) supp p (as', x')" + using asm unfolding alphas by (auto simp add: Diff_Int) + lemma alpha_abs_res_stronger1: assumes asm: "(as, x) \res (op =) supp p' (as', x')" shows "\p. (as, x) \res (op =) supp p (as', x') \ supp p \ as \ as'" @@ -483,6 +508,25 @@ (\p. (bsl, x) \lst (op =) supp p (csl, y) \ supp p \ set bsl \ set csl)" by (lifting alphas_abs_stronger) +lemma Abs_eq_res_set: + "(([bs]res. x) = ([cs]res. y)) = (([(bs \ supp x)]set. x) = ([(cs \ supp y)]set. y))" + unfolding Abs_eq_iff + using alpha_abs_set_abs_res alpha_abs_res_abs_set + apply auto + apply (rule_tac x="p" in exI) + apply assumption + apply (rule_tac x="p" in exI) + apply assumption + done + +lemma Abs_eq_res_supp: + assumes asm: "supp x \ bs" + shows "([as]res. x) = ([as \ bs]res. x)" + unfolding Abs_eq_iff alphas + apply (rule_tac x="0::perm" in exI) + apply (simp add: fresh_star_zero) + using asm by blast + lemma Abs_exhausts: shows "(\as (x::'a::pt). y1 = Abs_set as x \ P1) \ P1" and "(\as (x::'a::pt). y2 = Abs_res as x \ P2) \ P2"