# HG changeset patch # User Cezary Kaliszyk # Date 1265794607 -3600 # Node ID ee276c9f12f0c72cc73f374911b4d888c9d6b7c9 # Parent 1e5dee9e6ae2db2da5317a767f0d05a5d6f3f6f3 A concrete example, with a proof that rbv is not regular and with proofs of induction and pseudo-injectivity that require this diff -r 1e5dee9e6ae2 -r ee276c9f12f0 Quot/Nominal/Terms.thy --- a/Quot/Nominal/Terms.thy Tue Feb 09 19:08:08 2010 +0100 +++ b/Quot/Nominal/Terms.thy Wed Feb 10 10:36:47 2010 +0100 @@ -929,22 +929,22 @@ (* example with a bn function defined over the type itself *) datatype rtrm6 = rVr6 "name" -| rAp6 "rtrm6" "rtrm6" -| rFo6 "rtrm6" "rtrm6" --"bind (bv6 left) in (right)" +| rLm6 "name" "rtrm6" +| rLt6 "rtrm6" "rtrm6" --"bind (bv6 left) in (right)" primrec rbv6 where - "rbv6 (rVr6 x) = {atom x}" -| "rbv6 (rAp6 l r) = rbv6 l \ rbv6 r" -| "rbv6 (rFo6 l r) = rbv6 r - rbv6 l" + "rbv6 (rVr6 n) = {}" +| "rbv6 (rLm6 n t) = {atom n}" +| "rbv6 (rLt6 l r) = rbv6 l \ rbv6 r" primrec rfv_trm6 where "rfv_trm6 (rVr6 n) = {atom n}" -| "rfv_trm6 (rAp6 t s) = (rfv_trm6 t) \ (rfv_trm6 s)" -| "rfv_trm6 (rFo6 l r) = (rfv_trm6 r - rbv6 l) \ (rfv_trm6 l)" +| "rfv_trm6 (rLm6 n t) = (rfv_trm6 t) - {atom n}" +| "rfv_trm6 (rLt6 l r) = (rfv_trm6 r - rbv6 l) \ rfv_trm6 r" instantiation rtrm6 :: pt @@ -954,8 +954,8 @@ permute_rtrm6 where "permute_rtrm6 pi (rVr6 a) = rVr6 (pi \ a)" -| "permute_rtrm6 pi (rAp6 t1 t2) = rAp6 (permute_rtrm6 pi t1) (permute_rtrm6 pi t2)" -| "permute_rtrm6 pi (rFo6 l r) = rFo6 (permute_rtrm6 pi l) (permute_rtrm6 pi r)" +| "permute_rtrm6 pi (rLm6 n t) = rLm6 (pi \ n) (permute_rtrm6 pi t)" +| "permute_rtrm6 pi (rLt6 l r) = rLt6 (permute_rtrm6 pi l) (permute_rtrm6 pi r)" lemma pt_rtrm6_zero: fixes t::rtrm6 @@ -982,9 +982,8 @@ alpha6 :: "rtrm6 \ rtrm6 \ bool" ("_ \6 _" [100, 100] 100) where a1: "a = b \ (rVr6 a) \6 (rVr6 b)" -| a2: "\t1 \6 t2; s1 \6 s2\ \ rAp6 t1 s1 \6 rAp6 t2 s2" -| a3: "\\pi. ((rbv6 l1, r1) \gen alpha6 rfv_trm6 pi (rbv6 l2, r2))\ - \ rFo6 l1 r1 \6 rFo6 l2 r2" +| a2: "(\pi. (({atom a}, t) \gen alpha6 rfv_trm6 pi ({atom b}, s))) \ rLm6 a t \6 rLm6 b s" +| a3: "(\pi. (((rbv6 t1), s1) \gen alpha6 rfv_trm6 pi ((rbv6 t2), s2))) \ rLt6 t1 s1 \6 rLt6 t2 s2" lemma alpha6_equivps: shows "equivp alpha6" @@ -1000,14 +999,14 @@ "rVr6" quotient_definition - "Ap6 :: trm6 \ trm6 \ trm6" + "Lm6 :: name \ trm6 \ trm6" as - "rAp6" + "rLm6" quotient_definition - "Fo6 :: trm6 \ trm6 \ trm6" + "Lt6 :: trm6 \ trm6 \ trm6" as - "rFo6" + "rLt6" quotient_definition "fv_trm6 :: trm6 \ atom set" @@ -1020,33 +1019,53 @@ "rbv6" lemma [quot_respect]: - "(op = ===> alpha1 ===> alpha1) permute permute" -apply auto (* eqvt *) + "(op = ===> alpha6 ===> alpha6) permute permute" +apply auto (* will work with eqvt *) sorry +(* Definitely not true , see lemma below *) + lemma [quot_respect]:"(alpha6 ===> op =) rbv6 rbv6" apply simp apply clarify apply (erule alpha6.induct) +oops + +lemma "(a :: name) \ b \ \ (alpha6 ===> op =) rbv6 rbv6" apply simp +apply (rule_tac x="rLm6 (a::name) (rVr6 (a :: name))" in exI) +apply (rule_tac x="rLm6 (b::name) (rVr6 (b :: name))" in exI) apply simp -apply (erule exE) -apply (simp add: alpha_gen) -oops +apply (rule a2) +apply (rule_tac x="(a \ b)" in exI) +apply (simp add: alpha_gen fresh_star_def) +apply (rule a1) +apply (rule refl) +done lemma [quot_respect]:"(alpha6 ===> op =) rfv_trm6 rfv_trm6" apply simp apply clarify apply (induct_tac x y rule: alpha6.induct) apply simp_all apply (erule exE) -apply (simp add: alpha_gen) +apply (simp_all add: alpha_gen) +apply (erule conjE)+ +apply (erule exE) apply (erule conjE)+ +apply (simp) oops + +lemma [quot_respect]: "(op = ===> alpha6) rVr6 rVr6" +by (simp_all add: a1) + lemma [quot_respect]: - "(op = ===> alpha6) rVr6 rVr6" - "(alpha6 ===> alpha6 ===> alpha6) rAp6 rAp6" - "(alpha6 ===> alpha6 ===> alpha6) rFo6 rFo6" -apply (simp_all add: a1 a2) + "(op = ===> alpha6 ===> alpha6) rLm6 rLm6" + "(alpha6 ===> alpha6 ===> alpha6) rLt6 rLt6" +apply simp_all apply (clarify) +apply (rule a2) +apply (rule_tac x="0::perm" in exI) +apply (simp add: alpha_gen) +(* needs rfv6_rsp *) defer apply clarify apply (rule a3) apply (rule_tac x="0::perm" in exI) @@ -1066,24 +1085,31 @@ sorry end -lemma +lemma lifted_induct: "\x1 = x2; \a b. a = b \ P (Vr6 a) (Vr6 b); - \t1 t2 s1 s2. \t1 = t2; P t1 t2; s1 = s2; P s1 s2\ \ P (Ap6 t1 s1) (Ap6 t2 s2); - \l1 r1 l2 r2. - \pi. (bv6 l1, r1) \gen (\x1 x2. x1 = x2 \ P x1 x2) fv_trm6 pi (bv6 l2, r2) \ - P (Fo6 l1 r1) (Fo6 l2 r2)\ + \a t b s. + \pi. fv_trm6 t - {atom a} = fv_trm6 s - {atom b} \ + (fv_trm6 t - {atom a}) \* pi \ pi \ t = s \ P (pi \ t) s \ + P (Lm6 a t) (Lm6 b s); + \t1 s1 t2 s2. + \pi. fv_trm6 s1 - bv6 t1 = fv_trm6 s2 - bv6 t2 \ + (fv_trm6 s1 - bv6 t1) \* pi \ pi \ s1 = s2 \ P (pi \ s1) s2 \ + P (Lt6 t1 s1) (Lt6 t2 s2)\ \ P x1 x2" unfolding alpha_gen apply (lifting alpha6.induct[unfolded alpha_gen]) -apply(injection) -sorry +apply injection +(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *) +oops -lemma "\\pi. ((bv6 l1, r1) \gen (op =) fv_trm6 pi (bv6 l2, r2))\ - \ Fo6 l1 r1 = Fo6 l2 r2" -apply (unfold alpha_gen) -apply (lifting a3[unfolded alpha_gen]) +lemma lifted_inject_a3: + "\pi. fv_trm6 s1 - bv6 t1 = fv_trm6 s2 - bv6 t2 \ + (fv_trm6 s1 - bv6 t1) \* pi \ pi \ s1 = s2 \ Lt6 t1 s1 = Lt6 t2 s2" +apply(lifting a3[unfolded alpha_gen]) apply injection -sorry +(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *) +oops +