LamEx.thy
changeset 573 14682786c356
parent 567 5dffcd087e30
child 574 06e54c862a39
equal deleted inserted replaced
567:5dffcd087e30 573:14682786c356
   188 apply (tactic {* lift_tac_lam @{context} @{thm pi_lam_com} 1 *})
   188 apply (tactic {* lift_tac_lam @{context} @{thm pi_lam_com} 1 *})
   189 done
   189 done
   190 
   190 
   191 lemma fv_var: "fv (Var (a\<Colon>name)) = {a}"
   191 lemma fv_var: "fv (Var (a\<Colon>name)) = {a}"
   192 apply (tactic {* lift_tac_lam @{context} @{thm rfv_var} 1 *})
   192 apply (tactic {* lift_tac_lam @{context} @{thm rfv_var} 1 *})
   193 apply (unfold fv_def[simplified id_simps])
       
   194 apply (tactic {* clean_tac @{context} 1 *})
       
   195 done
   193 done
   196 
   194 
   197 lemma fv_app: "fv (App (x\<Colon>lam) (xa\<Colon>lam)) = fv x \<union> fv xa"
   195 lemma fv_app: "fv (App (x\<Colon>lam) (xa\<Colon>lam)) = fv x \<union> fv xa"
   198 apply (tactic {* lift_tac_lam @{context} @{thm rfv_app} 1 *})
   196 apply (tactic {* lift_tac_lam @{context} @{thm rfv_app} 1 *})
   199 apply (unfold fv_def[simplified id_simps])
       
   200 apply (tactic {* clean_tac @{context} 1 *})
       
   201 done
   197 done
   202 
   198 
   203 lemma fv_lam: "fv (Lam (a\<Colon>name) (x\<Colon>lam)) = fv x - {a}"
   199 lemma fv_lam: "fv (Lam (a\<Colon>name) (x\<Colon>lam)) = fv x - {a}"
   204 apply (tactic {* lift_tac_lam @{context} @{thm rfv_lam} 1 *})
   200 apply (tactic {* lift_tac_lam @{context} @{thm rfv_lam} 1 *})
   205 apply (unfold fv_def[simplified id_simps])
       
   206 apply (tactic {* clean_tac @{context} 1 *})
       
   207 done
   201 done
   208 
   202 
   209 lemma a1: "(a\<Colon>name) = (b\<Colon>name) \<Longrightarrow> Var a = Var b"
   203 lemma a1: "(a\<Colon>name) = (b\<Colon>name) \<Longrightarrow> Var a = Var b"
   210 apply (tactic {* lift_tac_lam @{context} @{thm a1} 1 *})
   204 apply (tactic {* lift_tac_lam @{context} @{thm a1} 1 *})
   211 done
   205 done
   214 apply (tactic {* lift_tac_lam @{context} @{thm a2} 1 *})
   208 apply (tactic {* lift_tac_lam @{context} @{thm a2} 1 *})
   215 done
   209 done
   216 
   210 
   217 lemma a3: "\<lbrakk>(x\<Colon>lam) = [(a\<Colon>name, b\<Colon>name)] \<bullet> (xa\<Colon>lam); a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> Lam a x = Lam b xa"
   211 lemma a3: "\<lbrakk>(x\<Colon>lam) = [(a\<Colon>name, b\<Colon>name)] \<bullet> (xa\<Colon>lam); a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> Lam a x = Lam b xa"
   218 apply (tactic {* lift_tac_lam @{context} @{thm a3} 1 *})
   212 apply (tactic {* lift_tac_lam @{context} @{thm a3} 1 *})
   219 apply (unfold fv_def[simplified id_simps])
       
   220 apply (tactic {* clean_tac @{context} 1 *})
       
   221 done
   213 done
   222 
   214 
   223 lemma alpha_cases: "\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<rbrakk> \<Longrightarrow> P;
   215 lemma alpha_cases: "\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<rbrakk> \<Longrightarrow> P;
   224      \<And>x xa xb xc. \<lbrakk>a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\<rbrakk> \<Longrightarrow> P;
   216      \<And>x xa xb xc. \<lbrakk>a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\<rbrakk> \<Longrightarrow> P;
   225      \<And>x a b xa. \<lbrakk>a1 = Lam a x; a2 = Lam b xa; x = [(a, b)] \<bullet> xa; a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> P\<rbrakk>
   217      \<And>x a b xa. \<lbrakk>a1 = Lam a x; a2 = Lam b xa; x = [(a, b)] \<bullet> xa; a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> P\<rbrakk>
   226     \<Longrightarrow> P"
   218     \<Longrightarrow> P"
   227 apply (tactic {* lift_tac_lam @{context} @{thm alpha.cases} 1 *})
   219 apply (tactic {* lift_tac_lam @{context} @{thm alpha.cases} 1 *})
   228 apply (unfold fv_def[simplified id_simps])
       
   229 apply (tactic {* clean_tac @{context} 1 *})
       
   230 done
   220 done
   231 
   221 
   232 lemma alpha_induct: "\<lbrakk>(qx\<Colon>lam) = (qxa\<Colon>lam); \<And>(a\<Colon>name) b\<Colon>name. a = b \<Longrightarrow> (qxb\<Colon>lam \<Rightarrow> lam \<Rightarrow> bool) (Var a) (Var b);
   222 lemma alpha_induct: "\<lbrakk>(qx\<Colon>lam) = (qxa\<Colon>lam); \<And>(a\<Colon>name) b\<Colon>name. a = b \<Longrightarrow> (qxb\<Colon>lam \<Rightarrow> lam \<Rightarrow> bool) (Var a) (Var b);
   233      \<And>(x\<Colon>lam) (xa\<Colon>lam) (xb\<Colon>lam) xc\<Colon>lam. \<lbrakk>x = xa; qxb x xa; xb = xc; qxb xb xc\<rbrakk> \<Longrightarrow> qxb (App x xb) (App xa xc);
   223      \<And>(x\<Colon>lam) (xa\<Colon>lam) (xb\<Colon>lam) xc\<Colon>lam. \<lbrakk>x = xa; qxb x xa; xb = xc; qxb xb xc\<rbrakk> \<Longrightarrow> qxb (App x xb) (App xa xc);
   234      \<And>(x\<Colon>lam) (a\<Colon>name) (b\<Colon>name) xa\<Colon>lam.
   224      \<And>(x\<Colon>lam) (a\<Colon>name) (b\<Colon>name) xa\<Colon>lam.
   235         \<lbrakk>x = [(a, b)] \<bullet> xa; qxb x ([(a, b)] \<bullet> xa); a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> qxb (Lam a x) (Lam b xa)\<rbrakk>
   225         \<lbrakk>x = [(a, b)] \<bullet> xa; qxb x ([(a, b)] \<bullet> xa); a \<notin> fv (Lam b x)\<rbrakk> \<Longrightarrow> qxb (Lam a x) (Lam b xa)\<rbrakk>
   236     \<Longrightarrow> qxb qx qxa"
   226     \<Longrightarrow> qxb qx qxa"
   237 apply (tactic {* lift_tac_lam @{context} @{thm alpha.induct} 1 *})
   227 apply (tactic {* lift_tac_lam @{context} @{thm alpha.induct} 1 *})
   238 apply (unfold fv_def[simplified id_simps])
       
   239 apply (tactic {* clean_tac @{context} 1 *})
       
   240 done
   228 done
   241 
   229 
   242 lemma var_inject: "(Var a = Var b) = (a = b)"
   230 lemma var_inject: "(Var a = Var b) = (a = b)"
   243 apply (tactic {* lift_tac_lam @{context} @{thm rvar_inject} 1 *})
   231 apply (tactic {* lift_tac_lam @{context} @{thm rvar_inject} 1 *})
   244 done
   232 done