Nominal/Ex/Classical.thy
changeset 2911 567967bc94cc
parent 2910 ae6455351572
child 2913 bc86f5c3bc65
--- a/Nominal/Ex/Classical.thy	Mon Jun 27 19:22:10 2011 +0100
+++ b/Nominal/Ex/Classical.thy	Mon Jun 27 22:51:42 2011 +0100
@@ -46,203 +46,101 @@
 thm trm.supp
 thm trm.supp[simplified]
 
-lemma Abs_lst1_fcb2:
-  fixes a b :: "'a :: at"
-    and S T :: "'b :: fs"
-    and c::"'c::fs"
-  assumes e: "(Abs_lst [atom a] T) = (Abs_lst [atom b] S)"
-  and fcb1: "atom a \<sharp> f a T c"
-  and fresh: "{atom a, atom b} \<sharp>* c"
-  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f a T c) = f (p \<bullet> a) (p \<bullet> T) c"
-  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f b S c) = f (p \<bullet> b) (p \<bullet> S) c"
-  shows "f a T c = f b S c"
-proof -
-  have fcb2: "atom b \<sharp> f b S c"
-    using e[symmetric]
-    apply(simp add: Abs_eq_iff2)
-    apply(erule exE)
-    apply(simp add: alphas)
-    apply(rule_tac p="p" in permute_boolE)
-    apply(simp add: fresh_eqvt)
-    apply(subst perm2)
-    using fresh
-    apply(auto simp add: fresh_star_def)[1]
-    apply(simp add: atom_eqvt)
-    apply(rule fcb1)
-    done
-  have fin1: "finite (supp (f a T c))"
-    apply(rule_tac S="supp (a, T, c)" in supports_finite)
-    apply(simp add: supports_def)
-    apply(simp add: fresh_def[symmetric])
-    apply(clarify)
-    apply(subst perm1)
-    apply(simp add: supp_swap fresh_star_def)
-    apply(simp add: swap_fresh_fresh fresh_Pair)
-    apply(simp add: finite_supp)
-    done
-  have fin2: "finite (supp (f b S c))"
-    apply(rule_tac S="supp (b, S, c)" in supports_finite)
-    apply(simp add: supports_def)
-    apply(simp add: fresh_def[symmetric])
-    apply(clarify)
-    apply(subst perm2)
-    apply(simp add: supp_swap fresh_star_def)
-    apply(simp add: swap_fresh_fresh fresh_Pair)
-    apply(simp add: finite_supp)
-    done
-  obtain d::"'a::at" where fr: "atom d \<sharp> (a, b, S, T, c, f a T c, f b S c)" 
-    using obtain_fresh'[where x="(a, b, S, T, c, f a T c, f b S c)"]
-    apply(auto simp add: finite_supp supp_Pair fin1 fin2)
-    done
-  have "(a \<leftrightarrow> d) \<bullet> (Abs_lst [atom a] T) = (b \<leftrightarrow> d) \<bullet> (Abs_lst [atom b] S)" 
-    apply(simp (no_asm_use) only: flip_def)
-    apply(subst swap_fresh_fresh)
-    apply(simp add: Abs_fresh_iff)
-    using fr
-    apply(simp add: Abs_fresh_iff)
-    apply(subst swap_fresh_fresh)
-    apply(simp add: Abs_fresh_iff)
-    using fr
-    apply(simp add: Abs_fresh_iff)
-    apply(rule e)
-    done
-  then have "Abs_lst [atom d] ((a \<leftrightarrow> d) \<bullet> T) = Abs_lst [atom d] ((b \<leftrightarrow> d) \<bullet> S)"
-    apply (simp add: swap_atom flip_def)
-    done
-  then have eq: "(a \<leftrightarrow> d) \<bullet> T = (b \<leftrightarrow> d) \<bullet> S"
-    by (simp add: Abs1_eq_iff)
-  have "f a T c = (a \<leftrightarrow> d) \<bullet> f a T c"
-    unfolding flip_def
-    apply(rule sym)
-    apply(rule swap_fresh_fresh)
-    using fcb1 
-    apply(simp)
-    using fr
-    apply(simp add: fresh_Pair)
-    done
-  also have "... = f d ((a \<leftrightarrow> d) \<bullet> T) c"
-    unfolding flip_def
-    apply(subst perm1)
-    using fresh fr
-    apply(simp add: supp_swap fresh_star_def fresh_Pair)
-    apply(simp)
-    done
-  also have "... = f d ((b \<leftrightarrow> d) \<bullet> S) c" using eq by simp
-  also have "... = (b \<leftrightarrow> d) \<bullet> f b S c"
-    unfolding flip_def
-    apply(subst perm2)
-    using fresh fr
-    apply(simp add: supp_swap fresh_star_def fresh_Pair)
-    apply(simp)
-    done
-  also have "... = f b S c"   
-    apply(rule flip_fresh_fresh)
-    using fcb2
-    apply(simp)
-    using fr
-    apply(simp add: fresh_Pair)
-    done
-  finally show ?thesis by simp
-qed
-
 lemma Abs_lst_fcb2:
   fixes as bs :: "atom list"
     and x y :: "'b :: fs"
     and c::"'c::fs"
