| author | Cezary Kaliszyk <kaliszyk@in.tum.de> | 
| Thu, 25 Nov 2010 15:06:45 +0900 | |
| changeset 2578 | 64abcfddb0c1 | 
| parent 2577 | d8a676a69047 | 
| child 2579 | dc988b07755e | 
| permissions | -rw-r--r-- | 
| 2573 | 1 | theory Foo2 | 
| 2 | imports "../Nominal2" | |
| 3 | begin | |
| 4 | ||
| 5 | (* | |
| 6 | Contrived example that has more than one | |
| 7 | binding clause | |
| 8 | *) | |
| 9 | ||
| 10 | atom_decl name | |
| 11 | ||
| 12 | nominal_datatype foo: trm = | |
| 13 | Var "name" | |
| 14 | | App "trm" "trm" | |
| 15 | | Lam x::"name" t::"trm" bind x in t | |
| 16 | | Let1 a1::"assg" t1::"trm" a2::"assg" t2::"trm" bind "bn a1" in t1, bind "bn a2" in t2 | |
| 17 | | Let2 x::"name" y::"name" t1::"trm" t2::"trm" bind x y in t1, bind y in t2 | |
| 18 | and assg = | |
| 19 | As_Nil | |
| 20 | | As "name" x::"name" t::"trm" "assg" | |
| 21 | binder | |
| 22 | bn::"assg \<Rightarrow> atom list" | |
| 23 | where | |
| 24 | "bn (As x y t a) = [atom x] @ bn a" | |
| 25 | | "bn (As_Nil) = []" | |
| 26 | ||
| 27 | thm foo.perm_bn_simps | |
| 28 | ||
| 29 | ||
| 30 | thm foo.distinct | |
| 31 | thm foo.induct | |
| 32 | thm foo.inducts | |
| 33 | thm foo.exhaust | |
| 34 | thm foo.fv_defs | |
| 35 | thm foo.bn_defs | |
| 36 | thm foo.perm_simps | |
| 2575 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 37 | thm foo.eq_iff(5) | 
| 2573 | 38 | thm foo.fv_bn_eqvt | 
| 39 | thm foo.size_eqvt | |
| 40 | thm foo.supports | |
| 41 | thm foo.fsupp | |
| 42 | thm foo.supp | |
| 43 | thm foo.fresh | |
| 44 | ||
| 45 | lemma uu1: | |
| 46 | shows "alpha_bn as (permute_bn p as)" | |
| 47 | apply(induct as rule: foo.inducts(2)) | |
| 48 | apply(auto)[5] | |
| 49 | apply(simp add: foo.perm_bn_simps) | |
| 50 | apply(simp add: foo.eq_iff) | |
| 51 | apply(simp add: foo.perm_bn_simps) | |
| 52 | apply(simp add: foo.eq_iff) | |
| 53 | done | |
| 54 | ||
| 55 | lemma tt1: | |
| 56 | shows "(p \<bullet> bn as) = bn (permute_bn p as)" | |
| 57 | apply(induct as rule: foo.inducts(2)) | |
| 58 | apply(auto)[5] | |
| 59 | apply(simp add: foo.perm_bn_simps foo.bn_defs) | |
| 60 | apply(simp add: foo.perm_bn_simps foo.bn_defs) | |
| 61 | apply(simp add: atom_eqvt) | |
| 62 | done | |
| 63 | ||
| 64 | ||
| 65 | lemma Let1_rename: | |
| 66 | assumes "supp ([bn assn1]lst. trm1) \<sharp>* p" "supp ([bn assn2]lst. trm2) \<sharp>* p" | |
| 67 | shows "Let1 assn1 trm1 assn2 trm2 = Let1 (permute_bn p assn1) (p \<bullet> trm1) (permute_bn p assn2) (p \<bullet> trm2)" | |
| 68 | using assms | |
| 69 | apply - | |
| 70 | apply(drule supp_perm_eq[symmetric]) | |
| 71 | apply(drule supp_perm_eq[symmetric]) | |
| 72 | apply(simp only: permute_Abs) | |
| 73 | apply(simp only: tt1) | |
| 74 | apply(simp only: foo.eq_iff) | |
| 75 | apply(simp add: uu1) | |
| 76 | done | |
| 77 | ||
| 2575 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 78 | lemma Let2_rename: | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 79 | assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p" and "(supp ([[atom y]]lst. t2)) \<sharp>* p" | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 80 | shows "Let2 x y t1 t2 = Let2 (p \<bullet> x) (p \<bullet> y) (p \<bullet> t1) (p \<bullet> t2)" | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 81 | using assms | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 82 | apply - | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 83 | apply(drule supp_perm_eq[symmetric]) | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 84 | apply(drule supp_perm_eq[symmetric]) | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 85 | apply(simp only: foo.eq_iff) | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 86 | apply(simp only: eqvts) | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 87 | apply simp | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 88 | done | 
| 
b1d38940040a
single rename in let2
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2573diff
changeset | 89 | |
| 2576 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 90 | lemma Let2_rename2: | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 91 | assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p" and "(atom y) \<sharp> p" | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 92 | shows "Let2 x y t1 t2 = Let2 (p \<bullet> x) y (p \<bullet> t1) t2" | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 93 | using assms | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 94 | apply - | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 95 | apply(drule supp_perm_eq[symmetric]) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 96 | apply(simp only: foo.eq_iff) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 97 | apply(simp only: eqvts) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 98 | apply simp | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 99 | by (metis assms(2) atom_eqvt fresh_perm) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 100 | |
| 2577 | 101 | lemma Let2_rename3: | 
| 102 | assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p" | |
| 103 | and "(supp ([[atom y]]lst. t2)) \<sharp>* p" | |
| 104 | and "(atom x) \<sharp> p" | |
| 105 | shows "Let2 x y t1 t2 = Let2 x (p \<bullet> y) (p \<bullet> t1) (p \<bullet> t2)" | |
| 106 | using assms | |
| 107 | apply - | |
| 108 | apply(drule supp_perm_eq[symmetric]) | |
| 109 | apply(drule supp_perm_eq[symmetric]) | |
| 110 | apply(simp only: foo.eq_iff) | |
| 111 | apply(simp only: eqvts) | |
| 112 | apply simp | |
| 113 | by (metis assms(2) atom_eqvt fresh_perm) | |
| 114 | ||
| 2578 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 115 | lemma strong_exhaust1_pre: | 
| 2573 | 116 | fixes c::"'a::fs" | 
| 117 | assumes "\<And>name. y = Var name \<Longrightarrow> P" | |
| 118 | and "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" | |
| 119 |   and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
 | |
