Quot/Nominal/Nominal2_Base.thy
changeset 1008 7c633507a809
parent 947 fa810f01f7b5
child 1013 e63838c26f28
equal deleted inserted replaced
1007:b4f956137114 1008:7c633507a809
   458 
   458 
   459 instance
   459 instance
   460 by default auto
   460 by default auto
   461 
   461 
   462 end
   462 end
   463 
       
   464 
   463 
   465 subsection {* Permutations for sums *}
   464 subsection {* Permutations for sums *}
   466 
   465 
   467 instantiation "+" :: (pt, pt) pt
   466 instantiation "+" :: (pt, pt) pt
   468 begin
   467 begin
   881 apply default
   880 apply default
   882 apply (induct_tac x)
   881 apply (induct_tac x)
   883 apply (simp add: supp_Pair finite_supp)
   882 apply (simp add: supp_Pair finite_supp)
   884 done
   883 done
   885 
   884 
   886 
       
   887 subsection {* Type @{typ "'a + 'b"} is finitely supported *}
   885 subsection {* Type @{typ "'a + 'b"} is finitely supported *}
   888 
   886 
   889 lemma supp_Inl: 
   887 lemma supp_Inl: 
   890   shows "supp (Inl x) = supp x"
   888   shows "supp (Inl x) = supp x"
   891   by (simp add: supp_def)
   889   by (simp add: supp_def)
   954 apply default
   952 apply default
   955 apply (induct_tac x)
   953 apply (induct_tac x)
   956 apply (simp_all add: supp_Nil supp_Cons finite_supp)
   954 apply (simp_all add: supp_Nil supp_Cons finite_supp)
   957 done
   955 done
   958 
   956 
   959 end
   957 
       
   958 section {* support and freshness for applications *}
       
   959 
       
   960 lemma supp_fun_app:
       
   961   shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)"
       
   962 proof (rule subsetCI)
       
   963   fix a::"atom"
       
   964   assume a: "a \<in> supp (f x)"
       
   965   assume b: "a \<notin> supp f \<union> supp x"
       
   966   then have "finite {b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f}" "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" 
       
   967     unfolding supp_def by auto
       
   968   then have "finite ({b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f} \<union> {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x})" by simp
       
   969   moreover 
       
   970   have "{b. ((a \<rightleftharpoons> b) \<bullet> f) ((a \<rightleftharpoons> b) \<bullet> x) \<noteq> f x} \<subseteq> ({b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f} \<union> {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x})"
       
   971     by auto
       
   972   ultimately have "finite {b. ((a \<rightleftharpoons> b) \<bullet> f) ((a \<rightleftharpoons> b) \<bullet> x) \<noteq> f x}"
       
   973     using finite_subset by auto
       
   974   then have "a \<notin> supp (f x)" unfolding supp_def
       
   975     by (simp add: permute_fun_app_eq)
       
   976   with a show "False" by simp
       
   977 qed
       
   978     
       
   979 lemma fresh_fun_app:
       
   980   shows "a \<sharp> (f, x) \<Longrightarrow> a \<sharp> f x"
       
   981 unfolding fresh_def
       
   982 using supp_fun_app
       
   983 by (auto simp add: supp_Pair)
       
   984 
       
   985 lemma fresh_fun_eqvt_app:
       
   986   assumes a: "\<forall>p. p \<bullet> f = f"
       
   987   shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
       
   988 proof -
       
   989   from a have b: "supp f = {}"
       
   990     unfolding supp_def by simp
       
   991   show "a \<sharp> x \<Longrightarrow> a \<sharp> f x"
       
   992     unfolding fresh_def
       
   993     using supp_fun_app b
       
   994     by auto
       
   995 qed
       
   996 
       
   997 end