-  assumes e: "(Abs_lst as x) = (Abs_lst bs y)"
+  assumes eq: "[as]lst. x = [bs]lst. y"
   and fcb1: "(set as) \<sharp>* f as x c"
-  and fcb2: "(set bs) \<sharp>* f bs y c"
   and fresh1: "set as \<sharp>* c"
   and fresh2: "set bs \<sharp>* c"
   and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
   and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
   shows "f as x c = f bs y c"
 proof -
-  have fin1: "finite (supp (f as x c))"
-    apply(rule_tac S="supp (as, x, c)" in supports_finite)
-    apply(simp add: supports_def)
-    apply(simp add: fresh_def[symmetric])
-    apply(clarify)
-    apply(subst perm1)
-    apply(simp add: supp_swap fresh_star_def)
-    apply(simp add: swap_fresh_fresh fresh_Pair)
-    apply(simp add: finite_supp)
-    done
-  have fin2: "finite (supp (f bs y c))"
-    apply(rule_tac S="supp (bs, y, c)" in supports_finite)
-    apply(simp add: supports_def)
-    apply(simp add: fresh_def[symmetric])
-    apply(clarify)
-    apply(subst perm2)
-    apply(simp add: supp_swap fresh_star_def)
-    apply(simp add: swap_fresh_fresh fresh_Pair)
-    apply(simp add: finite_supp)
-    done
+  have "supp (as, x, c) supports (f as x c)"
+    unfolding  supports_def fresh_def[symmetric]
+    by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
+  then have fin1: "finite (supp (f as x c))"
+    by (auto intro: supports_finite simp add: finite_supp)
+  have "supp (bs, y, c) supports (f bs y c)"
+    unfolding  supports_def fresh_def[symmetric]
+    by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
+  then have fin2: "finite (supp (f bs y c))"
+    by (auto intro: supports_finite simp add: finite_supp)
   obtain q::"perm" where 
-    fr1: "(q \<bullet> (set as)) \<sharp>* (as, bs, x, y, c, f as x c, f bs y c)" and 
+    fr1: "(q \<bullet> (set as)) \<sharp>* (x, c, f as x c, f bs y c)" and 
     fr2: "supp q \<sharp>* Abs_lst as x" and 
     inc: "supp q \<subseteq> (set as) \<union> q \<bullet> (set as)"
-    using at_set_avoiding3[where xs="set as" and c="(as, bs, x, y, c, f as x c, f bs y c)" 
-      and x="Abs_lst as x"]
-    apply(simp add: supp_Pair finite_supp fin1 fin2 Abs_fresh_star)
-    apply(erule exE)
-    apply(erule conjE)+
-    apply(drule fresh_star_supp_conv)
-    apply(blast)
-    done
+    using at_set_avoiding3[where xs="set as" and c="(x, c, f as x c, f bs y c)" and x="[as]lst. x"]  
+      fin1 fin2
+    by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
   have "Abs_lst (q \<bullet> as) (q \<bullet> x) = q \<bullet> Abs_lst as x" by simp
   also have "\<dots> = Abs_lst as x"