| 120 | and "\<And>assn1 trm1 assn2 trm2. | |
| 121 | \<lbrakk>((set (bn assn1)) \<union> (set (bn assn2))) \<sharp>* c; y = Let1 assn1 trm1 assn2 trm2\<rbrakk> \<Longrightarrow> P" | |
| 2576 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 122 |   and     "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
 | 
| 2573 | 123 | shows "P" | 
| 124 | apply(rule_tac y="y" in foo.exhaust(1)) | |
| 125 | apply(rule assms(1)) | |
| 126 | apply(assumption) | |
| 127 | apply(rule assms(2)) | |
| 128 | apply(assumption) | |
| 129 | apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q")
 | |
| 130 | apply(erule exE) | |
| 131 | apply(erule conjE) | |
| 132 | apply(rule assms(3)) | |
| 133 | apply(perm_simp) | |
| 134 | apply(assumption) | |
| 135 | apply(simp) | |
| 136 | apply(drule supp_perm_eq[symmetric]) | |
| 137 | apply(perm_simp) | |
| 138 | apply(simp) | |
| 139 | apply(rule at_set_avoiding2) | |
| 140 | apply(simp add: finite_supp) | |
| 141 | apply(simp add: finite_supp) | |
| 142 | apply(simp add: finite_supp) | |
| 143 | apply(simp add: foo.fresh fresh_star_def) | |
| 144 | apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn assg1))) \<sharp>* c \<and> supp ([bn assg1]lst. trm1) \<sharp>* q") | |
| 145 | apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn assg2))) \<sharp>* c \<and> supp ([bn assg2]lst. trm2) \<sharp>* q") | |
| 146 | apply(erule exE)+ | |
| 147 | apply(erule conjE)+ | |
| 148 | apply(rule assms(4)) | |
| 149 | apply(simp add: set_eqvt union_eqvt) | |
| 150 | apply(simp add: tt1) | |
| 151 | apply(simp add: fresh_star_union) | |
| 152 | apply(rule conjI) | |
| 153 | apply(assumption) | |
| 154 | apply(rotate_tac 3) | |
| 155 | apply(assumption) | |
| 156 | apply(simp add: foo.eq_iff) | |
| 157 | apply(drule supp_perm_eq[symmetric])+ | |
| 158 | apply(simp add: tt1 uu1) | |
| 159 | apply(auto)[1] | |
| 160 | apply(rule at_set_avoiding2) | |
| 161 | apply(simp add: finite_supp) | |
| 162 | apply(simp add: finite_supp) | |
| 163 | apply(simp add: finite_supp) | |
| 164 | apply(simp add: Abs_fresh_star) | |
| 165 | apply(rule at_set_avoiding2) | |
| 166 | apply(simp add: finite_supp) | |
| 167 | apply(simp add: finite_supp) | |
| 168 | apply(simp add: finite_supp) | |
| 169 | apply(simp add: Abs_fresh_star) | |
| 2576 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 170 | apply(case_tac "name1 = name2") | 
| 2573 | 171 | apply(subgoal_tac | 
| 2576 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 172 |   "\<exists>q. (q \<bullet> {atom name1, atom name2}) \<sharp>* c \<and> (supp (([[atom name1, atom name2]]lst. trm1), ([[atom name2]]lst. trm2))) \<sharp>* q")
 | 
