diff -r b4f956137114 -r 2ebfbd861846 Quot/Nominal/LamEx.thy --- a/Quot/Nominal/LamEx.thy Mon Feb 01 13:00:01 2010 +0100 +++ b/Quot/Nominal/LamEx.thy Mon Feb 01 15:45:40 2010 +0100 @@ -1,5 +1,5 @@ theory LamEx -imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs" +imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs" "../QuotProd" begin @@ -26,13 +26,6 @@ apply(simp) done -lemma fresh_minus_perm: - fixes p::perm - shows "a \ (- p) \ a \ p" - apply(simp add: fresh_def) - apply(simp only: supp_minus_perm) - done - lemma fresh_plus: fixes p q::perm shows "\a \ p; a \ q\ \ a \ (p + q)" @@ -153,12 +146,13 @@ where a1: "a = b \ (rVar a) \ (rVar b)" | a2: "\t1 \ t2; s1 \ s2\ \ rApp t1 s1 \ rApp t2 s2" -| a3: "\pi. (rfv t - {atom a} = rfv s - {atom b} \ (rfv t - {atom a})\* pi \ (pi \ t) \ s) - \ rLam a t \ rLam b s" +| a3: "\pi. (({atom a}, t) \gen alpha rfv pi ({atom b}, s)) \ rLam a t \ rLam b s" + +thm alpha.induct lemma a3_inverse: assumes "rLam a t \ rLam b s" - shows "\pi. (rfv t - {atom a} = rfv s - {atom b} \ (rfv t - {atom a})\* pi \ (pi \ t) \ s)" + shows "\pi. (({atom a}, t) \gen alpha rfv pi ({atom b}, s))" using assms apply(erule_tac alpha.cases) apply(auto) @@ -172,11 +166,11 @@ apply(simp add: a2) apply(simp) apply(rule a3) -apply(erule conjE) apply(erule exE) -apply(erule conjE) apply(rule_tac x="pi \ pia" in exI) -apply(rule conjI) +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: eqvts atom_eqvt) apply(rule conjI) @@ -193,24 +187,43 @@ apply(simp add: a2) apply(rule a3) apply(rule_tac x="0" in exI) -apply(simp_all add: fresh_star_def fresh_zero_perm) +apply(rule alpha_gen_refl) +apply(assumption) done +lemma fresh_minus_perm: + fixes p::perm + shows "a \ (- p) \ a \ p" + apply(simp add: fresh_def) + apply(simp only: supp_minus_perm) + done + +lemma alpha_gen_atom_sym: + assumes a: "\pi t s. (R t s \ R (pi \ t) (pi \ s))" + shows "\pi. ({atom a}, t) \gen \x1 x2. R x1 x2 \ R x2 x1 f pi ({atom b}, s) \ + \pi. ({atom b}, s) \gen R f pi ({atom a}, t)" + apply(erule exE) + apply(rule_tac x="- pi" in exI) + apply(simp add: alpha_gen.simps) + 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(rule a) + apply assumption + done + lemma alpha_sym: shows "t \ s \ s \ t" -apply(induct rule: alpha.induct) -apply(simp add: a1) -apply(simp add: a2) -apply(rule a3) -apply(erule exE) -apply(rule_tac x="- pi" in exI) -apply(simp) -apply(simp add: fresh_star_def fresh_minus_perm) -apply(erule conjE)+ -apply(rotate_tac 3) -apply(drule_tac pi="- pi" in alpha_eqvt) -apply(simp) -done + apply(induct rule: alpha.induct) + apply(simp add: a1) + apply(simp add: a2) + apply(rule a3) + apply(rule alpha_gen_atom_sym) + apply(rule alpha_eqvt) + apply(assumption)+ + done lemma alpha_trans: shows "t1 \ t2 \ t2 \ t3 \ t1 \ t3" @@ -225,11 +238,13 @@ apply(rotate_tac 1) apply(erule alpha.cases) apply(simp_all) +apply(simp add: alpha_gen.simps) apply(erule conjE)+ apply(erule exE)+ apply(erule conjE)+ apply(rule a3) apply(rule_tac x="pia + pi" in exI) +apply(simp add: alpha_gen.simps) apply(simp add: fresh_star_plus) apply(drule_tac x="- pia \ sa" in spec) apply(drule mp) @@ -251,89 +266,9 @@ lemma alpha_rfv: shows "t \ s \ rfv t = rfv s" apply(induct rule: alpha.induct) - apply(simp_all) + apply(simp_all add: alpha_gen.simps) done -inductive - alpha2 :: "rlam \ rlam \ bool" ("_ \2 _" [100, 100] 100) -where - a21: "a = b \ (rVar a) \2 (rVar b)" -| a22: "\t1 \2 t2; s1 \2 s2\ \ rApp t1 s1 \2 rApp t2 s2" -| a23: "(a = b \ t \2 s) \ (a \ b \ ((a \ b) \ t) \2 s \ atom b \ rfv t)\ rLam a t \2 rLam b s" - -lemma fv_vars: - fixes a::name - assumes a1: "\x \ rfv t - {atom a}. pi \ x = x" - shows "(pi \ t) \2 ((a \ (pi \ a)) \ t)" -using a1 -apply(induct t) -apply(auto) -apply(rule a21) -apply(case_tac "name = a") -apply(simp) -apply(simp) -defer -apply(rule a22) -apply(simp) -apply(simp) -apply(rule a23) -apply(case_tac "a = name") -apply(simp) -oops - - -lemma - assumes a1: "t \2 s" - shows "t \ s" -using a1 -apply(induct) -apply(rule alpha.intros) -apply(simp) -apply(rule alpha.intros) -apply(simp) -apply(simp) -apply(rule alpha.intros) -apply(erule disjE) -apply(rule_tac x="0" in exI) -apply(simp add: fresh_star_def fresh_zero_perm) -apply(erule conjE)+ -apply(drule alpha_rfv) -apply(simp) -apply(rule_tac x="(a \ b)" in exI) -apply(simp) -apply(erule conjE)+ -apply(rule conjI) -apply(drule alpha_rfv) -apply(drule sym) -apply(simp) -apply(simp add: rfv_eqvt[symmetric]) -defer -apply(subgoal_tac "atom a \ (rfv t - {atom a})") -apply(subgoal_tac "atom b \ (rfv t - {atom a})") - -defer -sorry - -lemma - assumes a1: "t \ s" - shows "t \2 s" -using a1 -apply(induct) -apply(rule alpha2.intros) -apply(simp) -apply(rule alpha2.intros) -apply(simp) -apply(simp) -apply(clarify) -apply(rule alpha2.intros) -apply(frule alpha_rfv) -apply(rotate_tac 4) -apply(drule sym) -apply(simp) -apply(drule sym) -apply(simp) -oops - quotient_type lam = rlam / alpha by (rule alpha_equivp) @@ -378,7 +313,7 @@ apply(rule a3) apply(rule_tac x="0" in exI) unfolding fresh_star_def - apply(simp add: fresh_star_def fresh_zero_perm) + apply(simp add: fresh_star_def fresh_zero_perm alpha_gen.simps) apply(simp add: alpha_rfv) done @@ -441,10 +376,60 @@ "\x = xa; xb = xc\ \ App x xb = App xa xc" by (lifting a2) -lemma a3: - "\\pi. (fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a})\* pi \ (pi \ t) = s)\ - \ Lam a t = Lam b s" - apply (lifting a3) +lemma alpha_gen_rsp_pre: + assumes a5: "\t s. R t s \ R (pi \ t) (pi \ s)" + and a1: "R s1 t1" + and a2: "R s2 t2" + and a3: "\a b c d. R a b \ R c d \ R1 a c = R2 b d" + and a4: "\x y. R x y \ fv1 x = fv2 y" + shows "(a, s1) \gen R1 fv1 pi (b, s2) = (a, t1) \gen R2 fv2 pi (b, t2)" +apply (simp add: alpha_gen.simps) +apply (simp only: a4[symmetric, OF a1] a4[symmetric, OF a2]) +apply auto +apply (subst a3[symmetric]) +apply (rule a5) +apply (rule a1) +apply (rule a2) +apply (assumption) +apply (subst a3) +apply (rule a5) +apply (rule a1) +apply (rule a2) +apply (assumption) +done + +lemma [quot_respect]: "(prod_rel op = alpha ===> + (alpha ===> alpha ===> op =) ===> (alpha ===> op =) ===> op = ===> prod_rel op = alpha ===> op =) + alpha_gen alpha_gen" +apply simp +apply clarify +apply (rule alpha_gen_rsp_pre[of "alpha",OF alpha_eqvt]) +apply auto +done + +lemma pi_rep: "pi \ (rep_lam x) = rep_lam (pi \ x)" +apply (unfold rep_lam_def) +sorry + +lemma [quot_preserve]: "(prod_fun id rep_lam ---> + (abs_lam ---> abs_lam ---> id) ---> (abs_lam ---> id) ---> id ---> (prod_fun id rep_lam) ---> id) + alpha_gen = alpha_gen" +apply (simp add: expand_fun_eq) +apply (simp add: alpha_gen.simps) +apply (simp add: pi_rep) +apply (simp only: Quotient_abs_rep[OF Quotient_lam]) +apply auto +done + +lemma alpha_prs [quot_preserve]: "(rep_lam ---> rep_lam ---> id) alpha = (op =)" +apply (simp add: expand_fun_eq) +sledgehammer +sorry + + +lemma a3: + "\pi. ({atom a}, t) \gen (op =) fv pi ({atom b}, s) \ Lam a t = Lam b s" + apply (lifting a3) done lemma a3_inv: