diff -r a987b5acadc8 -r af02b193a19a Quot/Nominal/LamEx.thy --- a/Quot/Nominal/LamEx.thy Thu Jan 28 23:47:02 2010 +0100 +++ b/Quot/Nominal/LamEx.thy Fri Jan 29 00:22:00 2010 +0100 @@ -1,5 +1,5 @@ theory LamEx -imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" +imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs" begin @@ -153,9 +153,17 @@ 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 \ (pi \ a) = b) +| a3: "\pi. (rfv t - {atom a} = rfv s - {atom b} \ (rfv t - {atom a})\* pi \ (pi \ t) \ s) \ rLam a t \ rLam b s" +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)" +using assms +apply(erule_tac alpha.cases) +apply(auto) +done + text {* should be automatic with new version of eqvt-machinery *} lemma alpha_eqvt: shows "t \ s \ (pi \ t) \ (pi \ s)" @@ -174,9 +182,6 @@ apply(rule conjI) apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) apply(simp add: eqvts atom_eqvt) -apply(rule conjI) -apply(subst permute_eqvt[symmetric]) -apply(simp) apply(subst permute_eqvt[symmetric]) apply(simp) done @@ -201,13 +206,10 @@ apply(rule_tac x="- pi" in exI) apply(simp) apply(simp add: fresh_star_def fresh_minus_perm) -apply(rule conjI) apply(erule conjE)+ apply(rotate_tac 3) apply(drule_tac pi="- pi" in alpha_eqvt) apply(simp) -apply(clarify) -apply(simp) done lemma alpha_trans: @@ -231,10 +233,10 @@ apply(simp add: fresh_star_plus) apply(drule_tac x="- pia \ sa" in spec) apply(drule mp) -apply(rotate_tac 8) +apply(rotate_tac 7) apply(drule_tac pi="- pia" in alpha_eqvt) apply(simp) -apply(rotate_tac 11) +apply(rotate_tac 9) apply(drule_tac pi="pia" in alpha_eqvt) apply(simp) done @@ -330,12 +332,7 @@ apply(simp) apply(drule sym) apply(simp) -apply(case_tac "a = pi \ a") -apply(simp) -defer -apply(simp) -apply(simp add: fresh_star_def) -sorry +oops quotient_type lam = rlam / alpha by (rule alpha_equivp) @@ -440,16 +437,23 @@ by (lifting a2) lemma a3: - "\\pi. (fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a})\* pi \ (pi \ t) = s \ (pi \ a) = b)\ + "\\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) done +lemma a3_inv: + assumes "Lam a t = Lam b s" + shows "\pi. (fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a})\* pi \ (pi \ t) = s)" +using assms +apply(lifting a3_inverse) +done + lemma alpha_cases: "\a1 = a2; \a b. \a1 = Var a; a2 = Var b; a = b\ \ P; \x xa xb xc. \a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\ \ P; \t a s b. \a1 = Lam a t; a2 = Lam b s; - \pi. fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a}) \* pi \ (pi \ t) = s \ pi \ a = b\ + \pi. fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a}) \* pi \ (pi \ t) = s\ \ P\ \ P" by (lifting alpha.cases) @@ -460,7 +464,7 @@ \x xa xb xc. \x = xa; qxb x xa; xb = xc; qxb xb xc\ \ qxb (App x xb) (App xa xc); \t a s b. \\pi. fv t - {atom a} = fv s - {atom b} \ - (fv t - {atom a}) \* pi \ ((pi \ t) = s \ qxb (pi \ t) s) \ pi \ a = b\ + (fv t - {atom a}) \* pi \ ((pi \ t) = s \ qxb (pi \ t) s)\ \ qxb (Lam a t) (Lam b s)\ \ qxb qx qxa" by (lifting alpha.induct) @@ -486,6 +490,16 @@ apply(simp_all) done +lemma Lam_pseudo_inject: + shows "(Lam a t = Lam b s) = + (\pi. (fv t - {atom a} = fv s - {atom b} \ (fv t - {atom a})\* pi \ (pi \ t) = s))" +apply(rule iffI) +apply(rule a3_inv) +apply(assumption) +apply(rule a3) +apply(assumption) +done + lemma rlam_distinct: shows "\(rVar nam \ rApp rlam1' rlam2')" and "\(rApp rlam1' rlam2' \ rVar nam)" @@ -560,42 +574,18 @@ apply(simp add: lam_fsupp1) done -lemma lam_fresh1: - assumes f: "finite (supp t)" - and a1: "b \ t" - and a2: "atom a \ b" - shows "b \ Lam a t" - proof - - have "\c. c \ (b, a ,t, Lam a t)" sorry - then obtain c where fr1: "c \ b" - and fr2: "c \ atom a" - and fr3: "c \ t" - and fr4: "c \ Lam a t" - and fr5: "sort_of b = sort_of c" - apply(auto simp add: fresh_Pair fresh_atom) - sorry - have e: "(c \ b) \ (Lam a t) = Lam a ((c \ b) \ t)" using a2 fr1 fr2 - by simp - from fr4 have "((c \ b) \c) \ ((c \ b) \(Lam a t))" - by (simp only: fresh_permute_iff) - then have "b \ (Lam a ((c \ b) \ t))" using fr1 fr2 fr5 e - by simp - then show ?thesis using a1 fr3 - by (simp only: swap_fresh_fresh) -qed - -lemma lam_fresh2: - assumes f: "finite (supp t)" - shows "(atom a) \ Lam a t" +lemma lam_supp2: + shows "supp (Lam x t) = supp (Abs {atom x} t)" +apply(simp add: supp_def permute_set_eq atom_eqvt) +apply(simp add: Lam_pseudo_inject) +apply(simp add: abs_eq) sorry - lemma lam_supp: shows "supp (Lam x t) = ((supp t) - {atom x})" -apply(default) -apply(simp_all add: supp_conv_fresh) -apply(auto) -sorry +apply(simp add: lam_supp2) +apply(simp add: supp_Abs) +done lemma fresh_lam: "(atom a \ Lam b t) \ (a = b) \ (a \ b \ atom a \ t)"