| 2573 | 173 | apply(erule exE)+ | 
| 174 | apply(erule conjE)+ | |
| 175 | apply(perm_simp) | |
| 2576 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 176 | apply(rule assms(5)) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 177 | |
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 178 | apply (simp add: fresh_star_def eqvts) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 179 | apply (simp only: supp_Pair) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 180 | apply (simp only: fresh_star_Un_elim) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 181 | apply (subst Let2_rename) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 182 | apply assumption | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 183 | apply assumption | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 184 | apply (rule refl) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 185 | apply(rule at_set_avoiding2) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 186 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 187 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 188 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 189 | apply clarify | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 190 | apply (simp add: fresh_star_def) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 191 | apply (simp add: fresh_def supp_Pair supp_Abs) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 192 | apply(subgoal_tac | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 193 |   "\<exists>q. (q \<bullet> {atom name1}) \<sharp>* c \<and> (supp ((([[atom name1, atom name2]]lst. trm1)), (atom name2))) \<sharp>* q")
 | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 194 | prefer 2 | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 195 | apply(rule at_set_avoiding2) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 196 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 197 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 198 | apply(simp add: finite_supp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 199 | apply (simp add: fresh_star_def) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 200 | apply (simp add: fresh_def supp_Pair supp_Abs supp_atom) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 201 | apply(erule exE)+ | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 202 | apply(erule conjE)+ | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 203 | apply(perm_simp) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 204 | apply(rule assms(5)) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 205 | apply assumption | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 206 | apply clarify | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 207 | apply (rule_tac x="name1" and y="name2" and ?t1.0="trm1" and ?t2.0="trm2" in Let2_rename2) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 208 | apply (simp_all add: fresh_star_Un_elim supp_Pair supp_Abs) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 209 | apply (simp add: fresh_star_def supp_atom) | 
| 
67828f23c4e9
Foo2 strong_exhaust for first variable.
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2575diff
changeset | 210 | done | 
| 2573 | 211 | |
| 2578 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 212 | lemma strong_exhaust1: | 
| 2577 | 213 | fixes c::"'a::fs" | 
| 214 | assumes "\<And>name. y = Var name \<Longrightarrow> P" | |
| 215 | and "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" | |
| 216 |   and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
 | |
| 217 | and "\<And>assn1 trm1 assn2 trm2. | |
| 218 | \<lbrakk>((set (bn assn1)) \<union> (set (bn assn2))) \<sharp>* c; y = Let1 assn1 trm1 assn2 trm2\<rbrakk> \<Longrightarrow> P" | |
| 219 |   and     "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1, atom x2} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
 | |
| 220 | shows "P" | |
| 2578 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 221 | apply (rule strong_exhaust1_pre) | 
| 2577 | 222 | apply (erule assms) | 
| 223 | apply (erule assms) | |
| 224 | apply (erule assms) apply assumption | |
| 225 | apply (erule assms) apply assumption | |
| 226 | apply(case_tac "x1 = x2") | |
| 227 | apply(subgoal_tac | |
| 228 |   "\<exists>q. (q \<bullet> {atom x1, atom x2}) \<sharp>* c \<and> (supp (([[atom x1, atom x2]]lst. trm1), ([[atom x2]]lst. trm2))) \<sharp>* q")
 | |
| 229 | apply(erule exE)+ | |
| 230 | apply(erule conjE)+ | |
| 231 | apply(perm_simp) | |
| 232 | apply(rule assms(5)) | |
| 233 | apply assumption | |
| 234 | apply simp | |
| 235 | apply (rule Let2_rename) | |
| 236 | apply (simp only: supp_Pair) | |
| 237 | apply (simp only: fresh_star_Un_elim) | |
| 238 | apply (simp only: supp_Pair) | |
| 239 | apply (simp only: fresh_star_Un_elim) | |
| 240 | apply(rule at_set_avoiding2) | |
| 241 | apply(simp add: finite_supp) | |
| 242 | apply(simp add: finite_supp) | |
| 243 | apply(simp add: finite_supp) | |
| 244 | apply clarify | |
| 245 | apply (simp add: fresh_star_def) | |
| 246 | apply (simp add: fresh_def supp_Pair supp_Abs) | |
| 247 | ||
| 248 | apply(subgoal_tac | |
| 249 |     "\<exists>q. (q \<bullet> {atom x2}) \<sharp>* c \<and> supp (([[atom x2]]lst. trm2), ([[atom x1, atom x2]]lst. trm1), (atom x1)) \<sharp>* q")
 | |
| 250 | apply(erule exE)+ | |
| 251 | apply(erule conjE)+ | |
| 252 | apply(rule assms(5)) | |
| 253 | apply(perm_simp) | |
| 254 | apply(simp (no_asm) add: fresh_star_insert) | |
| 255 | apply(rule conjI) | |
| 256 | apply (simp add: fresh_star_def) | |
| 257 | apply(rotate_tac 2) | |
| 258 | apply(simp add: fresh_star_def) | |
| 259 | apply(simp) | |
| 260 | apply (rule Let2_rename3) | |
| 261 | apply (simp add: supp_Pair fresh_star_union) | |
| 262 | apply (simp add: supp_Pair fresh_star_union) | |
| 263 | apply (simp add: supp_Pair fresh_star_union) | |
| 264 | apply clarify | |
| 265 | apply (simp add: fresh_star_def supp_atom) | |
| 266 | apply(rule at_set_avoiding2) | |
| 267 | apply(simp add: finite_supp) | |
| 268 | apply(simp add: finite_supp) | |
| 269 | apply(simp add: finite_supp) | |
| 270 | apply(simp add: fresh_star_def) | |
| 271 | apply (simp add: fresh_def supp_Pair supp_Abs supp_atom) | |
| 272 | done | |
| 2573 | 273 | |
| 2578 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 274 | lemma strong_induct: | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 275 | fixes c :: "'a :: fs" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 276 | and assg :: assg and trm :: trm | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 277 | assumes a0: "\<And>name c. P1 c (Var name)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 278 | and a1: "\<And>trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (App trm1 trm2)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 279 | and a2: "\<And>name trm c. (\<And>d. P1 d trm) \<Longrightarrow> P1 c (Lam name trm)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 280 | and a3: "\<And>assg1 trm1 assg2 trm2 c. \<lbrakk>\<And>d. P2 c assg1; \<And>d. P1 d trm1; \<And>d. P2 d assg2; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Let1 assg1 trm1 assg2 trm2)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 281 | and a4: "\<And>name1 name2 trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Let2 name1 name2 trm1 trm2)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 282 | and a5: "\<And>c. P2 c As_Nil" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 283 | and a6: "\<And>name1 name2 trm assg c. \<lbrakk>\<And>d. P1 d trm; \<And>d. P2 d assg\<rbrakk> \<Longrightarrow> P2 c (As name1 name2 trm assg)" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 284 | shows "P1 c trm" "P2 c assg" | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 285 | using assms | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 286 | apply(induction_schema) | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 287 | apply(rule_tac y="trm" and c="c" in strong_exhaust1) | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 288 | apply(simp_all)[5] | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 289 | apply(rule_tac y="assg" in foo.exhaust(2)) | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 290 | apply(simp_all)[2] | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 291 | apply(relation "measure (sum_case (size o snd) (\<lambda>y. size (snd y)))") | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 292 | apply(simp_all add: foo.size) | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 293 | done | 
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 294 | |
| 
64abcfddb0c1
foo2 strong induction
 Cezary Kaliszyk <kaliszyk@in.tum.de> parents: 
2577diff
changeset | 295 | |
| 2573 | 296 | end | 
| 297 | ||
| 298 | ||
| 299 |