Nominal/Nominal2_Abs.thy
changeset 3224 cf451e182bf0
parent 3218 89158f401b07
child 3229 b52e8651591f
equal deleted inserted replaced
3223:c9a1c6f50ff5 3224:cf451e182bf0
    49 lemma [mono]: 
    49 lemma [mono]: 
    50   shows "R1 \<le> R2 \<Longrightarrow> alpha_set bs R1 \<le> alpha_set bs R2"
    50   shows "R1 \<le> R2 \<Longrightarrow> alpha_set bs R1 \<le> alpha_set bs R2"
    51   and   "R1 \<le> R2 \<Longrightarrow> alpha_res bs R1 \<le> alpha_res bs R2"
    51   and   "R1 \<le> R2 \<Longrightarrow> alpha_res bs R1 \<le> alpha_res bs R2"
    52   and   "R1 \<le> R2 \<Longrightarrow> alpha_lst cs R1 \<le> alpha_lst cs R2"
    52   and   "R1 \<le> R2 \<Longrightarrow> alpha_lst cs R1 \<le> alpha_lst cs R2"
    53   by (case_tac [!] bs, case_tac [!] cs) 
    53   by (case_tac [!] bs, case_tac [!] cs) 
    54      (auto simp add: le_fun_def le_bool_def alphas)
    54      (auto simp: le_fun_def le_bool_def alphas)
    55 
    55 
    56 section {* Equivariance *}
    56 section {* Equivariance *}
    57 
    57 
    58 lemma alpha_eqvt[eqvt]:
    58 lemma alpha_eqvt[eqvt]:
    59   shows "(bs, x) \<approx>set R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>set (p \<bullet> R) (p \<bullet> f) (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
    59   shows "(bs, x) \<approx>set R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>set (p \<bullet> R) (p \<bullet> f) (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
    85   shows "(bs, x) \<approx>set R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>set R f (- p) (bs, x)"
    85   shows "(bs, x) \<approx>set R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>set R f (- p) (bs, x)"
    86   and   "(bs, x) \<approx>res R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>res R f (- p) (bs, x)"
    86   and   "(bs, x) \<approx>res R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>res R f (- p) (bs, x)"
    87   and   "(ds, x) \<approx>lst R f p (es, y) \<Longrightarrow> (es, y) \<approx>lst R f (- p) (ds, x)"
    87   and   "(ds, x) \<approx>lst R f p (es, y) \<Longrightarrow> (es, y) \<approx>lst R f (- p) (ds, x)"
    88   unfolding alphas fresh_star_def
    88   unfolding alphas fresh_star_def
    89   using a
    89   using a
    90   by (auto simp add: fresh_minus_perm)
    90   by (auto simp: fresh_minus_perm)
    91 
    91 
    92 lemma alpha_trans:
    92 lemma alpha_trans:
    93   assumes a: "\<lbrakk>R (p \<bullet> x) y; R (q \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((q + p) \<bullet> x) z"
    93   assumes a: "\<lbrakk>R (p \<bullet> x) y; R (q \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((q + p) \<bullet> x) z"
    94   shows "\<lbrakk>(bs, x) \<approx>set R f p (cs, y); (cs, y) \<approx>set R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>set R f (q + p) (ds, z)"
    94   shows "\<lbrakk>(bs, x) \<approx>set R f p (cs, y); (cs, y) \<approx>set R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>set R f (q + p) (ds, z)"
    95   and   "\<lbrakk>(bs, x) \<approx>res R f p (cs, y); (cs, y) \<approx>res R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>res R f (q + p) (ds, z)"
    95   and   "\<lbrakk>(bs, x) \<approx>res R f p (cs, y); (cs, y) \<approx>res R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>res R f (q + p) (ds, z)"
   202   and   "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (es, y) \<approx>abs_lst (ds, x)"
   202   and   "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (es, y) \<approx>abs_lst (ds, x)"
   203   unfolding alphas_abs
   203   unfolding alphas_abs
   204   unfolding alphas
   204   unfolding alphas
   205   unfolding fresh_star_def
   205   unfolding fresh_star_def
   206   by (erule_tac [!] exE, rule_tac [!] x="-p" in exI)
   206   by (erule_tac [!] exE, rule_tac [!] x="-p" in exI)
   207      (auto simp add: fresh_minus_perm)
   207      (auto simp: fresh_minus_perm)
   208 
   208 
   209 lemma alphas_abs_trans:
   209 lemma alphas_abs_trans:
   210   shows "\<lbrakk>(bs, x) \<approx>abs_set (cs, y); (cs, y) \<approx>abs_set (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_set (ds, z)"
   210   shows "\<lbrakk>(bs, x) \<approx>abs_set (cs, y); (cs, y) \<approx>abs_set (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_set (ds, z)"
   211   and   "\<lbrakk>(bs, x) \<approx>abs_res (cs, y); (cs, y) \<approx>abs_res (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_res (ds, z)"
   211   and   "\<lbrakk>(bs, x) \<approx>abs_res (cs, y); (cs, y) \<approx>abs_res (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_res (ds, z)"
   212   and   "\<lbrakk>(es, x) \<approx>abs_lst (gs, y); (gs, y) \<approx>abs_lst (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>abs_lst (hs, z)"
   212   and   "\<lbrakk>(es, x) \<approx>abs_lst (gs, y); (gs, y) \<approx>abs_lst (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>abs_lst (hs, z)"
   276     by (simp add: atom_set_perm_eq)
   276     by (simp add: atom_set_perm_eq)
   277   obtain p where *: "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" and **: "supp p \<subseteq> supp x \<union> p' \<bullet> supp x"
   277   obtain p where *: "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" and **: "supp p \<subseteq> supp x \<union> p' \<bullet> supp x"
   278     using set_renaming_perm2 by blast
   278     using set_renaming_perm2 by blast
   279   from * have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   279   from * have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   280   from 0 have 1: "(supp x - as) \<sharp>* p" using *
   280   from 0 have 1: "(supp x - as) \<sharp>* p" using *
   281     by (auto simp add: fresh_star_def fresh_perm)
   281     by (auto simp: fresh_star_def fresh_perm)
   282   then have 2: "(supp x - as) \<inter> supp p = {}"
   282   then have 2: "(supp x - as) \<inter> supp p = {}"
   283     by (auto simp add: fresh_star_def fresh_def)
   283     by (auto simp: fresh_star_def fresh_def)
   284   have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
   284   have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
   285   have "supp p \<subseteq> supp x \<union> p' \<bullet> supp x" using ** by simp
   285   have "supp p \<subseteq> supp x \<union> p' \<bullet> supp x" using ** by simp
   286   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as)))" 
   286   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as)))" 
   287     using b by simp
   287     using b by simp
   288   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> ((p' \<bullet> (supp x - as)) \<union> (p' \<bullet> (supp x \<inter> as)))"
   288   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> ((p' \<bullet> (supp x - as)) \<union> (p' \<bullet> (supp x \<inter> as)))"
   301 qed
   301 qed
   302 
   302 
   303 lemma alpha_abs_res_minimal:
   303 lemma alpha_abs_res_minimal:
   304   assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
   304   assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
   305   shows "(as \<inter> supp x, x) \<approx>res (op =) supp p (as' \<inter> supp x', x')"
   305   shows "(as \<inter> supp x, x) \<approx>res (op =) supp p (as' \<inter> supp x', x')"
   306   using asm unfolding alpha_res by (auto simp add: Diff_Int)
   306   using asm unfolding alpha_res by (auto simp: Diff_Int)
   307 
   307 
   308 lemma alpha_abs_res_abs_set:
   308 lemma alpha_abs_res_abs_set:
   309   assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
   309   assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
   310   shows "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
   310   shows "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
   311 proof -
   311 proof -
   321 qed
   321 qed
   322 
   322 
   323 lemma alpha_abs_set_abs_res:
   323 lemma alpha_abs_set_abs_res:
   324   assumes asm: "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
   324   assumes asm: "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
   325   shows "(as, x) \<approx>res (op =) supp p (as', x')"
   325   shows "(as, x) \<approx>res (op =) supp p (as', x')"
   326   using asm unfolding alphas by (auto simp add: Diff_Int)
   326   using asm unfolding alphas by (auto simp: Diff_Int)
   327 
   327 
   328 lemma alpha_abs_res_stronger1:
   328 lemma alpha_abs_res_stronger1:
   329   assumes asm: "(as, x) \<approx>res (op =) supp p' (as', x')"
   329   assumes asm: "(as, x) \<approx>res (op =) supp p' (as', x')"
   330   shows "\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as'"
   330   shows "\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as'"
   331 using alpha_abs_res_stronger1_aux[OF asm] by auto
   331 using alpha_abs_res_stronger1_aux[OF asm] by auto
   342     using set_renaming_perm2 by blast
   342     using set_renaming_perm2 by blast
   343   from * have "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" by blast
   343   from * have "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" by blast
   344   then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   344   then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   345   from * have "\<forall>b \<in> as. p \<bullet> b = p' \<bullet> b" by blast
   345   from * have "\<forall>b \<in> as. p \<bullet> b = p' \<bullet> b" by blast
   346   then have zb: "p \<bullet> as = p' \<bullet> as" 
   346   then have zb: "p \<bullet> as = p' \<bullet> as" 
   347     apply(auto simp add: permute_set_def)
   347     apply(auto simp: permute_set_def)
   348     apply(rule_tac x="xa" in exI)
   348     apply(rule_tac x="xa" in exI)
   349     apply(simp)
   349     apply(simp)
   350     done
   350     done
   351   have zc: "p' \<bullet> as = as'" using asm by (simp add: alphas)
   351   have zc: "p' \<bullet> as = as'" using asm by (simp add: alphas)
   352   from 0 have 1: "(supp x - as) \<sharp>* p" using *
   352   from 0 have 1: "(supp x - as) \<sharp>* p" using *
   353     by (auto simp add: fresh_star_def fresh_perm)
   353     by (auto simp: fresh_star_def fresh_perm)
   354   then have 2: "(supp x - as) \<inter> supp p = {}"
   354   then have 2: "(supp x - as) \<inter> supp p = {}"
   355     by (auto simp add: fresh_star_def fresh_def)
   355     by (auto simp: fresh_star_def fresh_def)
   356   have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
   356   have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
   357   have "supp p \<subseteq> supp x \<union> as \<union> p' \<bullet> supp x \<union> p' \<bullet> as" using ** using union_eqvt by blast
   357   have "supp p \<subseteq> supp x \<union> as \<union> p' \<bullet> supp x \<union> p' \<bullet> as" using ** using union_eqvt by blast
   358   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as))) \<union> p' \<bullet> as" 
   358   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as))) \<union> p' \<bullet> as" 
   359     using b by simp
   359     using b by simp
   360   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> 
   360   also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> 
   388   then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   388   then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
   389   from * have "\<forall>b \<in> set as. p \<bullet> b = p' \<bullet> b" by blast
   389   from * have "\<forall>b \<in> set as. p \<bullet> b = p' \<bullet> b" by blast
   390   then have zb: "p \<bullet> as = p' \<bullet> as" by (induct as) (auto)
   390   then have zb: "p \<bullet> as = p' \<bullet> as" by (induct as) (auto)
   391   have zc: "p' \<bullet> set as = set as'" using asm by (simp add: alphas set_eqvt)
   391   have zc: "p' \<bullet> set as = set as'" using asm by (simp add: alphas set_eqvt)
   392   from 0 have 1: "(supp x - set as) \<sharp>* p" using *
   392   from 0 have 1: "(supp x - set as) \<sharp>* p" using *
   393     by (auto simp add: fresh_star_def fresh_perm)
   393     by (auto simp: fresh_star_def fresh_perm)
   394   then have 2: "(supp x - set as) \<inter> supp p = {}"
   394   then have 2: "(supp x - set as) \<inter> supp p = {}"
   395     by (auto simp add: fresh_star_def fresh_def)
   395     by (auto simp: fresh_star_def fresh_def)
   396   have b: "supp x = (supp x - set as) \<union> (supp x \<inter> set as)" by auto
   396   have b: "supp x = (supp x - set as) \<union> (supp x \<inter> set as)" by auto
   397   have "supp p \<subseteq> supp x \<union> set as \<union> p' \<bullet> supp x \<union> p' \<bullet> set as" using ** using union_eqvt by blast
   397   have "supp p \<subseteq> supp x \<union> set as \<union> p' \<bullet> supp x \<union> p' \<bullet> set as" using ** using union_eqvt by blast
   398   also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> 
   398   also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> 
   399     (p' \<bullet> ((supp x - set as) \<union> (supp x \<inter> set as))) \<union> p' \<bullet> set as" using b by simp
   399     (p' \<bullet> ((supp x - set as) \<union> (supp x \<inter> set as))) \<union> p' \<bullet> set as" using b by simp
   400   also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> 
   400   also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> 
   418   shows "(as, x) \<approx>abs_set (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>set (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
   418   shows "(as, x) \<approx>abs_set (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>set (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
   419   and   "(as, x) \<approx>abs_res (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
   419   and   "(as, x) \<approx>abs_res (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
   420   and   "(bs, x) \<approx>abs_lst (bs', x') \<longleftrightarrow> 
   420   and   "(bs, x) \<approx>abs_lst (bs', x') \<longleftrightarrow> 
   421    (\<exists>p. (bs, x) \<approx>lst (op =) supp p (bs', x') \<and> supp p \<subseteq> set bs \<union> set bs')"
   421    (\<exists>p. (bs, x) \<approx>lst (op =) supp p (bs', x') \<and> supp p \<subseteq> set bs \<union> set bs')"
   422 apply(rule iffI)
   422 apply(rule iffI)
   423 apply(auto simp add: alphas_abs alpha_abs_set_stronger1)[1]
   423 apply(auto simp: alphas_abs alpha_abs_set_stronger1)[1]
   424 apply(auto simp add: alphas_abs)[1]
   424 apply(auto simp: alphas_abs)[1]
   425 apply(rule iffI)
   425 apply(rule iffI)
   426 apply(auto simp add: alphas_abs alpha_abs_res_stronger1)[1]
   426 apply(auto simp: alphas_abs alpha_abs_res_stronger1)[1]
   427 apply(auto simp add: alphas_abs)[1]
   427 apply(auto simp: alphas_abs)[1]
   428 apply(rule iffI)
   428 apply(rule iffI)
   429 apply(auto simp add: alphas_abs alpha_abs_lst_stronger1)[1]
   429 apply(auto simp: alphas_abs alpha_abs_lst_stronger1)[1]
   430 apply(auto simp add: alphas_abs)[1]
   430 apply(auto simp: alphas_abs)[1]
   431 done
   431 done
   432 
   432 
   433 lemma alpha_res_alpha_set:
   433 lemma alpha_res_alpha_set:
   434   "(bs, x) \<approx>res op = supp p (cs, y) \<longleftrightarrow> (bs \<inter> supp x, x) \<approx>set op = supp p (cs \<inter> supp y, y)"
   434   "(bs, x) \<approx>res op = supp p (cs, y) \<longleftrightarrow> (bs \<inter> supp x, x) \<approx>set op = supp p (cs \<inter> supp y, y)"
   435   using alpha_abs_set_abs_res alpha_abs_res_abs_set by blast
   435   using alpha_abs_set_abs_res alpha_abs_res_abs_set by blast
   601   unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] 
   601   unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] 
   602   unfolding fresh_star_def fresh_def
   602   unfolding fresh_star_def fresh_def
   603   unfolding swap_set_not_in[OF a1 a2] 
   603   unfolding swap_set_not_in[OF a1 a2] 
   604   using a1 a2
   604   using a1 a2
   605   by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
   605   by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
   606      (auto simp add: supp_perm swap_atom)
   606      (auto simp: supp_perm swap_atom)
   607 
   607 
   608 lemma Abs_swap2:
   608 lemma Abs_swap2:
   609   assumes a1: "a \<notin> (supp x) - (set bs)"
   609   assumes a1: "a \<notin> (supp x) - (set bs)"
   610   and     a2: "b \<notin> (supp x) - (set bs)"
   610   and     a2: "b \<notin> (supp x) - (set bs)"
   611   shows "[bs]lst. x = [(a \<rightleftharpoons> b) \<bullet> bs]lst. ((a \<rightleftharpoons> b) \<bullet> x)"
   611   shows "[bs]lst. x = [(a \<rightleftharpoons> b) \<bullet> bs]lst. ((a \<rightleftharpoons> b) \<bullet> x)"
   614   unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] set_eqvt[symmetric]
   614   unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] set_eqvt[symmetric]
   615   unfolding fresh_star_def fresh_def
   615   unfolding fresh_star_def fresh_def
   616   unfolding swap_set_not_in[OF a1 a2]
   616   unfolding swap_set_not_in[OF a1 a2]
   617   using a1 a2
   617   using a1 a2
   618   by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
   618   by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
   619      (auto simp add: supp_perm swap_atom)
   619      (auto simp: supp_perm swap_atom)
   620 
   620 
   621 lemma Abs_supports:
   621 lemma Abs_supports:
   622   shows "((supp x) - as) supports ([as]set. x)"
   622   shows "((supp x) - as) supports ([as]set. x)"
   623   and   "((supp x) - as) supports ([as]res. x)"
   623   and   "((supp x) - as) supports ([as]res. x)"
   624   and   "((supp x) - set bs) supports ([bs]lst. x)"
   624   and   "((supp x) - set bs) supports ([bs]lst. x)"
   730   fixes x::"'a::fs"
   730   fixes x::"'a::fs"
   731   shows "as \<sharp>* ([bs]set. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
   731   shows "as \<sharp>* ([bs]set. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
   732   and   "as \<sharp>* ([bs]res. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
   732   and   "as \<sharp>* ([bs]res. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
   733   and   "as \<sharp>* ([cs]lst. x) \<longleftrightarrow> (as - set cs) \<sharp>* x"
   733   and   "as \<sharp>* ([cs]lst. x) \<longleftrightarrow> (as - set cs) \<sharp>* x"
   734   unfolding fresh_star_def
   734   unfolding fresh_star_def
   735   by (auto simp add: Abs_fresh_iff)
   735   by (auto simp: Abs_fresh_iff)
   736 
   736 
   737 lemma Abs_fresh_star:
   737 lemma Abs_fresh_star:
   738   fixes x::"'a::fs"
   738   fixes x::"'a::fs"
   739   shows "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']set. x)"
   739   shows "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']set. x)"
   740   and   "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']res. x)"
   740   and   "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']res. x)"
   741   and   "bs \<subseteq> set bs' \<Longrightarrow> bs \<sharp>* ([bs']lst. x)"
   741   and   "bs \<subseteq> set bs' \<Longrightarrow> bs \<sharp>* ([bs']lst. x)"
   742   unfolding fresh_star_def
   742   unfolding fresh_star_def
   743   by(auto simp add: Abs_fresh_iff)
   743   by(auto simp: Abs_fresh_iff)
   744 
   744 
   745 lemma Abs_fresh_star2:
   745 lemma Abs_fresh_star2:
   746   fixes x::"'a::fs"
   746   fixes x::"'a::fs"
   747   shows "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]set. x) \<longleftrightarrow> as \<sharp>* x"
   747   shows "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]set. x) \<longleftrightarrow> as \<sharp>* x"
   748   and   "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]res. x) \<longleftrightarrow> as \<sharp>* x"
   748   and   "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]res. x) \<longleftrightarrow> as \<sharp>* x"
   758   fixes x y::"'a::fs"
   758   fixes x y::"'a::fs"
   759   shows "[{atom a}]set. x = [{atom a}]set. y \<longleftrightarrow> x = y"
   759   shows "[{atom a}]set. x = [{atom a}]set. y \<longleftrightarrow> x = y"
   760   and   "[{atom a}]res. x = [{atom a}]res. y \<longleftrightarrow> x = y"
   760   and   "[{atom a}]res. x = [{atom a}]res. y \<longleftrightarrow> x = y"
   761   and   "[[atom a]]lst. x = [[atom a]]lst. y \<longleftrightarrow> x = y"
   761   and   "[[atom a]]lst. x = [[atom a]]lst. y \<longleftrightarrow> x = y"
   762 unfolding Abs_eq_iff2 alphas
   762 unfolding Abs_eq_iff2 alphas
   763 by (auto simp add: supp_perm_singleton fresh_star_def fresh_zero_perm)
   763 by (auto simp: supp_perm_singleton fresh_star_def fresh_zero_perm)
   764 
   764 
   765 lemma Abs1_eq_iff_fresh:
   765 lemma Abs1_eq_iff_fresh:
   766   fixes x y::"'a::fs"
   766   fixes x y::"'a::fs"
   767   and a b c::"'b::at"
   767   and a b c::"'b::at"
   768   assumes "atom c \<sharp> (a, b, x, y)"
   768   assumes "atom c \<sharp> (a, b, x, y)"
   806 
   806 
   807 lemma Abs1_eq_iff_all:
   807 lemma Abs1_eq_iff_all:
   808   fixes x y::"'a::fs"
   808   fixes x y::"'a::fs"
   809   and z::"'c::fs"
   809   and z::"'c::fs"
   810   and a b::"'b::at"
   810   and a b::"'b::at"
   811   shows "[{atom a}]set. x = [{atom b}]set. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> (a, b, x, y, z) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   811   shows "[{atom a}]set. x = [{atom b}]set. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> z \<longrightarrow> atom c \<sharp> (a, b, x, y) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   812   and   "[{atom a}]res. x = [{atom b}]res. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> (a, b, x, y, z) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   812   and   "[{atom a}]res. x = [{atom b}]res. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> z \<longrightarrow> atom c \<sharp> (a, b, x, y) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   813   and   "[[atom a]]lst. x = [[atom b]]lst. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> (a, b, x, y, z) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   813   and   "[[atom a]]lst. x = [[atom b]]lst. y \<longleftrightarrow> (\<forall>c. atom c \<sharp> z \<longrightarrow> atom c \<sharp> (a, b, x, y) \<longrightarrow> (a \<leftrightarrow> c) \<bullet> x = (b \<leftrightarrow> c) \<bullet> y)"
   814 apply(auto) 
   814 apply(auto) 
   815 apply(simp add: Abs1_eq_iff_fresh(1)[symmetric])
   815 apply(simp add: Abs1_eq_iff_fresh(1)[symmetric])
   816 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   816 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   817 apply(drule_tac x="aa" in spec)
   817 apply(drule_tac x="aa" in spec)
   818 apply(simp)
   818 apply(simp)
   819 apply(subst Abs1_eq_iff_fresh(1))
   819 apply(subst Abs1_eq_iff_fresh(1))
   820 apply(auto simp add: fresh_Pair)[2]
   820 apply(auto simp: fresh_Pair)[2]
   821 apply(simp add: Abs1_eq_iff_fresh(2)[symmetric])
   821 apply(simp add: Abs1_eq_iff_fresh(2)[symmetric])
   822 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   822 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   823 apply(drule_tac x="aa" in spec)
   823 apply(drule_tac x="aa" in spec)
   824 apply(simp)
   824 apply(simp)
   825 apply(subst Abs1_eq_iff_fresh(2))
   825 apply(subst Abs1_eq_iff_fresh(2))
   826 apply(auto simp add: fresh_Pair)[2]
   826 apply(auto simp: fresh_Pair)[2]
   827 apply(simp add: Abs1_eq_iff_fresh(3)[symmetric])
   827 apply(simp add: Abs1_eq_iff_fresh(3)[symmetric])
   828 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   828 apply(rule_tac ?'a="'b::at" and x="(a, b, x, y, z)" in obtain_fresh)
   829 apply(drule_tac x="aa" in spec)
   829 apply(drule_tac x="aa" in spec)
   830 apply(simp)
   830 apply(simp)
   831 apply(subst Abs1_eq_iff_fresh(3))
   831 apply(subst Abs1_eq_iff_fresh(3))
   832 apply(auto simp add: fresh_Pair)[2]
   832 apply(auto simp: fresh_Pair)[2]
   833 done
   833 done
   834 
   834 
   835 lemma Abs1_eq_iff:
   835 lemma Abs1_eq_iff:
   836   fixes x y::"'a::fs"
   836   fixes x y::"'a::fs"
   837   and a b::"'b::at"
   837   and a b::"'b::at"
   916   fixes x::"'a::fs"
   916   fixes x::"'a::fs"
   917   and a b::"'b::at"
   917   and a b::"'b::at"
   918   shows "[{atom a}]set. x = [{atom b}]set. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   918   shows "[{atom a}]set. x = [{atom b}]set. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   919   and   "[{atom a}]res. x = [{atom b}]res. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   919   and   "[{atom a}]res. x = [{atom b}]res. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   920   and   "[[atom a]]lst. x = [[atom b]]lst. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   920   and   "[[atom a]]lst. x = [[atom b]]lst. y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<leftrightarrow> a) \<bullet> x = y \<and> atom b \<sharp> x)"
   921 using assms by (auto simp add: Abs1_eq_iff fresh_permute_left)
   921 using assms by (auto simp: Abs1_eq_iff fresh_permute_left)
   922 
   922 
   923 
   923 
   924 ML {*
   924 ML {*
   925 fun alpha_single_simproc thm _ ctxt ctrm =
   925 fun alpha_single_simproc thm _ ctxt ctrm =
   926  let
   926  let
  1076   by (perm_simp) (rule refl)
  1076   by (perm_simp) (rule refl)
  1077 
  1077 
  1078 lemma prod_fv_supp:
  1078 lemma prod_fv_supp:
  1079   shows "prod_fv supp supp = supp"
  1079   shows "prod_fv supp supp = supp"
  1080 by (rule ext)
  1080 by (rule ext)
  1081    (auto simp add: supp_Pair)
  1081    (auto simp: supp_Pair)
  1082 
  1082 
  1083 lemma prod_alpha_eq:
  1083 lemma prod_alpha_eq:
  1084   shows "prod_alpha (op=) (op=) = (op=)"
  1084   shows "prod_alpha (op=) (op=) = (op=)"
  1085   unfolding prod_alpha_def
  1085   unfolding prod_alpha_def
  1086   by (auto intro!: ext)
  1086   by (auto intro!: ext)