# HG changeset patch # User Cezary Kaliszyk # Date 1306893547 -32400 # Node ID 6750964a69bf7aba65e19149346970e4efa88de0 # Parent 3e341af86bbd98ef03393b04673ea3493f3fea76 equivariance of db_trans diff -r 3e341af86bbd -r 6750964a69bf Nominal/Ex/Lambda.thy --- a/Nominal/Ex/Lambda.thy Tue May 31 12:22:28 2011 +0100 +++ b/Nominal/Ex/Lambda.thy Wed Jun 01 10:59:07 2011 +0900 @@ -436,6 +436,42 @@ apply (simp_all add: lam.size) done +lemma trans_eqvt[eqvt]: + "p \ trans t l n = trans (p \t) (p \l) (p \n)" +proof (nominal_induct t avoiding: l p arbitrary: n rule: lam.strong_induct) + fix name l n p + show "p \ trans (Var name) l n = + trans (p \ Var name) (p \ l) (p \ n)" + apply (induct l arbitrary: n) + apply simp + apply auto + apply (simp add: permute_pure) + done +next + fix lam1 lam2 l n p + assume + "\b ba n. ba \ trans lam1 b n = trans (ba \ lam1) (ba \ b) (ba \ n)" + " \b ba n. ba \ trans lam2 b n = trans (ba \ lam2) (ba \ b) (ba \ n)" + then show "p \ trans (App lam1 lam2) l n = + trans (p \ App lam1 lam2) (p \ l) (p \ n)" + by (simp add: db_in_eqvt) +next + fix name :: name and l :: "name list" and p :: perm + fix lam n + assume + "atom name \ l" + "atom name \ p" + "\b ba n. ba \ trans lam b n = trans (ba \ lam) (ba \ b) (ba \ n)" + then show + "p \ trans (Lam [name]. lam) l n = + trans (p \ Lam [name]. lam) (p \ l) (p \ n)" + apply (simp add: fresh_at_list) + apply (subst trans.simps) + apply (simp add: fresh_at_list[symmetric]) + apply (simp add: db_in_eqvt) + done +qed + lemma db_trans_test: assumes a: "y \ x" shows "trans (Lam [x]. Lam [y]. App (Var x) (Var y)) [] 0 = Some (DBLam (DBLam (DBApp (DBVar 1) (DBVar 0))))"