# HG changeset patch # User Cezary Kaliszyk # Date 1299037741 -32400 # Node ID 7fd879774d9b29dfed7fa676182a9ae0b92f4a73 # Parent 61d30863e5d159c683fe75f03965ad427d7c3eac# Parent ff22039df778799555ab706616b9fbb36dfa00cf merge diff -r 61d30863e5d1 -r 7fd879774d9b Nominal/Ex/Lambda_add.thy --- a/Nominal/Ex/Lambda_add.thy Wed Mar 02 00:06:28 2011 +0000 +++ b/Nominal/Ex/Lambda_add.thy Wed Mar 02 12:49:01 2011 +0900 @@ -73,6 +73,62 @@ apply (simp add: lam.eq_iff Abs1_eq_iff lam.supp fresh_def supp_at_base) done +nominal_primrec + Pair_pre +where + "atom z \ (M, N) \ (Pair_pre M N) (Lam [z]. _) = (Lam [z]. App (App (Var z) M) N)" +| "(Pair_pre M N) (App l r) = (App l r)" +| "(Pair_pre M N) (Var v) = (Var v)" +apply (subgoal_tac "\p a x. Pair_pre_graph a x \ Pair_pre_graph (p \ a) (p \ x)") +apply (simp add: eqvt_def) +apply (intro allI) +apply(simp add: permute_fun_def) +apply(rule ext) +apply(rule ext) +apply(simp add: permute_bool_def) +apply rule +apply(drule_tac x="p" in meta_spec) +apply(drule_tac x="- p \ x" in meta_spec) +apply(drule_tac x="- p \ xa" in meta_spec) +apply simp +apply(drule_tac x="-p" in meta_spec) +apply(drule_tac x="x" in meta_spec) +apply(drule_tac x="xa" in meta_spec) +apply simp +apply (erule Pair_pre_graph.induct) +apply (simp_all add: Pair_pre_graph.intros)[3] + apply (case_tac x) + apply clarify + apply (simp add: symmetric[OF atomize_conjL]) + apply (rule_tac y="c" and c="(ab, ba)" in lam.strong_exhaust) + apply (simp_all add: lam.distinct symmetric[OF atomize_conjL] lam.eq_iff Abs1_eq_iff fresh_star_def) + apply auto[1] + apply (simp_all add: fresh_Pair lam.fresh fresh_at_base) + apply (rule swap_fresh_fresh[symmetric]) + prefer 3 + apply (rule swap_fresh_fresh[symmetric]) + apply simp_all + done + +termination + by (relation "measure (\(t,_). size t)") + (simp_all add: lam.size) + +consts cx :: name + +fun + Pair where + "(Pair M N) = (Pair_pre M N (Lam [cx]. Var cx))" + +lemma Pair : "atom z \ (M, N) \ Pair M N = (Lam [z]. App (App (Var z) M) N)" + apply simp + apply (subgoal_tac "Lam [cx]. Var cx = Lam[z]. Var z") + apply simp + apply (auto simp add: lam.eq_iff Abs1_eq_iff) + by (metis Rep_name_inject atom_name_def fresh_at_base lam.fresh(1)) + + + end