# HG changeset patch # User Christian Urban # Date 1253538143 -7200 # Node ID d9bd7e01a681579577235ffe0d605487fdc90bb7 # Parent a45e8ec2b51ee24ae014da629839deb059a8ed9b tuned some proofs diff -r a45e8ec2b51e -r d9bd7e01a681 src/HOL/Nominal/Examples/Crary.thy --- a/src/HOL/Nominal/Examples/Crary.thy Mon Sep 21 13:42:36 2009 +0200 +++ b/src/HOL/Nominal/Examples/Crary.thy Mon Sep 21 15:02:23 2009 +0200 @@ -408,20 +408,7 @@ declare trm.inject[simp del] -lemma whn_eqvt[eqvt]: - fixes pi::"name prm" - assumes a: "t \ t'" - shows "(pi\t) \ (pi\t')" -using a -apply(induct) -apply(rule QAN_Reduce) -apply(rule whr_def.eqvt) -apply(assumption)+ -apply(rule QAN_Normal) -apply(auto) -apply(drule_tac pi="rev pi" in whr_def.eqvt) -apply(perm_simp) -done +equivariance whn_def lemma red_unicity : assumes a: "x \ a" @@ -631,6 +618,7 @@ apply (force) apply (rule ty_cases) done + termination by lexicographic_order lemma logical_monotonicity: @@ -968,7 +956,7 @@ then show "\ \ s \ t : T" using main_lemma(1) val by simp qed -text {* We leave soundness as an exercise - like in the book :-) \\ +text {* We leave soundness as an exercise - just like Crary in the ATS book :-) \\ @{prop[mode=IfThen] "\\ \ s \ t : T; \ \ t : T; \ \ s : T\ \ \ \ s \ t : T"} \\ @{prop "\\ \ s \ t : T; \ \ t : T; \ \ s : T\ \ \ \ s \ t : T"} *} diff -r a45e8ec2b51e -r d9bd7e01a681 src/HOL/Nominal/Nominal.thy --- a/src/HOL/Nominal/Nominal.thy Mon Sep 21 13:42:36 2009 +0200 +++ b/src/HOL/Nominal/Nominal.thy Mon Sep 21 15:02:23 2009 +0200 @@ -2623,74 +2623,77 @@ avoiding a finitely supported c and there is a permutation which 'translates' between both sets. *} + lemma at_set_avoiding_aux: fixes Xs::"'a set" and As::"'a set" assumes at: "at TYPE('a)" - and a: "finite Xs" and b: "Xs \ As" and c: "finite As" and d: "finite ((supp c)::'a set)" - shows "\(Ys::'a set) (pi::'a prm). Ys\*c \ Ys \ As = {} \ (pi\Xs=Ys) \ - set pi \ Xs \ Ys \ finite Ys" -using a b c -proof (induct) - case empty - have "({}::'a set)\*c" by (simp add: fresh_star_def) - moreover - have "({}::'a set) \ As = {}" by simp - moreover - have "([]::'a prm)\{} = ({}::'a set)" - by (rule pt1[OF pt_fun_inst, OF at_pt_inst[OF at], OF pt_bool_inst, OF at]) - moreover - have "set ([]::'a prm) \ {} \ {}" by simp - moreover - have "finite ({}::'a set)" by simp - ultimately show ?case by blast -next - case (insert x Xs) - then have ih: "\Ys pi. Ys\*c \ Ys \ As = {} \ pi\Xs = Ys \ set pi \ Xs \ Ys \ finite Ys" by simp - then obtain Ys pi where a1: "Ys\*c" and a2: "Ys \ As = {}" and a3: "pi\Xs = Ys" and - a4: "set pi \ Xs \ Ys" and a5: "finite Ys" by blast - have b: "x\Xs" by fact - have d1: "finite As" by fact - have d2: "finite Xs" by fact - have d3: "insert x Xs \ As" by fact - have "\y::'a. y\(c,x,Ys,As)" using d d1 a5 - by (rule_tac at_exists_fresh'[OF at]) - (simp add: supp_prod at_supp[OF at] at_fin_set_supp[OF at]) - then obtain y::"'a" where e: "y\(c,x,Ys,As)" by blast - have "({y}\Ys)\*c" using a1 e by (simp add: fresh_star_def) - moreover - have "({y}\Ys)\As = {}" using a2 d1 e by (simp add: fresh_prod at_fin_set_fresh[OF at]) - moreover - have "(((pi\x,y)#pi)\(insert x Xs)) = {y}\Ys" - proof - - have eq: "[(pi\x,y)]\Ys = Ys" + shows "\(pi::'a prm). (pi\Xs)\*c \ (pi\Xs) \ As = {} \ set pi \ Xs \ (pi\Xs)" +proof - + from b c have "finite Xs" by (simp add: finite_subset) + then show ?thesis using b + proof (induct) + case empty + have "({}::'a set)\*c" by (simp add: fresh_star_def) + moreover + have "({}::'a set) \ As = {}" by simp + moreover + have "set ([]::'a prm) \ {} \ {}" by simp + moreover + have "([]::'a prm)\{} = ({}::'a set)" + by (rule pt1[OF pt_fun_inst, OF at_pt_inst[OF at] pt_bool_inst at]) + ultimately show ?case by simp + next + case (insert x Xs) + then have ih: "\pi. (pi\Xs)\*c \ (pi\Xs) \ As = {} \ set pi \ Xs \ (pi\Xs)" by simp + then obtain pi where a1: "(pi\Xs)\*c" and a2: "(pi\Xs) \ As = {}" and + a4: "set pi \ Xs \ (pi\Xs)" by blast + have b: "x\Xs" by fact + have d1: "finite As" by fact + have d2: "finite Xs" by fact + have d3: "({x} \ Xs) \ As" using insert(4) by simp + from d d1 d2 + obtain y::"'a" where fr: "y\(c,pi\Xs,As)" + apply(rule_tac at_exists_fresh[OF at, where x="(c,pi\Xs,As)"]) + apply(auto simp add: supp_prod at_supp[OF at] at_fin_set_supp[OF at] + pt_supp_finite_pi[OF pt_fun_inst[OF at_pt_inst[OF at] pt_bool_inst at] at]) + done + have "({y}\(pi\Xs))\*c" using a1 fr by (simp add: fresh_star_def) + moreover + have "({y}\(pi\Xs))\As = {}" using a2 d1 fr + by (simp add: fresh_prod at_fin_set_fresh[OF at]) + moreover + have "pi\x=x" using a4 b a2 d3 + by (rule_tac at_prm_fresh2[OF at]) (auto) + then have "set ((pi\x,y)#pi) \ ({x} \ Xs) \ ({y}\(pi\Xs))" using a4 by auto + moreover + have "(((pi\x,y)#pi)\({x} \ Xs)) = {y}\(pi\Xs)" proof - - have "(pi\x)\Ys" using a3[symmetric] b d2 - by(simp add: pt_fresh_bij[OF pt_fun_inst, OF at_pt_inst[OF at], OF pt_bool_inst, OF at, OF at] - at_fin_set_fresh[OF at]) - moreover - have "y\Ys" using e by simp - ultimately show "[(pi\x,y)]\Ys = Ys" - by (simp add: pt_fresh_fresh[OF pt_fun_inst, OF at_pt_inst[OF at], OF pt_bool_inst, OF at, OF at]) + have eq: "[(pi\x,y)]\(pi\Xs) = (pi\Xs)" + proof - + have "(pi\x)\(pi\Xs)" using b d2 + by(simp add: pt_fresh_bij[OF pt_fun_inst, OF at_pt_inst[OF at], + OF pt_bool_inst, OF at, OF at] + at_fin_set_fresh[OF at]) + moreover + have "y\(pi\Xs)" using fr by simp + ultimately show "[(pi\x,y)]\(pi\Xs) = (pi\Xs)" + by (simp add: pt_fresh_fresh[OF pt_fun_inst, + OF at_pt_inst[OF at], OF pt_bool_inst, OF at, OF at]) + qed + have "(((pi\x,y)#pi)\({x}\Xs)) = ([(pi\x,y)]\(pi\({x}\Xs)))" + by (simp add: pt2[symmetric, OF pt_fun_inst, OF at_pt_inst[OF at], + OF pt_bool_inst, OF at]) + also have "\ = {y}\([(pi\x,y)]\(pi\Xs))" + by (simp only: union_eqvt perm_set_eq[OF at_pt_inst[OF at], OF at] at_calc[OF at])(auto) + finally show "(((pi\x,y)#pi)\({x} \ Xs)) = {y}\(pi\Xs)" using eq by simp qed - have "(((pi\x,y)#pi)\({x}\Xs)) = ([(pi\x,y)]\(pi\({x}\Xs)))" - by (simp add: pt2[symmetric, OF pt_fun_inst, OF at_pt_inst[OF at], OF pt_bool_inst, OF at]) - also have "\ = {y}\([(pi\x,y)]\(pi\Xs))" - by (simp only: union_eqvt perm_set_eq[OF at_pt_inst[OF at], OF at] at_calc[OF at])(auto) - also have "\ = {y}\([(pi\x,y)]\Ys)" using a3 by simp - also have "\ = {y}\Ys" using eq by simp - finally show "(((pi\x,y)#pi)\(insert x Xs)) = {y}\Ys" by auto + ultimately + show ?case by (rule_tac x="(pi\x,y)#pi" in exI) (auto) qed - moreover - have "pi\x=x" using a4 b a2 a3 d3 by (rule_tac at_prm_fresh2[OF at]) (auto) - then have "set ((pi\x,y)#pi) \ (insert x Xs) \ ({y}\Ys)" using a4 by auto - moreover - have "finite ({y}\Ys)" using a5 by simp - ultimately - show ?case by blast qed lemma at_set_avoiding: @@ -2698,10 +2701,10 @@ assumes at: "at TYPE('a)" and a: "finite Xs" and b: "finite ((supp c)::'a set)" - obtains pi::"'a prm" where "(pi \ Xs) \* c" and "set pi \ Xs \ (pi \ Xs)" - using a b - by (frule_tac As="Xs" in at_set_avoiding_aux[OF at]) auto - + obtains pi::"'a prm" where "(pi\Xs)\*c" and "set pi \ Xs \ (pi\Xs)" +using a b at_set_avoiding_aux[OF at, where Xs="Xs" and As="Xs" and c="c"] +by (blast) + section {* composition instances *} (* ============================= *)