diff -r fee2389789ad -r a5ba76208983 Nominal/Abs.thy --- a/Nominal/Abs.thy Sat Mar 20 02:46:07 2010 +0100 +++ b/Nominal/Abs.thy Sat Mar 20 04:51:26 2010 +0100 @@ -72,111 +72,34 @@ by (auto simp add: fresh_minus_perm) lemma alpha_gen_trans: - assumes a: "(bs, x) \gen R f p1 (cs, y)" - and b: "(cs, y) \gen R f p2 (ds, z)" - and c: "\R (p1 \ x) y; R (p2 \ y) z\ \ R ((p2 + p1) \ x) z" - shows "(bs, x) \gen R f (p2 + p1) (ds, z)" - using a b c using supp_plus_perm - apply(simp add: alpha_gen fresh_star_def fresh_def) - apply(blast) - done + assumes a: "\R (p \ x) y; R (q \ y) z\ \ R ((q + p) \ x) z" + shows "\(bs, x) \gen R f p (cs, y); (cs, y) \gen R f q (ds, z)\ \ (bs, x) \gen R f (q + p) (ds, z)" + and "\(bs, x) \res R f p (cs, y); (cs, y) \res R f q (ds, z)\ \ (bs, x) \res R f (q + p) (ds, z)" + and "\(es, x) \lst R f p (gs, y); (gs, y) \lst R f q (hs, z)\ \ (es, x) \lst R f (q + p) (hs, z)" + using a + unfolding alphas + unfolding fresh_star_def + by (simp_all add: fresh_plus_perm) lemma alpha_gen_eqvt: - assumes a: "(bs, x) \gen R f q (cs, y)" - and b: "R (q \ x) y \ R (p \ (q \ x)) (p \ y)" - and c: "p \ (f x) = f (p \ x)" - and d: "p \ (f y) = f (p \ y)" - shows "(p \ bs, p \ x) \gen R f (p \ q) (p \ cs, p \ y)" - using a b - apply(simp add: alpha_gen c[symmetric] d[symmetric] Diff_eqvt[symmetric]) - apply(simp add: permute_eqvt[symmetric]) - apply(simp add: fresh_star_permute_iff) - apply(clarsimp) - done - -lemma alpha_gen_compose_sym: - fixes pi - assumes b: "(aa, t) \gen (\x1 x2. R x1 x2 \ R x2 x1) f pi (ab, s)" - and a: "\pi t s. (R t s \ R (pi \ t) (pi \ s))" - shows "(ab, s) \gen R f (- pi) (aa, t)" - using b apply - - apply(simp add: alpha_gen) - apply(erule conjE)+ - apply(rule conjI) - apply(simp add: fresh_star_def fresh_minus_perm) - apply(subgoal_tac "R (- pi \ s) ((- pi) \ (pi \ t))") - apply simp - apply(clarify) - apply(simp) - apply(rule a) - apply assumption - done - -lemma alpha_gen_compose_sym2: - assumes a: "(aa, t1, t2) \gen (\(x11, x12) (x21, x22). - (R1 x11 x21 \ R1 x21 x11) \ R2 x12 x22 \ R2 x22 x12) (\(b, a). fb b \ fa a) pi (ab, s1, s2)" - and r1: "\pi t s. R1 t s \ R1 (pi \ t) (pi \ s)" - and r2: "\pi t s. R2 t s \ R2 (pi \ t) (pi \ s)" - shows "(ab, s1, s2) \gen (\(a, b) (d, c). R1 a d \ R2 b c) (\(b, a). fb b \ fa a) (- pi) (aa, t1, t2)" + assumes a: "R (q \ x) y \ R (p \ (q \ x)) (p \ y)" + and b: "p \ (f x) = f (p \ x)" + and c: "p \ (f y) = f (p \ y)" + shows "(bs, x) \gen R f q (cs, y) \ (p \ bs, p \ x) \gen R f (p \ q) (p \ cs, p \ y)" + and "(bs, x) \res R f q (cs, y) \ (p \ bs, p \ x) \res R f (p \ q) (p \ cs, p \ y)" + and "(ds, x) \lst R f q (es, y) \ (p \ ds, p \ x) \lst R f (p \ q) (p \ es, p \ y)" + unfolding alphas + unfolding set_eqvt[symmetric] + unfolding b[symmetric] c[symmetric] + unfolding Diff_eqvt[symmetric] + unfolding permute_eqvt[symmetric] using a - apply(simp add: alpha_gen) - apply clarify - apply (rule conjI) - apply(simp add: fresh_star_def fresh_minus_perm) - apply (rule conjI) - apply (rotate_tac 3) - apply (drule_tac pi="- pi" in r1) - apply simp - apply (rule conjI) - apply (rotate_tac -1) - apply (drule_tac pi="- pi" in r2) - apply simp_all - done - -lemma alpha_gen_compose_trans: - fixes pi pia - assumes b: "(aa, t) \gen (\x1 x2. R x1 x2 \ (\x. R x2 x \ R x1 x)) f pi (ab, ta)" - and c: "(ab, ta) \gen R f pia (ac, sa)" - and a: "\pi t s. (R t s \ R (pi \ t) (pi \ s))" - shows "(aa, t) \gen R f (pia + pi) (ac, sa)" - using b c apply - - apply(simp add: alpha_gen.simps) - apply(erule conjE)+ - apply(simp add: fresh_star_plus) - apply(drule_tac x="- pia \ sa" in spec) - apply(drule mp) - apply(rotate_tac 5) - apply(drule_tac pi="- pia" in a) - apply(simp) - apply(rotate_tac 7) - apply(drule_tac pi="pia" in a) - apply(simp) - done - -lemma alpha_gen_compose_eqvt: - fixes pia - assumes b: "(g d, t) \gen (\x1 x2. R x1 x2 \ R (pi \ x1) (pi \ x2)) f pia (g e, s)" - and c: "\y. pi \ (g y) = g (pi \ y)" - and a: "\x. pi \ (f x) = f (pi \ x)" - shows "(g (pi \ d), pi \ t) \gen R f (pi \ pia) (g (pi \ e), pi \ s)" - using b - apply - - apply(simp add: alpha_gen.simps) - apply(erule conjE)+ - apply(rule conjI) - apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) - apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric]) - apply(rule conjI) - apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) - apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric]) - apply(subst permute_eqvt[symmetric]) - apply(simp) - sorry + by (auto simp add: fresh_star_permute_iff) fun alpha_abs where - "alpha_abs (bs, x) (cs, y) = (\p. (bs, x) \gen (op=) supp p (cs, y))" + "alpha_abs (bs, x) (cs, y) \ (\p. (bs, x) \gen (op=) supp p (cs, y))" notation alpha_abs ("_ \abs _") @@ -185,17 +108,15 @@ 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_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 + unfolding Diff_iff + unfolding alpha_abs.simps + unfolding alphas + unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] + unfolding fresh_star_def fresh_def + unfolding swap_set_not_in[OF a1 a2] + by (rule_tac x="(a \ b)" in exI) + (auto simp add: supp_perm swap_atom) lemma alpha_gen_swap_fun: assumes f_eqvt: "\pi. (pi \ (f x)) = f (pi \ x)" @@ -213,12 +134,12 @@ apply(simp add: supp_swap) done - fun supp_abs_fun where "supp_abs_fun (bs, x) = (supp x) - bs" + lemma supp_abs_fun_lemma: assumes a: "x \abs y" shows "supp_abs_fun x = supp_abs_fun y" @@ -227,7 +148,8 @@ apply(simp add: alpha_gen) done -quotient_type 'a abs = "(atom set \ 'a::pt)" / "alpha_abs" + +quotient_type 'a abs_gen = "(atom set \ 'a::pt)" / "alpha_abs" apply(rule equivpI) unfolding reflp_def symp_def transp_def apply(simp_all) @@ -246,13 +168,11 @@ apply(clarify) apply(rule_tac x="pa + p" in exI) apply(rule alpha_gen_trans) - apply(assumption) - apply(assumption) - apply(simp) + apply(auto) done quotient_definition - "Abs::atom set \ ('a::pt) \ 'a abs" + "Abs::atom set \ ('a::pt) \ 'a abs_gen" is "Pair::atom set \ ('a::pt) \ (atom set \ 'a)" @@ -269,7 +189,6 @@ apply(clarsimp) apply(rule exI) apply(rule alpha_gen_eqvt) - apply(assumption) apply(simp_all add: supp_eqvt) done @@ -287,17 +206,19 @@ lemmas abs_induct2 = prod.induct[where 'a="atom set" and 'b="'a::pt", quot_lifted] thm abs_induct abs_induct2 -instantiation abs :: (pt) pt +instantiation abs_gen :: (pt) pt begin quotient_definition - "permute_abs::perm \ ('a::pt abs) \ 'a abs" + "permute_abs_gen::perm \ ('a::pt abs_gen) \ 'a abs_gen" is "permute:: perm \ (atom set \ 'a::pt) \ (atom set \ 'a::pt)" +(* ??? has to be 'a \ 'b does not work *) lemma permute_ABS [simp]: - fixes x::"'a::pt" (* ??? has to be 'a \ 'b does not work *) + fixes x::"'a::pt" shows "(p \ (Abs as x)) = Abs (p \ as) (p \ x)" + thm permute_prod.simps by (lifting permute_prod.simps(1)[where 'a="atom set" and 'b="'a"]) instance @@ -309,7 +230,7 @@ end quotient_definition - "supp_Abs_fun :: ('a::pt) abs \ atom \ bool" + "supp_Abs_fun :: ('a::pt) abs_gen \ atom \ bool" is "supp_abs_fun" @@ -379,7 +300,7 @@ apply(simp add: finite_supp) done -instance abs :: (fs) fs +instance abs_gen :: (fs) fs apply(default) apply(induct_tac x rule: abs_induct) apply(simp add: supp_Abs) @@ -765,12 +686,6 @@ apply(simp) done -fun - distinct_perms -where - "distinct_perms [] = True" -| "distinct_perms (p # ps) = (supp p \ supp ps = {} \ distinct_perms ps)" - (* support of concrete atom sets *) lemma supp_atom_image: @@ -807,5 +722,84 @@ by (simp add: alpha_gen) +lemma alpha_gen_compose_sym: + fixes pi + assumes b: "(aa, t) \gen (\x1 x2. R x1 x2 \ R x2 x1) f pi (ab, s)" + and a: "\pi t s. (R t s \ R (pi \ t) (pi \ s))" + shows "(ab, s) \gen R f (- pi) (aa, t)" + using b apply - + apply(simp add: alpha_gen) + apply(erule conjE)+ + apply(rule conjI) + apply(simp add: fresh_star_def fresh_minus_perm) + apply(subgoal_tac "R (- pi \ s) ((- pi) \ (pi \ t))") + apply simp + apply(clarify) + apply(simp) + apply(rule a) + apply assumption + done + +lemma alpha_gen_compose_sym2: + assumes a: "(aa, t1, t2) \gen (\(x11, x12) (x21, x22). + (R1 x11 x21 \ R1 x21 x11) \ R2 x12 x22 \ R2 x22 x12) (\(b, a). fb b \ fa a) pi (ab, s1, s2)" + and r1: "\pi t s. R1 t s \ R1 (pi \ t) (pi \ s)" + and r2: "\pi t s. R2 t s \ R2 (pi \ t) (pi \ s)" + shows "(ab, s1, s2) \gen (\(a, b) (d, c). R1 a d \ R2 b c) (\(b, a). fb b \ fa a) (- pi) (aa, t1, t2)" + using a + apply(simp add: alpha_gen) + apply clarify + apply (rule conjI) + apply(simp add: fresh_star_def fresh_minus_perm) + apply (rule conjI) + apply (rotate_tac 3) + apply (drule_tac pi="- pi" in r1) + apply simp + apply (rule conjI) + apply (rotate_tac -1) + apply (drule_tac pi="- pi" in r2) + apply simp_all + done + +lemma alpha_gen_compose_trans: + fixes pi pia + assumes b: "(aa, t) \gen (\x1 x2. R x1 x2 \ (\x. R x2 x \ R x1 x)) f pi (ab, ta)" + and c: "(ab, ta) \gen R f pia (ac, sa)" + and a: "\pi t s. (R t s \ R (pi \ t) (pi \ s))" + shows "(aa, t) \gen R f (pia + pi) (ac, sa)" + using b c apply - + apply(simp add: alpha_gen.simps) + apply(erule conjE)+ + apply(simp add: fresh_star_plus) + apply(drule_tac x="- pia \ sa" in spec) + apply(drule mp) + apply(rotate_tac 5) + apply(drule_tac pi="- pia" in a) + apply(simp) + apply(rotate_tac 7) + apply(drule_tac pi="pia" in a) + apply(simp) + done + +lemma alpha_gen_compose_eqvt: + fixes pia + assumes b: "(g d, t) \gen (\x1 x2. R x1 x2 \ R (pi \ x1) (pi \ x2)) f pia (g e, s)" + and c: "\y. pi \ (g y) = g (pi \ y)" + and a: "\x. pi \ (f x) = f (pi \ x)" + shows "(g (pi \ d), pi \ t) \gen R f (pi \ pia) (g (pi \ e), pi \ s)" + using b + apply - + apply(simp add: alpha_gen.simps) + apply(erule conjE)+ + apply(rule conjI) + apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) + apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric]) + apply(rule conjI) + apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) + apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric]) + apply(subst permute_eqvt[symmetric]) + apply(simp) + sorry + end