diff -r e63838c26f28 -r 272ea46a1766 Quot/Nominal/Abs.thy --- a/Quot/Nominal/Abs.thy Mon Feb 01 16:23:47 2010 +0100 +++ b/Quot/Nominal/Abs.thy Mon Feb 01 16:46:07 2010 +0100 @@ -80,34 +80,34 @@ notation alpha_abs ("_ \abs _") -lemma test1: +lemma alpha_abs_swap: assumes a1: "a \ (supp x) - bs" and a2: "b \ (supp x) - bs" shows "(bs, x) \abs ((a \ b) \ bs, (a \ b) \ x)" -apply(simp) -apply(rule_tac x="(a \ b)" in exI) -apply(simp add: alpha_gen) -apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric]) -apply(simp add: swap_set_fresh[OF a1 a2]) -apply(subgoal_tac "supp (a \ b) \ {a, b}") -using a1 a2 -apply(simp add: fresh_star_def fresh_def) -apply(blast) -apply(simp add: supp_swap) -done + apply(simp) + apply(rule_tac x="(a \ b)" in exI) + apply(simp add: alpha_gen) + apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric]) + apply(simp add: swap_set_not_in[OF a1 a2]) + apply(subgoal_tac "supp (a \ b) \ {a, b}") + using a1 a2 + apply(simp add: fresh_star_def fresh_def) + apply(blast) + apply(simp add: supp_swap) + done fun - s_test + supp_abs_fun where - "s_test (bs, x) = (supp x) - bs" + "supp_abs_fun (bs, x) = (supp x) - bs" -lemma s_test_lemma: +lemma supp_abs_fun_lemma: assumes a: "x \abs y" - shows "s_test x = s_test y" -using a -apply(induct rule: alpha_abs.induct) -apply(simp add: alpha_gen) -done + shows "supp_abs_fun x = supp_abs_fun y" + using a + apply(induct rule: alpha_abs.induct) + apply(simp add: alpha_gen) + done quotient_type 'a abs = "(atom set \ 'a::pt)" / "alpha_abs" apply(rule equivpI) @@ -137,30 +137,30 @@ lemma [quot_respect]: shows "((op =) ===> (op =) ===> alpha_abs) Pair Pair" -apply(clarsimp) -apply(rule exI) -apply(rule alpha_gen_refl) -apply(simp) -done + apply(clarsimp) + apply(rule exI) + apply(rule alpha_gen_refl) + apply(simp) + done lemma [quot_respect]: shows "((op =) ===> alpha_abs ===> alpha_abs) permute permute" -apply(clarsimp) -apply(rule exI) -apply(rule alpha_gen_eqvt) -apply(assumption) -apply(simp_all add: supp_eqvt) -done + apply(clarsimp) + apply(rule exI) + apply(rule alpha_gen_eqvt) + apply(assumption) + apply(simp_all add: supp_eqvt) + done lemma [quot_respect]: - shows "(alpha_abs ===> (op =)) s_test s_test" -apply(simp add: s_test_lemma) -done + shows "(alpha_abs ===> (op =)) supp_abs_fun supp_abs_fun" + apply(simp add: supp_abs_fun_lemma) + done lemma abs_induct: "\\as (x::'a::pt). P (Abs as x)\ \ P t" -apply(lifting prod.induct[where 'a="atom set" and 'b="'a"]) -done + apply(lifting prod.induct[where 'a="atom set" and 'b="'a"]) + done instantiation abs :: (pt) pt begin @@ -173,8 +173,7 @@ lemma permute_ABS [simp]: fixes x::"'a::pt" (* ??? has to be 'a \ 'b does not work *) shows "(p \ (Abs as x)) = Abs (p \ as) (p \ x)" -apply(lifting permute_prod.simps(1)[where 'a="atom set" and 'b="'a"]) -done + by (lifting permute_prod.simps(1)[where 'a="atom set" and 'b="'a"]) instance apply(default) @@ -184,120 +183,91 @@ end -lemma test1_lifted: +quotient_definition + "supp_Abs_fun :: ('a::pt) abs \ atom \ bool" +as + "supp_abs_fun" + +lemma supp_Abs_fun_simp: + shows "supp_Abs_fun (Abs bs x) = (supp x) - bs" + by (lifting supp_abs_fun.simps(1)) + +lemma supp_Abs_fun_eqvt: + shows "(p \ supp_Abs_fun) = supp_Abs_fun" + apply(subst permute_fun_def) + apply(subst expand_fun_eq) + apply(rule allI) + apply(induct_tac x rule: abs_induct) + apply(simp add: supp_Abs_fun_simp supp_eqvt Diff_eqvt) + done + +lemma supp_Abs_fun_fresh: + shows "a \ Abs bs x \ a \ supp_Abs_fun (Abs bs x)" + apply(rule fresh_fun_eqvt_app) + apply(simp add: supp_Abs_fun_eqvt) + apply(simp) + done + +lemma Abs_swap: assumes a1: "a \ (supp x) - bs" and a2: "b \ (supp x) - bs" shows "(Abs bs x) = (Abs ((a \ b) \ bs) ((a \ b) \ x))" -using a1 a2 -apply(lifting test1) -done + using a1 a2 by (lifting alpha_abs_swap) lemma Abs_supports: shows "((supp x) - as) supports (Abs as x)" -unfolding supports_def -apply(clarify) -apply(simp (no_asm)) -apply(subst test1_lifted[symmetric]) -apply(simp_all) -done - -quotient_definition - "s_test_lifted :: ('a::pt) abs \ atom \ bool" -as - "s_test" - -lemma s_test_lifted_simp: - shows "s_test_lifted (Abs bs x) = (supp x) - bs" -apply(lifting s_test.simps(1)) -done - -lemma s_test_lifted_eqvt: - shows "(p \ (s_test_lifted ab)) = s_test_lifted (p \ ab)" -apply(induct ab rule: abs_induct) -apply(simp add: s_test_lifted_simp supp_eqvt Diff_eqvt) -done - -lemma fresh_f_empty_supp: - assumes a: "\p. p \ f = f" - shows "a \ x \ a \ (f x)" -apply(simp add: fresh_def) -apply(simp add: supp_def) -apply(simp add: permute_fun_app_eq) -apply(simp add: a) -apply(rule finite_subset) -prefer 2 -apply(assumption) -apply(auto) -done - + unfolding supports_def + apply(clarify) + apply(simp (no_asm)) + apply(subst Abs_swap[symmetric]) + apply(simp_all) + done -lemma s_test_fresh_lemma: - shows "(a \ Abs bs x) \ (a \ s_test_lifted (Abs bs x))" -apply(rule fresh_f_empty_supp) -apply(rule allI) -apply(subst permute_fun_def) -apply(simp add: s_test_lifted_eqvt) -apply(simp) -done - +lemma supp_Abs_subset1: + fixes x::"'a::fs" + shows "(supp x) - as \ supp (Abs as x)" + apply(simp add: supp_conv_fresh) + apply(auto) + apply(drule_tac supp_Abs_fun_fresh) + apply(simp only: supp_Abs_fun_simp) + apply(simp add: fresh_def) + apply(simp add: supp_finite_atom_set finite_supp) + done -lemma supp_finite_set: - fixes S::"atom set" - assumes "finite S" - shows "supp S = S" - apply(rule finite_supp_unique) - apply(simp add: supports_def) - apply(auto simp add: permute_set_eq swap_atom)[1] - apply(metis) - apply(rule assms) - apply(auto simp add: permute_set_eq swap_atom)[1] -done - -lemma s_test_subset: +lemma supp_Abs_subset2: fixes x::"'a::fs" - shows "((supp x) - as) \ (supp (Abs as x))" -apply(rule subsetI) -apply(rule contrapos_pp) -apply(assumption) -unfolding fresh_def[symmetric] -thm s_test_fresh_lemma -apply(drule_tac s_test_fresh_lemma) -apply(simp only: s_test_lifted_simp) -apply(simp add: fresh_def) -apply(subgoal_tac "finite (supp x - as)") -apply(simp add: supp_finite_set) -apply(simp add: finite_supp) -done + shows "supp (Abs as x) \ (supp x) - as" + apply(rule supp_is_subset) + apply(rule Abs_supports) + apply(simp add: finite_supp) + done lemma supp_Abs: fixes x::"'a::fs" shows "supp (Abs as x) = (supp x) - as" -apply(rule subset_antisym) -apply(rule supp_is_subset) -apply(rule Abs_supports) -apply(simp add: finite_supp) -apply(rule s_test_subset) -done + apply(rule_tac subset_antisym) + apply(rule supp_Abs_subset2) + apply(rule supp_Abs_subset1) + done instance abs :: (fs) fs -apply(default) -apply(induct_tac x rule: abs_induct) -apply(simp add: supp_Abs) -apply(simp add: finite_supp) -done + apply(default) + apply(induct_tac x rule: abs_induct) + apply(simp add: supp_Abs) + apply(simp add: finite_supp) + done -lemma fresh_abs: +lemma Abs_fresh_iff: fixes x::"'a::fs" shows "a \ Abs bs x = (a \ bs \ (a \ bs \ a \ x))" -apply(simp add: fresh_def) -apply(simp add: supp_Abs) -apply(auto) -done + apply(simp add: fresh_def) + apply(simp add: supp_Abs) + apply(auto) + done -lemma abs_eq: +lemma Abs_eq_iff: shows "(Abs bs x) = (Abs cs y) \ (\p. (bs, x) \gen (op =) supp p (cs, y))" -apply(lifting alpha_abs.simps(1)) -done + by (lifting alpha_abs.simps(1)) end