# HG changeset patch # User Christian Urban # Date 1290811406 0 # Node ID 385add25dedffed47d63dafd88fd97c32059dfd1 # Parent 1eac050a36f4bd539d50d9a68eb6720a96256bc3 slightly simplified the Foo2 tests and hint at a general lemma diff -r 1eac050a36f4 -r 385add25dedf Nominal/Ex/Foo2.thy --- a/Nominal/Ex/Foo2.thy Fri Nov 26 19:03:23 2010 +0000 +++ b/Nominal/Ex/Foo2.thy Fri Nov 26 22:43:26 2010 +0000 @@ -298,6 +298,36 @@ *} +thm at_set_avoiding2 supp_perm_eq at_set_avoiding + +lemma abs_rename_set: + fixes x::"'a::fs" + assumes "b' \ x" "sort_of b = sort_of b'" + shows "\y. [{b}]set. x = [{b'}]set. y" +apply(rule_tac x="(b \ b') \ x" in exI) +apply(subst Abs_swap1[where a="b" and b="b'"]) +apply(simp) +using assms +apply(simp add: fresh_def) +apply(perm_simp) +using assms +apply(simp) +done + +lemma abs_rename_list: + fixes x::"'a::fs" + assumes "b' \ x" "sort_of b = sort_of b'" + shows "\y. [[b]]lst. x = [[b']]lst. y" +apply(rule_tac x="(b \ b') \ x" in exI) +apply(subst Abs_swap2[where a="b" and b="b'"]) +apply(simp) +using assms +apply(simp add: fresh_def) +apply(perm_simp) +using assms +apply(simp) +done + lemma test3: fixes c::"'a::fs" assumes a: "y = Let2 x1 x2 trm1 trm2" @@ -307,24 +337,19 @@ apply - apply(subgoal_tac "\q::perm. (q \ {atom x1, atom x2}) \* (c, x1, x2, trm1, trm2)") apply(erule exE) -apply(drule_tac p="- q" in permute_boolI) apply(perm_simp) +apply(drule_tac x="q \ x1" in spec) +apply(drule_tac x="q \ x2" in spec) apply(simp only: foo.eq_iff) -apply(drule_tac x="x1" in spec) -apply(drule_tac x="x2" in spec) apply(simp) -apply(drule mp) +apply(erule mp) apply(rule conjI) -defer -apply(rule_tac p="q" in permute_boolE) -apply(perm_simp add: permute_minus_cancel) +apply(simp add: fresh_star_prod) apply(rule conjI) prefer 2 -apply(rule_tac x="(atom x2 \ atom (q \ x2)) \ trm2" in exI) -apply(subst Abs_swap2[where a="atom x2" and b="atom (q \ x2)"]) -apply(simp) +apply(rule abs_rename_list) +apply(simp add: fresh_star_prod) apply(simp add: fresh_star_def) -apply(simp add: fresh_def supp_Pair) apply(simp) apply(case_tac "x1=x2") apply(simp) @@ -363,11 +388,6 @@ apply(simp add: fresh_star_def) apply(simp add: fresh_def supp_Pair) apply(simp add: supp_at_base) -apply(simp) -defer -apply(rule_tac p="q" in permute_boolE) -apply(perm_simp add: permute_minus_cancel fresh_star_prod) -apply(simp) apply(rule at_set_avoiding3[where x="()", simplified]) apply(simp) apply(simp add: finite_supp) @@ -386,6 +406,25 @@ apply(auto) done +lemma test5: + fixes c::"'a::fs" + assumes "\name. y = Var name \ P" + and "\trm1 trm2. y = App trm1 trm2 \ P" + and "\name trm. \{atom name} \* c; y = Lam name trm\ \ P" + and "\assn1 trm1 assn2 trm2. + \((set (bn assn1)) \ (set (bn assn2))) \* c; y = Let1 assn1 trm1 assn2 trm2\ \ P" + and "\x1 x2 trm1 trm2. \{atom x1, atom x2} \* c; y = Let2 x1 x2 trm1 trm2\ \ P" + shows "P" +apply(rule_tac y="y" in foo.exhaust(1)) +apply (erule assms) +apply (erule assms) +prefer 3 +apply(erule test4[where c="c"]) +apply (rule assms(5)) +apply assumption +apply(simp) +oops + end