# HG changeset patch # User Cezary Kaliszyk # Date 1333116480 -7200 # Node ID 8a3352cff8d0a27f78903df1ca2336c3359517f2 # Parent d24e704830516576c668beb2b67305b8976d7a11 More cleaning diff -r d24e70483051 -r 8a3352cff8d0 Nominal/Ex/AuxNoFCB.thy --- a/Nominal/Ex/AuxNoFCB.thy Fri Mar 30 13:56:36 2012 +0200 +++ b/Nominal/Ex/AuxNoFCB.thy Fri Mar 30 16:08:00 2012 +0200 @@ -44,6 +44,7 @@ apply simp_all[3] apply (metis, metis, metis) apply (rule_tac y="e" and c="(name, c, d)" in lam.strong_exhaust) apply simp_all[2] apply (metis, metis) + unfolding fresh_star_def apply (thin_tac "\faa fll xs n m. x = (faa, fll, xs, Var n, Var m) \ P") apply (thin_tac "\faa fll xs n l r. x = (faa, fll, xs, Var n, App l r) \ P") apply (thin_tac "\faa fll xs n xa t. x = (faa, fll, xs, Var n, Lam [xa]. t) \ P") @@ -60,26 +61,13 @@ apply (drule_tac x="lam" in meta_spec)+ apply (drule_tac x="b" in meta_spec)+ apply (drule_tac x="a" in meta_spec)+ - unfolding fresh_star_def - apply (case_tac " -(\x' y' t' s'. - atom x' \ (c, Lam [y']. s') \ - atom y' \ (x', c, Lam [x']. t') \ - Lam [name]. lam = Lam [x']. t' \ - Lam [namea]. lama = Lam [y']. s' \ b name lam namea lama = b x' t' y' s') - ") + apply (case_tac "(\x' y' t' s'. atom x' \ (c, Lam [y']. s') \ + atom y' \ (x', c, Lam [x']. t') \ Lam [name]. lam = Lam [x']. t' \ + Lam [namea]. lama = Lam [y']. s' \ b name lam namea lama = b x' t' y' s')") apply clarify apply (simp) - apply (thin_tac "\atom name \ (c, Lam [namea]. lama) \ - atom namea \ (name, c, Lam [name]. lam) \ - (\x' y' t' s'. - atom x' \ (c, Lam [y']. s') \ - atom y' \ (x', c, Lam [x']. t') \ - Lam [name]. lam = Lam [x']. t' \ - Lam [namea]. lama = Lam [y']. s' \ b name lam namea lama = b x' t' y' s'); - x = (a, b, c, Lam [name]. lam, Lam [namea]. lama)\ - \ P") - apply (simp) + apply (simp only: fresh_Pair_elim) + apply blast apply (simp_all)[53] apply clarify apply metis @@ -98,18 +86,15 @@ apply (rule_tac y="l2" and c="(name, xs, l)" in lam.strong_exhaust) apply auto[2] apply clarify - apply (case_tac "(\x' y' t' s'. - atom x' \ (xs, Lam [y']. s') \ - atom y' \ (x', xs, Lam [x']. t') \ - Lam [name]. lam = Lam [x']. t' \ - Lam [namea]. lama = Lam [y']. s' \ - fll name lam namea lama = fll x' t' y' s')") - apply (subst lam2_rec.simps) apply (simp add: fresh_star_def) - apply (subst lam2_rec.simps) apply (simp add: fresh_star_def) + apply (case_tac "(\x' y' t' s'. atom x' \ (xs, Lam [y']. s') \ + atom y' \ (x', xs, Lam [x']. t') \ Lam [name]. lam = Lam [x']. t' \ + Lam [namea]. lama = Lam [y']. s' \ fll name lam namea lama = fll x' t' y' s')") + unfolding fresh_star_def + apply (subst lam2_rec.simps) apply simp + apply (subst lam2_rec.simps) apply simp apply metis apply (subst lam2_rec.simps(10)) apply (simp add: fresh_star_def) - apply (subst lam2_rec.simps(10)) apply (simp add: fresh_star_def) - apply rule + apply (subst lam2_rec.simps(10)) apply (simp_all add: fresh_star_def) done nominal_primrec aux :: "lam \ lam \ (name \ name) list \ bool" @@ -144,7 +129,6 @@ apply (subst aux.simps, simp) apply (subst aux.simps) apply (subst lam2_rec.simps) - prefer 2 apply rule apply (rule, simp add: lam.fresh) apply (rule, simp add: lam.fresh) apply (intro allI impI) @@ -193,6 +177,7 @@ apply (simp add: Abs1_eq_iff fresh_Pair_elim fresh_at_base swap_commute) apply (rule sym) apply (simp add: Abs1_eq_iff fresh_Pair_elim fresh_at_base swap_commute) + apply (rule refl) done lemma aux_induct: "\\xs n m. P xs (Var n) (Var m); \xs n l r. P xs (Var n) (App l r); @@ -224,8 +209,7 @@ | "atom x \ (l, r, hl, hr, t) \ swapequal l r ((hl, hr) # t) \ swapequal ((hl \ x) \ l) ((hr \ x) \ r) t" unfolding eqvt_def swapequal_graph_def - apply (rule, perm_simp, rule) - apply(rule TrueI) + apply (rule, perm_simp, rule, rule TrueI) apply (case_tac x) apply (case_tac c) apply metis @@ -262,58 +246,33 @@ apply (simp add: fresh_Pair_elim) by (metis flip_at_base_simps(3) fresh_Pair fresh_at_base(2)) -lemma var_neq_swapequal: "atom ab \ xs \ ab \ m \ \ swapequal (Var ab) (Var m) xs" +lemma var_neq_swapequal: + "atom ab \ xs \ ab \ m \ \ swapequal (Var ab) (Var m) xs" + "atom ab \ xs \ ab \ m \ \ swapequal (Var m) (Var ab) xs" apply (induct xs arbitrary: m) - apply simp - apply (case_tac a) - apply (simp add: fresh_Cons) - apply (rule_tac x="(ab, aa, b, m, xs)" and ?'a="name" in obtain_fresh) + apply simp_all[2] + apply (case_tac [!] a) + apply (simp_all add: fresh_Cons) + apply (rule_tac [!] x="(ab, aa, b, m, xs)" and ?'a="name" in obtain_fresh) apply (subst swapequal.simps) - apply (simp add: fresh_Pair lam.fresh) - apply auto[1] + apply (auto simp add: fresh_Pair lam.fresh)[1] apply (elim conjE) - apply (simp add: fresh_Pair_elim) - apply (simp add: flip_at_base_simps(3) fresh_Pair fresh_at_base(2)) - apply (subgoal_tac "ab \ (b \ aba) \ m") - apply simp - by (metis (lifting) permute_flip_at) - -lemma var_neq_swapequal2: "atom ab \ xs \ ab \ m \ \ swapequal (Var m) (Var ab) xs" - apply (induct xs arbitrary: m) - apply simp - apply (case_tac a) - apply (simp add: fresh_Cons) - apply (rule_tac x="(ab, aa, b, m, xs)" and ?'a="name" in obtain_fresh) + apply (simp add: fresh_Pair_elim fresh_at_base permute_flip_at) apply (subst swapequal.simps) - apply (simp add: fresh_Pair lam.fresh) - apply auto[1] + apply (auto simp add: fresh_Pair lam.fresh)[1] apply (elim conjE) - apply (simp add: fresh_Pair_elim) - apply (simp add: flip_at_base_simps(3) fresh_Pair fresh_at_base(2)) - apply (subgoal_tac "ab \ (aa \ aba) \ m") - apply simp - by (metis (lifting) permute_flip_at) + apply (simp add: fresh_Pair_elim fresh_at_base permute_flip_at) + done lemma lookup_swapequal: "lookup n m xs = swapequal (Var n) (Var m) xs" apply (induct xs arbitrary: m n) apply simp apply (case_tac a) + apply (rule_tac x="(n, m, aa, b, xs)" and ?'a="name" in obtain_fresh) apply simp - apply (rule_tac x="(n, m, aa, b, xs)" and ?'a="name" in obtain_fresh) apply (subst swapequal.simps) apply (simp add: fresh_Pair lam.fresh fresh_Nil) - apply (case_tac "n = aa \ m = b") - apply simp - apply (simp add: var_eq_swapequal fresh_Pair_elim) - apply (case_tac "n = aa") - apply (simp add: fresh_Pair_elim fresh_at_base) - apply (simp add: var_neq_swapequal fresh_Pair_elim) - apply (simp add: fresh_Pair_elim fresh_at_base flip_def) - apply (case_tac "m = b") - apply simp - apply (simp add: var_neq_swapequal2 fresh_at_base) - apply simp - done + by (metis (hide_lams, mono_tags) flip_at_base_simps(3) flip_at_simps(1) fresh_Pair fresh_at_base(2) lam.perm_simps(1) var_eq_swapequal var_neq_swapequal(1) var_neq_swapequal(2)) lemma swapequal_reorder: " a \ x \ a \ y \ b \ x \ b \ y \ @@ -363,33 +322,25 @@ apply (subgoal_tac "[[atom y]]lst. s = [[atom a]]lst. ((y \ a) \ s)") apply simp apply (simp add: Abs1_eq_iff) - apply (auto simp add: Abs1_eq_iff flip_def fresh_at_base)[1] + apply (auto simp add: Abs1_eq_iff flip_def fresh_at_base)[2] apply (smt atom_eqvt eq_eqvt flip_at_simps(2) flip_def fresh_eqvt) - apply (simp add: Abs1_eq_iff) - apply (auto simp add: Abs1_eq_iff flip_def fresh_at_base)[1] apply (smt atom_eqvt eq_eqvt flip_at_simps(2) flip_def fresh_eqvt) apply clarify apply (simp add: fresh_Cons fresh_Pair fresh_at_base) apply clarify - apply (subst swapequal_reorder) - apply auto[4] + apply (simp add: swapequal_reorder) apply (rule_tac x="(x, y, t, s, a, b, xs)" and ?'a="name" in obtain_fresh) apply (rename_tac f) apply (subst (2) swapequal.simps) - apply (simp add: lam.fresh fresh_Pair fresh_at_base fresh_Cons) - apply auto[1] + apply (auto simp add: lam.fresh fresh_Pair fresh_at_base fresh_Cons)[1] apply (subst swapequal.simps) - apply (simp add: lam.fresh fresh_Pair fresh_at_base fresh_Cons) - apply auto[1] - apply simp - apply (simp add: flip_def) - apply (simp add: fresh_Pair_elim fresh_at_base) + apply (auto simp add: lam.fresh fresh_Pair fresh_at_base fresh_Cons)[1] + apply (simp add: flip_def fresh_Pair_elim fresh_at_base) done lemma distinct_swapequal: "\p q. p \ l \ q \ r \ \swapequal l r xs" apply (induct xs rule:swapequal.induct) - apply simp - apply metis + apply auto[1] apply (simp add: fresh_Pair_elim) apply (subgoal_tac "\(p\perm) q\perm. p \ (hl \ x) \ l \ q \ (hr \ x) \ r") apply simp @@ -406,9 +357,8 @@ apply simp apply (rule_tac x="(l1, l2, r1, r2, aa, b, xs)" and ?'a="name" in obtain_fresh) apply (simp add: fresh_Pair_elim) - apply (subst swapequal.simps) apply (simp add: fresh_Pair) apply auto[1] - apply (subst swapequal.simps) apply (simp add: fresh_Pair lam.fresh) apply auto[1] - apply simp + apply (subst swapequal.simps) apply (auto simp add: fresh_Pair)[1] + apply (subst swapequal.simps) apply (auto simp add: fresh_Pair lam.fresh) done lemma [simp]: "distinct (map fst xs) \ distinct xs" @@ -429,19 +379,14 @@ using assms apply (induct xs x y rule: aux_induct) apply (simp add: lookup_swapequal) - apply (simp, rule distinct_swapequal, simp) - apply (simp, rule distinct_swapequal, simp) - apply (simp, rule distinct_swapequal, simp) + apply (simp, rule distinct_swapequal, simp)+ apply (simp add: swapequal_app) - apply (simp, rule distinct_swapequal, simp) - apply (simp, rule distinct_swapequal, simp) - apply (simp, rule distinct_swapequal, simp) - apply (simp add: fresh_Pair_elim lam.fresh fresh_at_base) + apply (simp, rule distinct_swapequal, simp)+ + apply (simp add: fresh_Pair_elim lam.fresh fresh_at_base conjE) apply (elim conjE) apply (simp add: fresh_Pair_elim lam.fresh fresh_at_base) apply (subgoal_tac "x \ fst ` set xs \ x \ snd ` set xs \ y \ snd ` set xs \ y \ fst ` set xs") - apply (simp) apply (subst swapequal_lambda) apply auto[2] apply simp