src/HOL/Nominal/Examples/Lam_Funs.thy
changeset 26966 071f40487734
parent 26764 805eece49928
child 29097 68245155eb58
equal deleted inserted replaced
26965:003b5781b845 26966:071f40487734
    59   using the build in notion of support.
    59   using the build in notion of support.
    60 *}
    60 *}
    61 
    61 
    62 lemma frees_equals_support:
    62 lemma frees_equals_support:
    63   shows "frees t = supp t"
    63   shows "frees t = supp t"
    64 by (nominal_induct t rule: lam.induct)
    64 by (nominal_induct t rule: lam.strong_induct)
    65    (simp_all add: lam.supp supp_atm abs_supp)
    65    (simp_all add: lam.supp supp_atm abs_supp)
    66 
    66 
    67 text {* Parallel and single capture-avoiding substitution. *}
    67 text {* Parallel and single capture-avoiding substitution. *}
    68 
    68 
    69 fun
    69 fun
    94 
    94 
    95 lemma psubst_eqvt[eqvt]:
    95 lemma psubst_eqvt[eqvt]:
    96   fixes pi::"name prm" 
    96   fixes pi::"name prm" 
    97   and   t::"lam"
    97   and   t::"lam"
    98   shows "pi\<bullet>(\<theta><t>) = (pi\<bullet>\<theta>)<(pi\<bullet>t)>"
    98   shows "pi\<bullet>(\<theta><t>) = (pi\<bullet>\<theta>)<(pi\<bullet>t)>"
    99 by (nominal_induct t avoiding: \<theta> rule: lam.induct)
    99 by (nominal_induct t avoiding: \<theta> rule: lam.strong_induct)
   100    (simp_all add: eqvts fresh_bij)
   100    (simp_all add: eqvts fresh_bij)
   101 
   101 
   102 abbreviation 
   102 abbreviation 
   103   subst :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_[_::=_]" [100,100,100] 100)
   103   subst :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_[_::=_]" [100,100,100] 100)
   104 where 
   104 where 
   110   and   "x\<sharp>(y,t') \<Longrightarrow> (Lam [x].t)[y::=t'] = Lam [x].(t[y::=t'])"
   110   and   "x\<sharp>(y,t') \<Longrightarrow> (Lam [x].t)[y::=t'] = Lam [x].(t[y::=t'])"
   111 by (simp_all add: fresh_list_cons fresh_list_nil)
   111 by (simp_all add: fresh_list_cons fresh_list_nil)
   112 
   112 
   113 lemma subst_supp: 
   113 lemma subst_supp: 
   114   shows "supp(t1[a::=t2]) \<subseteq> (((supp(t1)-{a})\<union>supp(t2))::name set)"
   114   shows "supp(t1[a::=t2]) \<subseteq> (((supp(t1)-{a})\<union>supp(t2))::name set)"
   115 apply(nominal_induct t1 avoiding: a t2 rule: lam.induct)
   115 apply(nominal_induct t1 avoiding: a t2 rule: lam.strong_induct)
   116 apply(auto simp add: lam.supp supp_atm fresh_prod abs_supp)
   116 apply(auto simp add: lam.supp supp_atm fresh_prod abs_supp)
   117 apply(blast)+
   117 apply(blast)+
   118 done
   118 done
   119 
   119 
   120 text {* 
   120 text {* 
   152   "(CLam [x].E) \<circ> E' = CLam [x].(E \<circ> E')"
   152   "(CLam [x].E) \<circ> E' = CLam [x].(E \<circ> E')"
   153 by (rule TrueI)+
   153 by (rule TrueI)+
   154   
   154   
   155 lemma clam_compose:
   155 lemma clam_compose:
   156   shows "(E1 \<circ> E2)\<lbrakk>t\<rbrakk> = E1\<lbrakk>E2\<lbrakk>t\<rbrakk>\<rbrakk>"
   156   shows "(E1 \<circ> E2)\<lbrakk>t\<rbrakk> = E1\<lbrakk>E2\<lbrakk>t\<rbrakk>\<rbrakk>"
   157 by (induct E1 rule: clam.weak_induct) (auto)
   157 by (induct E1 rule: clam.induct) (auto)
   158 
   158 
   159 end
   159 end