# HG changeset patch # User Christian Urban # Date 1309217430 -3600 # Node ID 3c363a5070a59ebe379da1fadc45e13d6445f0bf # Parent 567967bc94cc02c02861efe8d5d0664136d3742e copied all work to Lambda.thy; had to derive a special version of fcb1 for concrete atom diff -r 567967bc94cc -r 3c363a5070a5 Nominal/Ex/Lambda.thy --- a/Nominal/Ex/Lambda.thy Mon Jun 27 22:51:42 2011 +0100 +++ b/Nominal/Ex/Lambda.thy Tue Jun 28 00:30:30 2011 +0100 @@ -2,93 +2,116 @@ imports "../Nominal2" begin +lemma Abs_lst_fcb2: + fixes as bs :: "atom list" + and x y :: "'b :: fs" + and c::"'c::fs" + assumes eq: "[as]lst. x = [bs]lst. y" + and fcb1: "(set as) \* f as x c" + and fresh1: "set as \* c" + and fresh2: "set bs \* c" + and perm1: "\p. supp p \* c \ p \ (f as x c) = f (p \ as) (p \ x) c" + and perm2: "\p. supp p \* c \ p \ (f bs y c) = f (p \ bs) (p \ y) c" + shows "f as x c = f bs y c" +proof - + have "supp (as, x, c) supports (f as x c)" + unfolding supports_def fresh_def[symmetric] + by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh) + then have fin1: "finite (supp (f as x c))" + by (auto intro: supports_finite simp add: finite_supp) + have "supp (bs, y, c) supports (f bs y c)" + unfolding supports_def fresh_def[symmetric] + by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh) + then have fin2: "finite (supp (f bs y c))" + by (auto intro: supports_finite simp add: finite_supp) + obtain q::"perm" where + fr1: "(q \ (set as)) \* (x, c, f as x c, f bs y c)" and + fr2: "supp q \* Abs_lst as x" and + inc: "supp q \ (set as) \ q \ (set as)" + using at_set_avoiding3[where xs="set as" and c="(x, c, f as x c, f bs y c)" and x="[as]lst. x"] + fin1 fin2 + by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv) + have "Abs_lst (q \ as) (q \ x) = q \ Abs_lst as x" by simp + also have "\ = Abs_lst as x" + by (simp only: fr2 perm_supp_eq) + finally have "Abs_lst (q \ as) (q \ x) = Abs_lst bs y" using eq by simp + then obtain r::perm where + qq1: "q \ x = r \ y" and + qq2: "q \ as = r \ bs" and + qq3: "supp r \ (q \ (set as)) \ set bs" + apply(drule_tac sym) + apply(simp only: Abs_eq_iff2 alphas) + apply(erule exE) + apply(erule conjE)+ + apply(drule_tac x="p" in meta_spec) + apply(simp add: set_eqvt) + apply(blast) + done + have "(set as) \* f as x c" by (rule fcb1) + then have "q \ ((set as) \* f as x c)" + by (simp add: permute_bool_def) + then have "set (q \ as) \* f (q \ as) (q \ x) c" + apply(simp add: fresh_star_eqvt set_eqvt) + apply(subst (asm) perm1) + using inc fresh1 fr1 + apply(auto simp add: fresh_star_def fresh_Pair) + done + then have "set (r \ bs) \* f (r \ bs) (r \ y) c" using qq1 qq2 by simp + then have "r \ ((set bs) \* f bs y c)" + apply(simp add: fresh_star_eqvt set_eqvt) + apply(subst (asm) perm2[symmetric]) + using qq3 fresh2 fr1 + apply(auto simp add: set_eqvt fresh_star_def fresh_Pair) + done + then have fcb2: "(set bs) \* f bs y c" by (simp add: permute_bool_def) + have "f as x c = q \ (f as x c)" + apply(rule perm_supp_eq[symmetric]) + using inc fcb1 fr1 by (auto simp add: fresh_star_def) + also have "\ = f (q \ as) (q \ x) c" + apply(rule perm1) + using inc fresh1 fr1 by (auto simp add: fresh_star_def) + also have "\ = f (r \ bs) (r \ y) c" using qq1 qq2 by simp + also have "\ = r \ (f bs y c)" + apply(rule perm2[symmetric]) + using qq3 fresh2 fr1 by (auto simp add: fresh_star_def) + also have "... = f bs y c" + apply(rule perm_supp_eq) + using qq3 fr1 fcb2 by (auto simp add: fresh_star_def) + finally show ?thesis by simp +qed lemma Abs_lst1_fcb2: - fixes a b :: "'a :: at" - and S T :: "'b :: fs" - and c::"'c::fs" - assumes e: "(Abs_lst [atom a] T) = (Abs_lst [atom b] S)" - and fcb1: "atom a \ f a T c" - and fcb2: "atom b \ f b S c" + fixes a b :: "atom" + and x y :: "'b :: fs" + and c::"'c :: fs" + assumes e: "(Abs_lst [a] x) = (Abs_lst [b] y)" + and fcb1: "a \ f a x c" + and fresh: "{a, b} \* c" + and perm1: "\p. supp p \* c \ p \ (f a x c) = f (p \ a) (p \ x) c" + and perm2: "\p. supp p \* c \ p \ (f b y c) = f (p \ b) (p \ y) c" + shows "f a x c = f b y c" +using e +apply(drule_tac Abs_lst_fcb2[where c="c" and f="\(as::atom list) . f (hd as)"]) +apply(simp_all) +using fcb1 fresh perm1 perm2 +apply(simp_all add: fresh_star_def) +done + +lemma Abs_lst1_fcb2': + fixes a b :: "'a::at" + and x y :: "'b :: fs" + and c::"'c :: fs" + assumes e: "(Abs_lst [atom a] x) = (Abs_lst [atom b] y)" + and fcb1: "atom a \ f a x c" and fresh: "{atom a, atom b} \* c" - and perm1: "\p. supp p \* c \ p \ (f a T c) = f (p \ a) (p \ T) c" - and perm2: "\p. supp p \* c \ p \ (f b S c) = f (p \ b) (p \ S) c" - shows "f a T c = f b S c" -proof - - have fin1: "finite (supp (f a T c))" - apply(rule_tac S="supp (a, T, c)" in supports_finite) - apply(simp add: supports_def) - apply(simp add: fresh_def[symmetric]) - apply(clarify) - apply(subst perm1) - apply(simp add: supp_swap fresh_star_def) - apply(simp add: swap_fresh_fresh fresh_Pair) - apply(simp add: finite_supp) - done - have fin2: "finite (supp (f b S c))" - apply(rule_tac S="supp (b, S, c)" in supports_finite) - apply(simp add: supports_def) - apply(simp add: fresh_def[symmetric]) - apply(clarify) - apply(subst perm2) - apply(simp add: supp_swap fresh_star_def) - apply(simp add: swap_fresh_fresh fresh_Pair) - apply(simp add: finite_supp) - done - obtain d::"'a::at" where fr: "atom d \ (a, b, S, T, c, f a T c, f b S c)" - using obtain_fresh'[where x="(a, b, S, T, c, f a T c, f b S c)"] - apply(auto simp add: finite_supp supp_Pair fin1 fin2) - done - have "(a \ d) \ (Abs_lst [atom a] T) = (b \ d) \ (Abs_lst [atom b] S)" - apply(simp (no_asm_use) only: flip_def) - apply(subst swap_fresh_fresh) - apply(simp add: Abs_fresh_iff) - using fr - apply(simp add: Abs_fresh_iff) - apply(subst swap_fresh_fresh) - apply(simp add: Abs_fresh_iff) - using fr - apply(simp add: Abs_fresh_iff) - apply(rule e) - done - then have "Abs_lst [atom d] ((a \ d) \ T) = Abs_lst [atom d] ((b \ d) \ S)" - apply (simp add: swap_atom flip_def) - done - then have eq: "(a \ d) \ T = (b \ d) \ S" - by (simp add: Abs1_eq_iff) - have "f a T c = (a \ d) \ f a T c" - unfolding flip_def - apply(rule sym) - apply(rule swap_fresh_fresh) - using fcb1 - apply(simp) - using fr - apply(simp add: fresh_Pair) - done - also have "... = f d ((a \ d) \ T) c" - unfolding flip_def - apply(subst perm1) - using fresh fr - apply(simp add: supp_swap fresh_star_def fresh_Pair) - apply(simp) - done - also have "... = f d ((b \ d) \ S) c" using eq by simp - also have "... = (b \ d) \ f b S c" - unfolding flip_def - apply(subst perm2) - using fresh fr - apply(simp add: supp_swap fresh_star_def fresh_Pair) - apply(simp) - done - also have "... = f b S c" - apply(rule flip_fresh_fresh) - using fcb2 - apply(simp) - using fr - apply(simp add: fresh_Pair) - done - finally show ?thesis by simp -qed + and perm1: "\p. supp p \* c \ p \ (f a x c) = f (p \ a) (p \ x) c" + and perm2: "\p. supp p \* c \ p \ (f b y c) = f (p \ b) (p \ y) c" + shows "f a x c = f b y c" +using e +apply(drule_tac Abs_lst1_fcb2[where c="c" and f="\a . f ((inv atom) a)"]) +using fcb1 fresh perm1 perm2 +apply(simp_all add: fresh_star_def inv_f_f inj_on_def atom_eqvt) +done atom_decl name @@ -133,7 +156,6 @@ apply(auto) apply (erule_tac c="()" in Abs_lst1_fcb2) apply(simp add: supp_removeAll fresh_def) -apply(simp add: supp_removeAll fresh_def) apply(simp add: fresh_star_def fresh_Unit) apply(simp add: eqvt_at_def removeAll_eqvt atom_eqvt) apply(simp add: eqvt_at_def removeAll_eqvt atom_eqvt) @@ -163,7 +185,6 @@ apply(simp) apply(erule_tac c="()" in Abs_lst1_fcb2) apply(simp add: fresh_minus_atom_set) - apply(simp add: fresh_minus_atom_set) apply(simp add: fresh_star_def fresh_Unit) apply(simp add: Diff_eqvt eqvt_at_def, perm_simp, rule refl) apply(simp add: Diff_eqvt eqvt_at_def, perm_simp, rule refl) @@ -461,8 +482,7 @@ apply (auto simp add: fresh_star_def)[3] apply(simp_all) apply(erule conjE)+ - apply (erule Abs_lst1_fcb2) - apply (simp add: fresh_star_def) + apply (erule_tac Abs_lst1_fcb2') apply (simp add: fresh_star_def) apply (simp add: fresh_star_def) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) @@ -487,8 +507,7 @@ apply(rule_tac y="a" and c="b" in lam.strong_exhaust) apply(auto simp add: fresh_star_def)[3] apply(erule conjE) - apply(erule Abs_lst1_fcb2) - apply(simp add: pure_fresh fresh_star_def) + apply(erule Abs_lst1_fcb2') apply(simp add: pure_fresh fresh_star_def) apply(simp add: pure_fresh fresh_star_def) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) @@ -557,8 +576,7 @@ apply (auto simp add: fresh_star_def fresh_at_list)[3] apply(simp_all) apply(erule conjE) - apply (erule_tac c="xsa" in Abs_lst1_fcb2) - apply (simp add: pure_fresh) + apply (erule_tac c="xsa" in Abs_lst1_fcb2') apply (simp add: pure_fresh) apply(simp add: fresh_star_def fresh_at_list) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq db_in_eqvt) @@ -661,19 +679,15 @@ apply(simp_all) apply(erule_tac c="()" in Abs_lst1_fcb2) apply (simp add: Abs_fresh_iff) - apply (simp add: Abs_fresh_iff) apply(simp add: fresh_star_def fresh_Unit) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) apply(erule conjE) - apply(erule_tac c="t2a" in Abs_lst1_fcb2) + apply(erule_tac c="t2a" in Abs_lst1_fcb2') apply (erule fresh_eqvt_at) apply (simp add: finite_supp) apply (simp add: fresh_Inl var_fresh_subst) - apply (erule fresh_eqvt_at) - apply (simp add: finite_supp) - apply (simp add: fresh_Inl var_fresh_subst) - apply(simp add: fresh_star_def fresh_Unit) + apply(simp add: fresh_star_def) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq subst_eqvt) apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq subst_eqvt) done