|
| 1 | +theory Nominal2_Lemmas |
| 2 | + imports Main "Nominal2.Nominal2" |
| 3 | +begin |
| 4 | + |
| 5 | +lemma Abs_lst_rename: |
| 6 | + fixes a c::"'a::at" and e::"'e::fs" |
| 7 | + assumes "atom c \<sharp> e" |
| 8 | + shows "[[atom a]]lst. e = [[atom c]]lst. (a \<leftrightarrow> c) \<bullet> e" |
| 9 | +proof - |
| 10 | + from assms have 1: "atom c \<notin> supp e - set [atom a]" by (simp add: fresh_def) |
| 11 | + have 2: "atom a \<notin> supp e - set [atom a]" by simp |
| 12 | + show ?thesis using Abs_swap2[OF 2 1] by (simp add: flip_def) |
| 13 | +qed |
| 14 | + |
| 15 | +lemma eqvt_at_deep: |
| 16 | + assumes fresh: "atom a \<sharp> (x, e)" "atom c \<sharp> (x, e)" |
| 17 | + and eqvt_at: "eqvt_at f (x, e, e2)" |
| 18 | +shows "(a \<leftrightarrow> c) \<bullet> f (x, e, e2) = f (x, e, (a \<leftrightarrow> c) \<bullet> e2)" |
| 19 | +proof - |
| 20 | + have 1: "(a \<leftrightarrow> c) \<bullet> f (x, e, e2) = f ((a \<leftrightarrow> c) \<bullet> (x, e, e2))" using eqvt_at eqvt_at_def by blast |
| 21 | + have 2: "(a \<leftrightarrow> c) \<bullet> (x, e, e2) = (x, e, (a \<leftrightarrow> c) \<bullet> e2)" using fresh fresh_Pair flip_fresh_fresh by fastforce |
| 22 | + |
| 23 | + show ?thesis using 1 2 by argo |
| 24 | +qed |
| 25 | + |
| 26 | +lemma Abs_lst_rename_deep: |
| 27 | + fixes a c::"'a::at" and x::"'b::fs" and e::"'c::fs" and e2::"'d::fs" and f::"'b * 'c * 'd \<Rightarrow> 'e::fs" |
| 28 | + assumes fresh: "atom c \<sharp> f (x, e, e2)" "atom c \<sharp> (x, e)" "atom a \<sharp> (x, e)" |
| 29 | + and eqvt_at: "eqvt_at f (x, e, e2)" |
| 30 | +shows "[[atom a]]lst. f (x, e, e2) = [[atom c]]lst. f (x, e, (a \<leftrightarrow> c) \<bullet> e2)" |
| 31 | +proof - |
| 32 | + have 1: "[[atom a]]lst. f (x, e, e2) = [[atom c]]lst. (a \<leftrightarrow> c) \<bullet> f (x, e, e2)" by (rule Abs_lst_rename[OF fresh(1)]) |
| 33 | + have 2: "(a \<leftrightarrow> c) \<bullet> f (x, e, e2) = f (x, e, (a \<leftrightarrow> c) \<bullet> e2)" by (rule eqvt_at_deep[OF fresh(3) fresh(2) eqvt_at]) |
| 34 | + show ?thesis using 1 2 by argo |
| 35 | +qed |
| 36 | + |
| 37 | +lemma Abs_lst_rename_both: |
| 38 | + fixes a c::"'a::at" and e e'::"'b::fs" |
| 39 | + assumes fresh: "atom c \<sharp> (y, e, y', e')" |
| 40 | + and equal: "[[atom y]]lst. e = [[atom y']]lst. e'" |
| 41 | +shows "(y \<leftrightarrow> c) \<bullet> e = (y' \<leftrightarrow> c) \<bullet> e'" |
| 42 | +proof - |
| 43 | + from assms have "(y \<leftrightarrow> c) \<bullet> ([[atom y]]lst. e) = (y' \<leftrightarrow> c) \<bullet> ([[atom y']]lst. e')" by auto |
| 44 | + then have "[[atom c]]lst. (y \<leftrightarrow> c) \<bullet> e = [[atom c]]lst. (y' \<leftrightarrow> c) \<bullet> e'" by auto |
| 45 | + then show ?thesis using Abs1_eq(3) by blast |
| 46 | +qed |
| 47 | + |
| 48 | +lemma Abs_sumC: |
| 49 | + fixes y y'::"'a::at" and x x'::"'b::fs" and e e'::"'c::fs" and e2 e2'::"'d::fs" and f::"'b * 'c * 'd \<Rightarrow> 'e::fs" |
| 50 | + assumes fresh: "atom y \<sharp> (x, e)" "atom y' \<sharp> (x', e')" |
| 51 | + and eqvt_at: "eqvt_at f (x, e, e2)" "eqvt_at f (x', e', e2')" |
| 52 | + and equal: "[[atom y]]lst. e2 = [[atom y']]lst. e2'" "x = x'" "e = e'" |
| 53 | + shows "[[atom y]]lst. f (x, e, e2) = [[atom y']]lst. f (x', e', e2')" |
| 54 | +proof - |
| 55 | + obtain c::"'a" where "atom c \<sharp> (y, y', e, e', x, x', e2, e2', f (x, e, e2), f (x', e', e2'))" using obtain_fresh by blast |
| 56 | + then have c: "atom c \<sharp> f (x, e, e2)" "atom c \<sharp> (x, e)" "atom c \<sharp> f (x', e', e2')" "atom c \<sharp> (x', e')" "atom c \<sharp> (y, e2, y', e2')" using fresh_Pair by auto |
| 57 | + |
| 58 | + have 1: "[[atom y]]lst. f (x, e, e2) = [[atom c]]lst. f (x, e, (y \<leftrightarrow> c) \<bullet> e2)" by (rule Abs_lst_rename_deep[OF c(1) c(2) fresh(1) eqvt_at(1)]) |
| 59 | + have 2: "[[atom y']]lst. f (x', e', e2') = [[atom c]]lst. f (x', e', (y' \<leftrightarrow> c) \<bullet> e2')" by (rule Abs_lst_rename_deep[OF c(3) c(4) fresh(2) eqvt_at(2)]) |
| 60 | + have 3: "(y \<leftrightarrow> c) \<bullet> e2 = (y' \<leftrightarrow> c) \<bullet> e2'" by (rule Abs_lst_rename_both[OF c(5) equal(1)]) |
| 61 | + |
| 62 | + show ?thesis using 1 2 3 equal by argo |
| 63 | +qed |
| 64 | + |
| 65 | +end |
0 commit comments