diff -r a94c04c4a720 -r 6d2200603585 Quot/Nominal/Terms.thy --- a/Quot/Nominal/Terms.thy Fri Feb 19 17:50:43 2010 +0100 +++ b/Quot/Nominal/Terms.thy Sat Feb 20 06:31:03 2010 +0100 @@ -30,12 +30,12 @@ | "bv1 (BPr bp1 bp2) = (bv1 bp1) \ (bv1 bp2)" setup {* snd o define_raw_perms ["rtrm1", "bp"] ["Terms.rtrm1", "Terms.bp"] *} +thm permute_rtrm1_permute_bp.simps local_setup {* snd o define_fv_alpha "Terms.rtrm1" [[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term bv1}, 0)], [], [(SOME @{term bv1}, 0)]]], [[], [[]], [[], []]]] *} -print_theorems notation alpha_rtrm1 ("_ \1 _" [100, 100] 100) and @@ -64,8 +64,8 @@ lemma bv1_eqvt[eqvt]: shows "(pi \ bv1 x) = bv1 (pi \ x)" apply (induct x) -apply (simp_all add: empty_eqvt insert_eqvt atom_eqvt eqvts) -done + apply (simp_all add: atom_eqvt eqvts) + done lemma fv_rtrm1_eqvt[eqvt]: "(pi\fv_rtrm1 t) = fv_rtrm1 (pi\t)" @@ -134,7 +134,7 @@ lemma alpha_rfv1: shows "t \1 s \ fv_rtrm1 t = fv_rtrm1 s" apply(induct rule: alpha_rtrm1_alpha_bp.inducts(1)) - apply(simp_all add: fv_rtrm1_fv_bp.simps alpha_gen.simps) + apply(simp_all add: alpha_gen.simps) done lemma [quot_respect]: @@ -568,31 +568,32 @@ lemma trm5_lts_zero: "0 \ (x\trm5) = x" "0 \ (y\lts) = y" -apply(induct x and y rule: trm5_lts_inducts) -apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted]) -done + apply(induct x and y rule: trm5_lts_inducts) + apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted]) + done lemma trm5_lts_plus: "(p + q) \ (x\trm5) = p \ q \ x" "(p + q) \ (y\lts) = p \ q \ y" -apply(induct x and y rule: trm5_lts_inducts) -apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted]) -done + apply(induct x and y rule: trm5_lts_inducts) + apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted]) + done instance -apply default -apply (simp_all add: trm5_lts_zero trm5_lts_plus) -done + apply default + apply (simp_all add: trm5_lts_zero trm5_lts_plus) + done end -lemmas permute_trm5_lts = permute_rtrm5_permute_rlts.simps[quot_lifted] - -lemmas alpha5_INJ = alpha5_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen] - -lemmas bv5[simp] = rbv5.simps[quot_lifted] - -lemmas fv_trm5_lts[simp] = fv_rtrm5_fv_rlts.simps[quot_lifted] +lemmas + permute_trm5_lts = permute_rtrm5_permute_rlts.simps[quot_lifted] +and + alpha5_INJ = alpha5_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen] +and + bv5[simp] = rbv5.simps[quot_lifted] +and + fv_trm5_lts[simp] = fv_rtrm5_fv_rlts.simps[quot_lifted] lemma lets_ok: "(Lt5 (Lcons x (Vr5 x) Lnil) (Vr5 x)) = (Lt5 (Lcons y (Vr5 y) Lnil) (Vr5 y))" @@ -665,23 +666,19 @@ local_setup {* snd o define_fv_alpha "Terms.rtrm6" [ [[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv6}, 0)], [(SOME @{term rbv6}, 0)]]]] *} -notation alpha_rtrm6 ("_ \6a _" [100, 100] 100) +notation alpha_rtrm6 ("_ \6 _" [100, 100] 100) (* HERE THE RULES DIFFER *) thm alpha_rtrm6.intros -inductive - alpha6 :: "rtrm6 \ rtrm6 \ bool" ("_ \6 _" [100, 100] 100) -where - a1: "a = b \ (rVr6 a) \6 (rVr6 b)" -| a2: "(\pi. (({atom a}, t) \gen alpha6 fv_rtrm6 pi ({atom b}, s))) \ rLm6 a t \6 rLm6 b s" -| a3: "(\pi. (((rbv6 t1), s1) \gen alpha6 fv_rtrm6 pi ((rbv6 t2), s2))) \ rLt6 t1 s1 \6 rLt6 t2 s2" +local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha6_inj}, []), (build_alpha_inj @{thms alpha_rtrm6.intros} @{thms rtrm6.distinct rtrm6.inject} @{thms alpha_rtrm6.cases} ctxt)) ctxt)) *} +thm alpha6_inj lemma alpha6_equivps: shows "equivp alpha6" sorry quotient_type - trm6 = rtrm6 / alpha6 + trm6 = rtrm6 / alpha_rtrm6 by (auto intro: alpha6_equivps) local_setup {* @@ -695,56 +692,53 @@ print_theorems lemma [quot_respect]: - "(op = ===> alpha6 ===> alpha6) permute permute" + "(op = ===> alpha_rtrm6 ===> alpha_rtrm6) permute permute" apply auto (* will work with eqvt *) sorry (* Definitely not true , see lemma below *) -lemma [quot_respect]:"(alpha6 ===> op =) rbv6 rbv6" +lemma [quot_respect]:"(alpha_rtrm6 ===> op =) rbv6 rbv6" apply simp apply clarify -apply (erule alpha6.induct) +apply (erule alpha_rtrm6.induct) oops -lemma "(a :: name) \ b \ \ (alpha6 ===> op =) rbv6 rbv6" +lemma "(a :: name) \ b \ \ (alpha_rtrm6 ===> 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 (rule a2) +apply (simp add: alpha6_inj) apply (rule_tac x="(a \ b)" in exI) apply (simp add: alpha_gen fresh_star_def) -apply (rule a1) -apply (rule refl) +apply (simp add: alpha6_inj) done -lemma [quot_respect]:"(alpha6 ===> op =) fv_rtrm6 fv_rtrm6" -apply simp apply clarify -apply (induct_tac x y rule: alpha6.induct) +lemma fv6_rsp: "x \6 y \ fv_rtrm6 x = fv_rtrm6 y" +apply (induct_tac x y rule: alpha_rtrm6.induct) apply simp_all apply (erule exE) apply (simp_all add: alpha_gen) -apply (erule conjE)+ -apply (erule exE) -apply (erule conjE)+ -apply (simp) -oops +done - -lemma [quot_respect]: "(op = ===> alpha6) rVr6 rVr6" -by (simp_all add: a1) +lemma [quot_respect]:"(alpha_rtrm6 ===> op =) fv_rtrm6 fv_rtrm6" +by (simp add: fv6_rsp) lemma [quot_respect]: - "(op = ===> alpha6 ===> alpha6) rLm6 rLm6" - "(alpha6 ===> alpha6 ===> alpha6) rLt6 rLt6" -apply simp_all apply (clarify) -apply (rule a2) + "(op = ===> alpha_rtrm6) rVr6 rVr6" + "(op = ===> alpha_rtrm6 ===> alpha_rtrm6) rLm6 rLm6" +apply auto +apply (simp_all add: alpha6_inj) 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) -apply (simp add: alpha_gen) +apply (simp add: alpha_gen fv6_rsp fresh_star_def fresh_zero_perm) +done + +lemma [quot_respect]: + "(alpha_rtrm6 ===> alpha_rtrm6 ===> alpha_rtrm6) rLt6 rLt6" +apply auto +apply (simp_all add: alpha6_inj) +apply (rule conjI) +apply (rule_tac [!] x="0::perm" in exI) +apply (simp_all add: alpha_gen fresh_star_def fresh_zero_perm) (* needs rbv6_rsp *) oops @@ -761,28 +755,33 @@ end lemma lifted_induct: -"\x1 = x2; \a b. a = b \ P (Vr6 a) (Vr6 b); - \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]) +"\x1 = x2; \name namea. name = namea \ P (Vr6 name) (Vr6 namea); + \name rtrm6 namea rtrm6a. + \True; + \pi. fv_trm6 rtrm6 - {atom name} = fv_trm6 rtrm6a - {atom namea} \ + (fv_trm6 rtrm6 - {atom name}) \* pi \ pi \ rtrm6 = rtrm6a \ P (pi \ rtrm6) rtrm6a\ + \ P (Lm6 name rtrm6) (Lm6 namea rtrm6a); + \rtrm61 rtrm61a rtrm62 rtrm62a. + \\pi. fv_trm6 rtrm61 - bv6 rtrm61 = fv_trm6 rtrm61a - bv6 rtrm61a \ + (fv_trm6 rtrm61 - bv6 rtrm61) \* pi \ pi \ rtrm61 = rtrm61a \ P (pi \ rtrm61) rtrm61a; + \pi. fv_trm6 rtrm62 - bv6 rtrm61 = fv_trm6 rtrm62a - bv6 rtrm61a \ + (fv_trm6 rtrm62 - bv6 rtrm61) \* pi \ pi \ rtrm62 = rtrm62a \ P (pi \ rtrm62) rtrm62a\ + \ P (Lt6 rtrm61 rtrm62) (Lt6 rtrm61a rtrm62a)\ +\ P x1 x2" +apply (lifting alpha_rtrm6.induct[unfolded alpha_gen]) apply injection -(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *) +(* notice unsolvable goals: (alpha_rtrm6 ===> op =) rbv6 rbv6 *) oops 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]) +"(Lt6 rtrm61 rtrm62 = Lt6 rtrm61a rtrm62a) = +((\pi. fv_trm6 rtrm61 - bv6 rtrm61 = fv_trm6 rtrm61a - bv6 rtrm61a \ + (fv_trm6 rtrm61 - bv6 rtrm61) \* pi \ pi \ rtrm61 = rtrm61a) \ + (\pi. fv_trm6 rtrm62 - bv6 rtrm61 = fv_trm6 rtrm62a - bv6 rtrm61a \ + (fv_trm6 rtrm62 - bv6 rtrm61) \* pi \ pi \ rtrm62 = rtrm62a))" +apply(lifting alpha6_inj(3)[unfolded alpha_gen]) apply injection -(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *) +(* notice unsolvable goals: (alpha_rtrm6 ===> op =) rbv6 rbv6 *) oops @@ -803,7 +802,7 @@ | "rbv7 (rLt7 l r) = rbv7 l \ rbv7 r" setup {* snd o define_raw_perms ["rtrm7"] ["Terms.rtrm7"] *} -print_theorems +thm permute_rtrm7.simps local_setup {* snd o define_fv_alpha "Terms.rtrm7" [ [[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv7}, 0)], [(SOME @{term rbv7}, 0)]]]] *}