diff -r d3946f1a9341 -r 01ae4a87c7c3 Quot/Nominal/Terms.thy --- a/Quot/Nominal/Terms.thy Tue Feb 09 11:22:34 2010 +0100 +++ b/Quot/Nominal/Terms.thy Tue Feb 09 12:22:00 2010 +0100 @@ -388,8 +388,10 @@ a1: "a = b \ (rVr2 a) \2 (rVr2 b)" | a2: "\t1 \2 t2; s1 \2 s2\ \ rAp2 t1 s1 \2 rAp2 t2 s2" | a3: "(\pi. (({atom a}, t) \gen alpha2 fv_rtrm2 pi ({atom b}, s))) \ rLm2 a t \2 rLm2 b s" -| a4: "(\pi. (((bv2 bt), t) \gen alpha2 fv_rtrm2 pi ((bv2 bs), s))) \ rLt2 bt t \2 rLt2 bs s" -| a5: "(\pi. (({atom a}, t) \gen alpha2 fv_rtrm2 pi ({atom b}, s))) \ rAs a t \2a rAs b s" +| a4: "\\pi. ((rbv2 bt, t) \gen alpha2 fv_rtrm2 pi ((rbv2 bs), s)); + \pi. ((rbv2 bt, bt) \gen alpha2a fv_rassign pi (rbv2 bs, bs))\ + \ rLt2 bt t \2 rLt2 bs s" +| a5: "\a = b; t \2 s\ \ rAs a t \2a rAs b s" (* This way rbv2 can be lifted *) lemma alpha2_equivp: "equivp alpha2" @@ -403,6 +405,7 @@ by (auto intro: alpha2_equivp) + section {*** lets with many assignments ***} datatype trm3 = @@ -474,25 +477,28 @@ inductive alpha3 :: "trm3 \ trm3 \ bool" ("_ \3 _" [100, 100] 100) +and + alpha3a :: "assigns \ assigns \ bool" ("_ \3a _" [100, 100] 100) where a1: "a = b \ (Vr3 a) \3 (Vr3 b)" | a2: "\t1 \3 t2; s1 \3 s2\ \ Ap3 t1 s1 \3 Ap3 t2 s2" -| a3: "\pi. (fv_trm3 t - {atom a} = fv_trm3 s - {atom b} \ - (fv_trm3 t - {atom a})\* pi \ - (pi \ t) \3 s \ - (pi \ a) = b) - \ Lm3 a t \3 Lm3 b s" -| a4: "\pi. ( - fv_trm3 t1 - fv_assigns b1 = fv_trm3 t2 - fv_assigns b2 \ - (fv_trm3 t1 - fv_assigns b1) \* pi \ - pi \ t1 = t2 (* \ (pi \ b1 = b2) *) - ) \ Lt3 b1 t1 \3 Lt3 b2 t2" +| a3: "(\pi. (({atom a}, t) \gen alpha3 fv_rtrm3 pi ({atom b}, s))) \ Lm3 a t \3 Lm3 b s" +| a4: "\\pi. ((bv3 bt, t) \gen alpha3 fv_trm3 pi ((bv3 bs), s)); + \pi. ((bv3 bt, bt) \gen alpha3a fv_assign pi (bv3 bs, bs))\ + \ Lt3 bt t \3 Lt3 bs s" +| a5: "ANil \3a ANil" +| a6: "\a = b; t \3 s; tt \3a st\ \ ACons a t tt \3a ACons b s st" -lemma alpha3_equivp: "equivp alpha3" +lemma alpha3_equivp: + "equivp alpha3" + "equivp alpha3a" sorry -quotient_type qtrm3 = trm3 / alpha3 - by (rule alpha3_equivp) +quotient_type + qtrm3 = trm3 / alpha3 +and + qassigns = assigns / alpha3a + by (auto intro: alpha3_equivp) section {*** lam with indirect list recursion ***} @@ -516,7 +522,7 @@ (* needs to be stated by the package *) (* there cannot be a clause for lists, as *) -(* permuteutations are already defined in Nominal (also functions, options, and so on) *) +(* permutations are already defined in Nominal (also functions, options, and so on) *) instantiation trm4 :: pt begin @@ -574,11 +580,7 @@ where a1: "a = b \ (Vr4 a) \4 (Vr4 b)" | a2: "\t1 \4 t2; s1 \4list s2\ \ Ap4 t1 s1 \4 Ap4 t2 s2" -| a4: "\pi. (fv_trm4 t - {atom a} = fv_trm4 s - {atom b} \ - (fv_trm4 t - {atom a})\* pi \ - (pi \ t) \4 s \ - (pi \ a) = b) - \ Lm4 a t \4 Lm4 b s" +| a3: "(\pi. (({atom a}, t) \gen alpha4 fv_rtrm4 pi ({atom b}, s))) \ Lm4 a t \4 Lm4 b s" | a5: "[] \4list []" | a6: "\t \4 s; ts \4list ss\ \ (t#ts) \4list (s#ss)" @@ -741,6 +743,47 @@ as "rbv5" +lemma rbv5_eqvt: + "pi \ (rbv5 x) = rbv5 (pi \ x)" +sorry + +lemma rfv_trm5_eqvt: + "pi \ (rfv_trm5 x) = rfv_trm5 (pi \ x)" +sorry + +lemma rfv_lts_eqvt: + "pi \ (rfv_lts x) = rfv_lts (pi \ x)" +sorry + +lemma alpha5_eqvt: + "xa \5 y \ (x \ xa) \5 (x \ y)" + "xb \l ya \ (x \ xb) \l (x \ ya)" + apply(induct rule: alpha5_alphalts.inducts) + apply (simp_all add: alpha5_inj) + apply (erule exE)+ + apply(unfold alpha_gen) + apply (erule conjE)+ + apply (rule conjI) + apply (rule_tac x="x \ pi" in exI) + apply (rule conjI) + apply(rule_tac ?p1="- x" in permute_eq_iff[THEN iffD1]) + apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt rfv_trm5_eqvt) + apply(rule conjI) + apply(rule_tac ?p1="- x" in fresh_star_permute_iff[THEN iffD1]) + apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt rfv_trm5_eqvt) + apply (subst permute_eqvt[symmetric]) + apply (simp) + apply (rule_tac x="x \ pia" in exI) + apply (rule conjI) + apply(rule_tac ?p1="- x" in permute_eq_iff[THEN iffD1]) + apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt rfv_lts_eqvt) + apply(rule conjI) + apply(rule_tac ?p1="- x" in fresh_star_permute_iff[THEN iffD1]) + apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt rfv_lts_eqvt) + apply (subst permute_eqvt[symmetric]) + apply (simp) + done + lemma alpha5_rfv: "(t \5 s \ rfv_trm5 t = rfv_trm5 s)" "(l \l m \ rfv_lts l = rfv_lts m)" @@ -748,27 +791,32 @@ apply(simp_all add: alpha_gen) done -lemma [quot_respect]: -"(op = ===> alpha5 ===> alpha5) permute permute" -"(op = ===> alphalts ===> alphalts) permute permute" -"(op = ===> alpha5) rVr5 rVr5" -"(alpha5 ===> alpha5 ===> alpha5) rAp5 rAp5" -"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5" -"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5" -"(op = ===> alpha5 ===> alphalts ===> alphalts) rLcons rLcons" -"(alpha5 ===> op =) rfv_trm5 rfv_trm5" -"(alphalts ===> op =) rfv_lts rfv_lts" -"(alphalts ===> op =) rbv5 rbv5" -sorry - lemma bv_list_rsp: shows "x \l y \ rbv5 x = rbv5 y" -apply(induct rule: alpha5_alphalts.inducts(2)) -apply(simp_all) -done + apply(induct rule: alpha5_alphalts.inducts(2)) + apply(simp_all) + done +lemma [quot_respect]: + "(alphalts ===> op =) rfv_lts rfv_lts" + "(alpha5 ===> op =) rfv_trm5 rfv_trm5" + "(alphalts ===> op =) rbv5 rbv5" + "(op = ===> alpha5) rVr5 rVr5" + "(alpha5 ===> alpha5 ===> alpha5) rAp5 rAp5" + "(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5" + "(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5" + "(op = ===> alpha5 ===> alphalts ===> alphalts) rLcons rLcons" + "(op = ===> alpha5 ===> alpha5) permute permute" + "(op = ===> alphalts ===> alphalts) permute permute" + apply (simp_all add: alpha5_inj alpha5_rfv alpha5_eqvt bv_list_rsp) + apply (auto) + apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv) + apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv) + apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv) + apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv) + done -lemma +lemma shows "(alphalts ===> op =) rbv5 rbv5" by (simp add: bv_list_rsp)