LamEx.thy
changeset 567 5dffcd087e30
parent 545 95371a8b17e1
child 570 6a031829319a
child 573 14682786c356
equal deleted inserted replaced
566:4eca2c3e59f7 567:5dffcd087e30
   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 *})
   193 done
   195 done
   194 
   196 
   195 lemma fv_app: "fv (App (x\<Colon>lam) (xa\<Colon>lam)) = fv x \<union> fv xa"
   197 lemma fv_app: "fv (App (x\<Colon>lam) (xa\<Colon>lam)) = fv x \<union> fv xa"
   196 apply (tactic {* lift_tac_lam @{context} @{thm rfv_app} 1 *})
   198 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 *})
   197 done
   201 done
   198 
   202 
   199 lemma fv_lam: "fv (Lam (a\<Colon>name) (x\<Colon>lam)) = fv x - {a}"
   203 lemma fv_lam: "fv (Lam (a\<Colon>name) (x\<Colon>lam)) = fv x - {a}"
   200 apply (tactic {* lift_tac_lam @{context} @{thm rfv_lam} 1 *})
   204 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 *})
   201 done
   207 done
   202 
   208 
   203 lemma a1: "(a\<Colon>name) = (b\<Colon>name) \<Longrightarrow> Var a = Var b"
   209 lemma a1: "(a\<Colon>name) = (b\<Colon>name) \<Longrightarrow> Var a = Var b"
   204 apply (tactic {* lift_tac_lam @{context} @{thm a1} 1 *})
   210 apply (tactic {* lift_tac_lam @{context} @{thm a1} 1 *})
   205 done
   211 done
   208 apply (tactic {* lift_tac_lam @{context} @{thm a2} 1 *})
   214 apply (tactic {* lift_tac_lam @{context} @{thm a2} 1 *})
   209 done
   215 done
   210 
   216 
   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"
   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"
   212 apply (tactic {* lift_tac_lam @{context} @{thm a3} 1 *})
   218 apply (tactic {* lift_tac_lam @{context} @{thm a3} 1 *})
       
   219 apply (unfold fv_def[simplified id_simps])
       
   220 apply (tactic {* clean_tac @{context} 1 *})
   213 done
   221 done
   214 
   222 
   215 lemma alpha_cases: "\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<rbrakk> \<Longrightarrow> P;
   223 lemma alpha_cases: "\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<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;
   224      \<And>x xa xb xc. \<lbrakk>a1 = App x xb; a2 = App xa xc; x = xa; xb = xc\<rbrakk> \<Longrightarrow> P;
   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>
   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>
   218     \<Longrightarrow> P"
   226     \<Longrightarrow> P"
   219 apply (tactic {* lift_tac_lam @{context} @{thm alpha.cases} 1 *})
   227 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 *})
   220 done
   230 done
   221 
   231 
   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);
   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);
   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);
   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);
   224      \<And>(x\<Colon>lam) (a\<Colon>name) (b\<Colon>name) xa\<Colon>lam.
   234      \<And>(x\<Colon>lam) (a\<Colon>name) (b\<Colon>name) xa\<Colon>lam.
   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>
   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>
   226     \<Longrightarrow> qxb qx qxa"
   236     \<Longrightarrow> qxb qx qxa"
   227 apply (tactic {* lift_tac_lam @{context} @{thm alpha.induct} 1 *})
   237 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 *})
   228 done
   240 done
   229 
   241 
   230 lemma var_inject: "(Var a = Var b) = (a = b)"
   242 lemma var_inject: "(Var a = Var b) = (a = b)"
   231 apply (tactic {* lift_tac_lam @{context} @{thm rvar_inject} 1 *})
   243 apply (tactic {* lift_tac_lam @{context} @{thm rvar_inject} 1 *})
   232 done
   244 done