-    apply(rule perm_supp_eq)
-    apply(simp add: fr2)
-    done
-  finally have "Abs_lst (q \<bullet> as) (q \<bullet> x) = Abs_lst bs y" using e by simp
+    by (simp only: fr2 perm_supp_eq)
+  finally have "Abs_lst (q \<bullet> as) (q \<bullet> x) = Abs_lst bs y" using eq by simp
   then obtain r::perm where 
     qq1: "q \<bullet> x = r \<bullet> y" and 
     qq2: "q \<bullet> as = r \<bullet> bs" and 
-    qq3: "supp r \<subseteq> (set (q \<bullet> as) \<union> set bs)"
-    apply -
+    qq3: "supp r \<subseteq> (q \<bullet> (set as)) \<union> set bs"
     apply(drule_tac sym)
     apply(simp only: Abs_eq_iff2 alphas)
     apply(erule exE)
     apply(erule conjE)+
     apply(drule_tac x="p" in meta_spec)
-    apply(simp)
+    apply(simp add: set_eqvt)
     apply(blast)
     done
-  have "f as x c = q \<bullet> (f as x c)"
-    apply(rule sym)
-    apply(rule perm_supp_eq)
-    using inc fcb1 fr1
-    apply(simp add: set_eqvt)
-    apply(simp add: fresh_star_Pair)
-    apply(auto simp add: fresh_star_def)
+  have "(set as) \<sharp>* f as x c" by (rule fcb1)
+  then have "q \<bullet> ((set as) \<sharp>* f as x c)"
+    by (simp add: permute_bool_def)
+  then have "set (q \<bullet> as) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
+    apply(simp add: fresh_star_eqvt set_eqvt)
+    apply(subst (asm) perm1)
+    using inc fresh1 fr1
+    apply(auto simp add: fresh_star_def fresh_Pair)
     done
+  then have "set (r \<bullet> bs) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
+  then have "r \<bullet> ((set bs) \<sharp>* f bs y c)"
+    apply(simp add: fresh_star_eqvt set_eqvt)
+    apply(subst (asm) perm2[symmetric])
+    using qq3 fresh2 fr1
+    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
+    done
+  then have fcb2: "(set bs) \<sharp>* f bs y c" by (simp add: permute_bool_def)
+  have "f as x c = q \<bullet> (f as x c)"
+    apply(rule perm_supp_eq[symmetric])
+    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
   also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
-    apply(subst perm1)
-    using inc fresh1 fr1
-    apply(simp add: set_eqvt)
-    apply(simp add: fresh_star_Pair)
-    apply(auto simp add: fresh_star_def)
-    done
+    apply(rule perm1)
+    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
   also have "\<dots> = f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
   also have "\<dots> = r \<bullet> (f bs y c)"
-    apply(rule sym)
-    apply(subst perm2)
-    using qq3 fresh2 fr1
-    apply(simp add: set_eqvt)
-    apply(simp add: fresh_star_Pair)
-    apply(auto simp add: fresh_star_def)
-    done
-  also have "... = f bs y c"   
+    apply(rule perm2[symmetric])
+    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
+  also have "... = f bs y c"
     apply(rule perm_supp_eq)
-    using qq3 fr1 fcb2
-    apply(simp add: set_eqvt)
-    apply(simp add: fresh_star_Pair)
-    apply(auto simp add: fresh_star_def)
-    done
+    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
   finally show ?thesis by simp
 qed
 
+lemma Abs_lst1_fcb2:
+  fixes a b :: "atom"
+    and x y :: "'b :: fs"
+    and c::"'c :: fs"
+  assumes e: "(Abs_lst [a] x) = (Abs_lst [b] y)"
+  and fcb1: "a \<sharp> f a x c"
+  and fresh: "{a, b} \<sharp>* c"
+  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f a x c) = f (p \<bullet> a) (p \<bullet> x) c"
+  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f b y c) = f (p \<bullet> b) (p \<bullet> y) c"
+  shows "f a x c = f b y c"
+using e
+apply(drule_tac Abs_lst_fcb2[where c="c" and f="\<lambda>(as::atom list) . f (hd as)"])
+apply(simp_all)
+using fcb1 fresh perm1 perm2
+apply(simp_all add: fresh_star_def)
+done
+
 lemma supp_zero_perm_zero:
   shows "supp (p :: perm) = {} \<longleftrightarrow> p = 0"
   by (metis supp_perm_singleton supp_zero_perm)