diff -r f7c4b8e6918b -r 1b0d230445ce Nominal/Nominal2_FCB.thy --- a/Nominal/Nominal2_FCB.thy Tue Jan 03 11:43:27 2012 +0000 +++ b/Nominal/Nominal2_FCB.thy Wed Jan 04 17:42:16 2012 +0000 @@ -212,67 +212,107 @@ qed -text {* NOT DONE lemma Abs_res_fcb2: fixes as bs :: "atom set" and x y :: "'b :: fs" and c::"'c::fs" assumes eq: "[as]res. x = [bs]res. y" and fin: "finite as" "finite bs" - and fcb1: "as \* f as x c" + and fcb1: "(as \ supp x) \* f (as \ supp x) x c" and fresh1: "as \* c" and fresh2: "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" + and perm1: "\p. supp p \* c \ p \ (f (as \ supp x) x c) = f (p \ (as \ supp x)) (p \ x) c" + and perm2: "\p. supp p \* c \ p \ (f (bs \ supp y) y c) = f (p \ (bs \ supp y)) (p \ y) c" + shows "f (as \ supp x) x c = f (bs \ supp y) y c" proof - - have "supp (as, x, c) supports (f as x c)" + have "supp (as, x, c) supports (f (as \ supp x) 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 (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh inter_eqvt supp_eqvt) + then have fin1: "finite (supp (f (as \ supp x) x c))" using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair) - have "supp (bs, y, c) supports (f bs y c)" + have "supp (bs, y, c) supports (f (bs \ supp y) 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 (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh inter_eqvt supp_eqvt) + then have fin2: "finite (supp (f (bs \ supp y) y c))" using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair) obtain q::"perm" where - fr1: "(q \ as) \* (x, c, f as x c, f bs y c)" and - fr2: "supp q \* ([as]res. x)" and - inc: "supp q \ as \ (q \ as)" - using at_set_avoiding3[where xs="as" and c="(x, c, f as x c, f bs y c)" and x="[as]res. x"] + fr1: "(q \ (as \ supp x)) \* (x, c, f (as \ supp x) x c, f (bs \ supp y) y c)" and + fr2: "supp q \* ([as \ supp x]set. x)" and + inc: "supp q \ (as \ supp x) \ (q \ (as \ supp x))" + using at_set_avoiding3[where xs="as \ supp x" and c="(x, c, f (as \ supp x) x c, f (bs \ supp y) y c)" + and x="[as \ supp x]set. x"] fin1 fin2 fin - by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv) - have "[q \ as]res. (q \ x) = q \ ([as]res. x)" by simp - also have "\ = [as]res. x" + apply (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv) + done + have "[q \ (as \ supp x)]set. (q \ x) = q \ ([as \ supp x]set. x)" by simp + also have "\ = [as \ supp x]set. x" by (simp only: fr2 perm_supp_eq) - finally have "[q \ as]res. (q \ x) = [bs]res. y" using eq by simp + finally have "[q \ (as \ supp x)]set. (q \ x) = [bs \ supp y]set. y" using eq + by(simp add: Abs_eq_res_set) then obtain r::perm where qq1: "q \ x = r \ y" and qq2: "(q \ as \ supp (q \ x)) = r \ (bs \ supp y)" and - qq3: "supp r \ bs \ supp y \ q \ as \ supp (q \ x)" + qq3: "supp r \ (bs \ supp y) \ q \ (as \ supp x)" apply(drule_tac sym) - apply(subst(asm) Abs_eq_res_set) 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(simp add: set_eqvt inter_eqvt supp_eqvt) done - have "(as \ supp x) \* f (as \ supp x) x c" sorry (* FCB? *) + have "(as \ supp x) \* f (as \ supp x) x c" by (rule fcb1) then have "q \ ((as \ supp x) \* f (as \ supp x) x c)" by (simp add: permute_bool_def) then have "(q \ (as \ supp x)) \* f (q \ (as \ supp x)) (q \ x) c" apply(simp add: fresh_star_eqvt set_eqvt) - sorry (* perm? *) - then have "r \ (bs \ supp y) \* f (r \ (bs \ supp y)) (r \ y) c" using qq2 - apply (simp add: inter_eqvt) - sorry - (* rest similar reversing it other way around... *) - show ?thesis sorry + apply(subst (asm) perm1) + using inc fresh1 fr1 + apply(auto simp add: fresh_star_def fresh_Pair) + done + then have "(r \ (bs \ supp y)) \* f (r \ (bs \ supp y)) (r \ y) c" using qq1 qq2 + apply(perm_simp) + apply simp + done + then have "r \ ((bs \ supp y) \* f (bs \ supp y) 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: "(bs \ supp y) \* f (bs \ supp y) y c" by (simp add: permute_bool_def) + have "f (as \ supp x) x c = q \ (f (as \ supp x) x c)" + apply(rule perm_supp_eq[symmetric]) + using inc fcb1 fr1 + apply (auto simp add: fresh_star_def) + done + also have "\ = f (q \ (as \ supp x)) (q \ x) c" + apply(rule perm1) + using inc fresh1 fr1 by (auto simp add: fresh_star_def) + also have "\ = f (r \ (bs \ supp y)) (r \ y) c" using qq1 qq2 + apply(perm_simp) + apply simp + done + also have "\ = r \ (f (bs \ supp y) y c)" + apply(rule perm2[symmetric]) + using qq3 fresh2 fr1 by (auto simp add: fresh_star_def) + also have "... = f (bs \ supp y) y c" + apply(rule perm_supp_eq) + using qq3 fr1 fcb2 by (auto simp add: fresh_star_def) + finally show ?thesis by simp qed -*} +typedef ('a::fs, 'b::fs) ffun = "{f::'a => 'b. finite (supp f)}" +apply(subgoal_tac "\x::'b::fs. x \ (UNIV::('b::fs) set)") +apply(erule exE) +apply(rule_tac x="\_. x" in exI) +apply(auto) +apply(rule_tac S="supp x" in supports_finite) +apply(simp add: supports_def) +apply(perm_simp) +apply(simp add: fresh_def[symmetric]) +apply(simp add: swap_fresh_fresh) +apply(simp add: finite_supp) +done lemma Abs_lst_fcb2: fixes as bs :: "atom list"