merged
authorwenzelm
Thu, 23 May 2024 20:22:52 +0200
changeset 80184 9f2c40da6690
parent 80183 5a9f168982b2 (current diff)
parent 80177 1478555580af (diff)
child 80185 455b58d356c5
merged
NEWS
--- a/Admin/Release/CHECKLIST	Thu May 23 11:18:46 2024 +0200
+++ b/Admin/Release/CHECKLIST	Thu May 23 20:22:52 2024 +0200
@@ -27,8 +27,7 @@
 - test "isabelle build HOL-Codegenerator_Test" with -new-syntax
   (see also etc/settings:ISABELLE_SCALAC_OPTIONS);
 
-- test Windows 10 subsystem for Linux:
-  https://docs.microsoft.com/en-us/windows/wsl/install-win10
+- test Windows Subsystem for Linux (e.g. on Windows Server 2022);
 
 - check (non-)executable files:
     $ find . "(" -name "*.thy" -o -name "*.ML" -o -name "*.scala" -o -name ROOT ")" -executable
--- a/Admin/Windows/Cygwin/README	Thu May 23 11:18:46 2024 +0200
+++ b/Admin/Windows/Cygwin/README	Thu May 23 20:22:52 2024 +0200
@@ -71,11 +71,6 @@
   - run ssh-host-config
 ```
     StrictMode: yes
-    privilege separation: yes
-    new local account 'sshd': yes
-    sshd as a service: yes
-    different name (than cyg_server): no
-    new privileged account cyg_server: yes
 ```
 
   - user setup
@@ -85,3 +80,8 @@
 
     passwd -R USER
 ```
+
+  - firewall
+```
+    netsh advfirewall firewall add rule name="Open SSH Port 22" dir=in action=allow protocol=TCP localport=22 remoteip=any
+```
--- a/Admin/components/README.md	Thu May 23 11:18:46 2024 +0200
+++ b/Admin/components/README.md	Thu May 23 20:22:52 2024 +0200
@@ -45,7 +45,7 @@
       - macOS 14 Sonoma (`studio1` Mac13,2 M1 Ultra, 16+4 cores)
 
   * `x86_64-windows`
-      - **Windows Server 2012 Rev 2** (`vmnipkow9`)
+      - **Windows Server 2022** (`se0.proof.cit.tum.de`)
       - **Windows 10**
       - Windows 11
   * `x86_64-cygwin`
--- a/Admin/polyml/INSTALL-MinGW	Thu May 23 11:18:46 2024 +0200
+++ b/Admin/polyml/INSTALL-MinGW	Thu May 23 20:22:52 2024 +0200
@@ -14,8 +14,7 @@
 
   pacman -S --needed --noconfirm base-devel gmp-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-gmp mingw-w64-x86_64-lapack mingw-w64-x86_64-openblas
 
-- build (as regular user) e.g. on vmnipkow9 with Cygwin-Terminal from Isabelle2018
+- build (as regular user) e.g. with Cygwin-Terminal from Isabelle2018
   (to avoid address relocation problems):
 
-    isabelle component_polyml -M /cygdrive/c/msys64 -m32 -s sha1 src
-    isabelle component_polyml -M /cygdrive/c/msys64 -m64 -s sha1 src
+    isabelle component_polyml -M /cygdrive/c/msys64
--- a/CONTRIBUTORS	Thu May 23 11:18:46 2024 +0200
+++ b/CONTRIBUTORS	Thu May 23 20:22:52 2024 +0200
@@ -3,6 +3,10 @@
 listed as an author in one of the source files of this Isabelle distribution.
 
 
+Contributions to this Isabelle version
+--------------------------------------
+
+
 Contributions to Isabelle2024
 -----------------------------
 
--- a/NEWS	Thu May 23 11:18:46 2024 +0200
+++ b/NEWS	Thu May 23 20:22:52 2024 +0200
@@ -4,6 +4,11 @@
 (Note: Isabelle/jEdit shows a tree-view of the NEWS file in Sidekick.)
 
 
+New in this Isabelle version
+----------------------------
+
+
+
 New in Isabelle2024 (May 2024)
 ------------------------------
 
--- a/src/HOL/Analysis/Arcwise_Connected.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Arcwise_Connected.thy	Thu May 23 20:22:52 2024 +0200
@@ -1103,13 +1103,15 @@
       with Suc.prems show ?thesis by auto
     next
       case True
-      show ?thesis proof (cases "even j")
+      show ?thesis 
+      proof (cases "even j")
         case True
         then obtain k where k: "j = 2*k" by (metis evenE)
         with \<open>0 < j\<close> have "k > 0" "2 * k < 2 ^ n"
           using Suc.prems(2) k by auto
         with k \<open>0 < n\<close> Suc.IH [of k] show ?thesis
-          by (simp add: m1_to_3 a41 b43 del: power_Suc) (auto simp: of_nat_diff)
+          apply (simp add: m1_to_3 a41 b43 del: power_Suc of_nat_diff)
+          by simp
       next
         case False
         then obtain k where k: "j = 2*k + 1" by (metis oddE)
@@ -1145,7 +1147,7 @@
         by auto
       then show ?thesis
         using Suc.IH [of k] k \<open>0 < k\<close>
-        by (simp add: less2n add.commute [of 1] m1_to_3 a41 b43 del: power_Suc) (auto simp: of_nat_diff)
+        by (simp add: less2n add.commute [of 1] m1_to_3 a41 b43 del: power_Suc of_nat_diff) auto
     next
       case False
       then obtain k where k: "j = 2*k + 1" by (metis oddE)
--- a/src/HOL/Analysis/Bochner_Integration.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Bochner_Integration.thy	Thu May 23 20:22:52 2024 +0200
@@ -2795,7 +2795,7 @@
       have "eventually (\<lambda>n. x \<le> X n) sequentially"
         unfolding filterlim_at_top_ge[where c=x] by auto
       then show "(\<lambda>n. indicator {..X n} x *\<^sub>R f x) \<longlonglongrightarrow> f x"
-        by (intro tendsto_eventually) (auto split: split_indicator elim!: eventually_mono)
+        by (intro tendsto_eventually) (auto simp: frequently_def split: split_indicator)
     qed
     fix n show "AE x in M. norm (indicator {..X n} x *\<^sub>R f x) \<le> norm (f x)"
       by (auto split: split_indicator)
--- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy	Thu May 23 20:22:52 2024 +0200
@@ -3945,7 +3945,7 @@
     obtain n where "x - a < real n"
       using reals_Archimedean2[of "x - a"] ..
     then have "eventually (\<lambda>n. ?f n x = ?fR x) sequentially"
-      by (auto intro!: eventually_sequentiallyI[where c=n] split: split_indicator)
+      by (auto simp: frequently_def intro!: eventually_sequentiallyI[where c=n] split: split_indicator)
     then show "(\<lambda>n. ?f n x) \<longlonglongrightarrow> ?fR x"
       by (rule tendsto_eventually)
   qed (auto simp: nonneg incseq_def le_fun_def split: split_indicator)
--- a/src/HOL/Analysis/Further_Topology.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Further_Topology.thy	Thu May 23 20:22:52 2024 +0200
@@ -3310,16 +3310,19 @@
         proof (cases "j / n \<le> 1/2")
           case True
           show ?thesis
-            using \<open>j \<noteq> 0 \<close> \<open>j < n\<close> True
+            using \<open>j \<noteq> 0\<close> \<open>j < n\<close> True
             by (intro sin_monotone_2pi_le) (auto simp: field_simps intro: order_trans [of _ 0])
         next
           case False
           then have seq: "sin(pi * j / n) = sin(pi * (n - j) / n)"
             using \<open>j < n\<close> by (simp add: algebra_simps diff_divide_distrib of_nat_diff)
+
           show ?thesis
-            unfolding  seq
-            using \<open>j < n\<close> False
-            by (intro sin_monotone_2pi_le) (auto simp: field_simps intro: order_trans [of _ 0])
+            unfolding seq
+          proof (intro sin_monotone_2pi_le)
+            show "- (pi / 2) \<le> pi / real n"
+              by (smt (verit) divide_nonneg_nonneg of_nat_0_le_iff pi_ge_zero)
+          qed (use \<open>j < n\<close> False in \<open>auto simp: divide_simps\<close>)
         qed
         with sin_less show ?thesis by force
       qed
--- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy	Thu May 23 20:22:52 2024 +0200
@@ -2915,18 +2915,13 @@
   have g0: "Dg 0 = g"
     using \<open>p > 0\<close>
     by (auto simp add: Dg_def field_split_simps g_def split: if_split_asm)
-  {
-    fix m
-    assume "p > Suc m"
-    hence "p - Suc m = Suc (p - Suc (Suc m))"
-      by auto
-    hence "real (p - Suc m) * fact (p - Suc (Suc m)) = fact (p - Suc m)"
-      by auto
-  } note fact_eq = this
+  have fact_eq: "real (p - Suc m) * fact (p - Suc (Suc m)) = fact (p - Suc m)" 
+    if "p > Suc m" for m
+    by (metis Suc_diff_Suc fact_Suc that)
   have Dg: "\<And>m t. m < p \<Longrightarrow> a \<le> t \<Longrightarrow> t \<le> b \<Longrightarrow>
     (Dg m has_vector_derivative Dg (Suc m) t) (at t within {a..b})"
-    unfolding Dg_def
-    by (auto intro!: derivative_eq_intros simp: has_vector_derivative_def fact_eq field_split_simps)
+    unfolding Dg_def  has_vector_derivative_def
+    by (auto intro!: derivative_eq_intros simp: fact_eq divide_simps simp del: of_nat_diff)
   let ?sum = "\<lambda>t. \<Sum>i<p. (- 1) ^ i *\<^sub>R Dg i t *\<^sub>R Df (p - Suc i) t"
   from sum_prod_derivatives_has_vector_derivative[of _ Dg _ _ _ Df,
       OF \<open>p > 0\<close> g0 Dg f0 Df]
--- a/src/HOL/Analysis/Homeomorphism.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Homeomorphism.thy	Thu May 23 20:22:52 2024 +0200
@@ -716,7 +716,7 @@
     show "affine {x. i \<bullet> x = 0}"
       by (auto simp: affine_hyperplane)
     show "aff_dim {x. i \<bullet> x = 0} + 1 = int DIM('n)"
-      using i by clarsimp (metis DIM_positive Suc_pred add.commute of_nat_Suc)
+      using i by force
   qed (use i in auto)
   then obtain f g where fg: "homeomorphism (sphere 0 1 - {i}) {x. i \<bullet> x = 0} f g"
     by (force simp: homeomorphic_def)
--- a/src/HOL/Analysis/Kronecker_Approximation_Theorem.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Kronecker_Approximation_Theorem.thy	Thu May 23 20:22:52 2024 +0200
@@ -75,13 +75,16 @@
   let ?h = "\<lambda>i. \<lfloor>b * \<theta> i\<rfloor> - \<lfloor>a * \<theta> i\<rfloor>"
   show ?thesis
   proof
+    show "int (b - a) \<le> int (N ^ n)"
+      using \<open>b \<le> N ^ n\<close> by auto
+  next
     fix i
     assume "i<n"
     have "frac (b * \<theta> i) - frac (a * \<theta> i) = ?k * \<theta> i - ?h i"
       using \<open>a < b\<close> by (simp add: frac_def left_diff_distrib' of_nat_diff)
     then show "\<bar>of_int ?k * \<theta> i - ?h i\<bar> < 1/N"
       by (metis "*" \<open>i < n\<close> of_int_of_nat_eq)
-  qed (use \<open>a < b\<close> \<open>b \<le> N^n\<close> in auto)
+  qed (use \<open>a < b\<close> in auto)
 qed
 
 
--- a/src/HOL/Analysis/Nonnegative_Lebesgue_Integration.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Nonnegative_Lebesgue_Integration.thy	Thu May 23 20:22:52 2024 +0200
@@ -713,7 +713,7 @@
       then have "0 < ?M"
         by (simp add: less_le)
       also have "\<dots> \<le> ?\<mu> (\<lambda>y. f x \<le> g x)"
-        using mono by (intro emeasure_mono_AE) auto
+        using mono by (force intro: emeasure_mono_AE) 
       finally have "\<not> \<not> f x \<le> g x"
         by (intro notI) auto
       then show ?thesis
--- a/src/HOL/Analysis/Starlike.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Starlike.thy	Thu May 23 20:22:52 2024 +0200
@@ -4863,10 +4863,12 @@
   shows "bounded {x. a \<bullet> x = 0} \<longleftrightarrow> DIM('a) = 1"
 proof
   assume "bounded {x. a \<bullet> x = 0}"
-  then have "aff_dim {x. a \<bullet> x = 0} \<le> 0"
+  then have 0: "aff_dim {x. a \<bullet> x = 0} \<le> 0"
     by (simp add: affine_bounded_eq_lowdim affine_hyperplane)
-  with assms show "DIM('a) = 1"
-    by (simp add: le_Suc_eq)
+  with assms 0
+  have "int DIM('a) = 1"
+    using order_neq_le_trans by fastforce
+  then show "DIM('a) = 1" by auto
 next
   assume "DIM('a) = 1"
   then show "bounded {x. a \<bullet> x = 0}"
--- a/src/HOL/Analysis/Weierstrass_Theorems.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Analysis/Weierstrass_Theorems.thy	Thu May 23 20:22:52 2024 +0200
@@ -656,7 +656,12 @@
       then have "(j - 4/3)*e < (j-1)*e - e^2"
         using e by (auto simp: of_nat_diff algebra_simps power2_eq_square)
       also have "... < (j-1)*e - ((j - 1)/n) * e^2"
-        using e True jn by (simp add: power2_eq_square field_simps)
+      proof -
+        have "(j - 1) / n < 1"
+          using j1 jn by fastforce
+        with \<open>e>0\<close> show ?thesis
+          by (smt (verit, best) mult_less_cancel_right2 zero_less_power)
+      qed
       also have "... = e * (j-1) * (1 - e/n)"
         by (simp add: power2_eq_square field_simps)
       also have "... \<le> e * (\<Sum>i\<le>j-2. xf i t)"
--- a/src/HOL/Binomial.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Binomial.thy	Thu May 23 20:22:52 2024 +0200
@@ -18,10 +18,10 @@
 
 text \<open>Combinatorial definition\<close>
 
-definition binomial :: "nat \<Rightarrow> nat \<Rightarrow> nat"  (infixl "choose" 65)
+definition binomial :: "nat \<Rightarrow> nat \<Rightarrow> nat"  (infix "choose" 64)
   where "n choose k = card {K\<in>Pow {0..<n}. card K = k}"
 
-lemma binomial_mono:
+lemma binomial_right_mono:
   assumes "m \<le> n" shows "m choose k \<le> n choose k"
 proof -
   have "{K. K \<subseteq> {0..<m} \<and> card K = k} \<subseteq> {K. K \<subseteq> {0..<n} \<and> card K = k}"
@@ -362,7 +362,7 @@
 
 subsection \<open>Generalized binomial coefficients\<close>
 
-definition gbinomial :: "'a::{semidom_divide,semiring_char_0} \<Rightarrow> nat \<Rightarrow> 'a"  (infixl "gchoose" 65)
+definition gbinomial :: "'a::{semidom_divide,semiring_char_0} \<Rightarrow> nat \<Rightarrow> 'a"  (infix "gchoose" 64)
   where gbinomial_prod_rev: "a gchoose k = prod (\<lambda>i. a - of_nat i) {0..<k} div fact k"
 
 lemma gbinomial_0 [simp]:
@@ -379,6 +379,9 @@
 lemma gbinomial_Suc0 [simp]: "a gchoose Suc 0 = a"
   by (simp add: gbinomial_prod_rev lessThan_Suc)
 
+lemma gbinomial_0_left: "0 gchoose k = (if k = 0 then 1 else 0)"
+  by (cases k) simp_all
+
 lemma gbinomial_mult_fact: "fact k * (a gchoose k) = (\<Prod>i = 0..<k. a - of_nat i)"
   for a :: "'a::field_char_0"
   by (simp_all add: gbinomial_prod_rev field_simps)
@@ -479,7 +482,7 @@
   for a :: "'a::field_char_0"
   by (simp add: mult.commute gbinomial_mult_1)
 
-lemma gbinomial_Suc_Suc: "(a + 1) gchoose (Suc k) = a gchoose k + (a gchoose (Suc k))"
+lemma gbinomial_Suc_Suc: "(a + 1) gchoose (Suc k) = (a gchoose k) + (a gchoose (Suc k))"
   for a :: "'a::field_char_0"
 proof (cases k)
   case 0
@@ -491,16 +494,13 @@
     show "{1..k} = Suc ` {0..h}"
       using Suc by (auto simp add: image_Suc_atMost)
   qed auto
-  have "fact (Suc k) * (a gchoose k + (a gchoose (Suc k))) =
+  have "fact (Suc k) * ((a gchoose k) + (a gchoose (Suc k))) =
       (a gchoose Suc h) * (fact (Suc (Suc h))) +
       (a gchoose Suc (Suc h)) * (fact (Suc (Suc h)))"
     by (simp add: Suc field_simps del: fact_Suc)
   also have "\<dots> =
     (a gchoose Suc h) * of_nat (Suc (Suc h) * fact (Suc h)) + (\<Prod>i=0..Suc h. a - of_nat i)"
-    apply (simp only: gbinomial_mult_fact field_simps mult.left_commute [of _ "2"])
-    apply (simp del: fact_Suc add: fact_Suc [of "Suc h"] field_simps gbinomial_mult_fact
-      mult.left_commute [of _ "2"] atLeastLessThanSuc_atLeastAtMost)
-    done
+    by (metis atLeastLessThanSuc_atLeastAtMost fact_Suc gbinomial_mult_fact mult.commute of_nat_fact of_nat_mult)
   also have "\<dots> =
     (fact (Suc h) * (a gchoose Suc h)) * of_nat (Suc (Suc h)) + (\<Prod>i=0..Suc h. a - of_nat i)"
     by (simp only: fact_Suc mult.commute mult.left_commute of_nat_fact of_nat_id of_nat_mult)
@@ -526,7 +526,7 @@
     using fact_nonzero [of "Suc k"] by auto
 qed
 
-lemma gbinomial_reduce_nat: "0 < k \<Longrightarrow> a gchoose k = (a - 1) gchoose (k - 1) + ((a - 1) gchoose k)"
+lemma gbinomial_reduce_nat: "0 < k \<Longrightarrow> a gchoose k = (a-1 gchoose k-1) + (a-1 gchoose k)"
   for a :: "'a::field_char_0"
   by (metis Suc_pred' diff_add_cancel gbinomial_Suc_Suc)
 
@@ -1219,7 +1219,7 @@
     by (rule card_image) auto
   also have "\<dots> = (length (x # xs) + length ys) choose length (x # xs)"
     using "3.prems" by (intro "3.IH") auto
-  also have "length xs + length (y # ys) choose length xs + \<dots> =
+  also have "(length xs + length (y # ys) choose length xs) + \<dots> =
                (length (x # xs) + length (y # ys)) choose length (x # xs)" by simp
   finally show ?case .
 qed auto
@@ -1243,6 +1243,7 @@
 qed
 
 subsection \<open>Inclusion-exclusion principle\<close>
+
 text \<open>Ported from HOL Light by lcp\<close>
 
 lemma Inter_over_Union:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Binomial_Plus.thy	Thu May 23 20:22:52 2024 +0200
@@ -0,0 +1,412 @@
+section \<open>More facts about binomial coefficients\<close>
+
+text \<open>
+  These facts could have been proven before, but having real numbers
+  makes the proofs a lot easier. Thanks to Alexander Maletzky among others.
+\<close>
+
+theory Binomial_Plus
+imports Real
+begin
+
+subsection \<open>More facts about binomial coefficients\<close>
+
+text \<open>
+  These facts could have been proven before, but having real numbers
+  makes the proofs a lot easier.
+\<close>
+
+lemma central_binomial_odd:
+  "odd n \<Longrightarrow> n choose (Suc (n div 2)) = n choose (n div 2)"
+proof -
+  assume "odd n"
+  hence "Suc (n div 2) \<le> n" by presburger
+  hence "n choose (Suc (n div 2)) = n choose (n - Suc (n div 2))"
+    by (rule binomial_symmetric)
+  also from \<open>odd n\<close> have "n - Suc (n div 2) = n div 2" by presburger
+  finally show ?thesis .
+qed
+
+lemma binomial_less_binomial_Suc:
+  assumes k: "k < n div 2"
+  shows   "n choose k < n choose (Suc k)"
+proof -
+  from k have k': "k \<le> n" "Suc k \<le> n" by simp_all
+  from k' have "real (n choose k) = fact n / (fact k * fact (n - k))"
+    by (simp add: binomial_fact)
+  also from k' have "n - k = Suc (n - Suc k)" by simp
+  also from k' have "fact \<dots> = (real n - real k) * fact (n - Suc k)"
+    by (subst fact_Suc) (simp_all add: of_nat_diff)
+  also from k have "fact k = fact (Suc k) / (real k + 1)" by (simp add: field_simps)
+  also have "fact n / (fact (Suc k) / (real k + 1) * ((real n - real k) * fact (n - Suc k))) =
+               (n choose (Suc k)) * ((real k + 1) / (real n - real k))"
+    using k by (simp add: field_split_simps binomial_fact)
+  also from assms have "(real k + 1) / (real n - real k) < 1" by simp
+  finally show ?thesis using k by (simp add: mult_less_cancel_left)
+qed
+
+lemma binomial_strict_mono:
+  assumes "k < k'" "2*k' \<le> n"
+  shows   "n choose k < n choose k'"
+proof -
+  from assms have "k \<le> k' - 1" by simp
+  thus ?thesis
+  proof (induction rule: inc_induct)
+    case base
+    with assms binomial_less_binomial_Suc[of "k' - 1" n]
+      show ?case by simp
+  next
+    case (step k)
+    from step.prems step.hyps assms have "n choose k < n choose (Suc k)"
+      by (intro binomial_less_binomial_Suc) simp_all
+    also have "\<dots> < n choose k'" by (rule step.IH)
+    finally show ?case .
+  qed
+qed
+
+lemma binomial_mono:
+  assumes "k \<le> k'" "2*k' \<le> n"
+  shows   "n choose k \<le> n choose k'"
+  using assms binomial_strict_mono[of k k' n] by (cases "k = k'") simp_all
+
+lemma binomial_strict_antimono:
+  assumes "k < k'" "2 * k \<ge> n" "k' \<le> n"
+  shows   "n choose k > n choose k'"
+proof -
+  from assms have "n choose (n - k) > n choose (n - k')"
+    by (intro binomial_strict_mono) (simp_all add: algebra_simps)
+  with assms show ?thesis by (simp add: binomial_symmetric [symmetric])
+qed
+
+lemma binomial_antimono:
+  assumes "k \<le> k'" "k \<ge> n div 2" "k' \<le> n"
+  shows   "n choose k \<ge> n choose k'"
+proof (cases "k = k'")
+  case False
+  note not_eq = False
+  show ?thesis
+  proof (cases "k = n div 2 \<and> odd n")
+    case False
+    with assms(2) have "2*k \<ge> n" by presburger
+    with not_eq assms binomial_strict_antimono[of k k' n]
+      show ?thesis by simp
+  next
+    case True
+    have "n choose k' \<le> n choose (Suc (n div 2))"
+    proof (cases "k' = Suc (n div 2)")
+      case False
+      with assms True not_eq have "Suc (n div 2) < k'" by simp
+      with assms binomial_strict_antimono[of "Suc (n div 2)" k' n] True
+        show ?thesis by auto
+    qed simp_all
+    also from True have "\<dots> = n choose k" by (simp add: central_binomial_odd)
+    finally show ?thesis .
+  qed
+qed simp_all
+
+lemma binomial_maximum: "n choose k \<le> n choose (n div 2)"
+proof -
+  have "k \<le> n div 2 \<longleftrightarrow> 2*k \<le> n" by linarith
+  consider "2*k \<le> n" | "2*k \<ge> n" "k \<le> n" | "k > n" by linarith
+  thus ?thesis
+  proof cases
+    case 1
+    thus ?thesis by (intro binomial_mono) linarith+
+  next
+    case 2
+    thus ?thesis by (intro binomial_antimono) simp_all
+  qed (simp_all add: binomial_eq_0)
+qed
+
+lemma binomial_maximum': "(2*n) choose k \<le> (2*n) choose n"
+  using binomial_maximum[of "2*n"] by simp
+
+lemma central_binomial_lower_bound:
+  assumes "n > 0"
+  shows   "4^n / (2*real n) \<le> real ((2*n) choose n)"
+proof -
+  from binomial[of 1 1 "2*n"]
+    have "4 ^ n = (\<Sum>k\<le>2*n. (2*n) choose k)"
+    by (simp add: power_mult power2_eq_square One_nat_def [symmetric] del: One_nat_def)
+  also have "{..2*n} = {0<..<2*n} \<union> {0,2*n}" by auto
+  also have "(\<Sum>k\<in>\<dots>. (2*n) choose k) =
+             (\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) + (\<Sum>k\<in>{0,2*n}. (2*n) choose k)"
+    by (subst sum.union_disjoint) auto
+  also have "(\<Sum>k\<in>{0,2*n}. (2*n) choose k) \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)"
+    by (cases n) simp_all
+  also from assms have "\<dots> \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)"
+    by (intro sum_mono2) auto
+  also have "\<dots> = (2*n) choose n" by (rule choose_square_sum)
+  also have "(\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) \<le> (\<Sum>k\<in>{0<..<2*n}. (2*n) choose n)"
+    by (intro sum_mono binomial_maximum')
+  also have "\<dots> = card {0<..<2*n} * ((2*n) choose n)" by simp
+  also have "card {0<..<2*n} \<le> 2*n - 1" by (cases n) simp_all
+  also have "(2 * n - 1) * (2 * n choose n) + (2 * n choose n) = ((2*n) choose n) * (2*n)"
+    using assms by (simp add: algebra_simps)
+  finally have "4 ^ n \<le> (2 * n choose n) * (2 * n)" by simp_all
+  hence "real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))"
+    by (subst of_nat_le_iff)
+  with assms show ?thesis by (simp add: field_simps)
+qed
+
+lemma upper_le_binomial:
+  assumes "0 < k" and "k < n"
+  shows "n \<le> n choose k"
+proof -
+  from assms have "1 \<le> n" by simp
+  define k' where "k' = (if n div 2 \<le> k then k else n - k)"
+  from assms have 1: "k' \<le> n - 1" and 2: "n div 2 \<le> k'" by (auto simp: k'_def)
+  from assms(2) have "k \<le> n" by simp
+  have "n choose k = n choose k'" by (simp add: k'_def binomial_symmetric[OF \<open>k \<le> n\<close>])
+  have "n = n choose 1" by (simp only: choose_one)
+  also from \<open>1 \<le> n\<close> have "\<dots> = n choose (n - 1)" by (rule binomial_symmetric)
+  also from 1 2 have "\<dots> \<le> n choose k'" by (rule binomial_antimono) simp
+  also have "\<dots> = n choose k" by (simp add: k'_def binomial_symmetric[OF \<open>k \<le> n\<close>])
+  finally show ?thesis .
+qed
+
+subsection \<open>Results about binomials and integers, thanks to Alexander Maletzky\<close>
+
+text \<open>Restore original sort constraints: semidom rather than field of char 0\<close>
+setup \<open>Sign.add_const_constraint (@{const_name gbinomial}, SOME @{typ "'a::{semidom_divide,semiring_char_0} \<Rightarrow> nat \<Rightarrow> 'a"})\<close>
+
+lemma gbinomial_eq_0_int:
+  assumes "n < k"
+  shows "(int n) gchoose k = 0"
+  by (simp add: assms gbinomial_prod_rev prod_zero)
+
+corollary gbinomial_eq_0: "0 \<le> a \<Longrightarrow> a < int k \<Longrightarrow> a gchoose k = 0"
+  by (metis nat_eq_iff2 nat_less_iff gbinomial_eq_0_int)
+
+lemma int_binomial: "int (n choose k) = (int n) gchoose k"
+proof (cases "k \<le> n")
+  case True
+  from refl have eq: "(\<Prod>i = 0..<k. int (n - i)) = (\<Prod>i = 0..<k. int n - int i)"
+  proof (rule prod.cong)
+    fix i
+    assume "i \<in> {0..<k}"
+    with True show "int (n - i) = int n - int i" by simp
+  qed
+  show ?thesis
+    by (simp add: gbinomial_binomial[symmetric] gbinomial_prod_rev zdiv_int eq)
+next
+  case False
+  thus ?thesis by (simp add: gbinomial_eq_0_int)
+qed
+
+lemma falling_fact_pochhammer: "prod (\<lambda>i. a - int i) {0..<k} = (- 1) ^ k * pochhammer (- a) k"
+proof -
+  have eq: "z ^ Suc n * prod f {0..n} = prod (\<lambda>x. z * f x) {0..n}" for z::int and n f
+    by (induct n) (simp_all add: ac_simps)
+  show ?thesis
+  proof (cases k)
+    case 0
+    thus ?thesis by (simp add: pochhammer_minus)
+  next
+    case (Suc n)
+    thus ?thesis
+      by (simp only: pochhammer_prod atLeastLessThanSuc_atLeastAtMost
+          prod.atLeast_Suc_atMost_Suc_shift eq flip: power_mult_distrib) (simp add: of_nat_diff)
+  qed
+qed
+
+lemma falling_fact_pochhammer': "prod (\<lambda>i. a - int i) {0..<k} = pochhammer (a - int k + 1) k"
+  by (simp add: falling_fact_pochhammer pochhammer_minus')
+
+lemma gbinomial_int_pochhammer: "(a::int) gchoose k = (- 1) ^ k * pochhammer (- a) k div fact k"
+  by (simp only: gbinomial_prod_rev falling_fact_pochhammer)
+
+lemma gbinomial_int_pochhammer': "a gchoose k = pochhammer (a - int k + 1) k div fact k"
+  by (simp only: gbinomial_prod_rev falling_fact_pochhammer')
+
+lemma fact_dvd_pochhammer: "fact k dvd pochhammer (a::int) k"
+proof -
+  have dvd: "y \<noteq> 0 \<Longrightarrow> ((of_int (x div y))::'a::field_char_0) = of_int x / of_int y \<Longrightarrow> y dvd x"
+    for x y :: int
+    by (smt dvd_triv_left mult.commute nonzero_eq_divide_eq of_int_eq_0_iff of_int_eq_iff of_int_mult)
+  show ?thesis
+  proof (cases "0 < a")
+    case True
+    moreover define n where "n = nat (a - 1) + k"
+    ultimately have a: "a = int n - int k + 1" by simp
+    from fact_nonzero show ?thesis unfolding a
+    proof (rule dvd)
+      have "of_int (pochhammer (int n - int k + 1) k div fact k) = (of_int (int n gchoose k)::rat)"
+        by (simp only: gbinomial_int_pochhammer')
+      also have "\<dots> = of_nat (n choose k)"
+        by (metis int_binomial of_int_of_nat_eq)
+      also have "\<dots> = (of_nat n) gchoose k" by (fact binomial_gbinomial)
+      also have "\<dots> = pochhammer (of_nat n - of_nat k + 1) k / fact k"
+        by (fact gbinomial_pochhammer')
+      also have "\<dots> = pochhammer (of_int (int n - int k + 1)) k / fact k" by simp
+      also have "\<dots> = (of_int (pochhammer (int n - int k + 1) k)) / (of_int (fact k))"
+        by (simp only: of_int_fact pochhammer_of_int)
+      finally show "of_int (pochhammer (int n - int k + 1) k div fact k) =
+                      of_int (pochhammer (int n - int k + 1) k) / rat_of_int (fact k)" .
+    qed
+  next
+    case False
+    moreover define n where "n = nat (- a)"
+    ultimately have a: "a = - int n" by simp
+    from fact_nonzero have "fact k dvd (-1)^k * pochhammer (- int n) k"
+    proof (rule dvd)
+      have "of_int ((-1)^k * pochhammer (- int n) k div fact k) = (of_int (int n gchoose k)::rat)"
+        by (metis falling_fact_pochhammer gbinomial_prod_rev)
+      also have "\<dots> = of_int (int (n choose k))" by (simp only: int_binomial)
+      also have "\<dots> = of_nat (n choose k)" by simp
+      also have "\<dots> = (of_nat n) gchoose k" by (fact binomial_gbinomial)
+      also have "\<dots> = (-1)^k * pochhammer (- of_nat n) k / fact k"
+        by (fact gbinomial_pochhammer)
+      also have "\<dots> = (-1)^k * pochhammer (of_int (- int n)) k / fact k" by simp
+      also have "\<dots> = (-1)^k * (of_int (pochhammer (- int n) k)) / (of_int (fact k))"
+        by (simp only: of_int_fact pochhammer_of_int)
+      also have "\<dots> = (of_int ((-1)^k * pochhammer (- int n) k)) / (of_int (fact k))" by simp
+      finally show "of_int ((- 1) ^ k * pochhammer (- int n) k div fact k) =
+                    of_int ((- 1) ^ k * pochhammer (- int n) k) / rat_of_int (fact k)" .
+    qed
+    thus ?thesis unfolding a by (metis dvdI dvd_mult_unit_iff' minus_one_mult_self)
+  qed
+qed
+
+lemma gbinomial_int_negated_upper: "(a gchoose k) = (-1) ^ k * ((int k - a - 1) gchoose k)"
+  by (simp add: gbinomial_int_pochhammer pochhammer_minus algebra_simps fact_dvd_pochhammer div_mult_swap)
+
+lemma gbinomial_int_mult_fact: "fact k * (a gchoose k) = (\<Prod>i = 0..<k. a - int i)"
+  by (simp only: gbinomial_int_pochhammer' fact_dvd_pochhammer dvd_mult_div_cancel falling_fact_pochhammer')
+
+corollary gbinomial_int_mult_fact': "(a gchoose k) * fact k = (\<Prod>i = 0..<k. a - int i)"
+  using gbinomial_int_mult_fact[of k a] by (simp add: ac_simps)
+
+lemma gbinomial_int_binomial:
+  "a gchoose k = (if 0 \<le> a then int ((nat a) choose k) else (-1::int)^k * int ((k + (nat (- a)) - 1) choose k))"
+  by (auto simp: int_binomial gbinomial_int_negated_upper[of a] int_ops(6))
+
+corollary gbinomial_nneg: "0 \<le> a \<Longrightarrow> a gchoose k = int ((nat a) choose k)"
+  by (simp add: gbinomial_int_binomial)
+
+corollary gbinomial_neg: "a < 0 \<Longrightarrow> a gchoose k = (-1::int)^k * int ((k + (nat (- a)) - 1) choose k)"
+  by (simp add: gbinomial_int_binomial)
+
+lemma of_int_gbinomial: "of_int (a gchoose k) = (of_int a :: 'a::field_char_0) gchoose k"
+proof -
+  have of_int_div: "y dvd x \<Longrightarrow> of_int (x div y) = of_int x / (of_int y :: 'a)" for x y :: int by auto
+  show ?thesis
+    by (simp add: gbinomial_int_pochhammer' gbinomial_pochhammer' of_int_div fact_dvd_pochhammer
+        pochhammer_of_int[symmetric])
+qed
+
+lemma uminus_one_gbinomial [simp]: "(- 1::int) gchoose k = (- 1) ^ k"
+  by (simp add: gbinomial_int_binomial)
+
+lemma gbinomial_int_Suc_Suc: "(x + 1::int) gchoose (Suc k) = (x gchoose k) + (x gchoose (Suc k))"
+proof (rule linorder_cases)
+  assume 1: "x + 1 < 0"
+  hence 2: "x < 0" by simp
+  then obtain n where 3: "nat (- x) = Suc n" using not0_implies_Suc by fastforce
+  hence 4: "nat (- x - 1) = n" by simp
+  show ?thesis
+  proof (cases k)
+    case 0
+    show ?thesis by (simp add: \<open>k = 0\<close>)
+  next
+    case (Suc k')
+    from 1 2 3 4 show ?thesis by (simp add: \<open>k = Suc k'\<close> gbinomial_int_binomial int_distrib(2))
+  qed
+next
+  assume "x + 1 = 0"
+  hence "x = - 1" by simp
+  thus ?thesis by simp
+next
+  assume "0 < x + 1"
+  hence "0 \<le> x + 1" and "0 \<le> x" and "nat (x + 1) = Suc (nat x)" by simp_all
+  thus ?thesis by (simp add: gbinomial_int_binomial)
+qed
+
+corollary plus_Suc_gbinomial:
+  "(x + (1 + int k)) gchoose (Suc k) = ((x + int k) gchoose k) + ((x + int k) gchoose (Suc k))"
+    (is "?l = ?r")
+proof -
+  have "?l = (x + int k + 1) gchoose (Suc k)" by (simp only: ac_simps)
+  also have "\<dots> = ?r" by (fact gbinomial_int_Suc_Suc)
+  finally show ?thesis .
+qed
+
+lemma gbinomial_int_n_n [simp]: "(int n) gchoose n = 1"
+proof (induct n)
+  case 0
+  show ?case by simp
+next
+  case (Suc n)
+  have "int (Suc n) gchoose Suc n = (int n + 1) gchoose Suc n" by (simp add: add.commute)
+  also have "\<dots> = (int n gchoose n) + (int n gchoose (Suc n))" by (fact gbinomial_int_Suc_Suc)
+  finally show ?case by (simp add: Suc gbinomial_eq_0)
+qed
+
+lemma gbinomial_int_Suc_n [simp]: "(1 + int n) gchoose n = 1 + int n"
+proof (induct n)
+  case 0
+  show ?case by simp
+next
+  case (Suc n)
+  have "1 + int (Suc n) gchoose Suc n = (1 + int n) + 1 gchoose Suc n" by simp
+  also have "\<dots> = (1 + int n gchoose n) + (1 + int n gchoose (Suc n))" by (fact gbinomial_int_Suc_Suc)
+  also have "\<dots> = 1 + int n + (int (Suc n) gchoose (Suc n))" by (simp add: Suc)
+  also have "\<dots> = 1 + int (Suc n)" by (simp only: gbinomial_int_n_n)
+  finally show ?case .
+qed
+
+lemma zbinomial_eq_0_iff [simp]: "a gchoose k = 0 \<longleftrightarrow> (0 \<le> a \<and> a < int k)"
+proof
+  assume a: "a gchoose k = 0"
+  have 1: "b < int k" if "b gchoose k = 0" for b
+  proof (rule ccontr)
+    assume "\<not> b < int k"
+    hence "0 \<le> b" and "k \<le> nat b" by simp_all
+    from this(1) have "int ((nat b) choose k) = b gchoose k" by (simp add: gbinomial_int_binomial)
+    also have "\<dots> = 0" by (fact that)
+    finally show False using \<open>k \<le> nat b\<close> by simp
+  qed
+  show "0 \<le> a \<and> a < int k"
+  proof
+    show "0 \<le> a"
+    proof (rule ccontr)
+      assume "\<not> 0 \<le> a"
+      hence "(-1) ^ k * ((int k - a - 1) gchoose k) = a gchoose k"
+        by (simp add: gbinomial_int_negated_upper[of a])
+      also have "\<dots> = 0" by (fact a)
+      finally have "(int k - a - 1) gchoose k = 0" by simp
+      hence "int k - a - 1 < int k" by (rule 1)
+      with \<open>\<not> 0 \<le> a\<close> show False by simp
+    qed
+  next
+    from a show "a < int k" by (rule 1)
+  qed
+qed (auto intro: gbinomial_eq_0)
+
+subsection \<open>Sums\<close>
+
+lemma gchoose_rising_sum_nat: "(\<Sum>j\<le>n. int j + int k gchoose k) = (int n + int k + 1) gchoose (Suc k)"
+proof -
+  have "(\<Sum>j\<le>n. int j + int k gchoose k) = int (\<Sum>j\<le>n. k + j choose k)"
+    by (simp add: int_binomial add.commute)
+  also have "(\<Sum>j\<le>n. k + j choose k) = (k + n + 1) choose (k + 1)" by (fact choose_rising_sum(1))
+  also have "int \<dots> = (int n + int k + 1) gchoose (Suc k)"
+    by (simp add: int_binomial ac_simps del: binomial_Suc_Suc)
+  finally show ?thesis .
+qed
+
+lemma gchoose_rising_sum:
+  assumes "0 \<le> n"   \<comment>\<open>Necessary condition.\<close>
+  shows "(\<Sum>j=0..n. j + int k gchoose k) = (n + int k + 1) gchoose (Suc k)"
+proof -
+  from _ refl have "(\<Sum>j=0..n. j + int k gchoose k) = (\<Sum>j\<in>int ` {0..nat n}. j + int k gchoose k)"
+  proof (rule sum.cong)
+    from assms show "{0..n} = int ` {0..nat n}" by (simp add: image_int_atLeastAtMost)
+  qed
+  also have "\<dots> = (\<Sum>j\<le>nat n. int j + int k gchoose k)" by (simp add: sum.reindex atMost_atLeast0)
+  also have "\<dots> = (int (nat n) + int k + 1) gchoose (Suc k)" by (fact gchoose_rising_sum_nat)
+  also from assms have "\<dots> = (n + int k + 1) gchoose (Suc k)" by (simp add: add.assoc add.commute)
+  finally show ?thesis .
+qed
+
+end
--- a/src/HOL/Complex_Main.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Complex_Main.thy	Thu May 23 20:22:52 2024 +0200
@@ -4,6 +4,7 @@
 imports
   Complex
   MacLaurin
+  Binomial_Plus
 begin
 
 end
\ No newline at end of file
--- a/src/HOL/Computational_Algebra/Formal_Laurent_Series.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Computational_Algebra/Formal_Laurent_Series.thy	Thu May 23 20:22:52 2024 +0200
@@ -1057,7 +1057,7 @@
       by (auto simp: dfg_def)
     ultimately have
       "(f * g) $$ n = (\<Sum>i=0..nat (n - dfg). f $$ (df + int i) * g $$ (n - df - int i))"
-      by simp
+      by (simp del: of_nat_diff)
     moreover have
       "(\<Sum>i=0..nat (n - dfg). f $$ (df + int i) *  g $$ (n - df - int i)) =
         (\<Sum>i=0..n - dfg. f $$ (df + i) *  g $$ (n - df - i))"
--- a/src/HOL/Computational_Algebra/Formal_Power_Series.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Computational_Algebra/Formal_Power_Series.thy	Thu May 23 20:22:52 2024 +0200
@@ -5625,10 +5625,9 @@
         unfolding pochhammer_eq_0_iff by blast
       from j have "b = of_nat n - of_nat j - of_nat 1"
         by (simp add: algebra_simps)
-      then have "b = of_nat (n - j - 1)"
-        using j kn by (simp add: of_nat_diff)
       then show False 
-        using \<open>j < n\<close> j b by auto
+        using \<open>j < n\<close> j b
+        by (metis bn0 c mult_cancel_right2 pochhammer_minus)
     qed
 
     from nz kn [simplified] have nz': "pochhammer (1 + b - of_nat n) k \<noteq> 0"
@@ -5732,7 +5731,7 @@
   have h: "?b \<noteq> of_nat j" if "j < n" for j
   proof -
     have "c \<noteq> - of_nat (n - j - 1)"
-      using c that by auto
+      using c that by (auto simp: dest!: bspec [where x = "n-j-1"])
     with that show ?thesis
       by (auto simp add: algebra_simps of_nat_diff)
   qed
--- a/src/HOL/Filter.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Filter.thy	Thu May 23 20:22:52 2024 +0200
@@ -233,7 +233,7 @@
   "frequently P F \<Longrightarrow> eventually Q F \<Longrightarrow> frequently (\<lambda>x. P x \<and> Q x) F"
   using frequently_cong [of Q F P "\<lambda>x. P x \<and> Q x"] by meson
   
-lemma eventually_frequently_const_simps:
+lemma eventually_frequently_const_simps [simp]:
   "(\<exists>\<^sub>Fx in F. P x \<and> C) \<longleftrightarrow> (\<exists>\<^sub>Fx in F. P x) \<and> C"
   "(\<exists>\<^sub>Fx in F. C \<and> P x) \<longleftrightarrow> C \<and> (\<exists>\<^sub>Fx in F. P x)"
   "(\<forall>\<^sub>Fx in F. P x \<or> C) \<longleftrightarrow> (\<forall>\<^sub>Fx in F. P x) \<or> C"
--- a/src/HOL/HOLCF/Universal.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/HOLCF/Universal.thy	Thu May 23 20:22:52 2024 +0200
@@ -8,7 +8,7 @@
 imports Bifinite Completion "HOL-Library.Nat_Bijection"
 begin
 
-no_notation binomial  (infixl "choose" 65)
+no_notation binomial  (infix "choose" 64)
 
 subsection \<open>Basis for universal domain\<close>
 
@@ -54,7 +54,7 @@
 
 lemma eq_prod_encode_pairI:
   "\<lbrakk>fst (prod_decode x) = a; snd (prod_decode x) = b\<rbrakk> \<Longrightarrow> x = prod_encode (a, b)"
-by (erule subst, erule subst, simp)
+  by auto
 
 lemma node_cases:
   assumes 1: "x = 0 \<Longrightarrow> P"
@@ -144,24 +144,14 @@
 lemma ubasis_until_less: "ubasis_le (ubasis_until P x) x"
 apply (induct x rule: node_induct)
 apply (simp add: ubasis_le_refl)
-apply (simp add: ubasis_le_refl)
-apply (rule impI)
-apply (erule ubasis_le_trans)
-apply (erule ubasis_le_lower)
-done
+  by (metis ubasis_le.simps ubasis_until.simps(2))
 
 lemma ubasis_until_chain:
   assumes PQ: "\<And>x. P x \<Longrightarrow> Q x"
   shows "ubasis_le (ubasis_until P x) (ubasis_until Q x)"
 apply (induct x rule: node_induct)
 apply (simp add: ubasis_le_refl)
-apply (simp add: ubasis_le_refl)
-apply (simp add: PQ)
-apply clarify
-apply (rule ubasis_le_trans)
-apply (rule ubasis_until_less)
-apply (erule ubasis_le_lower)
-done
+  by (metis assms ubasis_until.simps(2) ubasis_until_less)
 
 lemma ubasis_until_mono:
   assumes "\<And>i a S b. \<lbrakk>finite S; P (node i a S); b \<in> S; ubasis_le a b\<rbrakk> \<Longrightarrow> P b"
@@ -172,17 +162,10 @@
   case (ubasis_le_trans a b c) thus ?case by - (rule ubasis_le.ubasis_le_trans)
 next
   case (ubasis_le_lower S a i) thus ?case
-    apply (clarsimp simp add: ubasis_le_refl)
-    apply (rule ubasis_le_trans [OF ubasis_until_less])
-    apply (erule ubasis_le.ubasis_le_lower)
-    done
+    by (metis ubasis_le.simps ubasis_until.simps(2) ubasis_until_less)
 next
   case (ubasis_le_upper S b a i) thus ?case
-    apply clarsimp
-    apply (subst ubasis_until_same)
-     apply (erule (3) assms)
-    apply (erule (2) ubasis_le.ubasis_le_upper)
-    done
+    by (metis assms ubasis_le.simps ubasis_until.simps(2) ubasis_until_same)
 qed
 
 lemma finite_range_ubasis_until:
--- a/src/HOL/Homology/Homology_Groups.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Homology/Homology_Groups.thy	Thu May 23 20:22:52 2024 +0200
@@ -770,11 +770,11 @@
         using a chain_boundary_chain_map singular_relcycle by blast
       have contf: "continuous_map (subtopology X S) (subtopology Y T) f"
         using assms
-        by (auto simp: continuous_map_in_subtopology topspace_subtopology
-            continuous_map_from_subtopology)
+        by (auto simp: continuous_map_in_subtopology continuous_map_from_subtopology)
       show ?thesis
         unfolding q using assms p1 a
-        by (simp add: cbm ceq contf hom_boundary_chain_boundary hom_induced_chain_map p1_eq sb sr)
+        by (simp add: cbm ceq contf hom_boundary_chain_boundary hom_induced_chain_map p1_eq sb sr
+                 del: of_nat_diff)
     next
       case False
       with assms show ?thesis
--- a/src/HOL/Lattices_Big.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Lattices_Big.thy	Thu May 23 20:22:52 2024 +0200
@@ -655,6 +655,29 @@
 
 end
 
+text \<open>Handy results about @{term Max} and @{term Min} by Chelsea Edmonds\<close>
+lemma obtains_Max:
+  assumes "finite A" and "A \<noteq> {}"
+  obtains x where "x \<in> A" and "Max A = x"
+  using assms Max_in by blast
+
+lemma obtains_MAX:
+  assumes "finite A" and "A \<noteq> {}"
+  obtains x where "x \<in> A" and "Max (f ` A) = f x"
+  using obtains_Max
+  by (metis (mono_tags, opaque_lifting) assms(1) assms(2) empty_is_image finite_imageI image_iff) 
+
+lemma obtains_Min:
+  assumes "finite A" and "A \<noteq> {}"
+  obtains x where "x \<in> A" and "Min A = x"
+  using assms Min_in by blast
+
+lemma obtains_MIN:
+  assumes "finite A" and "A \<noteq> {}"
+  obtains x where "x \<in> A" and "Min (f ` A) = f x"
+  using obtains_Min assms empty_is_image finite_imageI image_iff
+  by (metis (mono_tags, opaque_lifting)) 
+
 lemma Max_eq_if:
   assumes "finite A"  "finite B"  "\<forall>a\<in>A. \<exists>b\<in>B. a \<le> b"  "\<forall>b\<in>B. \<exists>a\<in>A. b \<le> a"
   shows "Max A = Max B"
--- a/src/HOL/Library/Landau_Symbols.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Library/Landau_Symbols.thy	Thu May 23 20:22:52 2024 +0200
@@ -1447,9 +1447,8 @@
 lemma landau_symbol_if_at_top_eq [simp]:
   assumes "landau_symbol L L' Lr"
   shows   "L at_top (\<lambda>x::'a::linordered_semidom. if x = a then f x else g x) = L at_top (g)"
-apply (rule landau_symbol.cong[OF assms])
-using less_add_one[of a] apply (auto intro: eventually_mono  eventually_ge_at_top[of "a + 1"])
-done
+  apply (rule landau_symbol.cong[OF assms])
+  by (auto simp add: frequently_def eventually_at_top_linorder dest!: spec [where x= "a + 1"])
 
 lemmas landau_symbols_if_at_top_eq [simp] = landau_symbols[THEN landau_symbol_if_at_top_eq]
 
--- a/src/HOL/Nat.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nat.thy	Thu May 23 20:22:52 2024 +0200
@@ -1752,7 +1752,7 @@
 context semiring_1_cancel
 begin
 
-lemma of_nat_diff:
+lemma of_nat_diff [simp]:
   \<open>of_nat (m - n) = of_nat m - of_nat n\<close> if \<open>n \<le> m\<close>
 proof -
   from that obtain q where \<open>m = n + q\<close>
--- a/src/HOL/Nominal/Examples/Class1.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Class1.thy	Thu May 23 20:22:52 2024 +0200
@@ -1,5 +1,5 @@
 theory Class1
-imports "HOL-Nominal.Nominal" 
+imports "HOL-Nominal.Nominal"
 begin
 
 section \<open>Term-Calculus from Urban's PhD\<close>
@@ -44,9 +44,9 @@
   and   T::"ty"
   shows "a\<sharp>T" and "x\<sharp>T"
 by (nominal_induct T rule: ty.strong_induct)
-   (auto simp add: fresh_string)
-
-text \<open>terms\<close>
+   (auto simp: fresh_string)
+
+text \<open>terms\<close>                               
 
 nominal_datatype trm = 
     Ax   "name" "coname"
@@ -89,11 +89,7 @@
 | "a\<sharp>(d,e,b) \<Longrightarrow> (ImpR (x).<a>.M b)[d\<turnstile>c>e] = 
        (if b=d then ImpR (x).<a>.(M[d\<turnstile>c>e]) e else ImpR (x).<a>.(M[d\<turnstile>c>e]) b)"
 | "\<lbrakk>a\<sharp>(d,e,N);x\<sharp>(M,y)\<rbrakk> \<Longrightarrow> (ImpL <a>.M (x).N y)[d\<turnstile>c>e] = ImpL <a>.(M[d\<turnstile>c>e]) (x).(N[d\<turnstile>c>e]) y"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh abs_supp fin_supp)+
-apply(fresh_guess)+
-done
+  by(finite_guess | simp add: abs_fresh abs_supp fin_supp | fresh_guess)+
 
 nominal_primrec (freshness_context: "(u::name,v::name)") 
   nrename :: "trm \<Rightarrow> name \<Rightarrow> name \<Rightarrow> trm"      ("_[_\<turnstile>n>_]" [100,100,100] 100) 
@@ -112,41 +108,29 @@
 | "\<lbrakk>a\<sharp>b; x\<sharp>(u,v)\<rbrakk> \<Longrightarrow> (ImpR (x).<a>.M b)[u\<turnstile>n>v] = ImpR (x).<a>.(M[u\<turnstile>n>v]) b"
 | "\<lbrakk>a\<sharp>N;x\<sharp>(u,v,M,y)\<rbrakk> \<Longrightarrow> (ImpL <a>.M (x).N y)[u\<turnstile>n>v] = 
         (if y=u then ImpL <a>.(M[u\<turnstile>n>v]) (x).(N[u\<turnstile>n>v]) v else ImpL <a>.(M[u\<turnstile>n>v]) (x).(N[u\<turnstile>n>v]) y)"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1)+
-apply(fresh_guess)+
-done
+  by(finite_guess | simp add: abs_fresh abs_supp fin_supp | fresh_guess)+
 
 lemmas eq_bij = pt_bij[OF pt_name_inst, OF at_name_inst] pt_bij[OF pt_coname_inst, OF at_coname_inst]
 
 lemma crename_name_eqvt[eqvt]:
   fixes pi::"name prm"
   shows "pi\<bullet>(M[d\<turnstile>c>e]) = (pi\<bullet>M)[(pi\<bullet>d)\<turnstile>c>(pi\<bullet>e)]"
-apply(nominal_induct M avoiding: d e rule: trm.strong_induct)
-apply(auto simp add: fresh_bij eq_bij)
-done
+  by (nominal_induct M avoiding: d e rule: trm.strong_induct) (auto simp: fresh_bij eq_bij)
 
 lemma crename_coname_eqvt[eqvt]:
   fixes pi::"coname prm"
   shows "pi\<bullet>(M[d\<turnstile>c>e]) = (pi\<bullet>M)[(pi\<bullet>d)\<turnstile>c>(pi\<bullet>e)]"
-apply(nominal_induct M avoiding: d e rule: trm.strong_induct)
-apply(auto simp add: fresh_bij eq_bij)
-done
+  by (nominal_induct M avoiding: d e rule: trm.strong_induct)(auto simp: fresh_bij eq_bij)
 
 lemma nrename_name_eqvt[eqvt]:
   fixes pi::"name prm"
   shows "pi\<bullet>(M[x\<turnstile>n>y]) = (pi\<bullet>M)[(pi\<bullet>x)\<turnstile>n>(pi\<bullet>y)]"
-apply(nominal_induct M avoiding: x y rule: trm.strong_induct)
-apply(auto simp add: fresh_bij eq_bij)
-done
+  by(nominal_induct M avoiding: x y rule: trm.strong_induct) (auto simp: fresh_bij eq_bij)
 
 lemma nrename_coname_eqvt[eqvt]:
   fixes pi::"coname prm"
   shows "pi\<bullet>(M[x\<turnstile>n>y]) = (pi\<bullet>M)[(pi\<bullet>x)\<turnstile>n>(pi\<bullet>y)]"
-apply(nominal_induct M avoiding: x y rule: trm.strong_induct)
-apply(auto simp add: fresh_bij eq_bij)
-done
+  by(nominal_induct M avoiding: x y rule: trm.strong_induct)(auto simp: fresh_bij eq_bij)
 
 lemmas rename_eqvts = crename_name_eqvt crename_coname_eqvt
                       nrename_name_eqvt nrename_coname_eqvt
@@ -155,68 +139,64 @@
   shows "M[x\<turnstile>n>y] = M"
 using a
 by (nominal_induct M avoiding: x y rule: trm.strong_induct)
-   (auto simp add: trm.inject fresh_atm abs_fresh fin_supp abs_supp)
+   (auto simp: trm.inject fresh_atm abs_fresh fin_supp abs_supp)
 
 lemma crename_fresh:
   assumes a: "a\<sharp>M"
   shows "M[a\<turnstile>c>b] = M"
 using a
 by (nominal_induct M avoiding: a b rule: trm.strong_induct)
-   (auto simp add: trm.inject fresh_atm abs_fresh)
+   (auto simp: trm.inject fresh_atm abs_fresh)
 
 lemma nrename_nfresh:
   fixes x::"name"
   shows "x\<sharp>y\<Longrightarrow>x\<sharp>M[x\<turnstile>n>y]"
 by (nominal_induct M avoiding: x y rule: trm.strong_induct)
-   (auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 
  lemma crename_nfresh:
   fixes x::"name"
   shows "x\<sharp>M\<Longrightarrow>x\<sharp>M[a\<turnstile>c>b]"
 by (nominal_induct M avoiding: a b rule: trm.strong_induct)
-   (auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 
 lemma crename_cfresh:
   fixes a::"coname"
   shows "a\<sharp>b\<Longrightarrow>a\<sharp>M[a\<turnstile>c>b]"
 by (nominal_induct M avoiding: a b rule: trm.strong_induct)
-   (auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 
 lemma nrename_cfresh:
   fixes c::"coname"
   shows "c\<sharp>M\<Longrightarrow>c\<sharp>M[x\<turnstile>n>y]"
 by (nominal_induct M avoiding: x y rule: trm.strong_induct)
-   (auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 
 lemma nrename_nfresh':
   fixes x::"name"
   shows "x\<sharp>(M,z,y)\<Longrightarrow>x\<sharp>M[z\<turnstile>n>y]"
 by (nominal_induct M avoiding: x z y rule: trm.strong_induct)
-   (auto simp add: fresh_prod fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_prod fresh_atm abs_fresh abs_supp fin_supp)
 
 lemma crename_cfresh':
   fixes a::"coname"
   shows "a\<sharp>(M,b,c)\<Longrightarrow>a\<sharp>M[b\<turnstile>c>c]"
 by (nominal_induct M avoiding: a b c rule: trm.strong_induct)
-   (auto simp add: fresh_prod fresh_atm abs_fresh abs_supp fin_supp)
+   (auto simp: fresh_prod fresh_atm abs_fresh abs_supp fin_supp)
 
 lemma nrename_rename:
   assumes a: "x'\<sharp>M"
   shows "([(x',x)]\<bullet>M)[x'\<turnstile>n>y]= M[x\<turnstile>n>y]"
 using a
-apply(nominal_induct M avoiding: x x' y rule: trm.strong_induct)
-apply(auto simp add: abs_fresh fresh_bij fresh_atm fresh_prod fresh_right calc_atm abs_supp fin_supp)
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)
-done
+proof (nominal_induct M avoiding: x x' y rule: trm.strong_induct)
+qed (auto simp: abs_fresh abs_supp fin_supp fresh_left calc_atm fresh_atm)
 
 lemma crename_rename:
   assumes a: "a'\<sharp>M"
   shows "([(a',a)]\<bullet>M)[a'\<turnstile>c>b]= M[a\<turnstile>c>b]"
 using a
-apply(nominal_induct M avoiding: a a' b rule: trm.strong_induct)
-apply(auto simp add: abs_fresh fresh_bij fresh_atm fresh_prod fresh_right calc_atm abs_supp fin_supp)
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)
-done
+proof (nominal_induct M avoiding: a a' b rule: trm.strong_induct)
+qed (auto simp: abs_fresh abs_supp fin_supp fresh_left calc_atm fresh_atm)
 
 lemmas rename_fresh = nrename_fresh crename_fresh 
                       nrename_nfresh crename_nfresh crename_cfresh nrename_cfresh
@@ -230,21 +210,13 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,a,x,u,v)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a,x,u,v)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq1: "(Cut <a>.M (x).N) = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   have "(Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))[u\<turnstile>n>v] = 
                         Cut <a'>.(([(a',a)]\<bullet>M)[u\<turnstile>n>v]) (x').(([(x',x)]\<bullet>N)[u\<turnstile>n>v])"
     using fs1 fs2
-    apply -
-    apply(rule nrename.simps)
-    apply(simp add: fresh_left calc_atm)
-    apply(simp add: fresh_left calc_atm)
-    done
+    by (intro nrename.simps; simp add: fresh_left calc_atm)
   also have "\<dots> = Cut <a>.(M[u\<turnstile>n>v]) (x).(N[u\<turnstile>n>v])" using fs1 fs2 a
-    apply -
-    apply(simp add: trm.inject alpha fresh_atm fresh_prod rename_eqvts)
-    apply(simp add: calc_atm)
-    apply(simp add: rename_fresh fresh_atm)
-    done
+    by(simp add: trm.inject alpha fresh_prod rename_eqvts calc_atm rename_fresh fresh_atm)
   finally show "(Cut <a>.M (x).N)[u\<turnstile>n>v] = Cut <a>.(M[u\<turnstile>n>v]) (x).(N[u\<turnstile>n>v])" using eq1
     by simp
 qed
@@ -256,21 +228,13 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,a,x,b,c)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a,x,b,c)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq1: "(Cut <a>.M (x).N) = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   have "(Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))[b\<turnstile>c>c] = 
                         Cut <a'>.(([(a',a)]\<bullet>M)[b\<turnstile>c>c]) (x').(([(x',x)]\<bullet>N)[b\<turnstile>c>c])"
     using fs1 fs2
-    apply -
-    apply(rule crename.simps)
-    apply(simp add: fresh_left calc_atm)
-    apply(simp add: fresh_left calc_atm)
-    done
+    by (intro crename.simps; simp add: fresh_left calc_atm)
   also have "\<dots> = Cut <a>.(M[b\<turnstile>c>c]) (x).(N[b\<turnstile>c>c])" using fs1 fs2 a
-    apply -
-    apply(simp add: trm.inject alpha fresh_atm fresh_prod rename_eqvts)
-    apply(simp add: calc_atm)
-    apply(simp add: rename_fresh fresh_atm)
-    done
+    by(simp add: trm.inject alpha calc_atm rename_fresh fresh_atm fresh_prod rename_eqvts)
   finally show "(Cut <a>.M (x).N)[b\<turnstile>c>c] = Cut <a>.(M[b\<turnstile>c>c]) (x).(N[b\<turnstile>c>c])" using eq1
     by simp
 qed
@@ -286,28 +250,28 @@
 lemma nrename_swap:
   shows "x\<sharp>M \<Longrightarrow> [(x,y)]\<bullet>M = M[y\<turnstile>n>x]"
 by (nominal_induct M avoiding: x y rule: trm.strong_induct) 
-   (simp_all add: calc_atm fresh_atm trm.inject alpha abs_fresh abs_supp fin_supp)
+   (auto simp: abs_fresh abs_supp fin_supp fresh_left calc_atm fresh_atm)
+
 
 lemma crename_swap:
   shows "a\<sharp>M \<Longrightarrow> [(a,b)]\<bullet>M = M[b\<turnstile>c>a]"
 by (nominal_induct M avoiding: a b rule: trm.strong_induct) 
-   (simp_all add: calc_atm fresh_atm trm.inject alpha abs_fresh abs_supp fin_supp)
+   (auto simp: abs_fresh abs_supp fin_supp fresh_left calc_atm fresh_atm)
+
 
 lemma crename_ax:
   assumes a: "M[a\<turnstile>c>b] = Ax x c" "c\<noteq>a" "c\<noteq>b"
   shows "M = Ax x c"
 using a
-apply(nominal_induct M avoiding: a b x c rule: trm.strong_induct)
-apply(simp_all add: trm.inject split: if_splits)
-done
+proof (nominal_induct M avoiding: a b x c rule: trm.strong_induct)
+qed (simp_all add: trm.inject split: if_splits)
 
 lemma nrename_ax:
   assumes a: "M[x\<turnstile>n>y] = Ax z a" "z\<noteq>x" "z\<noteq>y"
   shows "M = Ax z a"
 using a
-apply(nominal_induct M avoiding: x y z a rule: trm.strong_induct)
-apply(simp_all add: trm.inject split: if_splits)
-done
+proof (nominal_induct M avoiding: x y z a rule: trm.strong_induct)
+qed (simp_all add: trm.inject split: if_splits)
 
 text \<open>substitution functions\<close>
 
@@ -317,11 +281,7 @@
   and   M::"trm"
   assumes a: "c\<sharp>pi" "c\<sharp>M"
   shows "c\<sharp>(pi\<bullet>M)"
-using a
-apply -
-apply(simp add: fresh_left)
-apply(simp add: at_prm_fresh[OF at_coname_inst] fresh_list_rev)
-done
+  by (simp add: assms fresh_perm_app)
 
 lemma fresh_perm_name:
   fixes x::"name"
@@ -329,30 +289,27 @@
   and   M::"trm"
   assumes a: "x\<sharp>pi" "x\<sharp>M"
   shows "x\<sharp>(pi\<bullet>M)"
-using a
-apply -
-apply(simp add: fresh_left)
-apply(simp add: at_prm_fresh[OF at_name_inst] fresh_list_rev)
-done
+  by (simp add: assms fresh_perm_app)
 
 lemma fresh_fun_simp_NotL:
   assumes a: "x'\<sharp>P" "x'\<sharp>M"
   shows "fresh_fun (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x') = Cut <c>.P (x').NotL <a>.M x'"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_name_inst)
-apply(rule at_name_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(c,P,a,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app)
+  show "pt (TYPE(trm)::trm itself) (TYPE(name)::name itself)"
+    by(rule pt_name_inst)
+  show "at (TYPE(name)::name itself)"
+    by(rule at_name_inst)
+  show "finite (supp (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x')::name set)"
+    using a by(finite_guess)
+  obtain n::name where n: "n\<sharp>(c,P,a,M)"
+    by (metis assms fresh_atm(3) fresh_prod)
+  with assms have "n \<sharp> (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x')"
+    by (fresh_guess)
+  then show "\<exists>b. b \<sharp> (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x', Cut <c>.P (b).NotL <a>.M b)"
+    by (metis abs_fresh(1) abs_fresh(5) fresh_prod n trm.fresh(3))
+  show "x' \<sharp> (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x')"
+    using assms by(fresh_guess)
+qed
 
 lemma fresh_fun_NotL[eqvt_force]:
   fixes pi1::"name prm"
@@ -361,48 +318,30 @@
              fresh_fun (pi1\<bullet>(\<lambda>x'. Cut <c>.P (x').NotL <a>.M x'))"
   and   "pi2\<bullet>fresh_fun (\<lambda>x'. Cut <c>.P (x').NotL <a>.M x')=
              fresh_fun (pi2\<bullet>(\<lambda>x'. Cut <c>.P (x').NotL <a>.M x'))"
-apply -
-apply(perm_simp)
-apply(generate_fresh "name")
-apply(auto simp add: fresh_prod)
-apply(simp add: fresh_fun_simp_NotL)
-apply(rule sym)
-apply(rule trans)
-apply(rule fresh_fun_simp_NotL)
-apply(rule fresh_perm_name)
-apply(assumption)
-apply(assumption)
-apply(rule fresh_perm_name)
-apply(assumption)
-apply(assumption)
-apply(simp add: at_prm_fresh[OF at_name_inst] swap_simps)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,pi2\<bullet>P,pi2\<bullet>M,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_NotL calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(generate_fresh "name")
+   apply(auto simp: fresh_prod fresh_fun_simp_NotL)
+  apply (metis fresh_bij(1) fresh_fun_simp_NotL name_prm_coname_def)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,pi2\<bullet>P,pi2\<bullet>M,pi2)")
+   apply (metis fresh_fun_simp_NotL fresh_prodD swap_simps(8) trm.perm(14) trm.perm(16))
+  by (meson exists_fresh(1) fs_name1)
 
 lemma fresh_fun_simp_AndL1:
   assumes a: "z'\<sharp>P" "z'\<sharp>M" "z'\<sharp>x"
-  shows "fresh_fun (\<lambda>z'. Cut <c>.P (z').AndL1 (x).M z') = Cut <c>.P (z').AndL1 (x).M z'"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_name_inst)
-apply(rule at_name_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(c,P,x,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+  shows "fresh_fun (\<lambda>z'. Cut <c>.P(z').AndL1 (x).M z') = Cut <c>.P (z').AndL1 (x).M z'"
+proof (rule fresh_fun_app [OF pt_name_inst at_name_inst])
+  obtain n::name where "n\<sharp>(c,P,x,M)"
+    by (meson exists_fresh(1) fs_name1)
+  then show "\<exists>a. a \<sharp> (\<lambda>z'. Cut <c>.P(z').AndL1 x. M z', Cut <c>.P(a).AndL1 x. M a)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+next
+  show "z' \<sharp> (\<lambda>z'. Cut <c>.P(z').AndL1 x. M z')"
+    using a by(fresh_guess)
+qed finite_guess
 
 lemma fresh_fun_AndL1[eqvt_force]:
   fixes pi1::"name prm"
@@ -411,41 +350,30 @@
              fresh_fun (pi1\<bullet>(\<lambda>z'. Cut <c>.P (z').AndL1 (x).M z'))"
   and   "pi2\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P (z').AndL1 (x).M z')=
              fresh_fun (pi2\<bullet>(\<lambda>z'. Cut <c>.P (z').AndL1 (x).M z'))"
-apply -
 apply(perm_simp)
 apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>x,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndL1 at_prm_fresh[OF at_name_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
+apply(force simp add: fresh_prod fresh_fun_simp_AndL1 at_prm_fresh[OF at_name_inst] swap_simps)
+  apply (meson exists_fresh(1) fs_name1)
 apply(perm_simp)
 apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>x,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndL1 calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+apply(force simp add: fresh_prod fresh_fun_simp_AndL1 calc_atm)
+  by (meson exists_fresh'(1) fs_name1)
 
 lemma fresh_fun_simp_AndL2:
   assumes a: "z'\<sharp>P" "z'\<sharp>M" "z'\<sharp>x"
   shows "fresh_fun (\<lambda>z'. Cut <c>.P (z').AndL2 (x).M z') = Cut <c>.P (z').AndL2 (x).M z'"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_name_inst)
-apply(rule at_name_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(c,P,x,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_name_inst at_name_inst])
+  obtain n::name where "n\<sharp>(c,P,x,M)"
+    by (meson exists_fresh(1) fs_name1)
+  then show "\<exists>a. a \<sharp> (\<lambda>z'. Cut <c>.P(z').AndL2 x. M z', Cut <c>.P(a).AndL2 x. M a)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+next
+  show "z' \<sharp> (\<lambda>z'. Cut <c>.P(z').AndL2 x. M z')"
+    using a by(fresh_guess)           
+qed finite_guess
 
 lemma fresh_fun_AndL2[eqvt_force]:
   fixes pi1::"name prm"
@@ -454,84 +382,62 @@
              fresh_fun (pi1\<bullet>(\<lambda>z'. Cut <c>.P (z').AndL2 (x).M z'))"
   and   "pi2\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P (z').AndL2 (x).M z')=
              fresh_fun (pi2\<bullet>(\<lambda>z'. Cut <c>.P (z').AndL2 (x).M z'))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>x,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndL2 at_prm_fresh[OF at_name_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>x,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndL2 calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>x,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_AndL2 at_prm_fresh[OF at_name_inst] swap_simps)
+   apply (meson exists_fresh(1) fs_name1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,x,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>x,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_AndL2 calc_atm)
+  by (meson exists_fresh(1) fs_name1)
 
 lemma fresh_fun_simp_OrL:
   assumes a: "z'\<sharp>P" "z'\<sharp>M" "z'\<sharp>N" "z'\<sharp>u" "z'\<sharp>x"
-  shows "fresh_fun (\<lambda>z'. Cut <c>.P (z').OrL (x).M (u).N z') = Cut <c>.P (z').OrL (x).M (u).N z'"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_name_inst)
-apply(rule at_name_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(c,P,x,M,u,N)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+  shows "fresh_fun (\<lambda>z'. Cut <c>.P(z').OrL(x).M(u).N z') = Cut <c>.P (z').OrL (x).M (u).N z'"
+proof (rule fresh_fun_app [OF pt_name_inst at_name_inst])
+  obtain n::name where "n\<sharp>(c,P,x,M,u,N)"
+    by (meson exists_fresh(1) fs_name1)
+  then show "\<exists>a. a \<sharp> (\<lambda>z'. Cut <c>.P(z').OrL(x).M(u).N(z'), Cut <c>.P(a).OrL(x).M(u).N(a))"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+next
+  show "z' \<sharp> (\<lambda>z'. Cut <c>.P(z').OrL(x).M(u).N(z'))"
+    using a by(fresh_guess) 
+qed finite_guess
 
 lemma fresh_fun_OrL[eqvt_force]:
   fixes pi1::"name prm"
   and   pi2::"coname prm"
-  shows "pi1\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P (z').OrL (x).M (u).N z')=
-             fresh_fun (pi1\<bullet>(\<lambda>z'. Cut <c>.P (z').OrL (x).M (u).N z'))"
-  and   "pi2\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P (z').OrL (x).M (u).N z')=
-             fresh_fun (pi2\<bullet>(\<lambda>z'. Cut <c>.P (z').OrL (x).M (u).N z'))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,u,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>x,pi1\<bullet>u,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrL at_prm_fresh[OF at_name_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,u,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>x,pi2\<bullet>u,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrL calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+  shows "pi1\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P(z').OrL (x).M(u).N z')=
+             fresh_fun (pi1\<bullet>(\<lambda>z'. Cut <c>.P (z').OrL(x).M (u).N z'))"
+  and   "pi2\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P(z').OrL (x).M(u).N z')=
+             fresh_fun (pi2\<bullet>(\<lambda>z'. Cut <c>.P(z').OrL(x).M(u).N z'))"
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,u,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>x,pi1\<bullet>u,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_OrL at_prm_fresh[OF at_name_inst] swap_simps)
+   apply (meson exists_fresh(1) fs_name1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,u,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>x,pi2\<bullet>u,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_OrL calc_atm)
+  by (meson exists_fresh(1) fs_name1)
 
 lemma fresh_fun_simp_ImpL:
   assumes a: "z'\<sharp>P" "z'\<sharp>M" "z'\<sharp>N" "z'\<sharp>x"
   shows "fresh_fun (\<lambda>z'. Cut <c>.P (z').ImpL <a>.M (x).N z') = Cut <c>.P (z').ImpL <a>.M (x).N z'"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_name_inst)
-apply(rule at_name_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(c,P,x,M,N)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_name_inst at_name_inst])
+  obtain n::name where "n\<sharp>(c,P,x,M,N)"
+    by (meson exists_fresh(1) fs_name1)
+  then show "\<exists>aa. aa \<sharp> (\<lambda>z'. Cut <c>.P(z').ImpL <a>.M(x).N z', Cut <c>.P(aa).ImpL <a>.M(x).N aa)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+next
+  show "z' \<sharp> (\<lambda>z'. Cut <c>.P(z').ImpL <a>.M(x).N z')"
+    using a by(fresh_guess) 
+qed finite_guess
 
 lemma fresh_fun_ImpL[eqvt_force]:
   fixes pi1::"name prm"
@@ -540,41 +446,27 @@
              fresh_fun (pi1\<bullet>(\<lambda>z'. Cut <c>.P (z').ImpL <a>.M (x).N z'))"
   and   "pi2\<bullet>fresh_fun (\<lambda>z'. Cut <c>.P (z').ImpL <a>.M (x).N z')=
              fresh_fun (pi2\<bullet>(\<lambda>z'. Cut <c>.P (z').ImpL <a>.M (x).N z'))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>x,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_ImpL at_prm_fresh[OF at_name_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>x,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_ImpL calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>x,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_ImpL at_prm_fresh[OF at_name_inst] swap_simps)
+   apply (meson exists_fresh(1) fs_name1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::name. n\<sharp>(P,M,N,x,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>x,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_ImpL calc_atm)
+  by (meson exists_fresh(1) fs_name1)
 
 lemma fresh_fun_simp_NotR:
   assumes a: "a'\<sharp>P" "a'\<sharp>M"
   shows "fresh_fun (\<lambda>a'. Cut <a'>.(NotR (y).M a') (x).P) = Cut <a'>.(NotR (y).M a') (x).P"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_coname_inst)
-apply(rule at_coname_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(x,P,y,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_coname_inst at_coname_inst])
+  obtain n::coname where "n\<sharp>(x,P,y,M)"
+    by (metis assms(1) assms(2) fresh_atm(4) fresh_prod)
+  then show "\<exists>a. a \<sharp> (\<lambda>a'. Cut <a'>.(NotR (y).M a') (x).P, Cut <a>.NotR(y).M(a) (x).P)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+qed (use a in \<open>fresh_guess|finite_guess\<close>)+
 
 lemma fresh_fun_NotR[eqvt_force]:
   fixes pi1::"name prm"
@@ -583,41 +475,27 @@
              fresh_fun (pi1\<bullet>(\<lambda>a'. Cut <a'>.(NotR (y).M a') (x).P))"
   and   "pi2\<bullet>fresh_fun (\<lambda>a'. Cut <a'>.(NotR (y).M a') (x).P)=
              fresh_fun (pi2\<bullet>(\<lambda>a'. Cut <a'>.(NotR (y).M a') (x).P))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,pi1\<bullet>P,pi1\<bullet>M,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_NotR calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,pi2\<bullet>P,pi2\<bullet>M,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_NotR at_prm_fresh[OF at_coname_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,pi1\<bullet>P,pi1\<bullet>M,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_NotR calc_atm)
+   apply (meson exists_fresh(2) fs_coname1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,pi2\<bullet>P,pi2\<bullet>M,pi2)")
+   apply(force simp: fresh_prod fresh_fun_simp_NotR at_prm_fresh[OF at_coname_inst] swap_simps)
+  by (meson exists_fresh(2) fs_coname1)
 
 lemma fresh_fun_simp_AndR:
   assumes a: "a'\<sharp>P" "a'\<sharp>M" "a'\<sharp>N" "a'\<sharp>b" "a'\<sharp>c"
   shows "fresh_fun (\<lambda>a'. Cut <a'>.(AndR <b>.M <c>.N a') (x).P) = Cut <a'>.(AndR <b>.M <c>.N a') (x).P"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_coname_inst)
-apply(rule at_coname_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(x,P,b,M,c,N)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_coname_inst at_coname_inst])
+  obtain n::coname where "n\<sharp>(x,P,b,M,c,N)"
+    by (meson exists_fresh(2) fs_coname1)
+  then show "\<exists>a. a \<sharp> (\<lambda>a'. Cut <a'>.AndR <b>.M <c>.N(a') (x).P, Cut <a>.AndR <b>.M <c>.N(a) (x).P)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+qed (use a in \<open>fresh_guess|finite_guess\<close>)+
 
 lemma fresh_fun_AndR[eqvt_force]:
   fixes pi1::"name prm"
@@ -626,41 +504,27 @@
              fresh_fun (pi1\<bullet>(\<lambda>a'. Cut <a'>.(AndR <b>.M <c>.N a') (x).P))"
   and   "pi2\<bullet>fresh_fun (\<lambda>a'. Cut <a'>.(AndR <b>.M <c>.N a') (x).P)=
              fresh_fun (pi2\<bullet>(\<lambda>a'. Cut <a'>.(AndR <b>.M <c>.N a') (x).P))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,N,b,c,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>b,pi1\<bullet>c,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndR calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,N,b,c,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>b,pi2\<bullet>c,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_AndR at_prm_fresh[OF at_coname_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,N,b,c,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>N,pi1\<bullet>b,pi1\<bullet>c,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_AndR calc_atm)
+   apply (meson exists_fresh(2) fs_coname1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,N,b,c,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>N,pi2\<bullet>b,pi2\<bullet>c,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_AndR at_prm_fresh[OF at_coname_inst] swap_simps)
+  by (meson exists_fresh(2) fs_coname1)
 
 lemma fresh_fun_simp_OrR1:
   assumes a: "a'\<sharp>P" "a'\<sharp>M" "a'\<sharp>b" 
   shows "fresh_fun (\<lambda>a'. Cut <a'>.(OrR1 <b>.M a') (x).P) = Cut <a'>.(OrR1 <b>.M a') (x).P"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_coname_inst)
-apply(rule at_coname_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(x,P,b,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_coname_inst at_coname_inst])
+  obtain n::coname where "n\<sharp>(x,P,b,M)"
+    by (meson exists_fresh(2) fs_coname1)
+  then show "\<exists>a. a \<sharp> (\<lambda>a'. Cut <a'>.OrR1 <b>.M(a') (x).P, Cut <a>.OrR1 <b>.M(a) (x).P)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+qed (use a in \<open>fresh_guess|finite_guess\<close>)+
 
 lemma fresh_fun_OrR1[eqvt_force]:
   fixes pi1::"name prm"
@@ -669,41 +533,27 @@
              fresh_fun (pi1\<bullet>(\<lambda>a'. Cut <a'>.(OrR1 <b>.M  a') (x).P))"
   and   "pi2\<bullet>fresh_fun (\<lambda>a'. Cut <a'>.(OrR1 <b>.M a') (x).P)=
              fresh_fun (pi2\<bullet>(\<lambda>a'. Cut <a'>.(OrR1 <b>.M a') (x).P))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrR1 calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrR1 at_prm_fresh[OF at_coname_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_OrR1 calc_atm)
+   apply (meson exists_fresh(2) fs_coname1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_OrR1 at_prm_fresh[OF at_coname_inst] swap_simps)
+  by (meson exists_fresh(2) fs_coname1)
 
 lemma fresh_fun_simp_OrR2:
   assumes a: "a'\<sharp>P" "a'\<sharp>M" "a'\<sharp>b" 
   shows "fresh_fun (\<lambda>a'. Cut <a'>.(OrR2 <b>.M a') (x).P) = Cut <a'>.(OrR2 <b>.M a') (x).P"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_coname_inst)
-apply(rule at_coname_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(x,P,b,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_coname_inst at_coname_inst])
+  obtain n::coname where "n\<sharp>(x,P,b,M)"
+    by (meson exists_fresh(2) fs_coname1)
+  then show "\<exists>a. a \<sharp> (\<lambda>a'. Cut <a'>.OrR2 <b>.M(a') (x).P, Cut <a>.OrR2 <b>.M(a) (x).P)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+qed (use a in \<open>fresh_guess|finite_guess\<close>)+
 
 lemma fresh_fun_OrR2[eqvt_force]:
   fixes pi1::"name prm"
@@ -712,41 +562,27 @@
              fresh_fun (pi1\<bullet>(\<lambda>a'. Cut <a'>.(OrR2 <b>.M  a') (x).P))"
   and   "pi2\<bullet>fresh_fun (\<lambda>a'. Cut <a'>.(OrR2 <b>.M a') (x).P)=
              fresh_fun (pi2\<bullet>(\<lambda>a'. Cut <a'>.(OrR2 <b>.M a') (x).P))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrR2 calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_OrR2 at_prm_fresh[OF at_coname_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_OrR2 calc_atm)
+   apply (meson exists_fresh(2) fs_coname1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_OrR2 at_prm_fresh[OF at_coname_inst] swap_simps)
+  by (meson exists_fresh(2) fs_coname1)
 
 lemma fresh_fun_simp_ImpR:
   assumes a: "a'\<sharp>P" "a'\<sharp>M" "a'\<sharp>b" 
   shows "fresh_fun (\<lambda>a'. Cut <a'>.(ImpR (y).<b>.M a') (x).P) = Cut <a'>.(ImpR (y).<b>.M a') (x).P"
-using a
-apply -
-apply(rule fresh_fun_app)
-apply(rule pt_coname_inst)
-apply(rule at_coname_inst)
-apply(finite_guess)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(x,P,y,b,M)")
-apply(erule exE)
-apply(rule_tac x="n" in exI)
-apply(simp add: fresh_prod abs_fresh)
-apply(fresh_guess)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(fresh_guess)
-done
+proof (rule fresh_fun_app [OF pt_coname_inst at_coname_inst])
+  obtain n::coname where "n\<sharp>(x,P,y,b,M)"
+    by (meson exists_fresh(2) fs_coname1)
+  then show "\<exists>a. a \<sharp> (\<lambda>a'. Cut <a'>.(ImpR (y).<b>.M a') (x).P, Cut <a>.(ImpR (y).<b>.M a) (x).P)"
+    apply(intro exI [where x="n"])
+    apply(simp add: fresh_prod abs_fresh)
+    apply(fresh_guess)
+    done
+qed (use a in \<open>fresh_guess|finite_guess\<close>)+
 
 lemma fresh_fun_ImpR[eqvt_force]:
   fixes pi1::"name prm"
@@ -755,22 +591,14 @@
              fresh_fun (pi1\<bullet>(\<lambda>a'. Cut <a'>.(ImpR (y).<b>.M  a') (x).P))"
   and   "pi2\<bullet>fresh_fun (\<lambda>a'. Cut <a'>.(ImpR (y).<b>.M a') (x).P)=
              fresh_fun (pi2\<bullet>(\<lambda>a'. Cut <a'>.(ImpR (y).<b>.M a') (x).P))"
-apply -
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_ImpR calc_atm)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-apply(perm_simp)
-apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
-apply(simp add: fresh_prod)
-apply(auto)
-apply(simp add: fresh_fun_simp_ImpR at_prm_fresh[OF at_coname_inst] swap_simps)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+   apply(perm_simp)
+   apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi1\<bullet>P,pi1\<bullet>M,pi1\<bullet>b,pi1)")
+    apply(force simp add: fresh_prod fresh_fun_simp_ImpR calc_atm)
+   apply (meson exists_fresh(2) fs_coname1)
+  apply(perm_simp)
+  apply(subgoal_tac "\<exists>n::coname. n\<sharp>(P,M,b,pi2\<bullet>P,pi2\<bullet>M,pi2\<bullet>b,pi2)")
+   apply(force simp add: fresh_prod fresh_fun_simp_ImpR at_prm_fresh[OF at_coname_inst] swap_simps)
+  by (meson exists_fresh(2) fs_coname1)
 
 nominal_primrec (freshness_context: "(y::name,c::coname,P::trm)")
   substn :: "trm \<Rightarrow> name   \<Rightarrow> coname \<Rightarrow> trm \<Rightarrow> trm" ("_{_:=<_>._}" [100,100,100,100] 100) 
@@ -798,50 +626,40 @@
 | "\<lbrakk>a\<sharp>(N,c,P);x\<sharp>(y,P,M,z)\<rbrakk> \<Longrightarrow> (ImpL <a>.M (x).N z){y:=<c>.P} = 
   (if y=z then fresh_fun (\<lambda>z'. Cut <c>.P (z').ImpL <a>.(M{y:=<c>.P}) (x).(N{y:=<c>.P}) z') 
    else ImpL <a>.(M{y:=<c>.P}) (x).(N{y:=<c>.P}) z)"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1,x3,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1,x3,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x3,P,y1,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::name. x\<sharp>(x3,P,y1,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
+apply(finite_guess | simp add: abs_fresh abs_supp fin_supp | fresh_guess | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_NotL abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_AndL1 abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_AndL2 abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1,x3,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_OrL abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x1,P,y1,x3,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_OrL abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x3,P,y1,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_ImpL abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
+
+apply(simp add: abs_fresh abs_supp fin_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::name. x\<sharp>(x3,P,y1,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_ImpL abs_fresh fresh_atm)
+apply (meson exists_fresh(1) fs_name1)
 apply(fresh_guess)+
 done
 
@@ -870,801 +688,377 @@
    else ImpR (x).<a>.(M{d:=(z).P}) b)"
 | "\<lbrakk>a\<sharp>(N,d,P);x\<sharp>(y,z,P,M)\<rbrakk> \<Longrightarrow> (ImpL <a>.M (x).N y){d:=(z).P} = 
   ImpL <a>.(M{d:=(z).P}) (x).(N{d:=(z).P}) y"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1,x3,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1,x3,y2)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,x2,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh fresh_atm abs_supp)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(rule impI)
-apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,x2,y1)", erule exE, simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh fresh_atm)
-apply(rule exists_fresh', simp add: fin_supp)
-apply(simp add: abs_fresh abs_supp)+
-apply(fresh_guess add: abs_fresh fresh_prod)+
+apply(finite_guess | simp add: abs_fresh abs_supp fs_name1 fs_coname1 | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_NotR abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1 | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1,x3,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_AndR abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1 | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1,x3,y2)")
+apply(force simp add: fresh_prod fresh_fun_simp_AndR abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1 | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_OrR1 abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp fs_name1 fs_coname1 | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_OrR2 abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,x2,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_ImpR abs_fresh fresh_atm abs_supp)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh abs_supp | rule strip)+
+apply(subgoal_tac "\<exists>x::coname. x\<sharp>(x1,P,x2,y1)")
+apply(force simp add: fresh_prod fresh_fun_simp_ImpR abs_fresh fresh_atm)
+apply(meson exists_fresh' fin_supp)
+
+apply(simp add: abs_fresh | fresh_guess add: abs_fresh)+
 done
 
+
 lemma csubst_eqvt[eqvt]:
   fixes pi1::"name prm"
   and   pi2::"coname prm"
   shows "pi1\<bullet>(M{c:=(x).N}) = (pi1\<bullet>M){(pi1\<bullet>c):=(pi1\<bullet>x).(pi1\<bullet>N)}"
   and   "pi2\<bullet>(M{c:=(x).N}) = (pi2\<bullet>M){(pi2\<bullet>c):=(pi2\<bullet>x).(pi2\<bullet>N)}"
-apply(nominal_induct M avoiding: c x N rule: trm.strong_induct)
-apply(auto simp add: eq_bij fresh_bij eqvts)
-apply(perm_simp)+
-done
+by (nominal_induct M avoiding: c x N rule: trm.strong_induct)
+   (auto simp: eq_bij fresh_bij eqvts; perm_simp)+
 
 lemma nsubst_eqvt[eqvt]:
   fixes pi1::"name prm"
   and   pi2::"coname prm"
   shows "pi1\<bullet>(M{x:=<c>.N}) = (pi1\<bullet>M){(pi1\<bullet>x):=<(pi1\<bullet>c)>.(pi1\<bullet>N)}"
   and   "pi2\<bullet>(M{x:=<c>.N}) = (pi2\<bullet>M){(pi2\<bullet>x):=<(pi2\<bullet>c)>.(pi2\<bullet>N)}"
-apply(nominal_induct M avoiding: c x N rule: trm.strong_induct)
-apply(auto simp add: eq_bij fresh_bij eqvts)
-apply(perm_simp)+
-done
+by (nominal_induct M avoiding: c x N rule: trm.strong_induct)
+   (auto simp: eq_bij fresh_bij eqvts; perm_simp)+
 
 lemma supp_subst1:
   shows "supp (M{y:=<c>.P}) \<subseteq> ((supp M) - {y}) \<union> (supp P)"
-apply(nominal_induct M avoiding: y P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-done
-
+proof (nominal_induct M avoiding: y P c rule: trm.strong_induct)
+  case (NotL coname trm name)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P)"
+    by (meson exists_fresh(1) fs_name1)
+  with NotL
+   show ?case 
+     by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotL; blast)
+next
+  case (AndL1 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL1 show ?case
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL1 fresh_atm; blast)
+next
+  case (AndL2 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL2 show ?case
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL2 fresh_atm; blast)
+next
+  case (OrL name1 trm1 name2 trm2 name3)
+  obtain x'::name where "x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)"
+    by (meson exists_fresh(1) fs_name1)
+  with OrL show ?case 
+    by (auto simp: fs_name1 fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrL fresh_atm; blast)
+next
+  case (ImpL coname trm1 name1 trm2 name2)
+  obtain x'::name where "x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})"
+    by (meson exists_fresh(1) fs_name1)
+  with ImpL show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpL fresh_atm; blast)
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
+
+text \<open>Identical to the previous proof\<close>
 lemma supp_subst2:
   shows "supp (M{y:=<c>.P}) \<subseteq> supp (M) \<union> ((supp P) - {c})"
-apply(nominal_induct M avoiding: y P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)+
-done
+proof (nominal_induct M avoiding: y P c rule: trm.strong_induct)
+  case (NotL coname trm name)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P)"
+    by (meson exists_fresh(1) fs_name1)
+  with NotL
+   show ?case 
+     by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotL; blast)
+next
+  case (AndL1 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL1 show ?case
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL1 fresh_atm; blast)
+next
+  case (AndL2 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL2 show ?case
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL2 fresh_atm; blast)
+next
+  case (OrL name1 trm1 name2 trm2 name3)
+  obtain x'::name where "x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)"
+    by (meson exists_fresh(1) fs_name1)
+  with OrL show ?case 
+    by (auto simp: fs_name1 fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrL fresh_atm; blast)
+next
+  case (ImpL coname trm1 name1 trm2 name2)
+  obtain x'::name where "x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})"
+    by (meson exists_fresh(1) fs_name1)
+  with ImpL show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpL fresh_atm; blast)
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
 
 lemma supp_subst3:
   shows "supp (M{c:=(x).P}) \<subseteq> ((supp M) - {c}) \<union> (supp P)"
-apply(nominal_induct M avoiding: x P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-done
+proof (nominal_induct M avoiding: x P c rule: trm.strong_induct)
+  case (NotR name trm coname)
+  obtain x'::coname where "x'\<sharp>(trm{coname:=(x).P},P)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with NotR show ?case
+     by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotR; blast)
+next
+  case (AndR coname1 trm1 coname2 trm2 coname3)
+  obtain x'::coname where x': "x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with AndR show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndR; blast)
+next
+  case (OrR1 coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR1 show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR1; blast)
+next
+  case (OrR2 coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR2 show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR2; blast)  
+next
+  case (ImpR name coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with ImpR show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpR; blast)
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
+
 
 lemma supp_subst4:
   shows "supp (M{c:=(x).P}) \<subseteq> (supp M) \<union> ((supp P) - {x})"
-apply(nominal_induct M avoiding: x P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-done
+proof (nominal_induct M avoiding: x P c rule: trm.strong_induct)
+  case (NotR name trm coname)
+  obtain x'::coname where "x'\<sharp>(trm{coname:=(x).P},P)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with NotR show ?case
+     by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotR; blast)
+next
+  case (AndR coname1 trm1 coname2 trm2 coname3)
+  obtain x'::coname where x': "x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with AndR show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndR; blast)
+next
+  case (OrR1 coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR1 show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR1; blast)
+next
+  case (OrR2 coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR2 show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR2; blast)  
+next
+  case (ImpR name coname1 trm coname2)
+  obtain x'::coname where x': "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with ImpR show ?case 
+    by (auto simp: fresh_prod abs_supp supp_atm trm.supp fs_name1 fresh_fun_simp_ImpR; blast)
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
 
 lemma supp_subst5:
   shows "(supp M - {y}) \<subseteq> supp (M{y:=<c>.P})"
-apply(nominal_induct M avoiding: y P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-done
+proof (nominal_induct M avoiding: y P c rule: trm.strong_induct)
+  case (NotL coname trm name)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P)"
+    by (meson exists_fresh(1) fs_name1)
+  with NotL
+  show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotL)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndL1 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL1 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL1)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndL2 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL2 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL2)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (OrL name1 trm1 name2 trm2 name3)
+  obtain x'::name where "x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)"
+    by (meson exists_fresh(1) fs_name1)
+  with OrL show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrL)
+           apply (fastforce simp: fresh_def)+
+    done
+next
+  case (ImpL coname trm1 name1 trm2 name2)
+  obtain x'::name where "x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})"
+    by (meson exists_fresh(1) fs_name1)
+  with ImpL show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpL)
+           apply (fastforce simp: fresh_def)+
+    done
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
 
 lemma supp_subst6:
   shows "(supp M) \<subseteq> ((supp (M{y:=<c>.P}))::coname set)"
-apply(nominal_induct M avoiding: y P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{y:=<c>.P},P,name1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndL2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpL abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm)
-apply(blast)
-apply(rule exists_fresh'(1)[OF fs_name1])
-apply(blast)
-done
+proof (nominal_induct M avoiding: y P c rule: trm.strong_induct)
+  case (NotL coname trm name)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P)"
+    by (meson exists_fresh(1) fs_name1)
+  with NotL
+  show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotL)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndL1 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL1 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL1)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndL2 name1 trm name2)
+  obtain x'::name where "x'\<sharp>(trm{y:=<c>.P},P,name1)"
+    by (meson exists_fresh(1) fs_name1)
+  with AndL2 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndL2)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (OrL name1 trm1 name2 trm2 name3)
+  obtain x'::name where "x'\<sharp>(trm1{y:=<c>.P},P,name1,trm2{y:=<c>.P},name2)"
+    by (meson exists_fresh(1) fs_name1)
+  with OrL show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrL)
+           apply (fastforce simp: fresh_def)+
+    done
+next
+  case (ImpL coname trm1 name1 trm2 name2)
+  obtain x'::name where "x'\<sharp>(trm1{name2:=<c>.P},P,name1,trm2{name2:=<c>.P})"
+    by (meson exists_fresh(1) fs_name1)
+  with ImpL show ?case 
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpL)
+           apply (fastforce simp: fresh_def)+
+    done
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
 
 lemma supp_subst7:
   shows "(supp M - {c}) \<subseteq>  supp (M{c:=(x).P})"
-apply(nominal_induct M avoiding: x P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)
-done
-
+proof (nominal_induct M avoiding: x P c rule: trm.strong_induct)
+  case (NotR name trm coname)
+  obtain x'::coname where "x'\<sharp>(trm{coname:=(x).P},P)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with NotR show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotR)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndR coname1 trm1 coname2 trm2 coname3)
+  obtain x'::coname where "x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with AndR show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndR)
+     apply (fastforce simp: fresh_def)+
+    done
+next
+  case (OrR1 coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR1 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR1)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (OrR2 coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR2 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR2)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (ImpR name coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with ImpR show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_ImpR)
+     apply (auto simp: fresh_def)
+    done
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
+  
 lemma supp_subst8:
   shows "(supp M) \<subseteq> ((supp (M{c:=(x).P}))::name set)"
-apply(nominal_induct M avoiding: x P c rule: trm.strong_induct)
-apply(auto)
-apply(auto simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(x).P},P)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_NotR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_AndR abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR1 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_OrR2 abs_fresh fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)
-apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname2:=(x).P},P,coname1)")
-apply(erule exE)
-apply(simp add: fresh_prod)
-apply(erule conjE)+
-apply(simp add: fresh_fun_simp_ImpR abs_fresh abs_supp fin_supp fresh_atm)
-apply(simp add: fresh_def abs_supp trm.supp supp_atm fin_supp)
-apply(blast)
-apply(rule exists_fresh'(2)[OF fs_coname1])
-apply(blast)+
-done
-
+proof (nominal_induct M avoiding: x P c rule: trm.strong_induct)
+  case (NotR name trm coname)
+  obtain x'::coname where "x'\<sharp>(trm{coname:=(x).P},P)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with NotR show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_NotR)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (AndR coname1 trm1 coname2 trm2 coname3)
+  obtain x'::coname where "x'\<sharp>(trm1{coname3:=(x).P},P,trm2{coname3:=(x).P},coname1,coname2)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with AndR show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_AndR)
+     apply (fastforce simp: fresh_def)+
+    done
+next
+  case (OrR1 coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR1 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR1)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (OrR2 coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with OrR2 show ?case
+    apply (auto simp: fresh_prod abs_supp supp_atm trm.supp fresh_fun_simp_OrR2)
+     apply (auto simp: fresh_def)
+    done
+next
+  case (ImpR name coname1 trm coname2)
+  obtain x'::coname where "x'\<sharp>(trm{coname2:=(x).P},P,coname1)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with ImpR show ?case
+    by (force simp: fresh_prod abs_supp fs_name1 supp_atm trm.supp fresh_fun_simp_ImpR)
+qed (simp add: abs_supp supp_atm trm.supp fs_name1; blast)+
+  
 lemmas subst_supp = supp_subst1 supp_subst2 supp_subst3 supp_subst4
                     supp_subst5 supp_subst6 supp_subst7 supp_subst8
 lemma subst_fresh:
@@ -1678,17 +1072,14 @@
   and   "b\<sharp>(M,P) \<Longrightarrow> b\<sharp>M{c:=(y).P}"
   and   "b\<sharp>M \<Longrightarrow> b\<sharp>M{y:=<b>.P}"
   and   "b\<sharp>(M,P) \<Longrightarrow> b\<sharp>M{y:=<c>.P}"
-apply -
-apply(insert subst_supp)
-apply(simp_all add: fresh_def supp_prod)
-apply(blast)+ 
-done
+  using subst_supp
+  by(fastforce simp add: fresh_def supp_prod)+
 
 lemma forget:
   shows "x\<sharp>M \<Longrightarrow> M{x:=<c>.P} = M"
   and   "c\<sharp>M \<Longrightarrow> M{c:=(x).P} = M"
 apply(nominal_induct M avoiding: x c P rule: trm.strong_induct)
-apply(auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+apply(auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 done
 
 lemma substc_rename1:
@@ -1696,198 +1087,81 @@
   shows "M{a:=(x).N} = ([(c,a)]\<bullet>M){c:=(x).N}"
 using a
 proof(nominal_induct M avoiding: c a x N rule: trm.strong_induct)
-  case (Ax z d)
-  then show ?case by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha)
-next
-  case NotL
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (NotR y M d)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
   case (AndR c1 M c2 M' c3)
   then show ?case
-    apply(auto simp add: fresh_prod calc_atm fresh_atm abs_fresh fresh_left)
-    apply (metis (erased, opaque_lifting))
-    by metis
-next
-  case AndL1
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case AndL2
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (OrR1 d M e)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (OrR2 d M e)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (OrL x1 M x2 M' x3)
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+    apply(auto simp: fresh_prod calc_atm fresh_atm abs_fresh fresh_left)
+     apply (metis (no_types, lifting))+
+    done
 next 
   case ImpL
   then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+    by (auto simp: calc_atm alpha fresh_atm abs_fresh fresh_prod fresh_left)
        metis
 next
-  case (ImpR y d M e)
-  then show ?case
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next
   case (Cut d M y M')
   then show ?case
     by(simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
       (metis crename.simps(1) crename_id crename_rename)
-qed
+qed (auto simp: calc_atm alpha fresh_atm abs_fresh fresh_prod fresh_left trm.inject)
 
 lemma substc_rename2:
   assumes a: "y\<sharp>(N,x)"
   shows "M{a:=(x).N} = M{a:=(y).([(y,x)]\<bullet>N)}"
 using a
 proof(nominal_induct M avoiding: a x y N rule: trm.strong_induct)
-  case (Ax z d)
-  then show ?case 
-    by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
-next
-  case NotL
-  then show ?case 
-    by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
-next
   case (NotR y M d)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(N,M{d:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_NotR)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(2)[OF fs_coname1])
-    done
+  obtain a::coname where "a\<sharp>(N,M{d:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N)"
+    by (meson exists_fresh(2) fs_coname1)
+  with NotR show ?case
+    apply(auto simp: calc_atm alpha fresh_atm fresh_prod fresh_left)
+    by (metis (no_types, opaque_lifting) alpha(1) trm.inject(2))
 next
   case (AndR c1 M c2 M' c3)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac 
-       "\<exists>a'::coname. a'\<sharp>(N,M{c3:=(y).([(y,x)]\<bullet>N)},M'{c3:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,c1,c2,c3)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_AndR)
-    apply (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh subst_fresh perm_swap fresh_left)
-    apply(rule exists_fresh'(2)[OF fs_coname1])
-    done
-next
-  case AndL1
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next
-  case AndL2
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+  obtain a'::coname where "a'\<sharp>(N,M{c3:=(y).([(y,x)]\<bullet>N)},M'{c3:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,c1,c2,c3)"
+    by (meson exists_fresh(2) fs_coname1)
+  with AndR show ?case
+    apply(auto simp: calc_atm alpha fresh_atm fresh_prod fresh_left)
+    by (metis (no_types, opaque_lifting) alpha(1) trm.inject(2))
 next
   case (OrR1 d M e)
-  then show ?case 
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_OrR1)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(2)[OF fs_coname1])
-    done
+  obtain a'::coname where "a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)"
+    by (meson exists_fresh(2) fs_coname1)
+  with OrR1 show ?case 
+    by (auto simp: perm_swap calc_atm trm.inject alpha fresh_atm fresh_prod fresh_left fresh_fun_simp_OrR1)
 next
   case (OrR2 d M e)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_OrR2)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(2)[OF fs_coname1])
-    done
-next
-  case (OrL x1 M x2 M' x3)
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next 
-  case ImpL
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+  obtain a'::coname where "a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)"
+    by (meson exists_fresh(2) fs_coname1)
+  with OrR2 show ?case 
+    by (auto simp: perm_swap calc_atm trm.inject alpha fresh_atm fresh_prod fresh_left fresh_fun_simp_OrR2)
 next
   case (ImpR y d M e)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_ImpR)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(2)[OF fs_coname1])
-    done
-next
-  case (Cut d M y M')
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left perm_swap)
-qed
+  obtain a'::coname where "a'\<sharp>(N,M{e:=(y).([(y,x)]\<bullet>N)},[(y,x)]\<bullet>N,d,e)"
+    by (meson exists_fresh(2) fs_coname1)
+  with ImpR show ?case 
+    by (auto simp: perm_swap calc_atm trm.inject alpha fresh_atm fresh_prod fresh_left fresh_fun_simp_ImpR) 
+qed (auto simp: calc_atm trm.inject alpha fresh_atm fresh_prod fresh_left perm_swap)
 
 lemma substn_rename3:
   assumes a: "y\<sharp>(M,x)"
   shows "M{x:=<a>.N} = ([(y,x)]\<bullet>M){y:=<a>.N}"
 using a
 proof(nominal_induct M avoiding: a x y N rule: trm.strong_induct)
-  case (Ax z d)
-  then show ?case by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha)
-next
-  case NotR
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (NotL d M z)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (AndR c1 M c2 M' c3)
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next
-  case OrR1
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case OrR2
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (AndL1 u M v)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
-  case (AndL2 u M v)
-  then show ?case 
-    by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod)
-next
   case (OrL x1 M x2 M' x3)
   then show ?case
-    by(simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-      (metis (poly_guards_query))
-next 
-  case ImpR
-  then show ?case
-  by(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_left abs_supp fin_supp fresh_prod)
+    apply(auto simp add: calc_atm fresh_atm abs_fresh fresh_prod fresh_left)
+    by (metis (mono_tags))+
 next
   case (ImpL d M v M' u)
   then show ?case
-    by(simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-       (metis (poly_guards_query))
+    apply(auto simp add: calc_atm fresh_atm abs_fresh fresh_prod fresh_left)
+    by (metis (mono_tags))+
 next
   case (Cut d M y M')
   then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(drule pt_bij1[OF pt_name_inst, OF at_name_inst])
-    apply(simp add: calc_atm)
-    apply metis
-    done
-qed
+    apply(auto simp: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+    by (metis nrename.simps(1) nrename_id nrename_rename)+
+qed (auto simp: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_left abs_supp fin_supp fresh_prod)
 
 lemma substn_rename4:
   assumes a: "c\<sharp>(N,a)"
@@ -1896,86 +1170,51 @@
 proof(nominal_induct M avoiding: x c a N rule: trm.strong_induct)
   case (Ax z d)
   then show ?case 
-    by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
+    by (auto simp: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
 next
   case NotR
   then show ?case 
-    by (auto simp add: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
+    by (auto simp: fresh_prod fresh_atm calc_atm trm.inject alpha perm_swap fresh_left)
 next
   case (NotL d M y)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::name. a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_NotL)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(1)[OF fs_name1])
-    done
+  then obtain a'::name where "a'\<sharp>(N, M{x:=<c>.([(c,a)]\<bullet>N)}, [(c,a)]\<bullet>N)"
+    by (meson exists_fresh(1) fs_name1)
+  with NotL show ?case
+    apply(auto simp: calc_atm trm.inject fresh_atm fresh_prod fresh_left)
+    by (metis (no_types, opaque_lifting) alpha(2) trm.inject(2))
 next
   case (OrL x1 M x2 M' x3)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac 
-       "\<exists>a'::name. a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},M'{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,x1,x2,x3)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_OrL)
-    apply (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh subst_fresh perm_swap fresh_left)
-    apply(rule exists_fresh'(1)[OF fs_name1])
-    done
-next
-  case OrR1
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next
-  case OrR2
-  then show ?case by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+  then obtain a'::name where "a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},M'{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,x1,x2,x3)"
+    by (meson exists_fresh(1) fs_name1)  
+  with OrL show ?case
+    apply(auto simp: calc_atm trm.inject fresh_atm fresh_prod fresh_left)
+    by (metis (no_types) alpha'(2) trm.inject(2))
 next
   case (AndL1 u M v)
-  then show ?case 
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::name. a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,u,v)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_AndL1)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(1)[OF fs_name1])
-    done
+  then obtain a'::name where "a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,u,v)"
+    by (meson exists_fresh(1) fs_name1)  
+  with AndL1 show ?case 
+    apply(auto simp: calc_atm trm.inject fresh_atm fresh_prod fresh_left)
+    by (metis (mono_tags, opaque_lifting) alpha'(2) trm.inject(2))
 next
   case (AndL2 u M v)
-  then show ?case 
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::name. a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,u,v)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_AndL2)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(1)[OF fs_name1])
-    done
-next
-  case (AndR c1 M c2 M' c3)
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-next 
-  case ImpR
-  then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
+  then obtain a'::name where "a'\<sharp>(N,M{x:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,u,v)"
+    by (meson exists_fresh(1) fs_name1)  
+  with AndL2 show ?case 
+    apply(auto simp: calc_atm trm.inject fresh_atm fresh_prod fresh_left)
+    by (metis (mono_tags, opaque_lifting) alpha'(2) trm.inject(2))
 next
   case (ImpL d M y M' u)
-  then show ?case
-    apply(auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left)
-    apply(subgoal_tac "\<exists>a'::name. a'\<sharp>(N,M{u:=<c>.([(c,a)]\<bullet>N)},M'{u:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,y,u)")
-    apply(erule exE, simp add: fresh_prod)
-    apply(erule conjE)+
-    apply(simp add: fresh_fun_simp_ImpL)
-    apply(simp add: trm.inject alpha perm_swap fresh_left calc_atm)
-    apply(rule exists_fresh'(1)[OF fs_name1])
-    done
+  then obtain a'::name where "a'\<sharp>(N,M{u:=<c>.([(c,a)]\<bullet>N)},M'{u:=<c>.([(c,a)]\<bullet>N)},[(c,a)]\<bullet>N,y,u)"
+    by (meson exists_fresh(1) fs_name1)  
+  with ImpL show ?case
+    apply(auto simp: calc_atm trm.inject fresh_atm fresh_prod fresh_left)
+    by (metis (no_types) alpha'(2) trm.inject(2))
 next
   case (Cut d M y M')
   then show ?case
-    by (auto simp add: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left perm_swap)
-qed
+    by (auto simp: calc_atm trm.inject alpha fresh_atm abs_fresh fresh_prod fresh_left perm_swap)
+qed (auto simp: calc_atm fresh_atm fresh_left)
 
 lemma subst_rename5:
   assumes a: "c'\<sharp>(c,N)" "x'\<sharp>(x,M)"
@@ -2005,30 +1244,20 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,c,P,x,y)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,c,P,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq1: "(Cut <a>.M (x).N) = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   have eq2: "(M=Ax y a) = (([(a',a)]\<bullet>M)=Ax y a')"
-    apply(auto simp add: calc_atm)
-    apply(drule pt_bij1[OF pt_coname_inst, OF at_coname_inst])
-    apply(simp add: calc_atm)
-    done
+    by (metis perm_swap(4) swap_simps(4) swap_simps(8) trm.perm(13))
   have "(Cut <a>.M (x).N){y:=<c>.P} = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)){y:=<c>.P}" 
     using eq1 by simp
   also have "\<dots> = (if ([(a',a)]\<bullet>M)=Ax y a' then Cut <c>.P (x').(([(x',x)]\<bullet>N){y:=<c>.P}) 
                               else Cut <a'>.(([(a',a)]\<bullet>M){y:=<c>.P}) (x').(([(x',x)]\<bullet>N){y:=<c>.P}))" 
-    using fs1 fs2 by (auto simp add: fresh_prod fresh_left calc_atm fresh_atm)
+    using fs1 fs2 by (auto simp: fresh_prod fresh_left calc_atm fresh_atm)
   also have "\<dots> =(if M=Ax y a then Cut <c>.P (x).(N{y:=<c>.P}) else Cut <a>.(M{y:=<c>.P}) (x).(N{y:=<c>.P}))"
     using fs1 fs2 a
-    apply -
-    apply(simp only: eq2[symmetric])
-    apply(auto simp add: trm.inject)
-    apply(simp_all add: alpha fresh_atm fresh_prod subst_fresh)
-    apply(simp_all add: eqvts perm_fresh_fresh calc_atm)
-    apply(auto)
-    apply(rule subst_rename)
-    apply(simp add: fresh_prod fresh_atm)
-    apply(simp add: abs_fresh)
-    apply(simp add: perm_fresh_fresh)
-    done
+    unfolding eq2[symmetric]
+    apply(auto simp: trm.inject)
+    apply(simp_all add: alpha fresh_atm fresh_prod subst_fresh eqvts perm_fresh_fresh calc_atm)
+    by (metis abs_fresh(2) fresh_atm(2) fresh_prod perm_fresh_fresh(2) substn_rename4)
   finally show ?thesis by simp
 qed
     
@@ -2040,12 +1269,9 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,c,P,x,y)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,c,P,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq1: "(Cut <a>.M (x).N) = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N))"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   have eq2: "(N=Ax x c) = (([(x',x)]\<bullet>N)=Ax x' c)"
-    apply(auto simp add: calc_atm)
-    apply(drule pt_bij1[OF pt_name_inst, OF at_name_inst])
-    apply(simp add: calc_atm)
-    done
+    by (metis perm_dj(1) perm_swap(1) swap_simps(1) trm.perm(1))
   have "(Cut <a>.M (x).N){c:=(y).P} = (Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)){c:=(y).P}" 
     using eq1 by simp
   also have "\<dots> = (if ([(x',x)]\<bullet>N)=Ax x' c then  Cut <a'>.(([(a',a)]\<bullet>M){c:=(y).P}) (y).P
@@ -2053,52 +1279,42 @@
     using fs1 fs2  by (simp add: fresh_prod fresh_left calc_atm fresh_atm trm.inject)
   also have "\<dots> =(if N=Ax x c then Cut <a>.(M{c:=(y).P}) (y).P else Cut <a>.(M{c:=(y).P}) (x).(N{c:=(y).P}))"
     using fs1 fs2 a
-    apply -
-    apply(simp only: eq2[symmetric])
-    apply(auto simp add: trm.inject)
-    apply(simp_all add: alpha fresh_atm fresh_prod subst_fresh)
-    apply(simp_all add: eqvts perm_fresh_fresh calc_atm)
-    apply(auto)
-    apply(rule subst_rename)
-    apply(simp add: fresh_prod fresh_atm)
-    apply(simp add: abs_fresh)
-    apply(simp add: perm_fresh_fresh)
-    done
+    unfolding eq2[symmetric]
+    apply(auto simp: trm.inject)
+    apply(simp_all add: alpha fresh_atm fresh_prod subst_fresh eqvts perm_fresh_fresh calc_atm)
+    by (metis abs_fresh(1) fresh_atm(1) fresh_prod perm_fresh_fresh(1) substc_rename2)
   finally show ?thesis by simp
 qed
 
 lemma better_Cut_substn':
-  assumes a: "a\<sharp>[c].P" "y\<sharp>(N,x)" "M\<noteq>Ax y a"
+  assumes "a\<sharp>[c].P" "y\<sharp>(N,x)" "M\<noteq>Ax y a"
   shows "(Cut <a>.M (x).N){y:=<c>.P} = Cut <a>.(M{y:=<c>.P}) (x).N"
-using a
-apply -
-apply(generate_fresh "name")
-apply(subgoal_tac "Cut <a>.M (x).N = Cut <a>.M (ca).([(ca,x)]\<bullet>N)")
-apply(simp)
-apply(subgoal_tac"y\<sharp>([(ca,x)]\<bullet>N)")
-apply(simp add: forget)
-apply(simp add: trm.inject)
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)[1]
-apply(simp add: trm.inject)
-apply(rule sym)
-apply(simp add: alpha fresh_prod fresh_atm)
-done
+proof -
+  obtain d::name where d: "d \<sharp> (M, N, P, a, c, x, y)"
+    by (meson exists_fresh(1) fs_name1)
+  then have *: "y\<sharp>([(d,x)]\<bullet>N)"
+    by (metis assms(2) fresh_atm(1) fresh_list_cons fresh_list_nil fresh_perm_name fresh_prod)
+  with d have "Cut <a>.M (x).N = Cut <a>.M (d).([(d,x)]\<bullet>N)"
+    by (metis (no_types, lifting) alpha(1) fresh_prodD perm_fresh_fresh(1) trm.inject(2))
+  with * d assms show ?thesis
+    apply(simp add: fresh_prod)
+    by (smt (verit, ccfv_SIG) forget(1) trm.inject(2))
+qed
 
 lemma better_NotR_substc:
   assumes a: "d\<sharp>M"
   shows "(NotR (x).M d){d:=(z).P} = fresh_fun (\<lambda>a'. Cut <a'>.NotR (x).M a' (z).P)"
-using a
-apply -
-apply(generate_fresh "name")
-apply(subgoal_tac "NotR (x).M d = NotR (c).([(c,x)]\<bullet>M) d")
-apply(auto simp add: fresh_left calc_atm forget)
-apply(generate_fresh "coname")
-apply(rule_tac f="fresh_fun" in arg_cong)
-apply(simp add:  fun_eq_iff)
-apply(rule allI)
-apply(simp add: trm.inject alpha fresh_prod fresh_atm)
-apply(perm_simp add: trm.inject alpha fresh_prod fresh_atm fresh_left, auto)
-done
+proof -
+  obtain c::name where c: "c \<sharp> (M, P, d, x, z)"
+    by (meson exists_fresh(1) fs_name1)
+  obtain e::coname where e: "e \<sharp> (M, P, d, x, z, c)"
+    by (meson exists_fresh'(2) fs_coname1)
+  with c have "NotR (x).M d = NotR (c).([(c,x)]\<bullet>M) d"
+    by (metis alpha'(1) fresh_prodD(1) nrename_id nrename_swap trm.inject(3))
+  with c e assms show ?thesis
+    apply(simp add: fresh_prod)
+    by (metis forget(2) fresh_perm_app(3) trm.inject(3))
+qed
 
 lemma better_NotL_substn:
   assumes a: "y\<sharp>M"
@@ -2107,7 +1323,7 @@
 apply -
 apply(generate_fresh "coname")
 apply(subgoal_tac "NotL <a>.M y = NotL <ca>.([(ca,a)]\<bullet>M) y")
-apply(auto simp add: fresh_left calc_atm forget)
+apply(auto simp: fresh_left calc_atm forget)
 apply(generate_fresh "name")
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
@@ -2123,7 +1339,7 @@
 apply -
 apply(generate_fresh "name")
 apply(subgoal_tac "AndL1 (x).M y = AndL1 (ca).([(ca,x)]\<bullet>M) y")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(generate_fresh "name")
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
@@ -2148,7 +1364,7 @@
 apply -
 apply(generate_fresh "name")
 apply(subgoal_tac "AndL2 (x).M y = AndL2 (ca).([(ca,x)]\<bullet>M) y")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(generate_fresh "name")
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
@@ -2174,12 +1390,12 @@
 apply(generate_fresh "coname")
 apply(generate_fresh "coname")
 apply(subgoal_tac "AndR <a>.M <b>.N c = AndR <ca>.([(ca,a)]\<bullet>M) <caa>.([(caa,b)]\<bullet>N) c")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule trans)
 apply(rule substc.simps)
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)[1]
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)[1]
-apply(auto simp add: fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_left calc_atm fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_left calc_atm fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_prod fresh_atm)[1]
 apply(simp)
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
@@ -2187,9 +1403,9 @@
 apply(simp add: trm.inject alpha fresh_prod fresh_atm)
 apply(rule conjI)
 apply(rule forget)
-apply(auto simp add: fresh_left calc_atm abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh)[1]
 apply(rule forget)
-apply(auto simp add: fresh_left calc_atm abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh)[1]
 apply(perm_simp add: trm.inject alpha fresh_left calc_atm fresh_prod fresh_atm)
 apply(auto)
 done
@@ -2202,12 +1418,12 @@
 apply(generate_fresh "name")
 apply(generate_fresh "name")
 apply(subgoal_tac "OrL (y).M (z).N x = OrL (ca).([(ca,y)]\<bullet>M) (caa).([(caa,z)]\<bullet>N) x")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule trans)
 apply(rule substn.simps)
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)[1]
-apply(auto simp add: fresh_left calc_atm fresh_prod fresh_atm)[1]
-apply(auto simp add: fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_left calc_atm fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_left calc_atm fresh_prod fresh_atm)[1]
+apply(auto simp: fresh_prod fresh_atm)[1]
 apply(simp)
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
@@ -2215,9 +1431,9 @@
 apply(simp add: trm.inject alpha fresh_prod fresh_atm)
 apply(rule conjI)
 apply(rule forget)
-apply(auto simp add: fresh_left calc_atm abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh)[1]
 apply(rule forget)
-apply(auto simp add: fresh_left calc_atm abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh)[1]
 apply(perm_simp add: trm.inject alpha fresh_left calc_atm fresh_prod fresh_atm)
 apply(auto)
 done
@@ -2229,7 +1445,7 @@
 apply -
 apply(generate_fresh "coname")
 apply(subgoal_tac "OrR1 <a>.M d = OrR1 <c>.([(c,a)]\<bullet>M) d")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
 apply(rule allI)
@@ -2253,7 +1469,7 @@
 apply -
 apply(generate_fresh "coname")
 apply(subgoal_tac "OrR2 <a>.M d = OrR2 <c>.([(c,a)]\<bullet>M) d")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
 apply(rule allI)
@@ -2278,7 +1494,7 @@
 apply(generate_fresh "coname")
 apply(generate_fresh "name")
 apply(subgoal_tac "ImpR (x).<a>.M d = ImpR (ca).<c>.([(c,a)]\<bullet>[(ca,x)]\<bullet>M) d")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
 apply(rule allI)
@@ -2303,7 +1519,7 @@
 apply(generate_fresh "coname")
 apply(generate_fresh "name")
 apply(subgoal_tac "ImpL <a>.M (x).N y = ImpL <ca>.([(ca,a)]\<bullet>M) (caa).([(caa,x)]\<bullet>N) y")
-apply(auto simp add: fresh_left calc_atm forget abs_fresh)[1]
+apply(auto simp: fresh_left calc_atm forget abs_fresh)[1]
 apply(rule_tac f="fresh_fun" in arg_cong)
 apply(simp add:  fun_eq_iff)
 apply(rule allI)
@@ -2317,47 +1533,34 @@
 
 lemma freshn_after_substc:
   fixes x::"name"
-  assumes a: "x\<sharp>M{c:=(y).P}"
+  assumes "x\<sharp>M{c:=(y).P}"
   shows "x\<sharp>M"
-using a supp_subst8
-apply(simp add: fresh_def)
-apply(blast)
-done
+  by (meson assms fresh_def subsetD supp_subst8)
 
 lemma freshn_after_substn:
   fixes x::"name"
-  assumes a: "x\<sharp>M{y:=<c>.P}" "x\<noteq>y"
+  assumes "x\<sharp>M{y:=<c>.P}" "x\<noteq>y"
   shows "x\<sharp>M"
-using a
-using a supp_subst5
-apply(simp add: fresh_def)
-apply(blast)
-done
+  by (meson DiffI assms fresh_def singleton_iff subset_eq supp_subst5)
 
 lemma freshc_after_substc:
   fixes a::"coname"
-  assumes a: "a\<sharp>M{c:=(y).P}" "a\<noteq>c"
+  assumes "a\<sharp>M{c:=(y).P}" "a\<noteq>c"
   shows "a\<sharp>M"
-using a supp_subst7
-apply(simp add: fresh_def)
-apply(blast)
-done
+  by (meson Diff_iff assms fresh_def in_mono singleton_iff supp_subst7)
 
 lemma freshc_after_substn:
   fixes a::"coname"
-  assumes a: "a\<sharp>M{y:=<c>.P}" 
+  assumes "a\<sharp>M{y:=<c>.P}" 
   shows "a\<sharp>M"
-using a supp_subst6
-apply(simp add: fresh_def)
-apply(blast)
-done
+  by (meson assms fresh_def subset_iff supp_subst6)
 
 lemma substn_crename_comm:
   assumes a: "c\<noteq>a" "c\<noteq>b"
   shows "M{x:=<c>.P}[a\<turnstile>c>b] = M[a\<turnstile>c>b]{x:=<c>.(P[a\<turnstile>c>b])}"
 using a
 apply(nominal_induct M avoiding: x c P a b rule: trm.strong_induct)
-apply(auto simp add: subst_fresh rename_fresh trm.inject)
+apply(auto simp: subst_fresh rename_fresh trm.inject)
 apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,x,c)")
 apply(erule exE)
 apply(subgoal_tac "Cut <c>.P (x).Ax x a = Cut <c>.P (x').Ax x' a")
@@ -2381,11 +1584,11 @@
 apply(rule better_crename_Cut)
 apply(simp add: fresh_atm fresh_prod)
 apply(simp add: rename_fresh fresh_atm)
-apply(auto simp add: fresh_atm)[1]
+apply(auto simp: fresh_atm)[1]
 apply(rule trans)
 apply(rule better_crename_Cut)
 apply(simp add: fresh_atm)
-apply(auto simp add: fresh_atm)[1]
+apply(auto simp: fresh_atm)[1]
 apply(drule crename_ax)
 apply(simp add: fresh_atm)
 apply(simp add: fresh_atm)
@@ -2449,7 +1652,7 @@
   shows "M{c:=(x).P}[a\<turnstile>c>b] = M[a\<turnstile>c>b]{c:=(x).(P[a\<turnstile>c>b])}"
 using a
 apply(nominal_induct M avoiding: x c P a b rule: trm.strong_induct)
-apply(auto simp add: subst_fresh rename_fresh trm.inject)
+apply(auto simp: subst_fresh rename_fresh trm.inject)
 apply(rule trans)
 apply(rule better_crename_Cut)
 apply(simp add: fresh_atm fresh_prod)
@@ -2523,7 +1726,7 @@
   shows "M{x:=<c>.P}[y\<turnstile>n>z] = M[y\<turnstile>n>z]{x:=<c>.(P[y\<turnstile>n>z])}"
 using a
 apply(nominal_induct M avoiding: x c P y z rule: trm.strong_induct)
-apply(auto simp add: subst_fresh rename_fresh trm.inject)
+apply(auto simp: subst_fresh rename_fresh trm.inject)
 apply(rule trans)
 apply(rule better_nrename_Cut)
 apply(simp add: fresh_prod fresh_atm)
@@ -2595,7 +1798,7 @@
   shows "M{c:=(x).P}[y\<turnstile>n>z] = M[y\<turnstile>n>z]{c:=(x).(P[y\<turnstile>n>z])}"
 using a
 apply(nominal_induct M avoiding: x c P y z rule: trm.strong_induct)
-apply(auto simp add: subst_fresh rename_fresh trm.inject)
+apply(auto simp: subst_fresh rename_fresh trm.inject)
 apply(rule trans)
 apply(rule better_nrename_Cut)
 apply(simp add: fresh_atm fresh_prod)
@@ -2681,152 +1884,82 @@
 done
 
 lemma substn_crename_comm':
-  assumes a: "a\<noteq>c" "a\<sharp>P"
+  assumes "a\<noteq>c" "a\<sharp>P"
   shows "M{x:=<c>.P}[a\<turnstile>c>b] = M[a\<turnstile>c>b]{x:=<c>.P}"
-using a
 proof -
-  assume a1: "a\<noteq>c"
-  assume a2: "a\<sharp>P"
   obtain c'::"coname" where fs2: "c'\<sharp>(c,P,a,b)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq: "M{x:=<c>.P} = M{x:=<c'>.([(c',c)]\<bullet>P)}"
-    using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
+    using fs2 substn_rename4 by force
    have eq': "M[a\<turnstile>c>b]{x:=<c>.P} = M[a\<turnstile>c>b]{x:=<c'>.([(c',c)]\<bullet>P)}"
-    using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
-  have eq2: "([(c',c)]\<bullet>P)[a\<turnstile>c>b] = ([(c',c)]\<bullet>P)" using fs2 a2 a1
-    apply -
-    apply(rule rename_fresh)
-    apply(simp add: fresh_left calc_atm fresh_prod fresh_atm)
-    done
+    using fs2 by (simp add: substn_rename4)
+  have eq2: "([(c',c)]\<bullet>P)[a\<turnstile>c>b] = ([(c',c)]\<bullet>P)" using fs2 assms
+    by (metis crename_fresh fresh_atm(2) fresh_aux(2) fresh_prod)
   have "M{x:=<c>.P}[a\<turnstile>c>b] = M{x:=<c'>.([(c',c)]\<bullet>P)}[a\<turnstile>c>b]" using eq by simp
   also have "\<dots> = M[a\<turnstile>c>b]{x:=<c'>.(([(c',c)]\<bullet>P)[a\<turnstile>c>b])}"
     using fs2
-    apply -
-    apply(rule substn_crename_comm)
-    apply(simp_all add: fresh_prod fresh_atm)
-    done
+    by (simp add: fresh_atm(2) fresh_prod substn_crename_comm)
   also have "\<dots> = M[a\<turnstile>c>b]{x:=<c'>.(([(c',c)]\<bullet>P))}" using eq2 by simp
   also have "\<dots> = M[a\<turnstile>c>b]{x:=<c>.P}" using eq' by simp 
   finally show ?thesis by simp
 qed
 
 lemma substc_crename_comm':
-  assumes a: "c\<noteq>a" "c\<noteq>b" "a\<sharp>P"
+  assumes "c\<noteq>a" "c\<noteq>b" "a\<sharp>P"
   shows "M{c:=(x).P}[a\<turnstile>c>b] = M[a\<turnstile>c>b]{c:=(x).P}"
-using a
 proof -
-  assume a1: "c\<noteq>a"
-  assume a1': "c\<noteq>b"
-  assume a2: "a\<sharp>P"
   obtain c'::"coname" where fs2: "c'\<sharp>(c,M,a,b)" by (rule exists_fresh(2), rule fin_supp, blast)
   have eq: "M{c:=(x).P} = ([(c',c)]\<bullet>M){c':=(x).P}"
-    using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
+    using fs2 by (simp add: substc_rename1)
    have eq': "([(c',c)]\<bullet>(M[a\<turnstile>c>b])){c':=(x).P} = M[a\<turnstile>c>b]{c:=(x).P}"
-    using fs2
-    apply -
-    apply(rule subst_rename[symmetric])
-    apply(simp add: rename_fresh)
-    done
-  have eq2: "([(c',c)]\<bullet>M)[a\<turnstile>c>b] = ([(c',c)]\<bullet>(M[a\<turnstile>c>b]))" using fs2 a2 a1 a1'
-    apply -
-    apply(simp add: rename_eqvts)
-    apply(simp add: fresh_left calc_atm fresh_prod fresh_atm)
-    done
+    using fs2 by (metis crename_cfresh' fresh_prod substc_rename1)
+  have eq2: "([(c',c)]\<bullet>M)[a\<turnstile>c>b] = ([(c',c)]\<bullet>(M[a\<turnstile>c>b]))" using fs2 assms
+    by (simp add: crename_coname_eqvt fresh_atm(2) fresh_prod swap_simps(6))
   have "M{c:=(x).P}[a\<turnstile>c>b] = ([(c',c)]\<bullet>M){c':=(x).P}[a\<turnstile>c>b]" using eq by simp
   also have "\<dots> = ([(c',c)]\<bullet>M)[a\<turnstile>c>b]{c':=(x).P[a\<turnstile>c>b]}"
-    using fs2
-    apply -
-    apply(rule substc_crename_comm)
-    apply(simp_all add: fresh_prod fresh_atm)
-    done
+    using fs2 assms
+    by (metis crename_fresh eq eq' eq2 substc_crename_comm)
   also have "\<dots> = ([(c',c)]\<bullet>(M[a\<turnstile>c>b])){c':=(x).P[a\<turnstile>c>b]}" using eq2 by simp
-  also have "\<dots> = ([(c',c)]\<bullet>(M[a\<turnstile>c>b])){c':=(x).P}" using a2 by (simp add: rename_fresh)
+  also have "\<dots> = ([(c',c)]\<bullet>(M[a\<turnstile>c>b])){c':=(x).P}" 
+    using assms by (simp add: rename_fresh)
   also have "\<dots> = M[a\<turnstile>c>b]{c:=(x).P}" using eq' by simp
   finally show ?thesis by simp
 qed
 
 lemma substn_nrename_comm':
-  assumes a: "x\<noteq>y" "x\<noteq>z" "y\<sharp>P"
+  assumes "x\<noteq>y" "x\<noteq>z" "y\<sharp>P"
   shows "M{x:=<c>.P}[y\<turnstile>n>z] = M[y\<turnstile>n>z]{x:=<c>.P}"
-using a
 proof -
-  assume a1: "x\<noteq>y"
-  assume a1': "x\<noteq>z"
-  assume a2: "y\<sharp>P"
   obtain x'::"name" where fs2: "x'\<sharp>(x,M,y,z)" by (rule exists_fresh(1), rule fin_supp, blast)
   have eq: "M{x:=<c>.P} = ([(x',x)]\<bullet>M){x':=<c>.P}"
-    using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
+    using fs2 by (simp add: substn_rename3)
    have eq': "([(x',x)]\<bullet>(M[y\<turnstile>n>z])){x':=<c>.P} = M[y\<turnstile>n>z]{x:=<c>.P}"
-    using fs2
-    apply -
-    apply(rule subst_rename[symmetric])
-    apply(simp add: rename_fresh)
-    done
-  have eq2: "([(x',x)]\<bullet>M)[y\<turnstile>n>z] = ([(x',x)]\<bullet>(M[y\<turnstile>n>z]))" using fs2 a2 a1 a1'
-    apply -
-    apply(simp add: rename_eqvts)
-    apply(simp add: fresh_left calc_atm fresh_prod fresh_atm)
-    done
+    using fs2 by (metis fresh_prod nrename_nfresh' substn_rename3)
+  have eq2: "([(x',x)]\<bullet>M)[y\<turnstile>n>z] = ([(x',x)]\<bullet>(M[y\<turnstile>n>z]))" 
+    using fs2 by (simp add: assms fresh_atm(1) fresh_prod nrename_name_eqvt swap_simps(5)) 
   have "M{x:=<c>.P}[y\<turnstile>n>z] = ([(x',x)]\<bullet>M){x':=<c>.P}[y\<turnstile>n>z]" using eq by simp
   also have "\<dots> = ([(x',x)]\<bullet>M)[y\<turnstile>n>z]{x':=<c>.P[y\<turnstile>n>z]}"
-    using fs2
-    apply -
-    apply(rule substn_nrename_comm)
-    apply(simp_all add: fresh_prod fresh_atm)
-    done
+    using fs2 by (metis assms eq eq' eq2 nrename_fresh substn_nrename_comm)
   also have "\<dots> = ([(x',x)]\<bullet>(M[y\<turnstile>n>z])){x':=<c>.P[y\<turnstile>n>z]}" using eq2 by simp
-  also have "\<dots> = ([(x',x)]\<bullet>(M[y\<turnstile>n>z])){x':=<c>.P}" using a2 by (simp add: rename_fresh)
+  also have "\<dots> = ([(x',x)]\<bullet>(M[y\<turnstile>n>z])){x':=<c>.P}" using assms by (simp add: rename_fresh)
   also have "\<dots> = M[y\<turnstile>n>z]{x:=<c>.P}" using eq' by simp
   finally show ?thesis by simp
 qed
 
 lemma substc_nrename_comm':
-  assumes a: "x\<noteq>y" "y\<sharp>P"
+  assumes "x\<noteq>y" "y\<sharp>P"
   shows "M{c:=(x).P}[y\<turnstile>n>z] = M[y\<turnstile>n>z]{c:=(x).P}"
-using a
 proof -
-  assume a1: "x\<noteq>y"
-  assume a2: "y\<sharp>P"
   obtain x'::"name" where fs2: "x'\<sharp>(x,P,y,z)" by (rule exists_fresh(1), rule fin_supp, blast)
   have eq: "M{c:=(x).P} = M{c:=(x').([(x',x)]\<bullet>P)}"
     using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
+    using substc_rename2 by auto
    have eq': "M[y\<turnstile>n>z]{c:=(x).P} = M[y\<turnstile>n>z]{c:=(x').([(x',x)]\<bullet>P)}"
-    using fs2
-    apply -
-    apply(rule subst_rename)
-    apply(simp)
-    done
-  have eq2: "([(x',x)]\<bullet>P)[y\<turnstile>n>z] = ([(x',x)]\<bullet>P)" using fs2 a2 a1
-    apply -
-    apply(rule rename_fresh)
-    apply(simp add: fresh_left calc_atm fresh_prod fresh_atm)
-    done
+    using fs2 by (simp add: substc_rename2)
+  have eq2: "([(x',x)]\<bullet>P)[y\<turnstile>n>z] = ([(x',x)]\<bullet>P)"
+    using fs2 by (metis assms(2) fresh_atm(1) fresh_aux(1) fresh_prod nrename_fresh)
   have "M{c:=(x).P}[y\<turnstile>n>z] = M{c:=(x').([(x',x)]\<bullet>P)}[y\<turnstile>n>z]" using eq by simp
   also have "\<dots> = M[y\<turnstile>n>z]{c:=(x').(([(x',x)]\<bullet>P)[y\<turnstile>n>z])}"
-    using fs2
-    apply -
-    apply(rule substc_nrename_comm)
-    apply(simp_all add: fresh_prod fresh_atm)
-    done
+    using fs2 by (simp add: fresh_atm(1) fresh_prod substc_nrename_comm)
   also have "\<dots> = M[y\<turnstile>n>z]{c:=(x').(([(x',x)]\<bullet>P))}" using eq2 by simp
   also have "\<dots> = M[y\<turnstile>n>z]{c:=(x).P}" using eq' by simp 
   finally show ?thesis by simp
@@ -2865,9 +1998,9 @@
   and   \<Delta>::"ctxtc"
   shows "a\<sharp>\<Gamma>" and "x\<sharp>\<Delta>"
 proof -
-  show "a\<sharp>\<Gamma>" by (induct \<Gamma>) (auto simp add: fresh_list_nil fresh_list_cons fresh_prod fresh_atm fresh_ty)
+  show "a\<sharp>\<Gamma>" by (induct \<Gamma>) (auto simp: fresh_list_nil fresh_list_cons fresh_prod fresh_atm fresh_ty)
 next
-  show "x\<sharp>\<Delta>" by (induct \<Delta>) (auto simp add: fresh_list_nil fresh_list_cons fresh_prod fresh_atm fresh_ty)
+  show "x\<sharp>\<Delta>" by (induct \<Delta>) (auto simp: fresh_list_nil fresh_list_cons fresh_prod fresh_atm fresh_ty)
 qed
 
 text \<open>cut-reductions\<close>
@@ -2887,59 +2020,36 @@
 equivariance fin
 
 lemma fin_Ax_elim:
-  assumes a: "fin (Ax x a) y"
+  assumes "fin (Ax x a) y"
   shows "x=y"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-done
+  using assms fin.simps trm.inject(1) by auto
 
 lemma fin_NotL_elim:
   assumes a: "fin (NotL <a>.M x) y"
   shows "x=y \<and> x\<sharp>M"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-apply(subgoal_tac "y\<sharp>[aa].Ma")
-apply(drule sym)
-apply(simp_all add: abs_fresh)
-done
+  using assms 
+  by (cases rule: fin.cases; simp add: trm.inject; metis abs_fresh(5))
 
 lemma fin_AndL1_elim:
   assumes a: "fin (AndL1 (x).M y) z"
   shows "z=y \<and> z\<sharp>[x].M"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-done
+  using assms by (cases rule: fin.cases; simp add: trm.inject)
 
 lemma fin_AndL2_elim:
   assumes a: "fin (AndL2 (x).M y) z"
   shows "z=y \<and> z\<sharp>[x].M"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-done
+  using assms by (cases rule: fin.cases; simp add: trm.inject)
 
 lemma fin_OrL_elim:
   assumes a: "fin (OrL (x).M (y).N u) z"
   shows "z=u \<and> z\<sharp>[x].M \<and> z\<sharp>[y].N"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-done
+  using assms by (cases rule: fin.cases; simp add: trm.inject)
 
 lemma fin_ImpL_elim:
   assumes a: "fin (ImpL <a>.M (x).N z) y"
   shows "z=y \<and> z\<sharp>M \<and> z\<sharp>[x].N"
-using a
-apply(erule_tac fin.cases)
-apply(auto simp add: trm.inject)
-apply(subgoal_tac "y\<sharp>[aa].Ma")
-apply(drule sym)
-apply(simp_all add: abs_fresh)
-apply (metis abs_fresh(5))
-done
+  using assms
+  by (cases rule: fin.cases; simp add: trm.inject; metis abs_fresh(5))
  
 
 lemma fin_rest_elims:
@@ -2957,7 +2067,7 @@
 lemma fin_rename:
   shows "fin M x \<Longrightarrow> fin ([(x',x)]\<bullet>M) x'"
 by (induct rule: fin.induct)
-   (auto simp add: calc_atm simp add: fresh_left abs_fresh)
+   (auto simp: calc_atm simp add: fresh_left abs_fresh)
 
 lemma not_fin_subst1:
   assumes a: "\<not>(fin M x)" 
@@ -2995,13 +2105,13 @@
 apply(rule exists_fresh'(2)[OF fs_coname1])
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(drule fin_AndL1_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substc)
 apply(subgoal_tac "name2\<sharp>[name1]. trm")
 apply(simp add: fin.intros)
 apply(simp add: abs_fresh)
 apply(drule fin_AndL2_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substc)
 apply(subgoal_tac "name2\<sharp>[name1].trm")
 apply(simp add: fin.intros)
@@ -3023,7 +2133,7 @@
 apply(rule exists_fresh'(2)[OF fs_coname1])
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(drule fin_OrL_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substc)+
 apply(subgoal_tac "name3\<sharp>[name1].trm1 \<and> name3\<sharp>[name2].trm2")
 apply(simp add: fin.intros)
@@ -3037,7 +2147,7 @@
 apply(rule exists_fresh'(2)[OF fs_coname1])
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(drule fin_ImpL_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substc)+
 apply(subgoal_tac "x\<sharp>[name1].trm2")
 apply(simp add: fin.intros)
@@ -3075,7 +2185,7 @@
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(rule exists_fresh'(1)[OF fs_name1])
 apply(drule fin_AndL1_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substn)
 apply(simp)
 apply(subgoal_tac "name2\<sharp>[name1]. trm")
@@ -3089,7 +2199,7 @@
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(rule exists_fresh'(1)[OF fs_name1])
 apply(drule fin_AndL2_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substn)
 apply(simp)
 apply(subgoal_tac "name2\<sharp>[name1].trm")
@@ -3105,7 +2215,7 @@
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(rule exists_fresh'(1)[OF fs_name1])
 apply(drule fin_OrL_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substn)
 apply(simp)
 apply(drule freshn_after_substn)
@@ -3122,7 +2232,7 @@
 apply(erule fin.cases, simp_all add: trm.inject)
 apply(rule exists_fresh'(1)[OF fs_name1])
 apply(drule fin_ImpL_elim)
-apply(auto simp add: abs_fresh)[1]
+apply(auto simp: abs_fresh)[1]
 apply(drule freshn_after_substn)
 apply(simp)
 apply(drule freshn_after_substn)
@@ -3315,7 +2425,7 @@
   shows "a=b"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 done
 
 lemma fic_NotR_elim:
@@ -3323,7 +2433,7 @@
   shows "a=b \<and> b\<sharp>M"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 apply(subgoal_tac "b\<sharp>[xa].Ma")
 apply(drule sym)
 apply(simp_all add: abs_fresh)
@@ -3334,7 +2444,7 @@
   shows "b=c \<and> c\<sharp>[a].M"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 done
 
 lemma fic_OrR2_elim:
@@ -3342,7 +2452,7 @@
   shows "b=c \<and> c\<sharp>[a].M"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 done
 
 lemma fic_AndR_elim:
@@ -3350,7 +2460,7 @@
   shows "c=d \<and> d\<sharp>[a].M \<and> d\<sharp>[b].N"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 done
 
 lemma fic_ImpR_elim:
@@ -3358,7 +2468,7 @@
   shows "b=c \<and> b\<sharp>[a].M"
 using a
 apply(erule_tac fic.cases)
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 apply(subgoal_tac "c\<sharp>[xa].[aa].Ma")
 apply(drule sym)
 apply(simp_all add: abs_fresh)
@@ -3379,7 +2489,7 @@
 lemma fic_rename:
   shows "fic M a \<Longrightarrow> fic ([(a',a)]\<bullet>M) a'"
 by (induct rule: fic.induct)
-   (auto simp add: calc_atm simp add: fresh_left abs_fresh)
+   (auto simp: calc_atm simp add: fresh_left abs_fresh)
 
 lemma not_fic_subst1:
   assumes a: "\<not>(fic M a)" 
@@ -3734,13 +2844,13 @@
   and   "M \<longrightarrow>\<^sub>l M' \<Longrightarrow> a\<sharp>M \<Longrightarrow> a\<sharp>M'"
 apply -
 apply(induct rule: l_redu.induct)
-apply(auto simp add: abs_fresh rename_fresh)
+apply(auto simp: abs_fresh rename_fresh)
 apply(case_tac "xa=x")
 apply(simp add: rename_fresh)
 apply(simp add: rename_fresh fresh_atm)
 apply(simp add: fresh_prod abs_fresh abs_supp fin_supp)+
 apply(induct rule: l_redu.induct)
-apply(auto simp add: abs_fresh rename_fresh)
+apply(auto simp: abs_fresh rename_fresh)
 apply(case_tac "aa=a")
 apply(simp add: rename_fresh)
 apply(simp add: rename_fresh fresh_atm)
@@ -3754,7 +2864,7 @@
   obtain x'::"name" where fs1: "x'\<sharp>(M,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(a,M,b)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.M (x).(Ax x b) =  Cut <a'>.([(a',a)]\<bullet>M) (x').(Ax x' b)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>l ([(a',a)]\<bullet>M)[a'\<turnstile>c>b]" using fs1 fs2 fin
     by (auto intro: l_redu.intros simp add: fresh_left calc_atm fic_rename)
   also have "\<dots> = M[a\<turnstile>c>b]" using fs1 fs2 by (simp add: crename_rename)
@@ -3768,7 +2878,7 @@
   obtain x'::"name" where fs1: "x'\<sharp>(y,M,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(a,M)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.(Ax y a) (x).M = Cut <a'>.(Ax y a') (x').([(x',x)]\<bullet>M)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>l ([(x',x)]\<bullet>M)[x'\<turnstile>n>y]" using fs1 fs2 fin
     by (auto intro: l_redu.intros simp add: fresh_left calc_atm fin_rename)
   also have "\<dots> = M[x\<turnstile>n>y]" using fs1 fs2 by (simp add: nrename_rename)
@@ -3786,17 +2896,17 @@
   have "Cut <a>.(NotR (x).M a) (y).(NotL <b>.N y) 
                       = Cut <a'>.(NotR (x).([(a',a)]\<bullet>M) a') (y').(NotL <b>.([(y',y)]\<bullet>N) y')"
     using f1 f2 f3 f4 
-    by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm abs_fresh)
+    by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm abs_fresh)
   also have "\<dots> = Cut <a'>.(NotR (x).M a') (y').(NotL <b>.N y')"
     using f1 f2 f3 f4 fs by (perm_simp)
   also have "\<dots> = Cut <a'>.(NotR (x').([(x',x)]\<bullet>M) a') (y').(NotL <b'>.([(b',b)]\<bullet>N) y')"
     using f1 f2 f3 f4 
-    by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>l Cut <b'>.([(b',b)]\<bullet>N) (x').([(x',x)]\<bullet>M)"
     using f1 f2 f3 f4 fs
     by (auto intro:  l_redu.intros simp add: fresh_prod fresh_left calc_atm fresh_atm)
   also have "\<dots> = Cut <b>.N (x).M"
-    using f1 f2 f3 f4 by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using f1 f2 f3 f4 by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   finally show ?thesis by simp
 qed 
 
@@ -3815,7 +2925,7 @@
     using f1 f2 f3 f4 fs
     apply(rule_tac sym)
     apply(perm_simp add: trm.inject alpha calc_atm fresh_prod fresh_left fresh_atm abs_fresh)
-    apply(auto simp add: perm_fresh_fresh)
+    apply(auto simp: perm_fresh_fresh)
     done
   also have "\<dots> = Cut <a'>.(AndR <b1'>.([(b1',b1)]\<bullet>M1) <b2'>.([(b2',b2)]\<bullet>M2) a') 
                                                                (y').(AndL1 (x').([(x',x)]\<bullet>N) y')"
@@ -3827,10 +2937,10 @@
     using f1 f2 f3 f4 f5 fs
     apply -
     apply(rule l_redu.intros)
-    apply(auto simp add: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
+    apply(auto simp: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
     done
   also have "\<dots> = Cut <b1>.M1 (x).N"
-    using f1 f2 f3 f4 f5 fs by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using f1 f2 f3 f4 f5 fs by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   finally show ?thesis by simp
 qed 
 
@@ -3849,7 +2959,7 @@
     using f1 f2 f3 f4 fs
     apply(rule_tac sym)
     apply(perm_simp add: trm.inject alpha calc_atm fresh_prod fresh_left fresh_atm abs_fresh)
-    apply(auto simp add: perm_fresh_fresh)
+    apply(auto simp: perm_fresh_fresh)
     done
   also have "\<dots> = Cut <a'>.(AndR <b1'>.([(b1',b1)]\<bullet>M1) <b2'>.([(b2',b2)]\<bullet>M2) a') 
                                                                (y').(AndL2 (x').([(x',x)]\<bullet>N) y')"
@@ -3861,10 +2971,10 @@
     using f1 f2 f3 f4 f5 fs
     apply -
     apply(rule l_redu.intros)
-    apply(auto simp add: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
+    apply(auto simp: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
     done
   also have "\<dots> = Cut <b2>.M2 (x).N"
-    using f1 f2 f3 f4 f5 fs by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using f1 f2 f3 f4 f5 fs by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   finally show ?thesis by simp
 qed
 
@@ -3883,7 +2993,7 @@
     using f1 f2 f3 f4 f5 fs
     apply(rule_tac sym)
     apply(perm_simp add: trm.inject alpha calc_atm fresh_prod fresh_left fresh_atm abs_fresh)
-    apply(auto simp add: perm_fresh_fresh)
+    apply(auto simp: perm_fresh_fresh)
     done
   also have "\<dots> = Cut <b'>.(OrR1 <a'>.([(a',a)]\<bullet>M) b') 
               (y').(OrL (x1').([(x1',x1)]\<bullet>N1) (x2').([(x2',x2)]\<bullet>N2) y')"   
@@ -3895,10 +3005,10 @@
     using f1 f2 f3 f4 f5 fs
     apply -
     apply(rule l_redu.intros)
-    apply(auto simp add: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
+    apply(auto simp: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
     done
   also have "\<dots> = Cut <a>.M (x1).N1"
-    using f1 f2 f3 f4 f5 fs by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using f1 f2 f3 f4 f5 fs by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   finally show ?thesis by simp
 qed
 
@@ -3917,7 +3027,7 @@
     using f1 f2 f3 f4 f5 fs
     apply(rule_tac sym)
     apply(perm_simp add: trm.inject alpha calc_atm fresh_prod fresh_left fresh_atm abs_fresh)
-    apply(auto simp add: perm_fresh_fresh)
+    apply(auto simp: perm_fresh_fresh)
     done
   also have "\<dots> = Cut <b'>.(OrR2 <a'>.([(a',a)]\<bullet>M) b') 
               (y').(OrL (x1').([(x1',x1)]\<bullet>N1) (x2').([(x2',x2)]\<bullet>N2) y')"   
@@ -3929,10 +3039,10 @@
     using f1 f2 f3 f4 f5 fs
     apply -
     apply(rule l_redu.intros)
-    apply(auto simp add: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
+    apply(auto simp: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
     done
   also have "\<dots> = Cut <a>.M (x2).N2"
-    using f1 f2 f3 f4 f5 fs by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using f1 f2 f3 f4 f5 fs by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   finally show ?thesis by simp
 qed 
 
@@ -3952,7 +3062,7 @@
     using f1 f2 f3 f4 f5 fs
     apply(rule_tac sym)
     apply(perm_simp add: trm.inject alpha calc_atm fresh_prod fresh_left fresh_atm abs_fresh)
-    apply(auto simp add: perm_fresh_fresh)
+    apply(auto simp: perm_fresh_fresh)
     done
   also have "\<dots> = Cut <b'>.(ImpR (x').<a'>.([(a',a)]\<bullet>([(x',x)]\<bullet>M)) b') 
                            (z').(ImpL <c'>.([(c',c)]\<bullet>N) (y').([(y',y)]\<bullet>P) z')"
@@ -3973,7 +3083,7 @@
     using f1 f2 f3 f4 f5 f6 fs
     apply -
     apply(rule l_redu.intros)
-    apply(auto simp add: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
+    apply(auto simp: abs_fresh fresh_prod fresh_left calc_atm fresh_atm)
     done
   also have "\<dots> = Cut <a>.(Cut <c>.N (x).M) (y).P"
     using f1 f2 f3 f4 f5 f6 fs 
@@ -3986,7 +3096,7 @@
     apply(simp add: fresh_prod fresh_atm)
     apply(rule conjI)
     apply(perm_simp add: calc_atm)
-    apply(auto simp add: fresh_prod fresh_atm)[1]
+    apply(auto simp: fresh_prod fresh_atm)[1]
     apply(perm_simp add: alpha)
     apply(perm_simp add: alpha)
     apply(perm_simp add: alpha)
@@ -4007,7 +3117,7 @@
   assumes a: "[a].M = [b].N" "c\<sharp>(a,b,M,N)"
   shows "M = [(a,c)]\<bullet>[(b,c)]\<bullet>N"
 using a
-apply(auto simp add: alpha_fresh fresh_prod fresh_atm)
+apply(auto simp: alpha_fresh fresh_prod fresh_atm)
 apply(drule sym)
 apply(perm_simp)
 done 
@@ -4018,7 +3128,7 @@
   assumes a: "[x].M = [y].N" "z\<sharp>(x,y,M,N)"
   shows "M = [(x,z)]\<bullet>[(y,z)]\<bullet>N"
 using a
-apply(auto simp add: alpha_fresh fresh_prod fresh_atm)
+apply(auto simp: alpha_fresh fresh_prod fresh_atm)
 apply(drule sym)
 apply(perm_simp)
 done 
@@ -4030,7 +3140,7 @@
   assumes a: "[x].[b].M = [y].[c].N" "z\<sharp>(x,y,M,N)" "a\<sharp>(b,c,M,N)"
   shows "M = [(x,z)]\<bullet>[(b,a)]\<bullet>[(c,a)]\<bullet>[(y,z)]\<bullet>N"
 using a
-apply(auto simp add: alpha_fresh fresh_prod fresh_atm 
+apply(auto simp: alpha_fresh fresh_prod fresh_atm 
                      abs_supp fin_supp abs_fresh abs_perm fresh_left calc_atm)
 apply(drule sym)
 apply(simp)
@@ -4099,7 +3209,7 @@
 apply(rule exI)+
 apply(rule conjI)
 apply(rule refl)
-apply(auto simp add: calc_atm abs_fresh fresh_left)[1]
+apply(auto simp: calc_atm abs_fresh fresh_left)[1]
 apply(case_tac "y=x")
 apply(perm_simp)
 apply(perm_simp)
@@ -4136,7 +3246,7 @@
 apply(rule_tac s="x" and t="[(x,ca)]\<bullet>[(y,ca)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh split: if_splits)[1]
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
 apply(auto)[1]
@@ -4148,7 +3258,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4161,7 +3271,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4174,7 +3284,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 (* and2 case *)
 apply(rule disjI2)
@@ -4206,7 +3316,7 @@
 apply(rule_tac s="x" and t="[(x,ca)]\<bullet>[(y,ca)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh split: if_splits)[1]
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
 apply(auto)[1]
@@ -4218,7 +3328,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4231,7 +3341,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4244,7 +3354,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 (* or1 case *)
 apply(rule disjI2)
@@ -4278,7 +3388,7 @@
 apply(rule_tac s="x" and t="[(x,ca)]\<bullet>[(y,ca)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4292,7 +3402,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 (* or2 case *)
 apply(rule disjI2)
@@ -4326,7 +3436,7 @@
 apply(rule_tac s="x" and t="[(x,ca)]\<bullet>[(y,ca)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4339,7 +3449,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(y,cb)]\<bullet>y" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 (* imp-case *)
 apply(rule disjI2)
@@ -4373,7 +3483,7 @@
 apply(rule_tac s="x" and t="[(x,cb)]\<bullet>[(z,cb)]\<bullet>z" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 apply(generate_fresh "name")
 apply(simp add: abs_fresh fresh_prod fresh_atm)
@@ -4386,7 +3496,7 @@
 apply(rule_tac s="x" and t="[(x,cc)]\<bullet>[(z,cc)]\<bullet>z" in subst)
 apply(simp add: calc_atm)
 apply(rule refl)
-apply(auto simp add: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
+apply(auto simp: fresh_left calc_atm abs_fresh alpha perm_fresh_fresh split: if_splits)[1]
 apply(perm_simp)+
 done
 
@@ -4408,7 +3518,7 @@
   obtain x'::"name" where fs1: "x'\<sharp>(N,M,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(a,M,N)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.M (x).N =  Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>c ([(a',a)]\<bullet>M){a':=(x').([(x',x)]\<bullet>N)}" using fs1 fs2 not_fic
     apply -
     apply(rule left)
@@ -4429,7 +3539,7 @@
   obtain x'::"name" where fs1: "x'\<sharp>(N,M,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(a,M,N)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.M (x).N =  Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>c ([(x',x)]\<bullet>N){x':=<a'>.([(a',a)]\<bullet>M)}" using fs1 fs2 not_fin
     apply -
     apply(rule right)
@@ -4450,9 +3560,9 @@
   and   "M \<longrightarrow>\<^sub>c M' \<Longrightarrow> c\<sharp>M \<Longrightarrow> c\<sharp>M'"
 apply -
 apply(induct rule: c_redu.induct)
-apply(auto simp add: abs_fresh rename_fresh subst_fresh)
+apply(auto simp: abs_fresh rename_fresh subst_fresh)
 apply(induct rule: c_redu.induct)
-apply(auto simp add: abs_fresh rename_fresh subst_fresh)
+apply(auto simp: abs_fresh rename_fresh subst_fresh)
 done
 
 inductive
@@ -4485,11 +3595,11 @@
 apply(induct rule: a_redu.induct)
 apply(simp add: fresh_l_redu)
 apply(simp add: fresh_c_redu)
-apply(auto simp add: abs_fresh abs_supp fin_supp)
+apply(auto simp: abs_fresh abs_supp fin_supp)
 apply(induct rule: a_redu.induct)
 apply(simp add: fresh_l_redu)
 apply(simp add: fresh_c_redu)
-apply(auto simp add: abs_fresh abs_supp fin_supp)
+apply(auto simp: abs_fresh abs_supp fin_supp)
 done
 
 equivariance a_redu
@@ -4504,11 +3614,11 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.M (x).N =  Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  Cut <a'>.([(a',a)]\<bullet>M') (x').([(x',x)]\<bullet>N)" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt)
   also have "\<dots> = Cut <a>.M' (x).N" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4519,11 +3629,11 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "Cut <a>.M (x).N =  Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N)"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  Cut <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N')" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt)
   also have "\<dots> = Cut <a>.M (x).N'" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
     
@@ -4534,11 +3644,11 @@
   obtain b'::"coname" where fs1: "b'\<sharp>(M,N,a,b,c)" by (rule exists_fresh(2), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a,b,c,b')" by (rule exists_fresh(2), rule fin_supp, blast)
   have "AndR <a>.M <b>.N c =  AndR <a'>.([(a',a)]\<bullet>M) <b'>.([(b',b)]\<bullet>N) c"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  AndR <a'>.([(a',a)]\<bullet>M') <b'>.([(b',b)]\<bullet>N) c" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = AndR <a>.M' <b>.N c" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4549,11 +3659,11 @@
   obtain b'::"coname" where fs1: "b'\<sharp>(M,N,a,b,c)" by (rule exists_fresh(2), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a,b,c,b')" by (rule exists_fresh(2), rule fin_supp, blast)
   have "AndR <a>.M <b>.N c =  AndR <a'>.([(a',a)]\<bullet>M) <b'>.([(b',b)]\<bullet>N) c"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  AndR <a'>.([(a',a)]\<bullet>M) <b'>.([(b',b)]\<bullet>N') c" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = AndR <a>.M <b>.N' c" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4563,11 +3673,11 @@
   assume red: "M\<longrightarrow>\<^sub>a M'"
   obtain x'::"name" where fs1: "x'\<sharp>(M,y,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   have "AndL1 (x).M y = AndL1 (x').([(x',x)]\<bullet>M) y"
-    using fs1 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a AndL1 (x').([(x',x)]\<bullet>M') y" using fs1 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = AndL1 (x).M' y" 
-    using fs1 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4577,11 +3687,11 @@
   assume red: "M\<longrightarrow>\<^sub>a M'"
   obtain x'::"name" where fs1: "x'\<sharp>(M,y,x)" by (rule exists_fresh(1), rule fin_supp, blast)
   have "AndL2 (x).M y = AndL2 (x').([(x',x)]\<bullet>M) y"
-    using fs1 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a AndL2 (x').([(x',x)]\<bullet>M') y" using fs1 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = AndL2 (x).M' y" 
-    using fs1 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4592,11 +3702,11 @@
   obtain x'::"name" where fs1: "x'\<sharp>(M,N,x,y,z)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain y'::"name" where fs2: "y'\<sharp>(M,N,x,y,z,x')" by (rule exists_fresh(1), rule fin_supp, blast)
   have "OrL (x).M (y).N z =  OrL (x').([(x',x)]\<bullet>M) (y').([(y',y)]\<bullet>N) z"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a OrL (x').([(x',x)]\<bullet>M') (y').([(y',y)]\<bullet>N) z" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = OrL (x).M' (y).N z" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4607,11 +3717,11 @@
   obtain x'::"name" where fs1: "x'\<sharp>(M,N,x,y,z)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain y'::"name" where fs2: "y'\<sharp>(M,N,x,y,z,x')" by (rule exists_fresh(1), rule fin_supp, blast)
   have "OrL (x).M (y).N z =  OrL (x').([(x',x)]\<bullet>M) (y').([(y',y)]\<bullet>N) z"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a OrL (x').([(x',x)]\<bullet>M) (y').([(y',y)]\<bullet>N') z" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = OrL (x).M (y).N' z" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4621,11 +3731,11 @@
   assume red: "M\<longrightarrow>\<^sub>a M'"
   obtain a'::"coname" where fs1: "a'\<sharp>(M,b,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "OrR1 <a>.M b = OrR1 <a'>.([(a',a)]\<bullet>M) b"
-    using fs1 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a OrR1 <a'>.([(a',a)]\<bullet>M') b" using fs1 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = OrR1 <a>.M' b" 
-    using fs1 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4635,11 +3745,11 @@
   assume red: "M\<longrightarrow>\<^sub>a M'"
   obtain a'::"coname" where fs1: "a'\<sharp>(M,b,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "OrR2 <a>.M b = OrR2 <a'>.([(a',a)]\<bullet>M) b"
-    using fs1 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a OrR2 <a'>.([(a',a)]\<bullet>M') b" using fs1 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = OrR2 <a>.M' b" 
-    using fs1 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4650,11 +3760,11 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,x,y)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "ImpL <a>.M (x).N y =  ImpL <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N) y"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  ImpL <a'>.([(a',a)]\<bullet>M') (x').([(x',x)]\<bullet>N) y" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = ImpL <a>.M' (x).N y" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4665,11 +3775,11 @@
   obtain x'::"name"   where fs1: "x'\<sharp>(M,N,x,y)" by (rule exists_fresh(1), rule fin_supp, blast)
   obtain a'::"coname" where fs2: "a'\<sharp>(M,N,a)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "ImpL <a>.M (x).N y =  ImpL <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N) y"
-    using fs1 fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs1 fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a  ImpL <a'>.([(a',a)]\<bullet>M) (x').([(x',x)]\<bullet>N') y" using fs1 fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = ImpL <a>.M (x).N' y" 
-    using fs1 fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs1 fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4679,11 +3789,11 @@
   assume red: "M\<longrightarrow>\<^sub>a M'"
   obtain a'::"coname" where fs2: "a'\<sharp>(M,a,b)" by (rule exists_fresh(2), rule fin_supp, blast)
   have "ImpR (x).<a>.M b = ImpR (x).<a'>.([(a',a)]\<bullet>M) b"
-    using fs2 by (rule_tac sym, auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm)
+    using fs2 by (rule_tac sym, auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm)
   also have "\<dots> \<longrightarrow>\<^sub>a ImpR (x).<a'>.([(a',a)]\<bullet>M') b" using fs2 red
     by (auto intro: a_redu.intros simp add: fresh_left calc_atm a_redu.eqvt fresh_atm fresh_prod)
   also have "\<dots> = ImpR (x).<a>.M' b" 
-    using fs2 red by (auto simp add: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
+    using fs2 red by (auto simp: trm.inject alpha fresh_atm fresh_prod calc_atm fresh_a_redu)
   finally show ?thesis by simp
 qed
 
@@ -4700,7 +3810,7 @@
 lemma ax_do_not_a_reduce:
   shows "Ax x a \<longrightarrow>\<^sub>a M \<Longrightarrow> False"
 apply(erule_tac a_redu.cases) 
-apply(auto simp add: trm.inject)
+apply(auto simp: trm.inject)
 apply(drule ax_do_not_l_reduce)
 apply(simp)
 apply(drule ax_do_not_c_reduce)
@@ -4719,12 +3829,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -4740,12 +3850,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -4761,81 +3871,81 @@
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rotate_tac 6)
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,ba)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(b,baa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 done
 
 lemma a_redu_AndL1_elim:
@@ -4850,12 +3960,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -4871,12 +3981,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -4892,81 +4002,81 @@
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rotate_tac 6)
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(x,xaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,ya)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,yaa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 done
 
 lemma a_redu_OrR1_elim:
@@ -4981,12 +4091,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -5002,12 +4112,12 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt)
+apply(auto simp: alpha a_redu.eqvt)
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)
 apply(simp add: perm_swap)
 done
 
@@ -5023,81 +4133,81 @@
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rotate_tac 5)
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
 apply(rule disjI1)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(a,aaa)]\<bullet>M')" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule disjI2)
-apply(auto simp add: alpha a_redu.eqvt)[1]
+apply(auto simp: alpha a_redu.eqvt)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI) 
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 apply(rule_tac x="([(y,xa)]\<bullet>N'a)" in exI)
-apply(auto simp add: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
+apply(auto simp: perm_swap fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu)[1]
 done
 
 lemma a_redu_ImpR_elim:
@@ -5112,43 +4222,43 @@
 apply(erule_tac a_redu.cases, simp_all add: trm.inject)
 apply(erule_tac l_redu.cases, simp_all add: trm.inject)
 apply(erule_tac c_redu.cases, simp_all add: trm.inject)
-apply(auto simp add: alpha a_redu.eqvt abs_perm abs_fresh)
+apply(auto simp: alpha a_redu.eqvt abs_perm abs_fresh)
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(a,aa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(a,aa)]\<bullet>[(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule sym)
 apply(rule trans)
 apply(rule perm_compose)
 apply(simp add: calc_atm perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>[(x,xa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule sym)
 apply(rule trans)
 apply(rule perm_compose)
 apply(simp add: calc_atm perm_swap)
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule_tac x="([(a,aa)]\<bullet>[(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule sym)
 apply(rule trans)
 apply(rule perm_compose)
 apply(simp add: calc_atm perm_swap)
 apply(rule_tac x="([(a,aaa)]\<bullet>[(x,xaa)]\<bullet>M'a)" in exI)
-apply(auto simp add: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
+apply(auto simp: fresh_left alpha a_redu.eqvt calc_atm fresh_a_redu perm_swap)
 apply(rule sym)
 apply(rule trans)
 apply(rule perm_compose)
@@ -5301,7 +4411,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_AndR_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_AndL1_elim:
@@ -5311,7 +4421,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_AndL1_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_AndL2_elim:
@@ -5321,7 +4431,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_AndL2_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_OrL_elim:
@@ -5331,7 +4441,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_OrL_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_OrR1_elim:
@@ -5341,7 +4451,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_OrR1_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_OrR2_elim:
@@ -5351,7 +4461,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_OrR2_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_ImpR_elim:
@@ -5361,7 +4471,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_ImpR_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 lemma a_star_redu_ImpL_elim:
@@ -5371,7 +4481,7 @@
 apply(induct set: rtranclp)
 apply(auto)
 apply(drule a_redu_ImpL_elim)
-apply(auto simp add: alpha trm.inject)
+apply(auto simp: alpha trm.inject)
 done
 
 text \<open>Substitution\<close>
@@ -5701,7 +4811,7 @@
   shows "fin M' x"
 using b a
 apply(induct set: rtranclp)
-apply(auto simp add: fin_a_reduce)
+apply(auto simp: fin_a_reduce)
 done
 
 lemma fic_l_reduce:
@@ -5767,7 +4877,7 @@
   shows "fic M' x"
 using b a
 apply(induct set: rtranclp)
-apply(auto simp add: fic_a_reduce)
+apply(auto simp: fic_a_reduce)
 done
 
 text \<open>substitution properties\<close>
@@ -5882,7 +4992,7 @@
       apply(simp add: abs_fresh)
       done
     also have "\<dots> = AndL1 (u).(M{x:=<a>.Ax y a}) y" using fs new
-      by (auto simp add: fresh_prod fresh_atm nrename_fresh)
+      by (auto simp: fresh_prod fresh_atm nrename_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* AndL1 (u).(M[x\<turnstile>n>y]) y" using ih by (auto intro: a_star_congs)
     also have "\<dots> = (AndL1 (u).M v)[x\<turnstile>n>y]" using eq fs by simp
     finally show "(AndL1 (u).M v){x:=<a>.Ax y a} \<longrightarrow>\<^sub>a* (AndL1 (u).M v)[x\<turnstile>n>y]" by simp
@@ -5916,7 +5026,7 @@
       apply(simp add: abs_fresh)
       done
     also have "\<dots> = AndL2 (u).(M{x:=<a>.Ax y a}) y" using fs new
-      by (auto simp add: fresh_prod fresh_atm nrename_fresh)
+      by (auto simp: fresh_prod fresh_atm nrename_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* AndL2 (u).(M[x\<turnstile>n>y]) y" using ih by (auto intro: a_star_congs)
     also have "\<dots> = (AndL2 (u).M v)[x\<turnstile>n>y]" using eq fs by simp
     finally show "(AndL2 (u).M v){x:=<a>.Ax y a} \<longrightarrow>\<^sub>a* (AndL2 (u).M v)[x\<turnstile>n>y]" by simp
@@ -5966,7 +5076,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = OrL (u).(M{x:=<a>.Ax y a}) (v).(N{x:=<a>.Ax y a}) y" using fs new
-      by (auto simp add: fresh_prod fresh_atm nrename_fresh subst_fresh)
+      by (auto simp: fresh_prod fresh_atm nrename_fresh subst_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* OrL (u).(M[x\<turnstile>n>y]) (v).(N[x\<turnstile>n>y]) y" 
       using ih1 ih2 by (auto intro: a_star_congs)
     also have "\<dots> = (OrL (u).M (v).N z)[x\<turnstile>n>y]" using eq fs by simp
@@ -6012,7 +5122,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = ImpL <c>.(M{x:=<a>.Ax y a}) (u).(N{x:=<a>.Ax y a}) y" using fs new
-      by (auto simp add: fresh_prod subst_fresh fresh_atm trm.inject alpha rename_fresh)
+      by (auto simp: fresh_prod subst_fresh fresh_atm trm.inject alpha rename_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* ImpL <c>.(M[x\<turnstile>n>y]) (u).(N[x\<turnstile>n>y]) y" 
       using ih1 ih2 by (auto intro: a_star_congs)
     also have "\<dots> = (ImpL <c>.M (u).N v)[x\<turnstile>n>y]" using eq fs by simp
@@ -6132,7 +5242,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = AndR <c>.(M{b:=(x).Ax x a}) <d>.(N{b:=(x).Ax x a}) a" using fs new
-      by (auto simp add: fresh_prod fresh_atm subst_fresh crename_fresh)
+      by (auto simp: fresh_prod fresh_atm subst_fresh crename_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* AndR <c>.(M[b\<turnstile>c>a]) <d>.(N[b\<turnstile>c>a]) a" using ih1 ih2 by (auto intro: a_star_congs)
     also have "\<dots> = (AndR <c>.M <d>.N e)[b\<turnstile>c>a]" using eq fs by simp
     finally show "(AndR <c>.M <d>.N e){b:=(x).Ax x a} \<longrightarrow>\<^sub>a* (AndR <c>.M <d>.N e)[b\<turnstile>c>a]" by simp
@@ -6182,7 +5292,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = OrR1 <c>.M{b:=(x).Ax x a} a" using fs new
-      by (auto simp add: fresh_prod fresh_atm crename_fresh subst_fresh)
+      by (auto simp: fresh_prod fresh_atm crename_fresh subst_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* OrR1 <c>.(M[b\<turnstile>c>a]) a" using ih by (auto intro: a_star_congs)
     also have "\<dots> = (OrR1 <c>.M d)[b\<turnstile>c>a]" using eq fs by simp
     finally show "(OrR1 <c>.M d){b:=(x).Ax x a} \<longrightarrow>\<^sub>a* (OrR1 <c>.M d)[b\<turnstile>c>a]" by simp
@@ -6216,7 +5326,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = OrR2 <c>.M{b:=(x).Ax x a} a" using fs new
-      by (auto simp add: fresh_prod fresh_atm crename_fresh subst_fresh)
+      by (auto simp: fresh_prod fresh_atm crename_fresh subst_fresh)
     also have "\<dots> \<longrightarrow>\<^sub>a* OrR2 <c>.(M[b\<turnstile>c>a]) a" using ih by (auto intro: a_star_congs)
     also have "\<dots> = (OrR2 <c>.M d)[b\<turnstile>c>a]" using eq fs by simp
     finally show "(OrR2 <c>.M d){b:=(x).Ax x a} \<longrightarrow>\<^sub>a* (OrR2 <c>.M d)[b\<turnstile>c>a]" by simp
@@ -6259,7 +5369,7 @@
       apply(simp_all add: abs_fresh)
       done
     also have "\<dots> = ImpR z.<c>.M{b:=(x).Ax x a} a" using fs new
-      by (auto simp add: fresh_prod crename_fresh subst_fresh fresh_atm)
+      by (auto simp: fresh_prod crename_fresh subst_fresh fresh_atm)
     also have "\<dots> \<longrightarrow>\<^sub>a* ImpR z.<c>.(M[b\<turnstile>c>a]) a" using ih by (auto intro: a_star_congs)
     also have "\<dots> = (ImpR z.<c>.M b)[b\<turnstile>c>a]" using eq fs by simp
     finally show "(ImpR (z).<c>.M d){b:=(x).Ax x a} \<longrightarrow>\<^sub>a* (ImpR (z).<c>.M d)[b\<turnstile>c>a]" using eq by simp
@@ -6288,7 +5398,7 @@
 lemma not_Ax1:
   shows "\<not>(b\<sharp>M) \<Longrightarrow> M{b:=(y).Q} \<noteq> Ax x a"
 apply(nominal_induct M avoiding: b y Q x a rule: trm.strong_induct)
-apply(auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+apply(auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 apply(subgoal_tac "\<exists>x'::coname. x'\<sharp>(trm{coname:=(y).Q},Q)")
 apply(erule exE)
 apply(simp add: fresh_prod)
@@ -6360,7 +5470,7 @@
 lemma not_Ax2:
   shows "\<not>(x\<sharp>M) \<Longrightarrow> M{x:=<b>.Q} \<noteq> Ax y a"
 apply(nominal_induct M avoiding: b y Q x a rule: trm.strong_induct)
-apply(auto simp add: fresh_atm abs_fresh abs_supp fin_supp)
+apply(auto simp: fresh_atm abs_fresh abs_supp fin_supp)
 apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(trm{x:=<b>.Q},Q)")
 apply(erule exE)
 apply(simp add: fresh_prod)
@@ -6442,7 +5552,7 @@
 proof(nominal_induct N avoiding: x y c P rule: trm.strong_induct)
   case Ax
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject)
 next 
   case (Cut d M u M' x' y' c P)
   with assms show ?case
@@ -6529,11 +5639,11 @@
 next
   case NotR
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget)
+    by (auto simp: abs_fresh fresh_atm forget)
 next
   case (NotL d M u)
   then show ?case
-    apply (auto simp add: abs_fresh fresh_atm forget)
+    apply (auto simp: abs_fresh fresh_atm forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{y:=<c>.P},M{x:=<c>.Ax y c}{y:=<c>.P},y,x)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6543,7 +5653,7 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(1)[OF fs_name1])
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x:=<c>.Ax y c},M{x:=<c>.Ax y c}{y:=<c>.P},Ax y c,y,x)")
@@ -6566,11 +5676,11 @@
 next
   case (AndR d1 M d2 M' d3)
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (AndL1 u M d)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{y:=<c>.P},M{x:=<c>.Ax y c}{y:=<c>.P},u,y,x)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6580,7 +5690,7 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(1)[OF fs_name1])
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,Ax y c,M{x:=<c>.Ax y c},M{x:=<c>.Ax y c}{y:=<c>.P},u,y,x)")
@@ -6593,13 +5703,13 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(1)[OF fs_name1])
     done
 next
   case (AndL2 u M d)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{y:=<c>.P},M{x:=<c>.Ax y c}{y:=<c>.P},u,y,x)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6609,7 +5719,7 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(1)[OF fs_name1])
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,Ax y c,M{x:=<c>.Ax y c},M{x:=<c>.Ax y c}{y:=<c>.P},u,y,x)")
@@ -6622,21 +5732,21 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(1)[OF fs_name1])
     done
 next
   case OrR1
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case OrR2
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (OrL x1 M x2 M' x3)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{y:=<c>.P},M{x:=<c>.Ax y c}{y:=<c>.P},
                                         M'{y:=<c>.P},M'{x:=<c>.Ax y c}{y:=<c>.P},x1,x2,x3,y,x)")
     apply(erule exE, simp add: fresh_prod)
@@ -6647,7 +5757,7 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substn.simps)
@@ -6674,17 +5784,17 @@
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(force)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(1)[OF fs_name1])
     done
 next
   case ImpR
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (ImpL a M x1 M' x2)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x2:=<c>.P},M{x:=<c>.Ax x2 c}{x2:=<c>.P},
                                         M'{x2:=<c>.P},M'{x:=<c>.Ax x2 c}{x2:=<c>.P},x1,y,x)")
     apply(erule exE, simp add: fresh_prod)
@@ -6695,7 +5805,7 @@
     apply(simp add: abs_fresh)
     apply(simp)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substn.simps)
@@ -6720,7 +5830,7 @@
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(1)[OF fs_name1])
     done
 qed 
@@ -6750,12 +5860,12 @@
 proof(nominal_induct N avoiding: a b y P rule: trm.strong_induct)
   case Ax
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject)
 next 
   case (Cut d M u M' x' y' c P)
   with assms show ?case
     apply(simp)
-    apply(auto simp add: trm.inject)
+    apply(auto simp: trm.inject)
     apply(rule trans)
     apply(rule better_Cut_substc)
     apply(simp)
@@ -6815,11 +5925,11 @@
 next
   case NotL
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget)
+    by (auto simp: abs_fresh fresh_atm forget)
 next
   case (NotR u M d)
   then show ?case
-    apply (auto simp add: abs_fresh fresh_atm forget)
+    apply (auto simp: abs_fresh fresh_atm forget)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,P,M{d:=(y).P},M{b:=(y).Ax y d}{d:=(y).P},u,y)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6829,7 +5939,7 @@
     apply(simp add: abs_fresh)
     apply(simp add: abs_fresh)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(P,M{d:=(y).Ax y a},M{d:=(y).Ax y a}{a:=(y).P},Ax y a,y,d)")
@@ -6852,7 +5962,7 @@
 next
   case (AndR d1 M d2 M' d3)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(P,M{d3:=(y).P},M{b:=(y).Ax y d3}{d3:=(y).P},
                                         M'{d3:=(y).P},M'{b:=(y).Ax y d3}{d3:=(y).P},d1,d2,d3,b,y)")
     apply(erule exE, simp add: fresh_prod)
@@ -6863,7 +5973,7 @@
     apply(simp add: abs_fresh fresh_atm)
     apply(simp add: abs_fresh fresh_atm)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
@@ -6890,21 +6000,21 @@
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(force)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     done
 next
   case (AndL1 u M d)
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (AndL2 u M d)
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (OrR1 d M e)
   then show ?case
-    apply (auto simp add: abs_fresh fresh_atm forget)
+    apply (auto simp: abs_fresh fresh_atm forget)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,P,M{e:=(y).P},M{b:=(y).Ax y e}{e:=(y).P},d,e)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6914,7 +6024,7 @@
     apply(simp add: abs_fresh)
     apply(simp add: abs_fresh)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,P,Ax y a,M{e:=(y).Ax y a},M{e:=(y).Ax y a}{a:=(y).P},d,e)")
@@ -6937,7 +6047,7 @@
 next
   case (OrR2 d M e)
   then show ?case
-    apply (auto simp add: abs_fresh fresh_atm forget)
+    apply (auto simp: abs_fresh fresh_atm forget)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,P,M{e:=(y).P},M{b:=(y).Ax y e}{e:=(y).P},d,e)")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6947,7 +6057,7 @@
     apply(simp add: abs_fresh)
     apply(simp add: abs_fresh)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,P,Ax y a,M{e:=(y).Ax y a},M{e:=(y).Ax y a}{a:=(y).P},d,e)")
@@ -6970,15 +6080,15 @@
 next
   case (OrL x1 M x2 M' x3)
   then show ?case
-    by(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case ImpL
   then show ?case
-    by (auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    by (auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
 next
   case (ImpR u e M d)
   then show ?case
-    apply(auto simp add: abs_fresh fresh_atm forget trm.inject subst_fresh)
+    apply(auto simp: abs_fresh fresh_atm forget trm.inject subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(b,e,d,P,M{d:=(y).P},M{b:=(y).Ax y d}{d:=(y).P})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -6988,7 +6098,7 @@
     apply(simp add: abs_fresh)
     apply(simp add: abs_fresh)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(e,d,P,Ax y a,M{d:=(y).Ax y a},M{d:=(y).Ax y a}{a:=(y).P})")
@@ -7007,7 +6117,7 @@
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(simp add: abs_fresh subst_fresh fresh_atm)
     apply(simp)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(rule exists_fresh'(2)[OF fs_coname1])
     done
 qed 
@@ -7043,7 +6153,7 @@
       using fs by (simp_all add: fresh_prod fresh_atm)
     also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (y).(Q{x:=<a>.(P{b:=(y).Q})})" using fs by (simp add: forget)
     also have "\<dots> = (Cut <b>.Ax x b (y).Q){x:=<a>.(P{b:=(y).Q})}"
-      using fs asm by (auto simp add: fresh_prod fresh_atm subst_fresh)
+      using fs asm by (auto simp: fresh_prod fresh_atm subst_fresh)
     also have "\<dots> = (Ax x b){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" using fs by simp
     finally have "(Ax z c){x:=<a>.P}{b:=(y).Q} = (Ax z c){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" 
       using asm by simp
@@ -7055,14 +6165,14 @@
     also have "\<dots> = Cut <b>.(Ax z c{x:=<a>.(P{b:=(y).Q})}) (y).(Q{x:=<a>.(P{b:=(y).Q})})" 
       using fs asm by (simp add: forget)
     also have "\<dots> = (Cut <b>.Ax z c (y).Q){x:=<a>.(P{b:=(y).Q})}" using asm fs
-      by (auto simp add: trm.inject subst_fresh fresh_prod fresh_atm abs_fresh)
+      by (auto simp: trm.inject subst_fresh fresh_prod fresh_atm abs_fresh)
     also have "\<dots> = (Ax z c){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" using asm fs by simp
     finally have "(Ax z c){x:=<a>.P}{b:=(y).Q} = (Ax z c){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" by simp
   }
   moreover
   { assume asm: "z=x \<and> c\<noteq>b"
     have "(Ax z c){x:=<a>.P}{b:=(y).Q} = (Cut <a>.P (x).Ax z c){b:=(y).Q}" using fs asm by simp
-    also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (x).Ax z c" using fs asm by (auto simp add: trm.inject abs_fresh)
+    also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (x).Ax z c" using fs asm by (auto simp: trm.inject abs_fresh)
     also have "\<dots> = (Ax z c){x:=<a>.(P{b:=(y).Q})}" using fs asm by simp
     also have "\<dots> = (Ax z c){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" using asm by auto
     finally have "(Ax z c){x:=<a>.P}{b:=(y).Q} = (Ax z c){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}" by simp
@@ -7078,12 +6188,12 @@
     have "(Cut <c>.M (z).N){x:=<a>.P}{b:=(y).Q} = (Cut <a>.P (z).(N{x:=<a>.P})){b:=(y).Q}" 
       using Cut asm by simp
     also have "\<dots> = (Cut <a>.P (z).N){b:=(y).Q}" using Cut asm by (simp add: fresh_atm)
-    also have "\<dots> = (Cut <a>.(P{b:=(y).Q}) (y).Q)" using Cut asm by (auto simp add: fresh_prod fresh_atm)
+    also have "\<dots> = (Cut <a>.(P{b:=(y).Q}) (y).Q)" using Cut asm by (auto simp: fresh_prod fresh_atm)
     finally have eq1: "(Cut <c>.M (z).N){x:=<a>.P}{b:=(y).Q} = (Cut <a>.(P{b:=(y).Q}) (y).Q)" by simp
     have "(Cut <c>.M (z).N){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})} = (Cut <c>.M (y).Q){x:=<a>.(P{b:=(y).Q})}"
       using Cut asm by (simp add: fresh_atm)
     also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (y).(Q{x:=<a>.(P{b:=(y).Q})})" using Cut asm
-      by (auto simp add: fresh_prod fresh_atm subst_fresh)
+      by (auto simp: fresh_prod fresh_atm subst_fresh)
     also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (y).Q" using Cut asm by (simp add: forget)
     finally have eq2: "(Cut <c>.M (z).N){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})} = Cut <a>.(P{b:=(y).Q}) (y).Q"
       by simp
@@ -7109,7 +6219,7 @@
     have "(Cut <c>.M (z).N){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})} = 
                (Cut <c>.(M{b:=(y).Q}) (y).Q){x:=<a>.(P{b:=(y).Q})}" using Cut asm by simp
     also have "\<dots> = Cut <c>.(M{b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}) (y).(Q{x:=<a>.(P{b:=(y).Q})})"
-      using Cut asm neq by (auto simp add: fresh_prod fresh_atm subst_fresh abs_fresh)
+      using Cut asm neq by (auto simp: fresh_prod fresh_atm subst_fresh abs_fresh)
     also have "\<dots> = Cut <c>.(M{b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}) (y).Q" using Cut asm by (simp add: forget)
     finally have eq2: "(Cut <c>.M (z).N){b:=(y).Q}{x:=<a>.(P{b:=(y).Q})} 
                                        = Cut <c>.(M{b:=(y).Q}{x:=<a>.(P{b:=(y).Q})}) (y).Q" by simp
@@ -7135,7 +6245,7 @@
                     = (Cut <c>.(M{b:=(y).Q}) (z).(N{b:=(y).Q})){x:=<a>.(P{b:=(y).Q})}"
       using Cut asm by auto
     also have "\<dots> = (Cut <c>.M (z).(N{b:=(y).Q})){x:=<a>.(P{b:=(y).Q})}"
-      using Cut asm by (auto simp add: fresh_atm)
+      using Cut asm by (auto simp: fresh_atm)
     also have "\<dots> = Cut <a>.(P{b:=(y).Q}) (z).(N{b:=(y).Q}{x:=<a>.(P{b:=(y).Q})})" 
       using Cut asm by (simp add: fresh_prod fresh_atm subst_fresh)
     finally 
@@ -7179,7 +6289,7 @@
 next
   case (NotR z M c)
   then show ?case
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(M{c:=(y).Q},M{c:=(y).Q}{x:=<a>.P{c:=(y).Q}},Q,a,P,c,y)")
     apply(erule exE)
     apply(simp add: fresh_prod)
@@ -7197,7 +6307,7 @@
 next
   case (NotL c M z)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x:=<a>.P},P{b:=(y).Q},M{b:=(y).Q}{x:=<a>.P{b:=(y).Q}},y,Q)")
     apply(erule exE)
     apply(simp add: fresh_prod)
@@ -7208,7 +6318,7 @@
 next
   case (AndR c1 M c2 N c3)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(Q,M{c3:=(y).Q},M{c3:=(y).Q}{x:=<a>.P{c3:=(y).Q}},c2,c3,a,
                                      P{c3:=(y).Q},N{c3:=(y).Q},N{c3:=(y).Q}{x:=<a>.P{c3:=(y).Q}},c1)")
     apply(erule exE)
@@ -7225,7 +6335,7 @@
 next
   case (AndL1 z1 M z2)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x:=<a>.P},P{b:=(y).Q},z1,y,Q,M{b:=(y).Q}{x:=<a>.P{b:=(y).Q}})")
     apply(erule exE)
     apply(simp add: fresh_prod)
@@ -7236,7 +6346,7 @@
 next
   case (AndL2 z1 M z2)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x:=<a>.P},P{b:=(y).Q},z1,y,Q,M{b:=(y).Q}{x:=<a>.P{b:=(y).Q}})")
     apply(erule exE)
     apply(simp add: fresh_prod)
@@ -7247,7 +6357,7 @@
 next
   case (OrL z1 M z2 N z3)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,M{x:=<a>.P},M{b:=(y).Q}{x:=<a>.P{b:=(y).Q}},z2,z3,a,y,Q,
                                      P{b:=(y).Q},N{x:=<a>.P},N{b:=(y).Q}{x:=<a>.P{b:=(y).Q}},z1)")
     apply(erule exE)
@@ -7263,7 +6373,7 @@
 next
   case (OrR1 c1 M c2)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(Q,M{c2:=(y).Q},a,P{c2:=(y).Q},c1,
                                                      M{c2:=(y).Q}{x:=<a>.P{c2:=(y).Q}})")
     apply(erule exE)
@@ -7277,7 +6387,7 @@
 next
   case (OrR2 c1 M c2)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(Q,M{c2:=(y).Q},a,P{c2:=(y).Q},c1,
                                                      M{c2:=(y).Q}{x:=<a>.P{c2:=(y).Q}})")
     apply(erule exE)
@@ -7291,7 +6401,7 @@
 next
   case (ImpR z c M d)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(Q,M{d:=(y).Q},a,P{d:=(y).Q},c,
                                                      M{d:=(y).Q}{x:=<a>.P{d:=(y).Q}})")
     apply(erule exE)
@@ -7304,7 +6414,7 @@
 next
   case (ImpL c M z N u)
   then show ?case  
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)
     apply(subgoal_tac "\<exists>z'::name. z'\<sharp>(P,P{b:=(y).Q},M{u:=<a>.P},N{u:=<a>.P},y,Q,
                         M{b:=(y).Q}{u:=<a>.P{b:=(y).Q}},N{b:=(y).Q}{u:=<a>.P{b:=(y).Q}},z)")
     apply(erule exE)
@@ -7326,7 +6436,7 @@
 proof(nominal_induct M avoiding: a x N y b P rule: trm.strong_induct)
   case (Ax z c)
   then show ?case
-    by (auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    by (auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
 next
   case (Cut d M' u M'')
   then show ?case
@@ -7385,7 +6495,7 @@
 next
   case (NotR z M' d) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(y,P,N,N{y:=<b>.P},M'{d:=(x).N},M'{y:=<b>.P}{d:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7405,7 +6515,7 @@
 next
   case (NotL d M' z) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(z,y,P,N,N{y:=<b>.P},M'{y:=<b>.P},M'{y:=<b>.P}{a:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7427,7 +6537,7 @@
 next
   case (AndR d M' e M'' f) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>a'::coname. a'\<sharp>(P,b,d,e,N,N{y:=<b>.P},M'{f:=(x).N},M''{f:=(x).N},
                   M'{y:=<b>.P}{f:=(x).N{y:=<b>.P}},M''{y:=<b>.P}{f:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7450,7 +6560,7 @@
 next
   case (AndL1 z M' u) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,b,z,u,x,N,M'{y:=<b>.P},M'{y:=<b>.P}{a:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7471,7 +6581,7 @@
 next
   case (AndL2 z M' u) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(P,b,z,u,x,N,M'{y:=<b>.P},M'{y:=<b>.P}{a:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7492,7 +6602,7 @@
 next
   case (OrL u M' v M'' w) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>z'::name. z'\<sharp>(P,b,u,w,v,N,N{y:=<b>.P},M'{y:=<b>.P},M''{y:=<b>.P},
                   M'{y:=<b>.P}{a:=(x).N{y:=<b>.P}},M''{y:=<b>.P}{a:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7516,7 +6626,7 @@
 next
   case (OrR1 e M' f) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>c'::coname. c'\<sharp>(P,b,e,f,x,N,N{y:=<b>.P},
                                         M'{f:=(x).N},M'{y:=<b>.P}{f:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7537,7 +6647,7 @@
 next
   case (OrR2 e M' f) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>c'::coname. c'\<sharp>(P,b,e,f,x,N,N{y:=<b>.P},
                                         M'{f:=(x).N},M'{y:=<b>.P}{f:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7558,7 +6668,7 @@
 next
   case (ImpR x e M' f) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>c'::coname. c'\<sharp>(P,b,e,f,x,N,N{y:=<b>.P},
                                         M'{f:=(x).N},M'{y:=<b>.P}{f:=(x).N{y:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7581,7 +6691,7 @@
 next
   case (ImpL e M' v M'' w) 
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget trm.inject)
     apply(subgoal_tac "\<exists>z'::name. z'\<sharp>(P,b,e,w,v,N,N{y:=<b>.P},M'{w:=<b>.P},M''{w:=<b>.P},
                   M'{w:=<b>.P}{a:=(x).N{w:=<b>.P}},M''{w:=<b>.P}{a:=(x).N{w:=<b>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7610,7 +6720,7 @@
 proof(nominal_induct N avoiding: x y a c M P rule: trm.strong_induct)
   case (Ax z c)
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (Cut d M' u M'')
   then show ?case
@@ -7650,11 +6760,11 @@
 next
   case NotR
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (NotL d M' u)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(y,P,M,M{y:=<c>.P},M'{x:=<a>.M},M'{y:=<c>.P}{x:=<a>.M{y:=<c>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7693,11 +6803,11 @@
 next
   case AndR
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (AndL1 u M' v)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(u,y,v,P,M,M{y:=<c>.P},M'{x:=<a>.M},M'{y:=<c>.P}{x:=<a>.M{y:=<c>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7736,7 +6846,7 @@
 next
   case (AndL2 u M' v)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(u,y,v,P,M,M{y:=<c>.P},M'{x:=<a>.M},M'{y:=<c>.P}{x:=<a>.M{y:=<c>.P}})")
     apply(erule exE, simp add: fresh_prod)
     apply(erule conjE)+
@@ -7775,15 +6885,15 @@
 next
   case OrR1
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case OrR2
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (OrL x1 M' x2 M'' x3)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(y,P,M,M{y:=<c>.P},M'{x:=<a>.M},M'{y:=<c>.P}{x:=<a>.M{y:=<c>.P}},
                                       x1,x2,x3,M''{x:=<a>.M},M''{y:=<c>.P}{x:=<a>.M{y:=<c>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7827,11 +6937,11 @@
 next
   case ImpR
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (ImpL d M' x1 M'' x2)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(subgoal_tac "\<exists>x'::name. x'\<sharp>(y,P,M,M{y:=<c>.P},M'{x2:=<a>.M},M'{y:=<c>.P}{x2:=<a>.M{y:=<c>.P}},
                                       x1,x2,M''{x2:=<a>.M},M''{y:=<c>.P}{x2:=<a>.M{y:=<c>.P}})")
     apply(erule exE, simp add: fresh_prod)
@@ -7879,7 +6989,7 @@
 proof(nominal_induct N avoiding: x y a c M P rule: trm.strong_induct)
   case (Ax z c)
   then show ?case
-    by (auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by (auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (Cut d M' u M'')
   then show ?case
@@ -7919,11 +7029,11 @@
 next
   case NotL
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (NotR u M' d)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -7937,7 +7047,7 @@
     apply(rule trans)
     apply(rule substc.simps)
     apply(simp add: fresh_prod fresh_atm)
-    apply(auto simp add: fresh_atm fresh_prod)[1]
+    apply(auto simp: fresh_atm fresh_prod)[1]
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -7946,25 +7056,25 @@
     apply(rule better_Cut_substc)
     apply(simp add: fresh_prod fresh_atm subst_fresh)
     apply(simp add: abs_fresh subst_fresh)
-    apply(auto simp add: fresh_atm)
+    apply(auto simp: fresh_atm)
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
     apply(simp add: fresh_atm subst_fresh)
-    apply(auto simp add: fresh_prod fresh_atm) 
+    apply(auto simp: fresh_prod fresh_atm) 
     done
 next
   case AndL1
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case AndL2
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (AndR d M e M' f)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -7977,10 +7087,10 @@
     apply(simp add: trm.inject alpha)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     apply(simp)
-    apply(auto simp add: fresh_atm fresh_prod)[1]
+    apply(auto simp: fresh_atm fresh_prod)[1]
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -7989,23 +7099,23 @@
     apply(rule better_Cut_substc)
     apply(simp add: subst_fresh fresh_atm fresh_prod)
     apply(simp add: abs_fresh subst_fresh)
-    apply(auto simp add: fresh_atm)[1]
+    apply(auto simp: fresh_atm)[1]
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     apply(simp)
-    apply(auto simp add: fresh_atm fresh_prod)[1]
+    apply(auto simp: fresh_atm fresh_prod)[1]
     done
 next
   case OrL
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (OrR1 d M' e)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8018,8 +7128,8 @@
     apply(simp add: trm.inject alpha)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8028,17 +7138,17 @@
     apply(rule better_Cut_substc)
     apply(simp add: subst_fresh fresh_atm fresh_prod)
     apply(simp add: abs_fresh subst_fresh)
-    apply(auto simp add: fresh_atm)[1]
+    apply(auto simp: fresh_atm)[1]
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     done
 next
   case (OrR2 d M' e)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8051,8 +7161,8 @@
     apply(simp add: trm.inject alpha)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8061,21 +7171,21 @@
     apply(rule better_Cut_substc)
     apply(simp add: subst_fresh fresh_atm fresh_prod)
     apply(simp add: abs_fresh subst_fresh)
-    apply(auto simp add: fresh_atm)[1]
+    apply(auto simp: fresh_atm)[1]
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
     done
 next
   case ImpL
   then show ?case
-    by(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    by(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
 next
   case (ImpR u d M' e)
   then show ?case
-    apply(auto simp add: subst_fresh abs_fresh fresh_atm fresh_prod forget)
+    apply(auto simp: subst_fresh abs_fresh fresh_atm fresh_prod forget)
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8088,9 +7198,9 @@
     apply(simp add: trm.inject alpha)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
     apply(generate_fresh "coname")
     apply(fresh_fun_simp)
     apply(fresh_fun_simp)
@@ -8099,14 +7209,14 @@
     apply(rule better_Cut_substc)
     apply(simp add: subst_fresh fresh_atm fresh_prod)
     apply(simp add: abs_fresh subst_fresh)
-    apply(auto simp add: fresh_atm)[1]
+    apply(auto simp: fresh_atm)[1]
     apply(simp add: trm.inject alpha forget)
     apply(rule trans)
     apply(rule substc.simps)
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
-    apply(auto simp add: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
+    apply(auto simp: fresh_prod fresh_atm subst_fresh abs_fresh abs_supp fin_supp)[1]
     done
 qed
 
--- a/src/HOL/Nominal/Examples/Compile.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Compile.thy	Thu May 23 20:22:52 2024 +0200
@@ -110,11 +110,7 @@
 | "\<lbrakk>z\<noteq>x; x\<sharp>y; x\<sharp>e; x\<sharp>e2; z\<sharp>y; z\<sharp>e; z\<sharp>e1; x\<sharp>t'; z\<sharp>t'\<rbrakk> \<Longrightarrow>
      (Case e of inl x \<rightarrow> e1 | inr z \<rightarrow> e2)[y::=t'] =
        (Case (e[y::=t']) of inl x \<rightarrow> (e1[y::=t']) | inr z \<rightarrow> (e2[y::=t']))"
-  apply(finite_guess)+
-  apply(rule TrueI)+
-  apply(simp add: abs_fresh)+
-  apply(fresh_guess)+
-  done
+  by(finite_guess | simp add: abs_fresh | fresh_guess)+
 
 instance ..
 
@@ -135,11 +131,7 @@
 | "(IRef e)[y::=t'] = IRef (e[y::=t'])"
 | "(ISeq e1 e2)[y::=t'] = ISeq (e1[y::=t']) (e2[y::=t'])"
 | "(Iif e e1 e2)[y::=t'] = Iif (e[y::=t']) (e1[y::=t']) (e2[y::=t'])"
-  apply(finite_guess)+
-  apply(rule TrueI)+
-  apply(simp add: abs_fresh)+
-  apply(fresh_guess)+
-  done
+  by(finite_guess | simp add: abs_fresh | fresh_guess)+
 
 instance ..
 
@@ -151,33 +143,28 @@
   and   t2::"trmI"
   and   x::"name"
   shows "pi\<bullet>(t1[x::=t2]) = ((pi\<bullet>t1)[(pi\<bullet>x)::=(pi\<bullet>t2)])"
-  apply (nominal_induct t1 avoiding: x t2 rule: trmI.strong_induct)
-  apply (simp_all add: subst_trmI.simps eqvts fresh_bij)
-  done
+  by (nominal_induct t1 avoiding: x t2 rule: trmI.strong_induct)
+     (simp_all add: subst_trmI.simps eqvts fresh_bij)
 
 lemma Isubst_supp:
   fixes t1::"trmI"
   and   t2::"trmI"
   and   x::"name"
   shows "((supp (t1[x::=t2]))::name set) \<subseteq> (supp t2)\<union>((supp t1)-{x})"
-  apply (nominal_induct t1 avoiding: x t2 rule: trmI.strong_induct)
-  apply (auto simp add: subst_trmI.simps trmI.supp supp_atm abs_supp supp_nat)
-  apply blast+
-  done
+proof (nominal_induct t1 avoiding: x t2 rule: trmI.strong_induct)
+  case (IVar name)
+  then show ?case
+    by (simp add: supp_atm trmI.supp(1))
+qed (fastforce simp add: subst_trmI.simps trmI.supp supp_atm abs_supp supp_nat)+
 
 lemma Isubst_fresh:
   fixes x::"name"
   and   y::"name"
   and   t1::"trmI"
   and   t2::"trmI"
-  assumes a: "x\<sharp>[y].t1" "x\<sharp>t2"
+  assumes "x\<sharp>[y].t1" "x\<sharp>t2"
   shows "x\<sharp>(t1[y::=t2])"
-using a
-apply(auto simp add: fresh_def Isubst_supp)
-apply(drule rev_subsetD)
-apply(rule Isubst_supp)
-apply(simp add: abs_supp)
-done
+  using assms Isubst_supp abs_supp(2)  unfolding fresh_def Isubst_supp by fastforce
 
 text \<open>big-step evaluation for trms\<close>
 
@@ -240,11 +227,8 @@
         let v1 = (trans e1) in
         let v2 = (trans e2) in 
         Iif (IRef (ISucc v)) (v2[x2::=IRef (ISucc (ISucc v))]) (v1[x1::=IRef (ISucc (ISucc v))]))"
-  apply(finite_guess add: Let_def)+
-  apply(rule TrueI)+
-  apply(simp add: abs_fresh Isubst_fresh)+
-  apply(fresh_guess add: Let_def)+
-  done
+  unfolding Let_def
+  by(finite_guess | simp add: abs_fresh Isubst_fresh | fresh_guess)+
 
 nominal_primrec
   trans_type :: "ty \<Rightarrow> tyI"
--- a/src/HOL/Nominal/Examples/Crary.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Crary.thy	Thu May 23 20:22:52 2024 +0200
@@ -76,7 +76,7 @@
 lemma lookup_eqvt[eqvt]:
   fixes pi::"name prm"
   shows "pi\<bullet>(lookup \<theta> x) = lookup (pi\<bullet>\<theta>) (pi\<bullet>x)"
-by (induct \<theta>) (auto simp add: perm_bij)
+by (induct \<theta>) (auto simp: perm_bij)
 
 lemma lookup_fresh:
   fixes z::"name"
@@ -84,14 +84,14 @@
   shows "z\<sharp> lookup \<theta> x"
 using a
 by (induct rule: lookup.induct) 
-   (auto simp add: fresh_list_cons)
+   (auto simp: fresh_list_cons)
 
 lemma lookup_fresh':
   assumes a: "z\<sharp>\<theta>"
   shows "lookup \<theta> z = Var z"
 using a
 by (induct rule: lookup.induct)
-   (auto simp add: fresh_list_cons fresh_prod fresh_atm)
+   (auto simp: fresh_list_cons fresh_prod fresh_atm)
  
 nominal_primrec
   psubst :: "Subst \<Rightarrow> trm \<Rightarrow> trm"  ("_<_>" [100,100] 130)
@@ -101,11 +101,7 @@
 | "x\<sharp>\<theta> \<Longrightarrow> \<theta><(Lam [x].t)> = Lam [x].(\<theta><t>)"
 | "\<theta><(Const n)> = Const n"
 | "\<theta><(Unit)> = Unit"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh)+
-apply(fresh_guess)+
-done
+  by(finite_guess | simp add: abs_fresh | fresh_guess)+
 
 abbreviation 
  subst :: "trm \<Rightarrow> name \<Rightarrow> trm \<Rightarrow> trm" ("_[_::=_]" [100,100,100] 100)
@@ -131,9 +127,8 @@
   assumes a: "c\<sharp>t\<^sub>1"
   shows "t\<^sub>1[a::=t\<^sub>2] = ([(c,a)]\<bullet>t\<^sub>1)[c::=t\<^sub>2]"
 using a
-apply(nominal_induct t\<^sub>1 avoiding: a c t\<^sub>2 rule: trm.strong_induct)
-apply(simp add: trm.inject calc_atm fresh_atm abs_fresh perm_nat_def)+
-done
+  by (nominal_induct t\<^sub>1 avoiding: a c t\<^sub>2 rule: trm.strong_induct)
+     (auto simp: trm.inject calc_atm fresh_atm abs_fresh perm_nat_def)
 
 lemma fresh_psubst: 
   fixes z::"name"
@@ -141,7 +136,7 @@
   shows "z\<sharp>(\<theta><t>)"
 using a
 by (nominal_induct t avoiding: z \<theta> t rule: trm.strong_induct)
-   (auto simp add: abs_fresh lookup_fresh)
+   (auto simp: abs_fresh lookup_fresh)
 
 lemma fresh_subst'':
   fixes z::"name"
@@ -149,7 +144,7 @@
   shows "z\<sharp>t\<^sub>1[z::=t\<^sub>2]"
 using assms 
 by (nominal_induct t\<^sub>1 avoiding: t\<^sub>2 z rule: trm.strong_induct)
-   (auto simp add: abs_fresh fresh_nat fresh_atm)
+   (auto simp: abs_fresh fresh_nat fresh_atm)
 
 lemma fresh_subst':
   fixes z::"name"
@@ -157,14 +152,14 @@
   shows "z\<sharp>t\<^sub>1[y::=t\<^sub>2]"
 using assms 
 by (nominal_induct t\<^sub>1 avoiding: y t\<^sub>2 z rule: trm.strong_induct)
-   (auto simp add: abs_fresh fresh_nat fresh_atm)
+   (auto simp: abs_fresh fresh_nat fresh_atm)
 
 lemma fresh_subst:
   fixes z::"name"
   assumes a: "z\<sharp>t\<^sub>1" "z\<sharp>t\<^sub>2"
   shows "z\<sharp>t\<^sub>1[y::=t\<^sub>2]"
 using a 
-by (auto simp add: fresh_subst' abs_fresh) 
+by (auto simp: fresh_subst' abs_fresh) 
 
 lemma fresh_psubst_simp:
   assumes "x\<sharp>t"
@@ -181,7 +176,7 @@
     by (simp add: fresh_list_cons fresh_prod)
   moreover have " \<theta><Lam [y].t> = Lam [y]. (\<theta><t>)" using fs by simp
   ultimately show "((x,u)#\<theta>)<Lam [y].t> = \<theta><Lam [y].t>" by auto
-qed (auto simp add: fresh_atm abs_fresh)
+qed (auto simp: fresh_atm abs_fresh)
 
 lemma forget: 
   fixes x::"name"
@@ -189,7 +184,7 @@
   shows "t[x::=t'] = t"
   using a
 by (nominal_induct t avoiding: x t' rule: trm.strong_induct)
-   (auto simp add: fresh_atm abs_fresh)
+   (auto simp: fresh_atm abs_fresh)
 
 lemma subst_fun_eq:
   fixes u::trm
@@ -212,20 +207,20 @@
 lemma psubst_empty[simp]:
   shows "[]<t> = t"
 by (nominal_induct t rule: trm.strong_induct) 
-   (auto simp add: fresh_list_nil)
+   (auto simp: fresh_list_nil)
 
 lemma psubst_subst_psubst:
   assumes h:"c\<sharp>\<theta>"
   shows "\<theta><t>[c::=s] = ((c,s)#\<theta>)<t>"
   using h
 by (nominal_induct t avoiding: \<theta> c s rule: trm.strong_induct)
-   (auto simp add: fresh_list_cons fresh_atm forget lookup_fresh lookup_fresh' fresh_psubst)
+   (auto simp: fresh_list_cons fresh_atm forget lookup_fresh lookup_fresh' fresh_psubst)
 
 lemma subst_fresh_simp:
   assumes a: "x\<sharp>\<theta>"
   shows "\<theta><Var x> = Var x"
 using a
-by (induct \<theta> arbitrary: x) (auto simp add:fresh_list_cons fresh_prod fresh_atm)
+by (induct \<theta> arbitrary: x) (auto simp:fresh_list_cons fresh_prod fresh_atm)
 
 lemma psubst_subst_propagate: 
   assumes "x\<sharp>\<theta>" 
@@ -239,7 +234,7 @@
   }
   moreover 
   { assume h:"x\<noteq>n"
-    then have "x\<sharp>Var n" by (auto simp add: fresh_atm) 
+    then have "x\<sharp>Var n" by (auto simp: fresh_atm) 
     moreover have "x\<sharp>\<theta>" by fact
     ultimately have "x\<sharp>\<theta><Var n>" using fresh_psubst by blast
     then have " \<theta><Var n>[x::=\<theta><u>] =  \<theta><Var n>" using forget by auto
@@ -291,7 +286,7 @@
   shows "\<not>(\<exists>\<tau>::ty. (a,\<tau>)\<in>set \<Gamma>)"
 using assms 
 by (induct \<Gamma>)
-   (auto simp add: fresh_prod fresh_list_cons fresh_atm)
+   (auto simp: fresh_prod fresh_list_cons fresh_atm)
 
 lemma type_unicity_in_context:
   assumes a: "valid \<Gamma>" 
@@ -415,15 +410,7 @@
   and     b: "x \<leadsto> b"
   shows "a=b"
   using a b
-apply (induct arbitrary: b)
-apply (erule whr_inv_auto(3))
-apply (clarify)
-apply (rule subst_fun_eq)
-apply (simp)
-apply (force)
-apply (erule whr_inv_auto(6))
-apply (blast)+
-done
+by (induct arbitrary: b) (use subst_fun_eq in blast)+
 
 lemma nf_unicity :
   assumes "x \<Down> a" and "x \<Down> b"
@@ -433,8 +420,7 @@
   case (QAN_Reduce x t a b)
   have h:"x \<leadsto> t" "t \<Down> a" by fact+
   have ih:"\<And>b. t \<Down> b \<Longrightarrow> a = b" by fact
-  have "x \<Down> b" by fact
-  then obtain t' where "x \<leadsto> t'" and hl:"t' \<Down> b" using h by auto
+  obtain t' where "x \<leadsto> t'" and hl:"t' \<Down> b" using h \<open>x \<Down> b\<close> by auto
   then have "t=t'" using h red_unicity by auto
   then show "a=b" using ih hl by auto
 qed (auto)
@@ -535,7 +521,7 @@
   shows "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T \<Longrightarrow> \<Gamma> \<turnstile> t \<Leftrightarrow> s : T" 
   and   "\<Gamma> \<turnstile> s \<leftrightarrow> t : T \<Longrightarrow> \<Gamma> \<turnstile> t \<leftrightarrow> s : T"
 by (induct rule: alg_equiv_alg_path_equiv.inducts) 
-   (auto simp add: fresh_prod)
+   (auto simp: fresh_prod)
 
 lemma algorithmic_transitivity:
   shows "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T \<Longrightarrow> \<Gamma> \<turnstile> t \<Leftrightarrow> u : T \<Longrightarrow> \<Gamma> \<turnstile> s \<Leftrightarrow> u : T"
@@ -560,7 +546,7 @@
   then have "(x,T\<^sub>1)#\<Gamma> \<turnstile> App t (Var x) \<Leftrightarrow> App u (Var x) : T\<^sub>2" using fs 
     by (simp add: Q_Arrow_strong_inversion)
   with ih have "(x,T\<^sub>1)#\<Gamma> \<turnstile> App s (Var x) \<Leftrightarrow> App u (Var x) : T\<^sub>2" by simp
-  then show "\<Gamma> \<turnstile> s \<Leftrightarrow> u : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp add: fresh_prod)
+  then show "\<Gamma> \<turnstile> s \<Leftrightarrow> u : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp: fresh_prod)
 next
   case (QAP_App \<Gamma> p q T\<^sub>1 T\<^sub>2 s t u)
   have "\<Gamma> \<turnstile> App q t \<leftrightarrow> u : T\<^sub>2" by fact
@@ -578,10 +564,9 @@
 
 lemma algorithmic_weak_head_closure:
   shows "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T \<Longrightarrow> s' \<leadsto> s \<Longrightarrow> t' \<leadsto> t \<Longrightarrow> \<Gamma> \<turnstile> s' \<Leftrightarrow> t' : T"
-apply (nominal_induct \<Gamma> s t T avoiding: s' t'  
-    rule: alg_equiv_alg_path_equiv.strong_inducts(1) [of _ _ _ _ "%a b c d e. True"])
-apply(auto intro!: QAT_Arrow)
-done
+proof (nominal_induct \<Gamma> s t T avoiding: s' t'  
+    rule: alg_equiv_alg_path_equiv.strong_inducts(1) [of _ _ _ _ "\<lambda>a b c d e. True"])
+qed(auto intro!: QAT_Arrow)
 
 lemma algorithmic_monotonicity:
   shows "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T \<Longrightarrow> \<Gamma> \<subseteq> \<Gamma>' \<Longrightarrow> valid \<Gamma>' \<Longrightarrow> \<Gamma>' \<turnstile> s \<Leftrightarrow> t : T"
@@ -596,7 +581,7 @@
   moreover
   have sub: "(x,T\<^sub>1)#\<Gamma> \<subseteq> (x,T\<^sub>1)#\<Gamma>'" using h2 by auto
   ultimately have "(x,T\<^sub>1)#\<Gamma>' \<turnstile> App s (Var x) \<Leftrightarrow> App t (Var x) : T\<^sub>2" using ih by simp
-  then show "\<Gamma>' \<turnstile> s \<Leftrightarrow> t : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp add: fresh_prod)
+  then show "\<Gamma>' \<turnstile> s \<Leftrightarrow> t : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp: fresh_prod)
 qed (auto)
 
 lemma path_equiv_implies_nf:
@@ -613,11 +598,7 @@
  | "\<Gamma> \<turnstile> s is t : TBase = \<Gamma> \<turnstile> s \<Leftrightarrow> t : TBase"
  | "\<Gamma> \<turnstile> s is t : (T\<^sub>1 \<rightarrow> T\<^sub>2) =  
     (\<forall>\<Gamma>' s' t'. \<Gamma>\<subseteq>\<Gamma>' \<longrightarrow> valid \<Gamma>' \<longrightarrow> \<Gamma>' \<turnstile> s' is t' : T\<^sub>1 \<longrightarrow>  (\<Gamma>' \<turnstile> (App s s') is (App t t') : T\<^sub>2))"
-apply (auto simp add: ty.inject)
-apply (subgoal_tac "(\<exists>T\<^sub>1 T\<^sub>2. b=T\<^sub>1 \<rightarrow> T\<^sub>2) \<or> b=TUnit \<or> b=TBase" )
-apply (force)
-apply (rule ty_cases)
-done
+using ty_cases by (force simp: ty.inject)+
 
 termination by lexicographic_order
 
@@ -656,7 +637,7 @@
     then have "(x,T\<^sub>1)#\<Gamma> \<turnstile> Var x is Var x : T\<^sub>1" using ih2 by auto
     then have "(x,T\<^sub>1)#\<Gamma> \<turnstile> App s (Var x) is App t (Var x) : T\<^sub>2" using h v by auto
     then have "(x,T\<^sub>1)#\<Gamma> \<turnstile> App s (Var x) \<Leftrightarrow> App t (Var x) : T\<^sub>2" using ih1 v by auto
-    then show "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp add: fresh_prod)
+    then show "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T\<^sub>1\<rightarrow>T\<^sub>2" using fs by (auto simp: fresh_prod)
   next
     case (2 \<Gamma> p q)
     have h: "\<Gamma> \<turnstile> p \<leftrightarrow> q : T\<^sub>1\<rightarrow>T\<^sub>2" by fact
@@ -693,7 +674,7 @@
   shows "\<Gamma> \<turnstile> t is s : T"
 using a 
 by (nominal_induct arbitrary: \<Gamma> s t rule: ty.strong_induct) 
-   (auto simp add: algorithmic_symmetry)
+   (auto simp: algorithmic_symmetry)
 
 lemma logical_transitivity:
   assumes "\<Gamma> \<turnstile> s is t : T" "\<Gamma> \<turnstile> t is u : T" 
@@ -726,8 +707,13 @@
   and     c: "t' \<leadsto> t"
   shows "\<Gamma> \<turnstile> s' is t' : T"
 using a b c algorithmic_weak_head_closure 
-by (nominal_induct arbitrary: \<Gamma> s t s' t' rule: ty.strong_induct) 
-   (auto, blast)
+proof (nominal_induct arbitrary: \<Gamma> s t s' t' rule: ty.strong_induct)
+next
+  case (Arrow ty1 ty2)
+  then show ?case
+    by (smt (verit, ccfv_threshold) QAR_App log_equiv.simps(3))
+qed auto
+   
 
 lemma logical_weak_head_closure':
   assumes "\<Gamma> \<turnstile> s is t : T" and "s' \<leadsto> s" 
@@ -764,11 +750,8 @@
 
 lemma logical_pseudo_reflexivity:
   assumes "\<Gamma>' \<turnstile> t is s over \<Gamma>"
-  shows "\<Gamma>' \<turnstile> s is s over \<Gamma>" 
-proof -
-  from assms have "\<Gamma>' \<turnstile> s is t over \<Gamma>" using logical_symmetry by blast
-  with assms show "\<Gamma>' \<turnstile> s is s over \<Gamma>" using logical_transitivity by blast
-qed
+  shows "\<Gamma>' \<turnstile> s is s over \<Gamma>"
+  by (meson assms logical_symmetry logical_transitivity) 
 
 lemma logical_subst_monotonicity :
   fixes \<Gamma> \<Gamma>' \<Gamma>'' :: Ctxt
@@ -796,8 +779,8 @@
     moreover
     {
       assume hl:"(y,U) \<in> set \<Gamma>"
-      then have "\<not> y\<sharp>\<Gamma>" by (induct \<Gamma>) (auto simp add: fresh_list_cons fresh_atm fresh_prod)
-      then have hf:"x\<sharp> Var y" using fs by (auto simp add: fresh_atm)
+      then have "\<not> y\<sharp>\<Gamma>" by (induct \<Gamma>) (auto simp: fresh_list_cons fresh_atm fresh_prod)
+      then have hf:"x\<sharp> Var y" using fs by (auto simp: fresh_atm)
       then have "((x,s)#\<theta>)<Var y> = \<theta><Var y>" "((x,t)#\<theta>')<Var y> = \<theta>'<Var y>" 
         using fresh_psubst_simp by blast+ 
       moreover have  "\<Gamma>' \<turnstile> \<theta><Var y> is \<theta>'<Var y> : U" using h1 hl by auto
@@ -847,18 +830,11 @@
 using h1 h2 h3
 proof (nominal_induct \<Gamma> s t T avoiding: \<Gamma>' \<theta> \<theta>' rule: def_equiv.strong_induct)
   case (Q_Refl \<Gamma> t T \<Gamma>' \<theta> \<theta>')
-  have "\<Gamma> \<turnstile> t : T" 
-  and  "valid \<Gamma>'" by fact+
-  moreover 
-  have "\<Gamma>' \<turnstile> \<theta> is \<theta>' over \<Gamma>" by fact
-  ultimately show "\<Gamma>' \<turnstile> \<theta><t> is \<theta>'<t> : T" using fundamental_theorem_1 by blast
+  then show "\<Gamma>' \<turnstile> \<theta><t> is \<theta>'<t> : T" using fundamental_theorem_1
+    by blast
 next
   case (Q_Symm \<Gamma> t s T \<Gamma>' \<theta> \<theta>')
-  have "\<Gamma>' \<turnstile> \<theta> is \<theta>' over \<Gamma>" 
-  and "valid \<Gamma>'" by fact+
-  moreover 
-  have ih: "\<And> \<Gamma>' \<theta> \<theta>'. \<lbrakk>\<Gamma>' \<turnstile> \<theta> is \<theta>' over \<Gamma>; valid \<Gamma>'\<rbrakk> \<Longrightarrow> \<Gamma>' \<turnstile> \<theta><t> is \<theta>'<s> : T" by fact
-  ultimately show "\<Gamma>' \<turnstile> \<theta><s> is \<theta>'<t> : T" using logical_symmetry by blast
+  then show "\<Gamma>' \<turnstile> \<theta><s> is \<theta>'<t> : T" using logical_symmetry by blast
 next
   case (Q_Trans \<Gamma> s t T u \<Gamma>' \<theta> \<theta>')
   have ih1: "\<And> \<Gamma>' \<theta> \<theta>'. \<lbrakk>\<Gamma>' \<turnstile> \<theta> is \<theta>' over \<Gamma>; valid \<Gamma>'\<rbrakk> \<Longrightarrow> \<Gamma>' \<turnstile> \<theta><s> is \<theta>'<t> : T" by fact
@@ -943,13 +919,8 @@
   shows   "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T"
 proof -
   have val: "valid \<Gamma>" using def_equiv_implies_valid asm by simp
-  moreover
-  {
-    fix x T
-    assume "(x,T) \<in> set \<Gamma>" "valid \<Gamma>"
-    then have "\<Gamma> \<turnstile> Var x is Var x : T" using main_lemma(2) by blast
-  }
-  ultimately have "\<Gamma> \<turnstile> [] is [] over \<Gamma>" by auto 
+  then have "\<Gamma> \<turnstile> [] is [] over \<Gamma>"
+    by (simp add: QAP_Var main_lemma(2)) 
   then have "\<Gamma> \<turnstile> []<s> is []<t> : T" using fundamental_theorem_2 val asm by blast
   then have "\<Gamma> \<turnstile> s is t : T" by simp
   then show  "\<Gamma> \<turnstile> s \<Leftrightarrow> t : T" using main_lemma(1) val by simp
--- a/src/HOL/Nominal/Examples/Fsub.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Fsub.thy	Thu May 23 20:22:52 2024 +0200
@@ -145,7 +145,7 @@
 lemma finite_doms:
   shows "finite (ty_dom \<Gamma>)"
   and   "finite (trm_dom \<Gamma>)"
-by (induct \<Gamma>) (auto simp add: finite_vrs)
+by (induct \<Gamma>) (auto simp: finite_vrs)
 
 lemma ty_dom_supp:
   shows "(supp (ty_dom  \<Gamma>)) = (ty_dom  \<Gamma>)"
@@ -167,12 +167,12 @@
   assumes a: "X\<in>(ty_dom \<Gamma>)" 
   shows "\<exists>T.(TVarB X T)\<in>set \<Gamma>"
   using a 
-  apply (induct \<Gamma>, auto)
-  apply (rename_tac a \<Gamma>') 
-  apply (subgoal_tac "\<exists>T.(TVarB X T=a)")
-  apply (auto)
-  apply (auto simp add: ty_binding_existence)
-done
+proof (induction \<Gamma>)
+  case Nil then show ?case by simp
+next
+  case (Cons a \<Gamma>) then show ?case
+    using ty_binding_existence by fastforce
+qed
 
 lemma doms_append:
   shows "ty_dom (\<Gamma>@\<Delta>) = ((ty_dom \<Gamma>) \<union> (ty_dom \<Delta>))"
@@ -183,18 +183,19 @@
   fixes pi::"vrs prm"
   and   S::"ty"
   shows "pi\<bullet>S = S"
-by (induct S rule: ty.induct) (auto simp add: calc_atm)
+by (induct S rule: ty.induct) (auto simp: calc_atm)
 
 lemma fresh_ty_dom_cons:
   fixes X::"tyvrs"
   shows "X\<sharp>(ty_dom (Y#\<Gamma>)) = (X\<sharp>(tyvrs_of Y) \<and> X\<sharp>(ty_dom \<Gamma>))"
-  apply (nominal_induct rule:binding.strong_induct)
-  apply (auto)
-  apply (simp add: fresh_def supp_def eqvts)
-  apply (simp add: fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst] finite_doms)
-  apply (simp add: fresh_def supp_def eqvts)
-  apply (simp add: fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst] finite_doms)+
-  done
+proof (nominal_induct rule:binding.strong_induct)
+  case (VarB vrs ty)
+  then show ?case by auto
+next
+  case (TVarB tyvrs ty)
+  then show ?case
+    by (simp add: at_fin_set_supp at_tyvrs_inst finite_doms(1) fresh_def supp_atm(1))
+qed
 
 lemma tyvrs_fresh:
   fixes   X::"tyvrs"
@@ -202,21 +203,19 @@
   shows   "X \<sharp> tyvrs_of a"
   and     "X \<sharp> vrs_of a"
   using assms
-  apply (nominal_induct a rule:binding.strong_induct)
-  apply (auto)
-  apply (fresh_guess)+
-done
+  by (nominal_induct a rule:binding.strong_induct) (force simp: fresh_singleton)+
 
 lemma fresh_dom:
   fixes X::"tyvrs"
   assumes a: "X\<sharp>\<Gamma>" 
   shows "X\<sharp>(ty_dom \<Gamma>)"
 using a
-apply(induct \<Gamma>)
-apply(simp add: fresh_set_empty) 
-apply(simp only: fresh_ty_dom_cons)
-apply(auto simp add: fresh_prod fresh_list_cons tyvrs_fresh) 
-done
+proof (induct \<Gamma>)
+  case Nil then show ?case by auto
+next
+  case (Cons a \<Gamma>) then show ?case
+    by (meson fresh_list_cons fresh_ty_dom_cons tyvrs_fresh(1))
+qed
 
 text \<open>Not all lists of type \<^typ>\<open>env\<close> are well-formed. One condition
   requires that in \<^term>\<open>TVarB X S#\<Gamma>\<close> all free variables of \<^term>\<open>S\<close> must be 
@@ -240,10 +239,7 @@
 lemma tyvrs_vrs_prm_simp:
   fixes pi::"vrs prm"
   shows "tyvrs_of (pi\<bullet>a) = tyvrs_of a"
-  apply (nominal_induct rule:binding.strong_induct) 
-  apply (simp_all add: eqvts)
-  apply (simp add: dj_perm_forget[OF dj_tyvrs_vrs])
-  done
+  by (nominal_induct rule:binding.strong_induct) (auto simp: vrs_prm_tyvrs_def)
 
 lemma ty_vrs_fresh:
   fixes x::"vrs"
@@ -255,17 +251,13 @@
   fixes pi::"vrs prm"
   and   \<Gamma>::"env"
   shows "(ty_dom (pi\<bullet>\<Gamma>)) = (ty_dom \<Gamma>)"
-  apply(induct \<Gamma>) 
-  apply (simp add: eqvts)
-  apply(simp add:  tyvrs_vrs_prm_simp)
-done
+by (induct \<Gamma>) (auto simp: tyvrs_vrs_prm_simp)
 
 lemma closed_in_eqvt'[eqvt]:
   fixes pi::"vrs prm"
   assumes a: "S closed_in \<Gamma>" 
   shows "(pi\<bullet>S) closed_in (pi\<bullet>\<Gamma>)"
-using a
-by (simp add: closed_in_def ty_dom_vrs_prm_simp  ty_vrs_prm_simp)
+  using assms closed_in_def ty_dom_vrs_prm_simp ty_vrs_prm_simp by force
 
 lemma fresh_vrs_of: 
   fixes x::"vrs"
@@ -277,12 +269,12 @@
   fixes x::"vrs"
   shows "x\<sharp> trm_dom \<Gamma> = x\<sharp>\<Gamma>"
   by (induct \<Gamma>)
-    (simp_all add: fresh_set_empty fresh_list_cons
+    (simp_all add: fresh_list_cons
      fresh_fin_union [OF pt_vrs_inst at_vrs_inst fs_vrs_inst]
-     finite_doms finite_vrs fresh_vrs_of fresh_list_nil)
+     finite_doms finite_vrs fresh_vrs_of)
 
 lemma closed_in_fresh: "(X::tyvrs) \<sharp> ty_dom \<Gamma> \<Longrightarrow> T closed_in \<Gamma> \<Longrightarrow> X \<sharp> T"
-  by (auto simp add: closed_in_def fresh_def ty_dom_supp)
+  by (auto simp: closed_in_def fresh_def ty_dom_supp)
 
 text \<open>Now validity of a context is a straightforward inductive definition.\<close>
   
@@ -313,8 +305,7 @@
 proof (induct \<Delta>)
   case (Cons a \<Gamma>')
   then show ?case 
-    by (nominal_induct a rule:binding.strong_induct)
-       (auto elim: validE)
+    by (nominal_induct a rule:binding.strong_induct) auto
 qed (auto)
 
 lemma replace_type:
@@ -324,12 +315,12 @@
 using a b
 proof(induct \<Delta>)
   case Nil
-  then show ?case by (auto elim: validE intro: valid_cons simp add: doms_append closed_in_def)
+  then show ?case by (auto intro: valid_cons simp add: doms_append closed_in_def)
 next
   case (Cons a \<Gamma>')
   then show ?case 
     by (nominal_induct a rule:binding.strong_induct)
-       (auto elim: validE intro!: valid_cons simp add: doms_append closed_in_def)
+       (auto intro!: valid_cons simp add: doms_append closed_in_def)
 qed
 
 text \<open>Well-formed contexts have a unique type-binding for a type-variable.\<close> 
@@ -353,10 +344,10 @@
         by (simp add:  fresh_ty_dom_cons 
                        fresh_fin_union[OF pt_tyvrs_inst  at_tyvrs_inst fs_tyvrs_inst]  
                        finite_vrs finite_doms, 
-            auto simp add: fresh_atm fresh_singleton)
+            auto simp: fresh_atm fresh_singleton)
     qed (simp)
   }
-  ultimately show "T=S" by (auto simp add: binding.inject)
+  ultimately show "T=S" by (auto simp: binding.inject)
 qed (auto)
 
 lemma uniqueness_of_ctxt':
@@ -377,10 +368,10 @@
       thus "\<not> (\<exists>T.(VarB x' T)\<in>set(y#\<Gamma>'))" 
         by (simp add:  fresh_fin_union[OF pt_vrs_inst  at_vrs_inst fs_vrs_inst]  
                        finite_vrs finite_doms, 
-            auto simp add: fresh_atm fresh_singleton)
+            auto simp: fresh_atm fresh_singleton)
     qed (simp)
   }
-  ultimately show "T=S" by (auto simp add: binding.inject)
+  ultimately show "T=S" by (auto simp: binding.inject)
 qed (auto)
 
 section \<open>Size and Capture-Avoiding Substitution for Types\<close>
@@ -392,11 +383,7 @@
 | "size_ty (Top) = 1"
 | "size_ty (T1 \<rightarrow> T2) = (size_ty T1) + (size_ty T2) + 1"
 | "X \<sharp> T1 \<Longrightarrow> size_ty (\<forall>X<:T1. T2) = (size_ty T1) + (size_ty T2) + 1"
-  apply (finite_guess)+
-  apply (rule TrueI)+
-  apply (simp add: fresh_nat)
-  apply (fresh_guess)+
-  done
+  by (finite_guess | fresh_guess | simp)+
 
 nominal_primrec
   subst_ty :: "ty \<Rightarrow> tyvrs \<Rightarrow> ty \<Rightarrow> ty" ("_[_ \<mapsto> _]\<^sub>\<tau>" [300, 0, 0] 300)
@@ -405,11 +392,7 @@
 | "(Top)[Y \<mapsto> T]\<^sub>\<tau> = Top"
 | "(T\<^sub>1 \<rightarrow> T\<^sub>2)[Y \<mapsto> T]\<^sub>\<tau> = T\<^sub>1[Y \<mapsto> T]\<^sub>\<tau> \<rightarrow> T\<^sub>2[Y \<mapsto> T]\<^sub>\<tau>"
 | "X\<sharp>(Y,T,T\<^sub>1) \<Longrightarrow> (\<forall>X<:T\<^sub>1. T\<^sub>2)[Y \<mapsto> T]\<^sub>\<tau> = (\<forall>X<:T\<^sub>1[Y \<mapsto> T]\<^sub>\<tau>. T\<^sub>2[Y \<mapsto> T]\<^sub>\<tau>)"
-  apply (finite_guess)+
-  apply (rule TrueI)+
-  apply (simp add: abs_fresh)
-  apply (fresh_guess)+
-  done
+  by (finite_guess | fresh_guess | simp add: abs_fresh)+
 
 lemma subst_eqvt[eqvt]:
   fixes pi::"tyvrs prm" 
@@ -429,16 +412,16 @@
   fixes X::"tyvrs"
   assumes "X\<sharp>T" and "X\<sharp>P"
   shows   "X\<sharp>T[Y \<mapsto> P]\<^sub>\<tau>"
-using assms
-by (nominal_induct T avoiding: X Y P rule:ty.strong_induct)
-   (auto simp add: abs_fresh)
+  using assms
+  by (nominal_induct T avoiding: X Y P rule:ty.strong_induct)
+    (auto simp: abs_fresh)
 
 lemma fresh_type_subst_fresh:
-    assumes "X\<sharp>T'"
-    shows "X\<sharp>T[X \<mapsto> T']\<^sub>\<tau>"
-using assms 
-by (nominal_induct T avoiding: X T' rule: ty.strong_induct)
-   (auto simp add: fresh_atm abs_fresh fresh_nat) 
+  assumes "X\<sharp>T'"
+  shows "X\<sharp>T[X \<mapsto> T']\<^sub>\<tau>"
+  using assms 
+  by (nominal_induct T avoiding: X T' rule: ty.strong_induct)
+     (auto simp: fresh_atm abs_fresh) 
 
 lemma type_subst_identity: 
   "X\<sharp>T \<Longrightarrow> T[X \<mapsto> U]\<^sub>\<tau> = T"
@@ -448,7 +431,7 @@
 lemma type_substitution_lemma:  
   "X \<noteq> Y \<Longrightarrow> X\<sharp>L \<Longrightarrow> M[X \<mapsto> N]\<^sub>\<tau>[Y \<mapsto> L]\<^sub>\<tau> = M[Y \<mapsto> L]\<^sub>\<tau>[X \<mapsto> N[Y \<mapsto> L]\<^sub>\<tau>]\<^sub>\<tau>"
   by (nominal_induct M avoiding: X Y N L rule: ty.strong_induct)
-    (auto simp add: type_subst_fresh type_subst_identity)
+    (auto simp: type_subst_fresh type_subst_identity)
 
 lemma type_subst_rename:
   "Y\<sharp>T \<Longrightarrow> ([(Y,X)]\<bullet>T)[Y \<mapsto> U]\<^sub>\<tau> = T[X \<mapsto> U]\<^sub>\<tau>"
@@ -469,7 +452,7 @@
   shows "X\<sharp>a[Y \<mapsto> P]\<^sub>b"
 using assms
 by (nominal_induct a rule: binding.strong_induct)
-   (auto simp add: type_subst_fresh)
+   (auto simp: type_subst_fresh)
 
 lemma binding_subst_identity: 
   shows "X\<sharp>B \<Longrightarrow> B[X \<mapsto> U]\<^sub>b = B"
@@ -487,7 +470,7 @@
   shows   "X\<sharp>\<Gamma>[Y \<mapsto> P]\<^sub>e"
 using assms
 by (induct \<Gamma>)
-   (auto simp add: fresh_list_cons binding_subst_fresh)
+   (auto simp: fresh_list_cons binding_subst_fresh)
 
 lemma ctxt_subst_mem_TVarB: "TVarB X T \<in> set \<Gamma> \<Longrightarrow> TVarB X (T[Y \<mapsto> U]\<^sub>\<tau>) \<in> set (\<Gamma>[Y \<mapsto> U]\<^sub>e)"
   by (induct \<Gamma>) auto
@@ -509,17 +492,13 @@
 | "(t \<cdot>\<^sub>\<tau> T)[y \<mapsto> t'] = t[y \<mapsto> t'] \<cdot>\<^sub>\<tau> T"
 | "X\<sharp>(T,t') \<Longrightarrow> (\<lambda>X<:T. t)[y \<mapsto> t'] = (\<lambda>X<:T. t[y \<mapsto> t'])" 
 | "x\<sharp>(y,t') \<Longrightarrow> (\<lambda>x:T. t)[y \<mapsto> t'] = (\<lambda>x:T. t[y \<mapsto> t'])"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh)+
-apply(fresh_guess add: ty_vrs_fresh abs_fresh)+
-done
+  by (finite_guess | simp add: abs_fresh | fresh_guess add: ty_vrs_fresh abs_fresh)+
 
 lemma subst_trm_fresh_tyvar:
   fixes X::"tyvrs"
   shows "X\<sharp>t \<Longrightarrow> X\<sharp>u \<Longrightarrow> X\<sharp>t[x \<mapsto> u]"
   by (nominal_induct t avoiding: x u rule: trm.strong_induct)
-    (auto simp add: trm.fresh abs_fresh)
+    (auto simp: abs_fresh)
 
 lemma subst_trm_fresh_var: 
   "x\<sharp>u \<Longrightarrow> x\<sharp>t[x \<mapsto> u]"
@@ -553,10 +532,7 @@
 | "(t1 \<cdot>\<^sub>\<tau> T)[Y \<mapsto>\<^sub>\<tau> T2] = t1[Y \<mapsto>\<^sub>\<tau> T2] \<cdot>\<^sub>\<tau> T[Y \<mapsto> T2]\<^sub>\<tau>"
 | "X\<sharp>(Y,T,T2) \<Longrightarrow> (\<lambda>X<:T. t)[Y \<mapsto>\<^sub>\<tau> T2] = (\<lambda>X<:T[Y \<mapsto> T2]\<^sub>\<tau>. t[Y \<mapsto>\<^sub>\<tau> T2])" 
 | "(\<lambda>x:T. t)[Y \<mapsto>\<^sub>\<tau> T2] = (\<lambda>x:T[Y \<mapsto> T2]\<^sub>\<tau>. t[Y \<mapsto>\<^sub>\<tau> T2])"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh ty_vrs_fresh)+
-apply(simp add: type_subst_fresh)
+apply(finite_guess | simp add: abs_fresh ty_vrs_fresh type_subst_fresh)+
 apply(fresh_guess add: ty_vrs_fresh abs_fresh)+
 done
 
@@ -564,7 +540,7 @@
   fixes X::"tyvrs"
   shows "X\<sharp>t \<Longrightarrow> X\<sharp>T \<Longrightarrow> X\<sharp>t[Y \<mapsto>\<^sub>\<tau> T]"
   by (nominal_induct t avoiding: Y T rule: trm.strong_induct)
-    (auto simp add: abs_fresh type_subst_fresh)
+    (auto simp: abs_fresh type_subst_fresh)
 
 lemma subst_trm_ty_fresh':
   "X\<sharp>T \<Longrightarrow> X\<sharp>t[X \<mapsto>\<^sub>\<tau> T]"
@@ -633,7 +609,7 @@
   have "S closed_in \<Gamma> \<and> T closed_in \<Gamma>" by fact
   hence "T closed_in \<Gamma>" by force
   ultimately show "(Tvar X) closed_in \<Gamma> \<and> T closed_in \<Gamma>" by simp
-qed (auto simp add: closed_in_def ty.supp supp_atm abs_supp)
+qed (auto simp: closed_in_def ty.supp supp_atm abs_supp)
 
 lemma subtype_implies_fresh:
   fixes X::"tyvrs"
@@ -647,7 +623,7 @@
   from a1 have "S closed_in \<Gamma> \<and> T closed_in \<Gamma>" by (rule subtype_implies_closed)
   hence "supp S \<subseteq> ((supp (ty_dom \<Gamma>))::tyvrs set)" 
     and "supp T \<subseteq> ((supp (ty_dom \<Gamma>))::tyvrs set)" by (simp_all add: ty_dom_supp closed_in_def)
-  ultimately show "X\<sharp>S \<and> X\<sharp>T" by (force simp add: supp_prod fresh_def)
+  ultimately show "X\<sharp>S \<and> X\<sharp>T" by (force simp: supp_prod fresh_def)
 qed
 
 lemma valid_ty_dom_fresh:
@@ -655,19 +631,26 @@
   assumes valid: "\<turnstile> \<Gamma> ok"
   shows "X\<sharp>(ty_dom \<Gamma>) = X\<sharp>\<Gamma>" 
   using valid
-  apply induct
-  apply (simp add: fresh_list_nil fresh_set_empty)
-  apply (simp_all add: binding.fresh fresh_list_cons
-     fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst] finite_doms fresh_atm)
-  apply (auto simp add: closed_in_fresh)
-  done
+proof induct
+  case valid_nil
+  then show ?case by auto
+next
+  case (valid_consT \<Gamma> X T)
+  then show ?case
+    by (auto simp: fresh_list_cons closed_in_fresh
+     fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst] finite_doms)
+next
+  case (valid_cons \<Gamma> x T)
+  then show ?case
+    using fresh_atm by (auto simp: fresh_list_cons closed_in_fresh)
+qed
 
 equivariance subtype_of
 
 nominal_inductive subtype_of
   apply (simp_all add: abs_fresh)
-  apply (fastforce simp add: valid_ty_dom_fresh dest: subtype_implies_ok)
-  apply (force simp add: closed_in_fresh dest: subtype_implies_closed subtype_implies_ok)+
+  apply (fastforce simp: valid_ty_dom_fresh dest: subtype_implies_ok)
+  apply (force simp: closed_in_fresh dest: subtype_implies_closed subtype_implies_ok)+
   done
 
 section \<open>Reflexivity of Subtyping\<close>
@@ -685,7 +668,7 @@
   hence fresh_ty_dom: "X\<sharp>(ty_dom \<Gamma>)" by (simp add: fresh_dom)
   have "(\<forall>X<:T\<^sub>2. T\<^sub>1) closed_in \<Gamma>" by fact
   hence closed\<^sub>T2: "T\<^sub>2 closed_in \<Gamma>" and closed\<^sub>T1: "T\<^sub>1 closed_in ((TVarB  X T\<^sub>2)#\<Gamma>)" 
-    by (auto simp add: closed_in_def ty.supp abs_supp)
+    by (auto simp: closed_in_def ty.supp abs_supp)
   have ok: "\<turnstile> \<Gamma> ok" by fact  
   hence ok': "\<turnstile> ((TVarB X T\<^sub>2)#\<Gamma>) ok" using closed\<^sub>T2 fresh_ty_dom by simp
   have "\<Gamma> \<turnstile> T\<^sub>2 <: T\<^sub>2" using ih_T\<^sub>2 closed\<^sub>T2 ok by simp
@@ -693,7 +676,7 @@
   have "((TVarB X T\<^sub>2)#\<Gamma>) \<turnstile> T\<^sub>1 <: T\<^sub>1" using ih_T\<^sub>1 closed\<^sub>T1 ok' by simp
   ultimately show "\<Gamma> \<turnstile> (\<forall>X<:T\<^sub>2. T\<^sub>1) <: (\<forall>X<:T\<^sub>2. T\<^sub>1)" using fresh_cond 
     by (simp add: subtype_of.SA_all)
-qed (auto simp add: closed_in_def ty.supp supp_atm)
+qed (auto simp: closed_in_def ty.supp supp_atm)
 
 lemma subtype_reflexivity_semiautomated:
   assumes a: "\<turnstile> \<Gamma> ok"
@@ -701,7 +684,7 @@
   shows "\<Gamma> \<turnstile> T <: T"
 using a b
 apply(nominal_induct T avoiding: \<Gamma> rule: ty.strong_induct)
-apply(auto simp add: ty.supp abs_supp supp_atm closed_in_def)
+apply(auto simp: ty.supp abs_supp supp_atm closed_in_def)
   \<comment> \<open>Too bad that this instantiation cannot be found automatically by
   \isakeyword{auto}; \isakeyword{blast} would find it if we had not used 
   an explicit definition for \<open>closed_in_def\<close>.\<close>
@@ -719,20 +702,15 @@
   "\<Delta> extends \<Gamma> \<equiv> \<forall>X Q. (TVarB X Q)\<in>set \<Gamma> \<longrightarrow> (TVarB X Q)\<in>set \<Delta>"
 
 lemma extends_ty_dom:
-  assumes a: "\<Delta> extends \<Gamma>"
+  assumes "\<Delta> extends \<Gamma>"
   shows "ty_dom \<Gamma> \<subseteq> ty_dom \<Delta>"
-  using a 
-  apply (auto simp add: extends_def)
-  apply (drule ty_dom_existence)
-  apply (force simp add: ty_dom_inclusion)
-  done
+  using assms
+  by (meson extends_def subsetI ty_dom_existence ty_dom_inclusion) 
 
 lemma extends_closed:
-  assumes a1: "T closed_in \<Gamma>"
-  and     a2: "\<Delta> extends \<Gamma>"
+  assumes "T closed_in \<Gamma>" and "\<Delta> extends \<Gamma>"
   shows "T closed_in \<Delta>"
-  using a1 a2
-  by (auto dest: extends_ty_dom simp add: closed_in_def)
+  by (meson assms closed_in_def extends_ty_dom order.trans)
 
 lemma extends_memb:
   assumes a: "\<Delta> extends \<Gamma>"
@@ -787,7 +765,7 @@
   have "T\<^sub>1 closed_in \<Delta>" using ext closed\<^sub>T1 by (simp only: extends_closed)
   hence "\<turnstile> ((TVarB X T\<^sub>1)#\<Delta>) ok" using fresh_dom ok by force   
   moreover 
-  have "((TVarB X T\<^sub>1)#\<Delta>) extends ((TVarB X T\<^sub>1)#\<Gamma>)" using ext by (force simp add: extends_def)
+  have "((TVarB X T\<^sub>1)#\<Delta>) extends ((TVarB X T\<^sub>1)#\<Gamma>)" using ext by (force simp: extends_def)
   ultimately have "((TVarB X T\<^sub>1)#\<Delta>) \<turnstile> S\<^sub>2 <: T\<^sub>2" using ih\<^sub>2 by simp
   moreover
   have "\<Delta> \<turnstile> T\<^sub>1 <: S\<^sub>1" using ok ext ih\<^sub>1 by simp 
@@ -815,7 +793,7 @@
   have "T\<^sub>1 closed_in \<Delta>" using ext closed\<^sub>T1 by (simp only: extends_closed)
   hence "\<turnstile> ((TVarB X T\<^sub>1)#\<Delta>) ok" using fresh_dom ok by force   
   moreover
-  have "((TVarB X T\<^sub>1)#\<Delta>) extends ((TVarB X T\<^sub>1)#\<Gamma>)" using ext by (force simp add: extends_def)
+  have "((TVarB X T\<^sub>1)#\<Delta>) extends ((TVarB X T\<^sub>1)#\<Gamma>)" using ext by (force simp: extends_def)
   ultimately have "((TVarB X T\<^sub>1)#\<Delta>) \<turnstile> S\<^sub>2 <: T\<^sub>2" using ih\<^sub>2 by simp
   moreover
   have "\<Delta> \<turnstile> T\<^sub>1 <: S\<^sub>1" using ok ext ih\<^sub>1 by simp 
@@ -836,9 +814,8 @@
 lemma S_ForallE_left:
   shows "\<lbrakk>\<Gamma> \<turnstile> (\<forall>X<:S\<^sub>1. S\<^sub>2) <: T; X\<sharp>\<Gamma>; X\<sharp>S\<^sub>1; X\<sharp>T\<rbrakk>
          \<Longrightarrow> T = Top \<or> (\<exists>T\<^sub>1 T\<^sub>2. T = (\<forall>X<:T\<^sub>1. T\<^sub>2) \<and> \<Gamma> \<turnstile> T\<^sub>1 <: S\<^sub>1 \<and> ((TVarB X T\<^sub>1)#\<Gamma>) \<turnstile> S\<^sub>2 <: T\<^sub>2)"
-apply(erule subtype_of.strong_cases[where X="X"])
-apply(auto simp add: abs_fresh ty.inject alpha)
-done
+  using subtype_of.strong_cases[where X="X"]
+  by(force simp: abs_fresh ty.inject alpha)
 
 text \<open>Next we prove the transitivity and narrowing for the subtyping-relation. 
 The POPLmark-paper says the following:
@@ -942,7 +919,7 @@
       moreover
       have "S\<^sub>1 closed_in \<Gamma>" and "S\<^sub>2 closed_in ((TVarB X Q\<^sub>1)#\<Gamma>)" 
         using lh_drv_prm\<^sub>1 lh_drv_prm\<^sub>2 by (simp_all add: subtype_implies_closed)
-      then have "(\<forall>X<:S\<^sub>1. S\<^sub>2) closed_in \<Gamma>" by (force simp add: closed_in_def ty.supp abs_supp)
+      then have "(\<forall>X<:S\<^sub>1. S\<^sub>2) closed_in \<Gamma>" by (force simp: closed_in_def ty.supp abs_supp)
       moreover
       have "\<turnstile> \<Gamma> ok" using rh_drv by (rule subtype_implies_ok)
       moreover
@@ -1060,7 +1037,7 @@
     by (rule exists_fresh) (rule fin_supp)
   then have "Y \<sharp> (\<Gamma>, t\<^sub>1, T2)" by simp
   moreover from Y have "(\<forall>X<:T11. T12) = (\<forall>Y<:T11. [(Y, X)] \<bullet> T12)"
-    by (auto simp add: ty.inject alpha' fresh_prod fresh_atm)
+    by (auto simp: ty.inject alpha' fresh_prod fresh_atm)
   with H1 have "\<Gamma> \<turnstile> t\<^sub>1 : (\<forall>Y<:T11. [(Y, X)] \<bullet> T12)" by simp
   ultimately have "\<Gamma> \<turnstile> t\<^sub>1 \<cdot>\<^sub>\<tau> T2 : (([(Y, X)] \<bullet> T12)[Y \<mapsto> T2]\<^sub>\<tau>)" using H2
     by (rule T_TApp)
@@ -1079,7 +1056,7 @@
 lemma ok_imp_VarB_closed_in:
   assumes ok: "\<turnstile> \<Gamma> ok"
   shows "VarB x T \<in> set \<Gamma> \<Longrightarrow> T closed_in \<Gamma>" using ok
-  by induct (auto simp add: binding.inject closed_in_def)
+  by induct (auto simp: binding.inject closed_in_def)
 
 lemma tyvrs_of_subst: "tyvrs_of (B[X \<mapsto> T]\<^sub>b) = tyvrs_of B"
   by (nominal_induct B rule: binding.strong_induct) simp_all
@@ -1095,18 +1072,26 @@
 
 lemma subst_closed_in:
   "T closed_in (\<Delta> @ TVarB X S # \<Gamma>) \<Longrightarrow> U closed_in \<Gamma> \<Longrightarrow> T[X \<mapsto> U]\<^sub>\<tau> closed_in (\<Delta>[X \<mapsto> U]\<^sub>e @ \<Gamma>)"
-  apply (nominal_induct T avoiding: X U \<Gamma> rule: ty.strong_induct)
-  apply (simp add: closed_in_def ty.supp supp_atm doms_append ty_dom_subst)
-  apply blast
-  apply (simp add: closed_in_def ty.supp)
-  apply (simp add: closed_in_def ty.supp)
-  apply (simp add: closed_in_def ty.supp abs_supp)
-  apply (drule_tac x = X in meta_spec)
-  apply (drule_tac x = U in meta_spec)
-  apply (drule_tac x = "(TVarB tyvrs ty2) # \<Gamma>" in meta_spec)
-  apply (simp add: doms_append ty_dom_subst)
-  apply blast
-  done
+proof (nominal_induct T avoiding: X U \<Gamma> rule: ty.strong_induct)
+  case (Tvar tyvrs)
+  then show ?case
+    by (auto simp add: closed_in_def ty.supp supp_atm doms_append ty_dom_subst)
+next
+  case Top
+  then show ?case
+    using closed_in_def fresh_def by fastforce
+next
+  case (Arrow ty1 ty2)
+  then show ?case
+    by (simp add: closed_in_def ty.supp)
+next
+  case (Forall tyvrs ty1 ty2)
+  then have "supp (ty1[X \<mapsto> U]\<^sub>\<tau>) \<subseteq> ty_dom (\<Delta>[X \<mapsto> U]\<^sub>e @ TVarB tyvrs ty2 # \<Gamma>)"
+    apply (simp add: closed_in_def ty.supp abs_supp)
+    by (metis Diff_subset_conv Un_left_commute doms_append(1) le_supI2 ty_dom.simps(2) tyvrs_of.simps(2))
+  with Forall show ?case
+    by (auto simp add: closed_in_def ty.supp abs_supp doms_append)
+qed
 
 lemmas subst_closed_in' = subst_closed_in [where \<Delta>="[]", simplified]
 
@@ -1120,12 +1105,12 @@
   show ?case by (rule ok_imp_VarB_closed_in)
 next
   case (T_App \<Gamma> t\<^sub>1 T\<^sub>1 T\<^sub>2 t\<^sub>2)
-  then show ?case by (auto simp add: ty.supp closed_in_def)
+  then show ?case by (auto simp: ty.supp closed_in_def)
 next
   case (T_Abs x T\<^sub>1 \<Gamma> t\<^sub>2 T\<^sub>2)
   from \<open>VarB x T\<^sub>1 # \<Gamma> \<turnstile> t\<^sub>2 : T\<^sub>2\<close>
   have "T\<^sub>1 closed_in \<Gamma>" by (auto dest: typing_ok)
-  with T_Abs show ?case by (auto simp add: ty.supp closed_in_def)
+  with T_Abs show ?case by (auto simp: ty.supp closed_in_def)
 next
   case (T_Sub \<Gamma> t S T)
   from \<open>\<Gamma> \<turnstile> S <: T\<close> show ?case by (simp add: subtype_implies_closed)
@@ -1133,11 +1118,11 @@
   case (T_TAbs X T\<^sub>1 \<Gamma> t\<^sub>2 T\<^sub>2)
   from \<open>TVarB X T\<^sub>1 # \<Gamma> \<turnstile> t\<^sub>2 : T\<^sub>2\<close>
   have "T\<^sub>1 closed_in \<Gamma>" by (auto dest: typing_ok)
-  with T_TAbs show ?case by (auto simp add: ty.supp closed_in_def abs_supp)
+  with T_TAbs show ?case by (auto simp: ty.supp closed_in_def abs_supp)
 next
   case (T_TApp X \<Gamma> t\<^sub>1 T2 T11 T12)
   then have "T12 closed_in (TVarB X T11 # \<Gamma>)"
-    by (auto simp add: closed_in_def ty.supp abs_supp)
+    by (auto simp: closed_in_def ty.supp abs_supp)
   moreover from T_TApp have "T2 closed_in \<Gamma>"
     by (simp add: subtype_implies_closed)
   ultimately show ?case by (rule subst_closed_in')
@@ -1177,7 +1162,7 @@
   then have "(\<lambda>y:T11. [(y, x)] \<bullet> t12) \<cdot> v2 \<longmapsto> ([(y, x)] \<bullet> t12)[y \<mapsto> v2]" using H
     by (rule E_Abs)
   moreover from y have "(\<lambda>x:T11. t12) \<cdot> v2 = (\<lambda>y:T11. [(y, x)] \<bullet> t12) \<cdot> v2"
-    by (auto simp add: trm.inject alpha' fresh_prod fresh_atm)
+    by (auto simp: trm.inject alpha' fresh_prod fresh_atm)
   ultimately have "(\<lambda>x:T11. t12) \<cdot> v2 \<longmapsto> ([(y, x)] \<bullet> t12)[y \<mapsto> v2]"
     by simp
   with y show ?thesis by (simp add: subst_trm_rename)
@@ -1190,7 +1175,7 @@
   then have "(\<lambda>Y<:T11. [(Y, X)] \<bullet> t12) \<cdot>\<^sub>\<tau> T2 \<longmapsto> ([(Y, X)] \<bullet> t12)[Y \<mapsto>\<^sub>\<tau> T2]"
     by (rule E_TAbs)
   moreover from Y have "(\<lambda>X<:T11. t12) \<cdot>\<^sub>\<tau> T2 = (\<lambda>Y<:T11. [(Y, X)] \<bullet> t12) \<cdot>\<^sub>\<tau> T2"
-    by (auto simp add: trm.inject alpha' fresh_prod fresh_atm)
+    by (auto simp: trm.inject alpha' fresh_prod fresh_atm)
   ultimately have "(\<lambda>X<:T11. t12) \<cdot>\<^sub>\<tau> T2 \<longmapsto> ([(Y, X)] \<bullet> t12)[Y \<mapsto>\<^sub>\<tau> T2]"
     by simp
   with Y show ?thesis by (simp add: subst_trm_ty_rename)
@@ -1217,42 +1202,33 @@
 using assms ty_dom_cons closed_in_def by auto
 
 lemma closed_in_weaken: "T closed_in (\<Delta> @ \<Gamma>) \<Longrightarrow> T closed_in (\<Delta> @ B # \<Gamma>)"
-  by (auto simp add: closed_in_def doms_append)
+  by (auto simp: closed_in_def doms_append)
 
 lemma closed_in_weaken': "T closed_in \<Gamma> \<Longrightarrow> T closed_in (\<Delta> @ \<Gamma>)"
-  by (auto simp add: closed_in_def doms_append)
+  by (auto simp: closed_in_def doms_append)
 
 lemma valid_subst:
   assumes ok: "\<turnstile> (\<Delta> @ TVarB X Q # \<Gamma>) ok"
   and closed: "P closed_in \<Gamma>"
   shows "\<turnstile> (\<Delta>[X \<mapsto> P]\<^sub>e @ \<Gamma>) ok" using ok closed
-  apply (induct \<Delta>)
-  apply simp_all
-  apply (erule validE)
-  apply assumption
-  apply (erule validE)
-  apply simp
-  apply (rule valid_consT)
-  apply assumption
-  apply (simp add: doms_append ty_dom_subst)
-  apply (simp add: fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst] finite_doms)
-  apply (rule_tac S=Q in subst_closed_in')
-  apply (simp add: closed_in_def doms_append ty_dom_subst)
-  apply (simp add: closed_in_def doms_append)
-  apply blast
-  apply simp
-  apply (rule valid_cons)
-  apply assumption
-  apply (simp add: doms_append trm_dom_subst)
-  apply (rule_tac S=Q in subst_closed_in')
-  apply (simp add: closed_in_def doms_append ty_dom_subst)
-  apply (simp add: closed_in_def doms_append)
-  apply blast
-  done
+proof (induct \<Delta>)
+  case Nil
+  then show ?case
+    by auto
+next
+  case (Cons a \<Delta>)
+  then have *: "\<turnstile> (a # \<Delta> @ TVarB X Q # \<Gamma>) ok"
+    by fastforce
+  then show ?case
+    apply (rule validE)
+    using Cons
+     apply (simp add: at_tyvrs_inst closed doms_append(1) finite_doms(1) fresh_fin_insert fs_tyvrs_inst pt_tyvrs_inst subst_closed_in ty_dom_subst)
+    by (simp add: doms_append(2) subst_closed_in Cons.hyps closed trm_dom_subst)
+qed
 
 lemma ty_dom_vrs:
   shows "ty_dom (G @ [VarB x Q] @ D) = ty_dom (G @ D)"
-by (induct G) (auto)
+  by (induct G) (auto)
 
 lemma valid_cons':
   assumes "\<turnstile> (\<Gamma> @ VarB x Q # \<Delta>) ok"
@@ -1321,15 +1297,7 @@
   then have closed: "T\<^sub>1 closed_in (\<Delta> @ \<Gamma>)"
     by (auto dest: typing_ok)
   have "\<turnstile> (VarB y T\<^sub>1 # \<Delta> @ B # \<Gamma>) ok"
-    apply (rule valid_cons)
-    apply (rule T_Abs)
-    apply (simp add: doms_append
-      fresh_fin_insert [OF pt_vrs_inst at_vrs_inst fs_vrs_inst]
-      fresh_fin_union [OF pt_vrs_inst at_vrs_inst fs_vrs_inst]
-      finite_doms finite_vrs fresh_vrs_of T_Abs fresh_trm_dom)
-    apply (rule closed_in_weaken)
-    apply (rule closed)
-    done
+    by (simp add: T_Abs closed closed_in_weaken fresh_list_append fresh_list_cons fresh_trm_dom)
   then have "\<turnstile> ((VarB y T\<^sub>1 # \<Delta>) @ B # \<Gamma>) ok" by simp
   with _ have "(VarB y T\<^sub>1 # \<Delta>) @ B # \<Gamma> \<turnstile> t\<^sub>2 : T\<^sub>2"
     by (rule T_Abs) simp
@@ -1349,15 +1317,8 @@
   have closed: "T\<^sub>1 closed_in (\<Delta> @ \<Gamma>)"
     by (auto dest: typing_ok)
   have "\<turnstile> (TVarB X T\<^sub>1 # \<Delta> @ B # \<Gamma>) ok"
-    apply (rule valid_consT)
-    apply (rule T_TAbs)
-    apply (simp add: doms_append
-      fresh_fin_insert [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst]
-      fresh_fin_union [OF pt_tyvrs_inst at_tyvrs_inst fs_tyvrs_inst]
-      finite_doms finite_vrs tyvrs_fresh T_TAbs fresh_dom)
-    apply (rule closed_in_weaken)
-    apply (rule closed)
-    done
+    by (simp add: T_TAbs at_tyvrs_inst closed closed_in_weaken doms_append finite_doms finite_vrs
+        fresh_dom fresh_fin_union fs_tyvrs_inst pt_tyvrs_inst tyvrs_fresh)
   then have "\<turnstile> ((TVarB X T\<^sub>1 # \<Delta>) @ B # \<Gamma>) ok" by simp
   with _ have "(TVarB X T\<^sub>1 # \<Delta>) @ B # \<Gamma> \<turnstile> t\<^sub>2 : T\<^sub>2"
     by (rule T_TAbs) simp
@@ -1375,12 +1336,14 @@
 
 lemma type_weaken':
  "\<Gamma> \<turnstile> t : T \<Longrightarrow>  \<turnstile> (\<Delta>@\<Gamma>) ok \<Longrightarrow> (\<Delta>@\<Gamma>) \<turnstile> t : T"
-  apply (induct \<Delta>)
-  apply simp_all
-  apply (erule validE)
-  apply (insert type_weaken [of "[]", simplified])
-  apply simp_all
-  done
+proof (induct \<Delta>)
+  case Nil
+  then show ?case by auto
+next
+  case (Cons a \<Delta>)
+  then show ?case
+    by (metis append_Cons append_Nil type_weaken validE(3))
+qed
 
 text \<open>A.6\<close>
 
@@ -1458,7 +1421,7 @@
    next
      assume "x\<noteq>y"
      then show ?case using T_Var
-       by (auto simp add:binding.inject dest: valid_cons')
+       by (auto simp:binding.inject dest: valid_cons')
    qed
  next
    case (T_App t1 T1 T2 t2 x u D)
@@ -1474,13 +1437,13 @@
  next
    case (T_TAbs X T1 t2 T2 x u D)
    from \<open>TVarB X T1 # D @ VarB x U # \<Gamma> \<turnstile> t2 : T2\<close> have "X \<sharp> T1"
-     by (auto simp add: valid_ty_dom_fresh dest: typing_ok intro!: closed_in_fresh)
+     by (auto simp: valid_ty_dom_fresh dest: typing_ok intro!: closed_in_fresh)
    with \<open>X \<sharp> u\<close> and T_TAbs show ?case by fastforce
  next
    case (T_TApp X t1 T2 T11 T12 x u D)
    then have "(D@\<Gamma>) \<turnstile>T2<:T11" using T_TApp by (auto dest: strengthening)
    then show "((D @ \<Gamma>) \<turnstile> ((t1 \<cdot>\<^sub>\<tau> T2)[x \<mapsto> u]) : (T12[X \<mapsto> T2]\<^sub>\<tau>))" using T_TApp
-     by (force simp add: fresh_prod fresh_list_append fresh_list_cons subst_trm_fresh_tyvar)
+     by (force simp: fresh_prod fresh_list_append fresh_list_cons subst_trm_fresh_tyvar)
 qed
 
 subsubsection \<open>Type Substitution Preserves Subtyping\<close>
@@ -1538,7 +1501,7 @@
       from X_\<Gamma>_ok have "X \<sharp> ty_dom \<Gamma>" and "\<turnstile> \<Gamma> ok" by auto
       then have "X \<sharp> \<Gamma>" by (simp add: valid_ty_dom_fresh)
       with Y have "X \<sharp> S"
-        by (induct \<Gamma>) (auto simp add: fresh_list_nil fresh_list_cons)
+        by (induct \<Gamma>) (auto simp: fresh_list_nil fresh_list_cons)
       with ST have "(D[X \<mapsto> P]\<^sub>e @ \<Gamma>)\<turnstile>S<:T[X \<mapsto> P]\<^sub>\<tau>"
         by (simp add: type_subst_identity)
       moreover from Y have "TVarB Y S \<in> set (D[X \<mapsto> P]\<^sub>e @ \<Gamma>)" by simp
@@ -1642,7 +1605,7 @@
   from T_TApp have "D'[X \<mapsto> P]\<^sub>e @ G \<turnstile> t1[X \<mapsto>\<^sub>\<tau> P] : (\<forall>X'<:T11. T12)[X \<mapsto> P]\<^sub>\<tau>"
     by simp
   with X' and T_TApp show ?case
-    by (auto simp add: fresh_atm type_substitution_lemma
+    by (auto simp: fresh_atm type_substitution_lemma
       fresh_list_append fresh_list_cons
       ctxt_subst_fresh' type_subst_fresh subst_trm_ty_fresh
       intro: substT_subtype)
@@ -1822,7 +1785,7 @@
   case (T_Sub t S)
   from \<open>[] \<turnstile> S <: T\<^sub>1 \<rightarrow> T\<^sub>2\<close>
   obtain S\<^sub>1 S\<^sub>2 where S: "S = S\<^sub>1 \<rightarrow> S\<^sub>2" 
-    by cases (auto simp add: T_Sub)
+    by cases (auto simp: T_Sub)
   then show ?case using \<open>val t\<close> by (rule T_Sub)
 qed (auto)
 
@@ -1834,7 +1797,7 @@
   case (T_Sub t S)
   from \<open>[] \<turnstile> S <: (\<forall>X<:T\<^sub>1. T\<^sub>2)\<close>
   obtain X S\<^sub>1 S\<^sub>2 where S: "S = (\<forall>X<:S\<^sub>1. S\<^sub>2)"
-    by cases (auto simp add: T_Sub)
+    by cases (auto simp: T_Sub)
   then show ?case using T_Sub by auto 
 qed (auto)
 
--- a/src/HOL/Nominal/Examples/Lam_Funs.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Lam_Funs.thy	Thu May 23 20:22:52 2024 +0200
@@ -22,11 +22,7 @@
   "depth (Var x) = 1"
 | "depth (App t1 t2) = (max (depth t1) (depth t2)) + 1"
 | "depth (Lam [a].t) = (depth t) + 1"
-  apply(finite_guess)+
-  apply(rule TrueI)+
-  apply(simp add: fresh_nat)
-  apply(fresh_guess)+
-  done
+  by(finite_guess | simp | fresh_guess)+
 
 text \<open>
   The free variables of a lambda-term. A complication in this
@@ -41,12 +37,8 @@
   "frees (Var a) = {a}"
 | "frees (App t1 t2) = (frees t1) \<union> (frees t2)"
 | "frees (Lam [a].t) = (frees t) - {a}"
-apply(finite_guess)+
-apply(simp)+ 
-apply(simp add: fresh_def)
-apply(simp add: supp_of_fin_sets[OF pt_name_inst, OF at_name_inst, OF fs_at_inst[OF at_name_inst]])
-apply(simp add: supp_atm)
-apply(blast)
+apply(finite_guess | simp add: fresh_def | fresh_guess)+
+  apply (simp add: at_fin_set_supp at_name_inst)
 apply(fresh_guess)+
 done
 
@@ -81,11 +73,7 @@
   "\<theta><(Var x)> = (lookup \<theta> x)"
 | "\<theta><(App e\<^sub>1 e\<^sub>2)> = App (\<theta><e\<^sub>1>) (\<theta><e\<^sub>2>)"
 | "x\<sharp>\<theta> \<Longrightarrow> \<theta><(Lam [x].e)> = Lam [x].(\<theta><e>)"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh)+
-apply(fresh_guess)+
-done
+  by (finite_guess | simp add: abs_fresh | fresh_guess)+
 
 lemma psubst_eqvt[eqvt]:
   fixes pi::"name prm" 
@@ -107,10 +95,19 @@
 
 lemma subst_supp: 
   shows "supp(t1[a::=t2]) \<subseteq> (((supp(t1)-{a})\<union>supp(t2))::name set)"
-apply(nominal_induct t1 avoiding: a t2 rule: lam.strong_induct)
-apply(auto simp add: lam.supp supp_atm fresh_prod abs_supp)
-apply(blast)+
-done
+proof (nominal_induct t1 avoiding: a t2 rule: lam.strong_induct)
+  case (Var name)
+  then show ?case
+    by (simp add: lam.supp(1) supp_atm)
+next
+  case (App lam1 lam2)
+  then show ?case
+    using lam.supp(2) by fastforce
+next
+  case (Lam name lam)
+  then show ?case
+    using frees.simps(3) frees_equals_support by auto
+qed
 
 text \<open>
   Contexts - lambda-terms with a single hole.
--- a/src/HOL/Nominal/Examples/Pattern.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Pattern.thy	Thu May 23 20:22:52 2024 +0200
@@ -62,21 +62,23 @@
   by (simp add: supp_def Collect_disj_eq del: disj_not1)
 
 instance pat :: pt_name
-proof (standard, goal_cases)
-  case (1 x)
-  show ?case by (induct x) simp_all
-next
-  case (2 _ _ x)
-  show ?case by (induct x) (simp_all add: pt_name2)
-next
-  case (3 _ _ x)
-  then show ?case by (induct x) (simp_all add: pt_name3)
+proof
+  fix x :: pat
+  show "([]::(name \<times> _) list) \<bullet> x = x"
+    by (induct x) simp_all
+  fix pi1 pi2 :: "(name \<times> name) list"
+  show "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x"
+    by (induct x) (simp_all add: pt_name2)
+  assume "pi1 \<triangleq> pi2"
+  then show "pi1 \<bullet> x = pi2 \<bullet> x"
+    by (induct x) (simp_all add: pt_name3)
 qed
 
 instance pat :: fs_name
-proof (standard, goal_cases)
-  case (1 x)
-  show ?case by (induct x) (simp_all add: fin_supp)
+proof
+  fix x :: pat
+  show "finite (supp x::name set)"
+    by (induct x) (simp_all add: fin_supp)
 qed
 
 (* the following function cannot be defined using nominal_primrec, *)
@@ -255,21 +257,15 @@
 lemma weakening: 
   assumes "\<Gamma>\<^sub>1 \<turnstile> t : T" and "valid \<Gamma>\<^sub>2" and "\<Gamma>\<^sub>1 \<sqsubseteq> \<Gamma>\<^sub>2"
   shows "\<Gamma>\<^sub>2 \<turnstile> t : T" using assms
-  apply (nominal_induct \<Gamma>\<^sub>1 t T avoiding: \<Gamma>\<^sub>2 rule: typing.strong_induct)
-  apply auto
-  apply (drule_tac x="(x, T) # \<Gamma>\<^sub>2" in meta_spec)
-  apply (auto intro: valid_typing)
-  apply (drule_tac x="\<Gamma>\<^sub>2" in meta_spec)
-  apply (drule_tac x="\<Delta> @ \<Gamma>\<^sub>2" in meta_spec)
-  apply (auto intro: valid_typing)
-  apply (rule typing.Let)
-  apply assumption+
-  apply (drule meta_mp)
-  apply (rule valid_app_mono)
-  apply (rule valid_typing)
-  apply assumption
-  apply (auto simp add: pat_freshs)
-  done
+proof (nominal_induct \<Gamma>\<^sub>1 t T avoiding: \<Gamma>\<^sub>2 rule: typing.strong_induct)
+  case (Abs x T \<Gamma> t U)
+  then show ?case
+    by (simp add: typing.Abs valid.Cons)
+next
+  case (Let p t \<Gamma> T \<Delta> u U)
+  then show ?case
+    by (smt (verit, ccfv_threshold) Un_iff pat_freshs set_append typing.simps valid_app_mono valid_typing) 
+qed auto
 
 inductive
   match :: "pat \<Rightarrow> trm \<Rightarrow> (name \<times> trm) list \<Rightarrow> bool"  ("\<turnstile> _ \<rhd> _ \<Rightarrow> _" [50, 50, 50] 50)
@@ -301,27 +297,20 @@
 | "x \<sharp> \<theta> \<Longrightarrow> \<theta>\<lparr>\<lambda>x:T. t\<rparr> = (\<lambda>x:T. \<theta>\<lparr>t\<rparr>)"
 | "\<theta>\<lparr>Base t\<rparr>\<^sub>b = Base (\<theta>\<lparr>t\<rparr>)"
 | "x \<sharp> \<theta> \<Longrightarrow> \<theta>\<lparr>Bind T x t\<rparr>\<^sub>b = Bind T x (\<theta>\<lparr>t\<rparr>\<^sub>b)"
-  apply finite_guess+
-  apply (simp add: abs_fresh | fresh_guess)+
-  done
+  by (finite_guess | simp add: abs_fresh | fresh_guess)+
 
 lemma lookup_fresh:
   "x = y \<longrightarrow> x \<in> set (map fst \<theta>) \<Longrightarrow> \<forall>(y, t)\<in>set \<theta>. x \<sharp> t \<Longrightarrow> x \<sharp> lookup \<theta> y"
-  apply (induct \<theta>)
-  apply (simp_all add: split_paired_all fresh_atm)
-  apply (case_tac "x = y")
-  apply (auto simp add: fresh_atm)
-  done
+  by (induct \<theta>) (use fresh_atm in force)+
 
 lemma psubst_fresh:
   assumes "x \<in> set (map fst \<theta>)" and "\<forall>(y, t)\<in>set \<theta>. x \<sharp> t"
   shows "x \<sharp> \<theta>\<lparr>t\<rparr>" and "x \<sharp> \<theta>\<lparr>t'\<rparr>\<^sub>b" using assms
-  apply (nominal_induct t and t' avoiding: \<theta> rule: trm_btrm.strong_inducts)
-  apply simp
-  apply (rule lookup_fresh)
-  apply (rule impI)
-  apply (simp_all add: abs_fresh)
-  done
+proof (nominal_induct t and t' avoiding: \<theta> rule: trm_btrm.strong_inducts)
+  case (Var name)
+  then show ?case
+    by (metis lookup_fresh simps(1))
+qed (auto simp: abs_fresh)
 
 lemma psubst_eqvt[eqvt]:
   fixes pi :: "name prm" 
@@ -350,25 +339,23 @@
 lemma psubst_forget:
   "(supp (map fst \<theta>)::name set) \<sharp>* t \<Longrightarrow> \<theta>\<lparr>t\<rparr> = t"
   "(supp (map fst \<theta>)::name set) \<sharp>* t' \<Longrightarrow> \<theta>\<lparr>t'\<rparr>\<^sub>b = t'"
-  apply (nominal_induct t and t' avoiding: \<theta> rule: trm_btrm.strong_inducts)
-  apply (auto simp add: fresh_star_def lookup_forget abs_fresh)
-  apply (drule_tac x=\<theta> in meta_spec)
-  apply (drule meta_mp)
-  apply (rule ballI)
-  apply (drule_tac x=x in bspec)
-  apply assumption
-  apply (drule supp_fst)
-  apply (auto simp add: fresh_def)
-  apply (drule_tac x=\<theta> in meta_spec)
-  apply (drule meta_mp)
-  apply (rule ballI)
-  apply (drule_tac x=x in bspec)
-  apply assumption
-  apply (drule supp_fst)
-  apply (auto simp add: fresh_def)
-  done
+proof (nominal_induct t and t' avoiding: \<theta> rule: trm_btrm.strong_inducts)
+  case (Var name)
+  then show ?case
+    by (simp add: fresh_star_set lookup_forget)
+next
+  case (Abs ty name trm)
+  then show ?case
+    apply (simp add: fresh_def)
+    by (metis abs_fresh(1) fresh_star_set supp_fst trm.fresh(3))
+next
+  case (Bind ty name btrm)
+  then show ?case
+    apply (simp add: fresh_def)
+    by (metis abs_fresh(1) btrm.fresh(2) fresh_star_set supp_fst)
+qed (auto simp: fresh_star_set)
 
-lemma psubst_nil: "[]\<lparr>t\<rparr> = t" "[]\<lparr>t'\<rparr>\<^sub>b = t'"
+lemma psubst_nil[simp]: "[]\<lparr>t\<rparr> = t" "[]\<lparr>t'\<rparr>\<^sub>b = t'"
   by (induct t and t' rule: trm_btrm.inducts) (simp_all add: fresh_list_nil)
 
 lemma psubst_cons:
@@ -380,9 +367,20 @@
 
 lemma psubst_append:
   "(supp (map fst (\<theta>\<^sub>1 @ \<theta>\<^sub>2))::name set) \<sharp>* map snd (\<theta>\<^sub>1 @ \<theta>\<^sub>2) \<Longrightarrow> (\<theta>\<^sub>1 @ \<theta>\<^sub>2)\<lparr>t\<rparr> = \<theta>\<^sub>2\<lparr>\<theta>\<^sub>1\<lparr>t\<rparr>\<rparr>"
-  by (induct \<theta>\<^sub>1 arbitrary: t)
-    (simp_all add: psubst_nil split_paired_all supp_list_cons psubst_cons fresh_star_def
-      fresh_list_cons fresh_list_append supp_list_append)
+proof (induct \<theta>\<^sub>1 arbitrary: t)
+  case Nil
+  then show ?case
+    by (auto simp: psubst_nil)
+next
+  case (Cons a \<theta>\<^sub>1)
+  then show ?case
+  proof (cases a)
+    case (Pair a b)
+    with Cons show ?thesis
+      apply (simp add: supp_list_cons fresh_star_set fresh_list_cons)
+      by (metis Un_iff fresh_star_set map_append psubst_cons(1) supp_list_append)
+  qed
+qed
 
 lemma abs_pat_psubst [simp]:
   "(supp p::name set) \<sharp>* \<theta> \<Longrightarrow> \<theta>\<lparr>\<lambda>[p]. t\<rparr>\<^sub>b = (\<lambda>[p]. \<theta>\<lparr>t\<rparr>\<^sub>b)"
@@ -557,17 +555,15 @@
   Abs: "{x}"
 | Beta: "{x}"
 | Let: "(supp p)::name set"
-  apply (simp_all add: fresh_star_def abs_fresh fin_supp)
-  apply (rule psubst_fresh)
-  apply simp
-  apply simp
-  apply (rule ballI)
-  apply (rule psubst_fresh)
-  apply (rule match_vars)
-  apply assumption+
-  apply (rule match_fresh_mono)
-  apply auto
-  done
+proof (simp_all add: fresh_star_def abs_fresh fin_supp)
+  show "x \<sharp> t[x\<mapsto>u]" if "x \<sharp> u" for x t u
+    by (simp add: \<open>x \<sharp> u\<close> psubst_fresh(1))
+next
+  show "\<forall>x\<in>supp p. (x::name) \<sharp> \<theta>\<lparr>u\<rparr>" 
+    if "\<forall>x\<in>supp p. (x::name) \<sharp> t" and "\<turnstile> p \<rhd> t \<Rightarrow> \<theta>"
+    for p t \<theta> u
+    by (meson that match_fresh_mono match_vars psubst_fresh(1))
+qed
 
 lemma typing_case_Abs:
   assumes ty: "\<Gamma> \<turnstile> (\<lambda>x:T. t) : S"
@@ -636,13 +632,16 @@
 proof
   fix x assume "x \<in> pi \<bullet> B"
   then show "x \<in> A \<union> B" using pi
-    apply (induct pi arbitrary: x B rule: rev_induct)
-    apply simp
-    apply (simp add: split_paired_all supp_eqvt)
-    apply (drule perm_mem_left)
-    apply (simp add: calc_atm split: if_split_asm)
-    apply (auto dest: perm_mem_right)
-    done
+  proof (induct pi arbitrary: x B rule: rev_induct)
+    case Nil
+    then show ?case
+      by simp
+  next
+    case (snoc y xs)
+    then show ?case
+      apply simp
+      by (metis SigmaE perm_mem_left perm_pi_simp(2) pt_name2 swap_simps(3))
+  qed
 qed
 
 lemma abs_pat_alpha':
--- a/src/HOL/Nominal/Examples/SN.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/SN.thy	Thu May 23 20:22:52 2024 +0200
@@ -88,9 +88,8 @@
   assumes a: "t\<longrightarrow>\<^sub>\<beta> s"
   shows "a\<sharp>t \<Longrightarrow> a\<sharp>s"
 using a
-apply(nominal_induct t s avoiding: a rule: Beta.strong_induct)
-apply(auto simp add: abs_fresh fresh_fact fresh_atm)
-done
+  by (nominal_induct t s avoiding: a rule: Beta.strong_induct)
+     (auto simp add: abs_fresh fresh_fact fresh_atm)
 
 lemma beta_abs: 
   assumes a: "Lam [a].t\<longrightarrow>\<^sub>\<beta> t'" 
@@ -200,13 +199,8 @@
     thus ?case
     proof (induct b rule: SN.SN.induct)
       case (SN_intro y)
-      show ?case
-        apply (rule hyp)
-        apply (erule SNI')
-        apply (erule SNI')
-        apply (rule SN.SN_intro)
-        apply (erule SN_intro)+
-        done
+      with SNI' show ?case
+        by (metis SN.simps hyp)
     qed
   qed
   from b show ?thesis by (rule r)
@@ -218,10 +212,7 @@
   and     c: "\<And>x z. \<lbrakk>\<And>y. x \<longrightarrow>\<^sub>\<beta> y \<Longrightarrow> P y z; \<And>u. z \<longrightarrow>\<^sub>\<beta> u \<Longrightarrow> P x u\<rbrakk> \<Longrightarrow> P x z"
   shows "P a b"
 using a b c
-apply(rule_tac double_SN_aux)
-apply(assumption)+
-apply(blast)
-done
+  by (smt (verit, best) double_SN_aux)
 
 section \<open>Candidates\<close>
 
@@ -249,11 +240,7 @@
   "fst_app_aux (Var a)     = None"
 | "fst_app_aux (App t1 t2) = Some t1"
 | "fst_app_aux (Lam [x].t) = None"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: fresh_none)
-apply(fresh_guess)+
-done
+by (finite_guess | simp add: fresh_none | fresh_guess)+
 
 definition
   fst_app_def[simp]: "fst_app t = the (fst_app_aux t)"
@@ -425,66 +412,40 @@
       fix t u
       assume ih1: "\<And>t'.  \<lbrakk>t \<longrightarrow>\<^sub>\<beta> t'; u\<in>RED \<tau>; \<forall>s\<in>RED \<tau>. t'[x::=s]\<in>RED \<sigma>\<rbrakk> \<Longrightarrow> App (Lam [x].t') u \<in> RED \<sigma>" 
       assume ih2: "\<And>u'.  \<lbrakk>u \<longrightarrow>\<^sub>\<beta> u'; u'\<in>RED \<tau>; \<forall>s\<in>RED \<tau>. t[x::=s]\<in>RED \<sigma>\<rbrakk> \<Longrightarrow> App (Lam [x].t) u' \<in> RED \<sigma>"
-      assume as1: "u \<in> RED \<tau>"
-      assume as2: "\<forall>s\<in>RED \<tau>. t[x::=s]\<in>RED \<sigma>"
+      assume u: "u \<in> RED \<tau>"
+      assume t: "\<forall>s\<in>RED \<tau>. t[x::=s]\<in>RED \<sigma>"
       have "CR3_RED (App (Lam [x].t) u) \<sigma>" unfolding CR3_RED_def
       proof(intro strip)
         fix r
         assume red: "App (Lam [x].t) u \<longrightarrow>\<^sub>\<beta> r"
         moreover
         { assume "\<exists>t'. t \<longrightarrow>\<^sub>\<beta> t' \<and> r = App (Lam [x].t') u"
-          then obtain t' where a1: "t \<longrightarrow>\<^sub>\<beta> t'" and a2: "r = App (Lam [x].t') u" by blast
-          have "App (Lam [x].t') u\<in>RED \<sigma>" using ih1 a1 as1 as2
-            apply(auto)
-            apply(drule_tac x="t'" in meta_spec)
-            apply(simp)
-            apply(drule meta_mp)
-            prefer 2
-            apply(auto)[1]
-            apply(rule ballI)
-            apply(drule_tac x="s" in bspec)
-            apply(simp)
-            apply(subgoal_tac "CR2 \<sigma>")(*A*)
-            apply(unfold CR2_def)[1]
-            apply(drule_tac x="t[x::=s]" in spec)
-            apply(drule_tac x="t'[x::=s]" in spec)
-            apply(simp add: beta_subst)
-            (*A*)
-            apply(simp add: RED_props)
-            done
-          then have "r\<in>RED \<sigma>" using a2 by simp
+          then obtain t' where "t \<longrightarrow>\<^sub>\<beta> t'" and t': "r = App (Lam [x].t') u" 
+            by blast
+          then have "\<forall>s\<in>RED \<tau>. t'[x::=s] \<in> RED \<sigma>"
+            using CR2_def RED_props(2) t beta_subst by blast
+          then have "App (Lam [x].t') u\<in>RED \<sigma>"
+            using \<open>t \<longrightarrow>\<^sub>\<beta> t'\<close> u ih1 by blast 
+          then have "r\<in>RED \<sigma>" using t' by simp
         }
         moreover
         { assume "\<exists>u'. u \<longrightarrow>\<^sub>\<beta> u' \<and> r = App (Lam [x].t) u'"
-          then obtain u' where b1: "u \<longrightarrow>\<^sub>\<beta> u'" and b2: "r = App (Lam [x].t) u'" by blast
-          have "App (Lam [x].t) u'\<in>RED \<sigma>" using ih2 b1 as1 as2
-            apply(auto)
-            apply(drule_tac x="u'" in meta_spec)
-            apply(simp)
-            apply(drule meta_mp)
-            apply(subgoal_tac "CR2 \<tau>")
-            apply(unfold CR2_def)[1]
-            apply(drule_tac x="u" in spec)
-            apply(drule_tac x="u'" in spec)
-            apply(simp)
-            apply(simp add: RED_props)
-            apply(simp)
-            done
-          then have "r\<in>RED \<sigma>" using b2 by simp
+          then obtain u' where "u \<longrightarrow>\<^sub>\<beta> u'" and u': "r = App (Lam [x].t) u'" by blast
+          have "CR2 \<tau>"
+            by (simp add: RED_props(2))
+          then
+          have "App (Lam [x].t) u'\<in>RED \<sigma>"
+            using CR2_def ih2 \<open>u \<longrightarrow>\<^sub>\<beta> u'\<close> t u by blast
+          then have "r\<in>RED \<sigma>" using u' by simp
         }
         moreover
         { assume "r = t[x::=u]"
-          then have "r\<in>RED \<sigma>" using as1 as2 by auto
+          then have "r\<in>RED \<sigma>" using u t by auto
         }
-        ultimately show "r \<in> RED \<sigma>" 
+        ultimately show "r \<in> RED \<sigma>"
+          by cases (auto simp: alpha subst_rename lam.inject dest: beta_abs)
           (* one wants to use the strong elimination principle; for this one 
              has to know that x\<sharp>u *)
-        apply(cases) 
-        apply(auto simp add: lam.inject)
-        apply(drule beta_abs)
-        apply(auto)[1]
-        apply(auto simp add: alpha subst_rename)
-        done
     qed
     moreover 
     have "NEUT (App (Lam [x].t) u)" unfolding NEUT_def by (auto)
@@ -545,18 +506,9 @@
 
 lemma id_closes:
   shows "(id \<Gamma>) closes \<Gamma>"
-apply(auto)
-apply(simp add: id_maps)
-apply(subgoal_tac "CR3 T") \<comment> \<open>A\<close>
-apply(drule CR3_implies_CR4)
-apply(simp add: CR4_def)
-apply(drule_tac x="Var x" in spec)
-apply(force simp add: NEUT_def NORMAL_Var)
-\<comment> \<open>A\<close>
-apply(rule RED_props)
-done
+  by (metis CR3_implies_CR4 CR4_def NEUT_def NORMAL_Var RED_props(3) id_maps)
 
-lemma typing_implies_RED:  
+lemma typing_implies_RED:
   assumes a: "\<Gamma> \<turnstile> t : \<tau>"
   shows "t \<in> RED \<tau>"
 proof -
--- a/src/HOL/Nominal/Examples/SOS.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/SOS.thy	Thu May 23 20:22:52 2024 +0200
@@ -67,11 +67,7 @@
   "\<theta><(Var x)> = (lookup \<theta> x)"
 | "\<theta><(App e\<^sub>1 e\<^sub>2)> = App (\<theta><e\<^sub>1>) (\<theta><e\<^sub>2>)"
 | "x\<sharp>\<theta> \<Longrightarrow> \<theta><(Lam [x].e)> = Lam [x].(\<theta><e>)"
-apply(finite_guess)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh)+
-apply(fresh_guess)+
-done
+  by (finite_guess | simp add: abs_fresh | fresh_guess)+
 
 lemma psubst_eqvt[eqvt]:
   fixes pi::"name prm" 
@@ -357,24 +353,30 @@
 
 lemma V_eqvt:
   fixes pi::"name prm"
-  assumes a: "x\<in>V T"
-  shows "(pi\<bullet>x)\<in>V T"
-using a
-apply(nominal_induct T arbitrary: pi x rule: ty.strong_induct)
-apply(auto simp add: trm.inject)
-apply(simp add: eqvts)
-apply(rule_tac x="pi\<bullet>xa" in exI)
-apply(rule_tac x="pi\<bullet>e" in exI)
-apply(simp)
-apply(auto)
-apply(drule_tac x="(rev pi)\<bullet>v" in bspec)
-apply(force)
-apply(auto)
-apply(rule_tac x="pi\<bullet>v'" in exI)
-apply(auto)
-apply(drule_tac pi="pi" in big.eqvt)
-apply(perm_simp add: eqvts)
-done
+  assumes "x \<in> V T"
+  shows "(pi\<bullet>x) \<in> V T"
+using assms
+proof (nominal_induct T arbitrary: pi x rule: ty.strong_induct)
+  case (TVar nat)
+  then show ?case
+    by (simp add: val.eqvt)
+next
+  case (Arrow T\<^sub>1 T\<^sub>2 pi x)
+  obtain a e where ae: "x = Lam [a]. e" "\<forall>v\<in>V T\<^sub>1. \<exists>v'. e[a::=v] \<Down> v' \<and> v' \<in> V T\<^sub>2"
+    using Arrow.prems by auto
+  have "\<exists>v'. (pi \<bullet> e)[(pi \<bullet> a)::=v] \<Down> v' \<and> v' \<in> V T\<^sub>2" if v: "v \<in> V T\<^sub>1" for v
+  proof -
+    have "rev pi \<bullet> v \<in> V T\<^sub>1"
+      by (simp add: Arrow.hyps(1) v)
+    then obtain v' where "e[a::=(rev pi \<bullet> v)] \<Down> v'" "v' \<in> V T\<^sub>2"
+      using ae(2) by blast
+    then have "(pi \<bullet> e)[(pi \<bullet> a)::=v] \<Down> pi \<bullet> v'"
+      by (metis (no_types, lifting) big.eqvt cons_eqvt nil_eqvt perm_pi_simp(1) perm_prod.simps psubst_eqvt)
+    then show ?thesis
+      using Arrow.hyps \<open>v' \<in> V T\<^sub>2\<close> by blast
+  qed
+  with ae show ?case by force
+qed
 
 lemma V_arrow_elim_weak:
   assumes h:"u \<in> V (T\<^sub>1 \<rightarrow> T\<^sub>2)"
@@ -385,33 +387,28 @@
   fixes c::"'a::fs_name"
   assumes h: "u \<in> V (T\<^sub>1 \<rightarrow> T\<^sub>2)"
   obtains a t where "a\<sharp>c" "u = Lam [a].t" "\<forall>v \<in> (V T\<^sub>1). \<exists> v'. t[a::=v] \<Down> v' \<and> v' \<in> V T\<^sub>2"
-using h
-apply -
-apply(erule V_arrow_elim_weak)
-apply(subgoal_tac "\<exists>a'::name. a'\<sharp>(a,t,c)") (*A*)
-apply(erule exE)
-apply(drule_tac x="a'" in meta_spec)
-apply(drule_tac x="[(a,a')]\<bullet>t" in meta_spec)
-apply(drule meta_mp)
-apply(simp)
-apply(drule meta_mp)
-apply(simp add: trm.inject alpha fresh_left fresh_prod calc_atm fresh_atm)
-apply(perm_simp)
-apply(force)
-apply(drule meta_mp)
-apply(rule ballI)
-apply(drule_tac x="[(a,a')]\<bullet>v" in bspec)
-apply(simp add: V_eqvt)
-apply(auto)
-apply(rule_tac x="[(a,a')]\<bullet>v'" in exI)
-apply(auto)
-apply(drule_tac pi="[(a,a')]" in big.eqvt)
-apply(perm_simp add: eqvts calc_atm)
-apply(simp add: V_eqvt)
-(*A*)
-apply(rule exists_fresh')
-apply(simp add: fin_supp)
-done
+proof -
+  obtain a t where "u = Lam [a].t" 
+    and at: "\<And>v. v \<in> (V T\<^sub>1) \<Longrightarrow> \<exists> v'. t[a::=v] \<Down> v' \<and> v' \<in> V T\<^sub>2"
+    using V_arrow_elim_weak [OF assms] by metis
+  obtain a'::name where a': "a'\<sharp>(a,t,c)"
+    by (meson exists_fresh fs_name_class.axioms)
+  then have "u = Lam [a'].([(a, a')] \<bullet> t)"
+    unfolding \<open>u = Lam [a].t\<close>
+    by (smt (verit) alpha fresh_atm fresh_prod perm_swap trm.inject(2))
+  moreover
+  have "\<exists> v'. ([(a, a')] \<bullet> t)[a'::=v] \<Down> v' \<and> v' \<in> V T\<^sub>2" if "v \<in> (V T\<^sub>1)" for v
+  proof -
+    obtain v' where v': "t[a::=([(a, a')] \<bullet> v)] \<Down> v' \<and> v' \<in> V T\<^sub>2"
+      using V_eqvt \<open>v \<in> V T\<^sub>1\<close> at by blast
+    then have "([(a, a')] \<bullet> t[a::=([(a, a')] \<bullet> v)]) \<Down> [(a, a')] \<bullet> v'"
+      by (simp add: big.eqvt)
+    then show ?thesis
+      by (smt (verit) V_eqvt cons_eqvt nil_eqvt perm_prod.simps perm_swap(1) psubst_eqvt swap_simps(1) v')
+  qed
+  ultimately show thesis
+    by (metis fresh_prod that a')
+qed
 
 lemma Vs_are_values:
   assumes a: "e \<in> V T"
--- a/src/HOL/Nominal/Examples/Standardization.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/Standardization.thy	Thu May 23 20:22:52 2024 +0200
@@ -31,11 +31,7 @@
   "size (Var n) = 0"
 | "size (t \<degree> u) = size t + size u + 1"
 | "size (Lam [x].t) = size t + 1"
-  apply finite_guess+
-  apply (rule TrueI)+
-  apply (simp add: fresh_nat)
-  apply fresh_guess+
-  done
+  by (finite_guess | simp add: fresh_nat | fresh_guess)+
 
 instance ..
 
@@ -47,40 +43,36 @@
   subst_Var: "(Var x)[y::=s] = (if x=y then s else (Var x))"
 | subst_App: "(t\<^sub>1 \<degree> t\<^sub>2)[y::=s] = t\<^sub>1[y::=s] \<degree> t\<^sub>2[y::=s]"
 | subst_Lam: "x \<sharp> (y, s) \<Longrightarrow> (Lam [x].t)[y::=s] = (Lam [x].(t[y::=s]))"
-  apply(finite_guess)+
-  apply(rule TrueI)+
-  apply(simp add: abs_fresh)
-  apply(fresh_guess)+
-  done
+  by (finite_guess | simp add: abs_fresh | fresh_guess)+
 
 lemma subst_eqvt [eqvt]:
   "(pi::name prm) \<bullet> (t[x::=u]) = (pi \<bullet> t)[(pi \<bullet> x)::=(pi \<bullet> u)]"
   by (nominal_induct t avoiding: x u rule: lam.strong_induct)
-    (perm_simp add: fresh_bij)+
+     (perm_simp add: fresh_bij)+
 
 lemma subst_rename:
   "y \<sharp> t \<Longrightarrow> ([(y, x)] \<bullet> t)[y::=u] = t[x::=u]"
   by (nominal_induct t avoiding: x y u rule: lam.strong_induct)
-    (simp_all add: fresh_atm calc_atm abs_fresh)
+     (simp_all add: fresh_atm calc_atm abs_fresh)
 
 lemma fresh_subst: 
   "(x::name) \<sharp> t \<Longrightarrow> x \<sharp> u \<Longrightarrow> x \<sharp> t[y::=u]"
   by (nominal_induct t avoiding: x y u rule: lam.strong_induct)
-    (auto simp add: abs_fresh fresh_atm)
+     (auto simp add: abs_fresh fresh_atm)
 
 lemma fresh_subst': 
   "(x::name) \<sharp> u \<Longrightarrow> x \<sharp> t[x::=u]"
   by (nominal_induct t avoiding: x u rule: lam.strong_induct)
-    (auto simp add: abs_fresh fresh_atm)
+     (auto simp add: abs_fresh fresh_atm)
 
 lemma subst_forget: "(x::name) \<sharp> t \<Longrightarrow> t[x::=u] = t"
   by (nominal_induct t avoiding: x u rule: lam.strong_induct)
-    (auto simp add: abs_fresh fresh_atm)
+     (auto simp add: abs_fresh fresh_atm)
 
 lemma subst_subst:
   "x \<noteq> y \<Longrightarrow> x \<sharp> v \<Longrightarrow> t[y::=v][x::=u[y::=v]] = t[x::=u][y::=v]"
   by (nominal_induct t avoiding: x y u v rule: lam.strong_induct)
-    (auto simp add: fresh_subst subst_forget)
+     (auto simp add: fresh_subst subst_forget)
 
 declare subst_Var [simp del]
 
@@ -132,20 +124,18 @@
 
 lemma Var_apps_eq_Var_apps_conv [iff]:
     "(Var m \<degree>\<degree> rs = Var n \<degree>\<degree> ss) = (m = n \<and> rs = ss)"
-  apply (induct rs arbitrary: ss rule: rev_induct)
-   apply (simp add: lam.inject)
-   apply blast
-  apply (induct_tac ss rule: rev_induct)
-   apply (auto simp add: lam.inject)
-  done
+proof (induct rs arbitrary: ss rule: rev_induct)
+  case Nil then show ?case by (auto simp add: lam.inject)
+next
+  case (snoc x xs) then show ?case 
+  by (induct ss rule: rev_induct) (auto simp add: lam.inject)
+qed
 
 lemma App_eq_foldl_conv:
   "(r \<degree> s = t \<degree>\<degree> ts) =
     (if ts = [] then r \<degree> s = t
     else (\<exists>ss. ts = ss @ [s] \<and> r = t \<degree>\<degree> ss))"
-  apply (rule_tac xs = ts in rev_exhaust)
-   apply (auto simp add: lam.inject)
-  done
+  by (rule rev_exhaust [of ts]) (auto simp: lam.inject)
 
 lemma Abs_eq_apps_conv [iff]:
     "((Lam [x].r) = s \<degree>\<degree> ss) = ((Lam [x].r) = s \<and> ss = [])"
@@ -160,19 +150,20 @@
 
 lemma Var_apps_neq_Abs_apps [iff]:
     "Var n \<degree>\<degree> ts \<noteq> (Lam [x].r) \<degree>\<degree> ss"
-  apply (induct ss arbitrary: ts rule: rev_induct)
-   apply simp
-  apply (induct_tac ts rule: rev_induct)
-   apply (auto simp add: lam.inject)
-  done
+proof (induct ss arbitrary: ts rule: rev_induct)
+  case Nil then show ?case by simp
+next
+  case (snoc x xs) then show ?case
+  by (induct ts rule: rev_induct) (auto simp add: lam.inject)
+qed
 
 lemma ex_head_tail:
   "\<exists>ts h. t = h \<degree>\<degree> ts \<and> ((\<exists>n. h = Var n) \<or> (\<exists>x u. h = (Lam [x].u)))"
-  apply (induct t rule: lam.induct)
-    apply (metis foldl_Nil)
-   apply (metis foldl_Cons foldl_Nil foldl_append)
-  apply (metis foldl_Nil)
-  done
+proof (induct t rule: lam.induct)
+  case (App lam1 lam2)
+  then show ?case
+    by (metis foldl_Cons foldl_Nil foldl_append)
+qed auto
 
 lemma size_apps [simp]:
   "size (r \<degree>\<degree> rs) = size r + foldl (+) 0 (map size rs) + length rs"
@@ -198,56 +189,67 @@
 
 text \<open>A customized induction schema for \<open>\<degree>\<degree>\<close>.\<close>
 
-lemma lem:
+lemma Apps_lam_induct_aux:
   assumes "\<And>n ts (z::'a::fs_name). (\<And>z. \<forall>t \<in> set ts. P z t) \<Longrightarrow> P z (Var n \<degree>\<degree> ts)"
     and "\<And>x u ts z. x \<sharp> z \<Longrightarrow> (\<And>z. P z u) \<Longrightarrow> (\<And>z. \<forall>t \<in> set ts. P z t) \<Longrightarrow> P z ((Lam [x].u) \<degree>\<degree> ts)"
   shows "size t = n \<Longrightarrow> P z t"
-  apply (induct n arbitrary: t z rule: nat_less_induct)
-  apply (cut_tac t = t in ex_head_tail)
-  apply clarify
-  apply (erule disjE)
-   apply clarify
-   apply (rule assms)
-   apply clarify
-   apply (erule allE, erule impE)
-    prefer 2
-    apply (erule allE, erule impE, rule refl, erule spec)
-    apply simp
-    apply (simp only: foldl_conv_fold add.commute fold_plus_sum_list_rev)
-    apply (fastforce simp add: sum_list_map_remove1)
-  apply clarify
-  apply (subgoal_tac "\<exists>y::name. y \<sharp> (x, u, z)")
-   prefer 2
-   apply (blast intro: exists_fresh' fin_supp) 
-  apply (erule exE)
-  apply (subgoal_tac "(Lam [x].u) = (Lam [y].([(y, x)] \<bullet> u))")
-  prefer 2
-  apply (auto simp add: lam.inject alpha' fresh_prod fresh_atm)[]
-  apply (simp (no_asm_simp))
-  apply (rule assms)
-  apply (simp add: fresh_prod)
-   apply (erule allE, erule impE)
-    prefer 2
-    apply (erule allE, erule impE, rule refl, erule spec)
-   apply simp
-  apply clarify
-  apply (erule allE, erule impE)
-   prefer 2
-   apply blast
-  apply simp
-  apply (simp only: foldl_conv_fold add.commute fold_plus_sum_list_rev)
-  apply (fastforce simp add: sum_list_map_remove1)
-  done
+proof (induct n arbitrary: t z rule: less_induct)
+  case (less n)
+  obtain ts h where t: "t = h \<degree>\<degree> ts" and D: "(\<exists>a. h = Var a) \<or> (\<exists>x u. h = (Lam [x].u))"
+    using ex_head_tail [of t] by metis
+  show ?case 
+    using D
+  proof (elim exE disjE)
+    fix a :: name
+    assume h: "h = Var a"
+    have "P z t" if "t \<in> set ts" for z t
+    proof -
+      have "size t < length ts + fold (+) (map size ts) 0"
+        using that
+        by (fastforce simp add: sum_list_map_remove1 fold_plus_sum_list_rev)
+      then have "size t < size (Var a \<degree>\<degree> ts)"
+        by simp (simp add: add.commute foldl_conv_fold)
+      then show ?thesis
+        using h less.hyps less.prems t by blast
+    qed
+    then show "P z t"
+      unfolding t h by (blast intro: assms)
+  next
+    fix x u
+    assume h: "h = (Lam [x].u)"
+    obtain y::name where y: "y \<sharp> (x, u, z)"
+      by (metis exists_fresh' fin_supp) 
+    then have eq: "(Lam [x].u) = (Lam [y].([(y, x)] \<bullet> u))"
+      by (metis alpha' fresh_prod lam.inject(3) perm_fresh_fresh)
+    show "P z t"
+      unfolding t h eq
+    proof (intro assms strip)
+      show "y \<sharp> z"
+        by (simp add: y)
+      have "size ([(y, x)] \<bullet> u) < size ((Lam [x].u) \<degree>\<degree> ts)"
+        by (simp add: eq)
+      then show "P z ([(y, x)] \<bullet> u)" for z
+        using h less.hyps less.prems t by blast
+      show "P z t" if "t\<in>set ts" for z t
+      proof -
+        have 2: "size t < size ((Lam [x].u) \<degree>\<degree> ts)"
+          using that
+          apply (simp add: eq)
+          apply (simp only: foldl_conv_fold add.commute fold_plus_sum_list_rev)
+          apply (fastforce simp add: sum_list_map_remove1)
+          done
+        then show ?thesis
+          using h less.hyps less.prems t by blast
+      qed
+    qed
+  qed
+qed
 
 theorem Apps_lam_induct:
   assumes "\<And>n ts (z::'a::fs_name). (\<And>z. \<forall>t \<in> set ts. P z t) \<Longrightarrow> P z (Var n \<degree>\<degree> ts)"
     and "\<And>x u ts z. x \<sharp> z \<Longrightarrow> (\<And>z. P z u) \<Longrightarrow> (\<And>z. \<forall>t \<in> set ts. P z t) \<Longrightarrow> P z ((Lam [x].u) \<degree>\<degree> ts)"
   shows "P z t"
-  apply (rule_tac t = t and z = z in lem)
-    prefer 3
-    apply (rule refl)
-    using assms apply blast+
-  done
+  using Apps_lam_induct_aux [of P] assms by blast
 
 
 subsection \<open>Congruence rules\<close>
@@ -277,66 +279,40 @@
 
 definition
   step1 :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> 'a list \<Rightarrow> bool" where
-  "step1 r =
+  "step1 r \<equiv>
     (\<lambda>ys xs. \<exists>us z z' vs. xs = us @ z # vs \<and> r z' z \<and> ys =
       us @ z' # vs)"
 
 lemma not_Nil_step1 [iff]: "\<not> step1 r [] xs"
-  apply (unfold step1_def)
-  apply blast
-  done
+  by (simp add: step1_def)
 
 lemma not_step1_Nil [iff]: "\<not> step1 r xs []"
-  apply (unfold step1_def)
-  apply blast
-  done
+  by (simp add: step1_def)
 
 lemma Cons_step1_Cons [iff]:
-    "(step1 r (y # ys) (x # xs)) =
-      (r y x \<and> xs = ys \<or> x = y \<and> step1 r ys xs)"
-  apply (unfold step1_def)
-  apply (rule iffI)
-   apply (erule exE)
-   apply (rename_tac ts)
-   apply (case_tac ts)
-    apply fastforce
-   apply force
-  apply (erule disjE)
-   apply blast
-  apply (blast intro: Cons_eq_appendI)
-  done
-
-lemma append_step1I:
-  "step1 r ys xs \<and> vs = us \<or> ys = xs \<and> step1 r vs us
-    \<Longrightarrow> step1 r (ys @ vs) (xs @ us)"
-  apply (unfold step1_def)
-  apply auto
-   apply blast
-  apply (blast intro: append_eq_appendI)
-  done
+    "step1 r (y # ys) (x # xs) \<longleftrightarrow> r y x \<and> xs = ys \<or> x = y \<and> step1 r ys xs"
+  apply (rule )
+   apply (smt (verit, ccfv_SIG) append_eq_Cons_conv list.inject step1_def)
+  by (metis append_Cons append_Nil step1_def)
 
 lemma Cons_step1E [elim!]:
   assumes "step1 r ys (x # xs)"
     and "\<And>y. ys = y # xs \<Longrightarrow> r y x \<Longrightarrow> R"
     and "\<And>zs. ys = x # zs \<Longrightarrow> step1 r zs xs \<Longrightarrow> R"
   shows R
-  using assms
-  apply (cases ys)
-   apply (simp add: step1_def)
-  apply blast
-  done
+  by (metis Cons_step1_Cons assms list.exhaust not_Nil_step1)
+
+lemma append_step1I:
+  "step1 r ys xs \<and> vs = us \<or> ys = xs \<and> step1 r vs us
+    \<Longrightarrow> step1 r (ys @ vs) (xs @ us)"
+  by (smt (verit) append_Cons append_assoc step1_def)
 
 lemma Snoc_step1_SnocD:
-  "step1 r (ys @ [y]) (xs @ [x])
-    \<Longrightarrow> (step1 r ys xs \<and> y = x \<or> ys = xs \<and> r y x)"
-  apply (unfold step1_def)
-  apply (clarify del: disjCI)
-  apply (rename_tac vs)
-  apply (rule_tac xs = vs in rev_exhaust)
-   apply force
-  apply simp
-  apply blast
-  done
+  assumes "step1 r (ys @ [y]) (xs @ [x])"
+  shows "(step1 r ys xs \<and> y = x \<or> ys = xs \<and> r y x)"
+  using assms
+    apply (clarsimp simp: step1_def)
+  by (metis butlast.simps(2) butlast_append butlast_snoc last.simps last_appendR list.simps(3))
 
 
 subsection \<open>Lifting beta-reduction to lists\<close>
@@ -347,15 +323,15 @@
 
 lemma head_Var_reduction:
   "Var n \<degree>\<degree> rs \<rightarrow>\<^sub>\<beta> v \<Longrightarrow> \<exists>ss. rs [\<rightarrow>\<^sub>\<beta>]\<^sub>1 ss \<and> v = Var n \<degree>\<degree> ss"
-  apply (induct u \<equiv> "Var n \<degree>\<degree> rs" v arbitrary: rs set: beta)
-     apply simp
-    apply (rule_tac xs = rs in rev_exhaust)
-     apply simp
-    apply (atomize, force intro: append_step1I iff: lam.inject)
-   apply (rule_tac xs = rs in rev_exhaust)
-    apply simp
-    apply (auto 0 3 intro: disjI2 [THEN append_step1I] simp add: lam.inject)
-  done
+proof (induct u \<equiv> "Var n \<degree>\<degree> rs" v arbitrary: rs set: beta)
+  case (appL s t u)
+  then show ?case
+    by (smt (verit, best) App_eq_foldl_conv app_last append_step1I lam.distinct(1))
+next
+  case (appR s t u)
+  then show ?case
+    by (smt (verit, ccfv_SIG) App_eq_foldl_conv Cons_step1_Cons app_last append_step1I lam.distinct(1))
+qed auto
 
 lemma apps_betasE [case_names appL appR beta, consumes 1]:
   assumes major: "r \<degree>\<degree> rs \<rightarrow>\<^sub>\<beta> s"
@@ -364,58 +340,48 @@
       "\<And>t u us. (x \<sharp> r \<Longrightarrow> r = (Lam [x].t) \<and> rs = u # us \<and> s = t[x::=u] \<degree>\<degree> us) \<Longrightarrow> R"
   shows R
 proof -
+  note [[simproc del: defined_all]]
   from major have
    "(\<exists>r'. r \<rightarrow>\<^sub>\<beta> r' \<and> s = r' \<degree>\<degree> rs) \<or>
     (\<exists>rs'. rs [\<rightarrow>\<^sub>\<beta>]\<^sub>1 rs' \<and> s = r \<degree>\<degree> rs') \<or>
     (\<exists>t u us. x \<sharp> r \<longrightarrow> r = (Lam [x].t) \<and> rs = u # us \<and> s = t[x::=u] \<degree>\<degree> us)"
-    supply [[simproc del: defined_all]]
-    apply (nominal_induct u \<equiv> "r \<degree>\<degree> rs" s avoiding: x r rs rule: beta.strong_induct)
-    apply (simp add: App_eq_foldl_conv)
-    apply (split if_split_asm)
-    apply simp
-    apply blast
-    apply simp
-    apply (rule impI)+
-    apply (rule disjI2)
-    apply (rule disjI2)
-    apply (subgoal_tac "r = [(xa, x)] \<bullet> (Lam [x].s)")
-    prefer 2
-    apply (simp add: perm_fresh_fresh)
-    apply (drule conjunct1)
-    apply (subgoal_tac "r = (Lam [xa]. [(xa, x)] \<bullet> s)")
-    prefer 2
-    apply (simp add: calc_atm)
-    apply (thin_tac "r = _")
-    apply simp
-    apply (rule exI)
-    apply (rule conjI)
-    apply (rule refl)
-    apply (simp add: abs_fresh fresh_atm fresh_left calc_atm subst_rename)
-      apply (drule App_eq_foldl_conv [THEN iffD1])
-      apply (split if_split_asm)
-       apply simp
+  proof (nominal_induct u \<equiv> "r \<degree>\<degree> rs" s avoiding: x r rs rule: beta.strong_induct)
+    case (beta y t s)
+    then show ?case
+      apply (simp add: App_eq_foldl_conv split: if_split_asm)
        apply blast
-      apply (force intro!: disjI1 [THEN append_step1I] simp add: fresh_list_append)
-     apply (drule App_eq_foldl_conv [THEN iffD1])
-     apply (split if_split_asm)
-      apply simp
+      by (metis (no_types, lifting) abs_fresh(1) alpha' lam.fresh(3) lam.inject(3) subst_rename)
+  next
+    case (appL s t u)
+    then show ?case
+      apply (simp add: App_eq_foldl_conv split: if_split_asm)
       apply blast
-     apply (clarify, auto 0 3 intro!: exI intro: append_step1I)
-    done
+      by (smt (verit) append_Cons append_step1I snoc_eq_iff_butlast)
+  next
+    case (appR s t u)
+    then show ?case
+      apply (simp add: App_eq_foldl_conv step1_def split: if_split_asm)
+      apply force
+      by (metis snoc_eq_iff_butlast)
+  next
+    case (abs s t x)
+    then show ?case
+      by blast
+  qed
   with cases show ?thesis by blast
 qed
 
 lemma apps_preserves_betas [simp]:
     "rs [\<rightarrow>\<^sub>\<beta>]\<^sub>1 ss \<Longrightarrow> r \<degree>\<degree> rs \<rightarrow>\<^sub>\<beta> r \<degree>\<degree> ss"
-  apply (induct rs arbitrary: ss rule: rev_induct)
-   apply simp
-  apply simp
-  apply (rule_tac xs = ss in rev_exhaust)
-   apply simp
-  apply simp
-  apply (drule Snoc_step1_SnocD)
-  apply blast
-  done
+proof (induct rs arbitrary: ss rule: rev_induct)
+  case Nil
+  then show ?case by simp
+next
+  case (snoc x ts)
+  then show ?case 
+    apply (simp add: step1_def)
+    by (smt (verit) appR app_last apps_preserves_beta foldl_Cons foldl_append)
+qed
 
 
 subsection \<open>Standard reduction relation\<close>
@@ -653,14 +619,7 @@
 lemma listsp_eqvt [eqvt]:
   assumes xs: "listsp p (xs::'a::pt_name list)"
   shows "listsp ((pi::name prm) \<bullet> p) (pi \<bullet> xs)" using xs
-  apply induct
-  apply simp
-  apply simp
-  apply (rule listsp.intros)
-  apply (drule_tac pi=pi in perm_boolI)
-  apply perm_simp
-  apply assumption
-  done
+by induction (use perm_app in force)+
 
 inductive NF :: "lam \<Rightarrow> bool"
 where
@@ -674,13 +633,7 @@
 lemma Abs_NF:
   assumes NF: "NF ((Lam [x].t) \<degree>\<degree> ts)"
   shows "ts = []" using NF
-proof cases
-  case (App us i)
-  thus ?thesis by (simp add: Var_apps_neq_Abs_apps [THEN not_sym])
-next
-  case (Abs u)
-  thus ?thesis by simp
-qed
+  by (metis Abs_eq_apps_conv NF.cases Var_apps_neq_Abs_apps)
 
 text \<open>
 \<^term>\<open>NF\<close> characterizes exactly the terms that are in normal form.
--- a/src/HOL/Nominal/Examples/W.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Examples/W.thy	Thu May 23 20:22:52 2024 +0200
@@ -13,17 +13,15 @@
 
 lemma difference_eqvt_tvar[eqvt]:
   fixes pi::"tvar prm"
-  and   Xs Ys::"tvar list"
+    and   Xs Ys::"tvar list"
   shows "pi\<bullet>(Xs - Ys) = (pi\<bullet>Xs) - (pi\<bullet>Ys)"
-by (induct Xs) (simp_all add: eqvts)
+  by (induct Xs) (simp_all add: eqvts)
 
-lemma difference_fresh:
+lemma difference_fresh [simp]:
   fixes X::"tvar"
-  and   Xs Ys::"tvar list"
-  assumes a: "X\<in>set Ys"
-  shows "X\<sharp>(Xs - Ys)"
-using a
-by (induct Xs) (auto simp add: fresh_list_nil fresh_list_cons fresh_atm)
+    and   Xs Ys::"tvar list"
+  shows "X\<sharp>(Xs - Ys) \<longleftrightarrow> X\<sharp>Xs \<or> X\<in>set Ys"
+  by (induct Xs) (auto simp add: fresh_list_nil fresh_list_cons fresh_atm)
 
 lemma difference_supset:
   fixes xs::"'a list"
@@ -114,10 +112,8 @@
 where
   "ftv_tyS (Ty T)    = ((ftv (T::ty))::tvar list)"
 | "ftv_tyS (\<forall>[X].S) = (ftv_tyS S) - [X]"
-apply(finite_guess add: ftv_ty_eqvt fs_tvar1)+
-apply(rule TrueI)+
-apply(rule difference_fresh)
-apply(simp)
+apply(finite_guess add: ftv_ty_eqvt fs_tvar1 | rule TrueI)+
+  apply (metis difference_fresh list.set_intros(1))
 apply(fresh_guess add: ftv_ty_eqvt fs_tvar1)+
 done
 
@@ -127,18 +123,21 @@
   fixes pi::"tvar prm"
   and   S::"tyS"
   shows "pi\<bullet>(ftv S) = ftv (pi\<bullet>S)"
-apply(nominal_induct S rule: tyS.strong_induct)
-apply(simp add: eqvts)
-apply(simp only: ftv_tyS.simps)
-apply(simp only: eqvts)
-apply(simp add: eqvts)
-done 
+proof (nominal_induct S rule: tyS.strong_induct)
+  case (Ty ty)
+  then show ?case
+    by (simp add: ftv_ty_eqvt)
+next
+  case (ALL tvar tyS)
+  then show ?case 
+    by (metis difference_eqvt_tvar ftv_ty.simps(1) ftv_tyS.simps(2) ftv_ty_eqvt ty.perm(3) tyS.perm(4))
+qed
 
 lemma ftv_Ctxt_eqvt[eqvt]:
   fixes pi::"tvar prm"
-  and   \<Gamma>::"Ctxt"
+    and   \<Gamma>::"Ctxt"
   shows "pi\<bullet>(ftv \<Gamma>) = ftv (pi\<bullet>\<Gamma>)"
-by (induct \<Gamma>) (auto simp add: eqvts)
+  by (induct \<Gamma>) (auto simp add: eqvts)
 
 text \<open>Valid\<close>
 inductive
@@ -157,7 +156,7 @@
 lemma gen_eqvt[eqvt]:
   fixes pi::"tvar prm"
   shows "pi\<bullet>(gen T Xs) = gen (pi\<bullet>T) (pi\<bullet>Xs)"
-by (induct Xs) (simp_all add: eqvts)
+  by (induct Xs) (simp_all add: eqvts)
 
 
 
@@ -169,7 +168,7 @@
 lemma close_eqvt[eqvt]:
   fixes pi::"tvar prm"
   shows "pi\<bullet>(close \<Gamma> T) = close (pi\<bullet>\<Gamma>) (pi\<bullet>T)"
-by (simp_all only: eqvts)
+  by (simp_all only: eqvts)
   
 text \<open>Substitution\<close>
 
@@ -183,8 +182,7 @@
 where
   "smth[X::=T] \<equiv> ([(X,T)])<smth>" 
 
-fun
-  lookup :: "Subst \<Rightarrow> tvar \<Rightarrow> ty"   
+fun lookup :: "Subst \<Rightarrow> tvar \<Rightarrow> ty"   
 where
   "lookup [] X        = TVar X"
 | "lookup ((Y,T)#\<theta>) X = (if X=Y then T else lookup \<theta> X)"
@@ -192,15 +190,15 @@
 lemma lookup_eqvt[eqvt]:
   fixes pi::"tvar prm"
   shows "pi\<bullet>(lookup \<theta> X) = lookup (pi\<bullet>\<theta>) (pi\<bullet>X)"
-by (induct \<theta>) (auto simp add: eqvts)
+  by (induct \<theta>) (auto simp add: eqvts)
 
 lemma lookup_fresh:
   fixes X::"tvar"
   assumes a: "X\<sharp>\<theta>"
   shows "lookup \<theta> X = TVar X"
-using a
-by (induct \<theta>)
-   (auto simp add: fresh_list_cons fresh_prod fresh_atm)
+  using a
+  by (induct \<theta>)
+    (auto simp add: fresh_list_cons fresh_prod fresh_atm)
 
 overloading 
   psubst_ty \<equiv> "psubst :: Subst \<Rightarrow> ty \<Rightarrow> ty"
@@ -231,9 +229,7 @@
 where 
   "\<theta><(Ty T)> = Ty (\<theta><T>)"
 | "X\<sharp>\<theta> \<Longrightarrow> \<theta><(\<forall>[X].S)> = \<forall>[X].(\<theta><S>)"
-apply(finite_guess add: psubst_ty_eqvt fs_tvar1)+
-apply(rule TrueI)+
-apply(simp add: abs_fresh)
+apply(finite_guess add: psubst_ty_eqvt fs_tvar1 | simp add: abs_fresh)+
 apply(fresh_guess add: psubst_ty_eqvt fs_tvar1)+
 done
 
@@ -330,26 +326,26 @@
   assumes a: "X\<sharp>\<theta>" 
   shows "\<theta><T[X::=T']> = (\<theta><T>)[X::=\<theta><T'>]"
 using a
-apply(nominal_induct T avoiding: \<theta> X T' rule: ty.strong_induct)
-apply(auto simp add: ty.inject lookup_fresh)
-apply(rule sym)
-apply(rule subst_forget_ty)
-apply(rule fresh_lookup)
-apply(simp_all add: fresh_atm)
-done
+proof (nominal_induct T avoiding: \<theta> X T' rule: ty.strong_induct)
+  case (TVar tvar)
+  then show ?case
+    by (simp add: fresh_atm(1) fresh_lookup lookup_fresh subst_forget_ty)
+qed auto
 
 lemma general_preserved:
   fixes \<theta>::"Subst"
   assumes a: "T \<prec> S"
   shows "\<theta><T> \<prec> \<theta><S>"
-using a
-apply(nominal_induct T S avoiding: \<theta> rule: inst.strong_induct)
-apply(auto)[1]
-apply(simp add: psubst_ty_lemma)
-apply(rule_tac I_All)
-apply(simp add: fresh_psubst_ty)
-apply(simp)
-done
+  using a
+proof (nominal_induct T S avoiding: \<theta> rule: inst.strong_induct)
+  case (I_Ty T)
+  then show ?case
+    by (simp add: inst.I_Ty)
+next
+  case (I_All X T' T S)
+  then show ?case
+    by (simp add: fresh_psubst_ty inst.I_All psubst_ty_lemma)
+qed
 
 
 text\<open>typing judgements\<close>
@@ -386,74 +382,72 @@
 lemma ftv_Ctxt: 
   fixes \<Gamma>::"Ctxt"
   shows "supp \<Gamma> = set (ftv \<Gamma>)"
-apply (induct \<Gamma>)
-apply (simp_all add: supp_list_nil supp_list_cons)
-apply (rename_tac a \<Gamma>')
-apply (case_tac a)
-apply (simp add: supp_prod supp_atm ftv_tyS)
-done
+proof (induct \<Gamma>)
+  case Nil
+  then show ?case
+    by (simp add: supp_list_nil)
+next
+  case (Cons c \<Gamma>)
+  show ?case
+  proof (cases c)
+    case (Pair a b)
+    with Cons show ?thesis
+      by (simp add: ftv_tyS supp_atm(3) supp_list_cons supp_prod)
+  qed
+qed
 
-lemma ftv_tvars: 
+lemma ftv_tvars:
   fixes Tvs::"tvar list"
   shows "supp Tvs = set Tvs"
-by (induct Tvs) 
-   (simp_all add: supp_list_nil supp_list_cons supp_atm)
+  by (induct Tvs) (simp_all add: supp_list_nil supp_list_cons supp_atm)
 
 lemma difference_supp: 
   fixes xs ys::"tvar list"
   shows "((supp (xs - ys))::tvar set) = supp xs - supp ys"
-by (induct xs) 
-   (auto simp add: supp_list_nil supp_list_cons ftv_tvars)
+  by (induct xs) (auto simp add: supp_list_nil supp_list_cons ftv_tvars)
 
 lemma set_supp_eq: 
   fixes xs::"tvar list"
   shows "set xs = supp xs"
-by (induct xs) 
-   (simp_all add: supp_list_nil supp_list_cons supp_atm)
+  by (induct xs) (simp_all add: supp_list_nil supp_list_cons supp_atm)
 
 nominal_inductive2 typing
   avoids T_LET: "set (ftv T\<^sub>1 - ftv \<Gamma>)"
-apply (simp add: fresh_star_def fresh_def ftv_Ctxt)
-apply (simp add: fresh_star_def fresh_tvar_trm)
-apply assumption
-apply simp
-done
+     apply (simp_all add: fresh_star_def fresh_def ftv_Ctxt fresh_tvar_trm)
+  by (meson fresh_def fresh_tvar_trm)
+
 
 lemma perm_fresh_fresh_aux:
   "\<forall>(x,y)\<in>set (pi::tvar prm). x \<sharp> z \<and> y \<sharp> z \<Longrightarrow> pi \<bullet> (z::'a::pt_tvar) = z"
-  apply (induct pi rule: rev_induct)
-  apply simp
-  apply (simp add: split_paired_all pt_tvar2)
-  apply (frule_tac x="(a, b)" in bspec)
-  apply simp
-  apply (simp add: perm_fresh_fresh)
-  done
+proof (induct pi rule: rev_induct)
+  case Nil
+  then show ?case
+    by simp
+next
+  case (snoc x xs)
+  then show ?case
+    unfolding split_paired_all pt_tvar2
+    using perm_fresh_fresh(1) by fastforce
+qed
 
 lemma freshs_mem:
   fixes S::"tvar set"
   assumes "x \<in> S"
-  and     "S \<sharp>* z"
+    and     "S \<sharp>* z"
   shows  "x \<sharp> z"
-using assms by (simp add: fresh_star_def)
+  using assms by (simp add: fresh_star_def)
 
 lemma fresh_gen_set:
   fixes X::"tvar"
   and   Xs::"tvar list"
-  assumes asm: "X\<in>set Xs" 
+  assumes "X\<in>set Xs" 
   shows "X\<sharp>gen T Xs"
-using asm
-apply(induct Xs)
-apply(simp)
-apply(rename_tac a Xs')
-apply(case_tac "X=a")
-apply(simp add: abs_fresh)
-apply(simp add: abs_fresh)
-done
+  using assms by (induct Xs) (auto simp: abs_fresh)
 
 lemma close_fresh:
   fixes \<Gamma>::"Ctxt"
   shows "\<forall>(X::tvar)\<in>set ((ftv T) - (ftv \<Gamma>)). X\<sharp>(close \<Gamma> T)"
-by (simp add: fresh_gen_set)
+  by (meson fresh_gen_set)
 
 lemma gen_supp: 
   shows "(supp (gen T Xs)::tvar set) = supp T - supp Xs"
@@ -466,9 +460,7 @@
 
 lemma close_supp: 
   shows "supp (close \<Gamma> T) = set (ftv T) \<inter> set (ftv \<Gamma>)"
-  apply (simp add: gen_supp difference_supp ftv_ty ftv_Ctxt)
-  apply (simp only: set_supp_eq minus_Int_eq)
-  done
+  using difference_supp ftv_ty gen_supp set_supp_eq by auto
 
 lemma better_T_LET:
   assumes x: "x\<sharp>\<Gamma>"
@@ -483,22 +475,12 @@
   from pi1 have pi1': "(pi \<bullet> set (ftv T\<^sub>1 - ftv \<Gamma>)) \<sharp>* \<Gamma>"
     by (simp add: fresh_star_prod)
   have Gamma_fresh: "\<forall>(x,y)\<in>set pi. x \<sharp> \<Gamma> \<and> y \<sharp> \<Gamma>"
-    apply (rule ballI)
-    apply (simp add: split_paired_all)
-    apply (drule subsetD [OF pi2])
-    apply (erule SigmaE)
-    apply (drule freshs_mem [OF _ pi1'])
-    apply (simp add: ftv_Ctxt [symmetric] fresh_def)
-    done
-  have close_fresh': "\<forall>(x, y)\<in>set pi. x \<sharp> close \<Gamma> T\<^sub>1 \<and> y \<sharp> close \<Gamma> T\<^sub>1"
-    apply (rule ballI)
-    apply (simp add: split_paired_all)
-    apply (drule subsetD [OF pi2])
-    apply (erule SigmaE)
-    apply (drule bspec [OF close_fresh])
-    apply (drule freshs_mem [OF _ pi1'])
-    apply (simp add: fresh_def close_supp ftv_Ctxt)
-    done
+    using freshs_mem [OF _ pi1'] subsetD [OF pi2] ftv_Ctxt fresh_def by fastforce
+  have "\<And>x y. \<lbrakk>x \<in> set (ftv T\<^sub>1 - ftv \<Gamma>); y \<in> pi \<bullet> set (ftv T\<^sub>1 - ftv \<Gamma>)\<rbrakk>
+              \<Longrightarrow> x \<sharp> close \<Gamma> T\<^sub>1 \<and> y \<sharp> close \<Gamma> T\<^sub>1"
+    by (metis DiffE filter_set fresh_def fresh_gen_set freshs_mem ftv_Ctxt ftv_ty gen_supp member_filter pi1')
+  then have close_fresh': "\<forall>(x, y)\<in>set pi. x \<sharp> close \<Gamma> T\<^sub>1 \<and> y \<sharp> close \<Gamma> T\<^sub>1"
+    using pi2 by auto
   note x
   moreover from Gamma_fresh perm_boolI [OF t1, of pi]
   have "\<Gamma> \<turnstile> t\<^sub>1 : pi \<bullet> T\<^sub>1"
@@ -518,96 +500,81 @@
   fixes T::"ty"
   and   \<theta>::"Subst"
   and   X Y ::"tvar"
-  assumes a1: "X \<in> set (ftv T)"
-  and     a2: "Y \<in> set (ftv (lookup \<theta> X))"
+  assumes "X \<in> set (ftv T)"
+  and     "Y \<in> set (ftv (lookup \<theta> X))"
   shows "Y \<in> set (ftv (\<theta><T>))"
-using a1 a2
-by (nominal_induct T rule: ty.strong_induct) (auto)
+  using assms
+  by (nominal_induct T rule: ty.strong_induct) (auto)
 
 lemma ftv_tyS_subst:
   fixes S::"tyS"
   and   \<theta>::"Subst"
   and   X Y::"tvar"
-  assumes a1: "X \<in> set (ftv S)"
-  and     a2: "Y \<in> set (ftv (lookup \<theta> X))"
+  assumes "X \<in> set (ftv S)"
+  and     "Y \<in> set (ftv (lookup \<theta> X))"
   shows "Y \<in> set (ftv (\<theta><S>))"
-using a1 a2
+  using assms
 by (nominal_induct S avoiding: \<theta> Y rule: tyS.strong_induct) 
    (auto simp add: ftv_ty_subst fresh_atm)
 
 lemma ftv_Ctxt_subst:
   fixes \<Gamma>::"Ctxt"
   and   \<theta>::"Subst"
-  assumes a1: "X \<in> set (ftv \<Gamma>)"
-  and     a2: "Y \<in> set (ftv (lookup \<theta> X))"
+assumes "X \<in> set (ftv \<Gamma>)"
+  and   "Y \<in> set (ftv (lookup \<theta> X))"
   shows "Y \<in> set (ftv (\<theta><\<Gamma>>))"
-using a1 a2
-by (induct \<Gamma>)
-   (auto simp add: ftv_tyS_subst)
+  using assms by (induct \<Gamma>) (auto simp add: ftv_tyS_subst)
 
 lemma gen_preserved1:
-  assumes asm: "Xs \<sharp>* \<theta>"
+  assumes "Xs \<sharp>* \<theta>"
   shows "\<theta><gen T Xs> = gen (\<theta><T>) Xs"
-using asm
-by (induct Xs) 
-   (auto simp add: fresh_star_def)
+  using assms by (induct Xs) (auto simp add: fresh_star_def)
 
 lemma gen_preserved2:
   fixes T::"ty"
   and   \<Gamma>::"Ctxt"
-  assumes asm: "((ftv T) - (ftv \<Gamma>)) \<sharp>* \<theta>"
+  assumes "((ftv T) - (ftv \<Gamma>)) \<sharp>* \<theta>"
   shows "((ftv (\<theta><T>)) - (ftv (\<theta><\<Gamma>>))) = ((ftv T) - (ftv \<Gamma>))"
-using asm
-apply(nominal_induct T rule: ty.strong_induct)
-apply(auto simp add: fresh_star_def)
-apply(simp add: lookup_fresh)
-apply(simp add: ftv_Ctxt[symmetric])
-apply(fold fresh_def)
-apply(rule fresh_psubst_Ctxt)
-apply(assumption)
-apply(assumption)
-apply(rule difference_supset)
-apply(auto)
-apply(simp add: ftv_Ctxt_subst)
-done
+  using assms
+proof(nominal_induct T rule: ty.strong_induct)
+  case (TVar tvar)
+  then show ?case 
+    apply(auto simp add: fresh_star_def ftv_Ctxt_subst)
+    by (metis filter.simps fresh_def fresh_psubst_Ctxt ftv_Ctxt ftv_ty.simps(1) lookup_fresh)
+next
+  case (Fun ty1 ty2)
+  then show ?case
+    by (simp add: fresh_star_list) 
+qed
 
 lemma close_preserved:
   fixes \<Gamma>::"Ctxt"
-  assumes asm: "((ftv T) - (ftv \<Gamma>)) \<sharp>* \<theta>"
+  assumes "((ftv T) - (ftv \<Gamma>)) \<sharp>* \<theta>"
   shows "\<theta><close \<Gamma> T> = close (\<theta><\<Gamma>>) (\<theta><T>)"
-using asm
-by (simp add: gen_preserved1 gen_preserved2)
+  using assms by (simp add: gen_preserved1 gen_preserved2)
 
 lemma var_fresh_for_ty:
   fixes x::"var"
-  and   T::"ty"
+    and   T::"ty"
   shows "x\<sharp>T"
-by (nominal_induct T rule: ty.strong_induct)
-   (simp_all add: fresh_atm)
+  by (nominal_induct T rule: ty.strong_induct) (simp_all add: fresh_atm)
 
 lemma var_fresh_for_tyS:
-  fixes x::"var"
-  and   S::"tyS"
+  fixes x::"var" and S::"tyS"
   shows "x\<sharp>S"
-by (nominal_induct S rule: tyS.strong_induct)
-   (simp_all add: abs_fresh var_fresh_for_ty)
+  by (nominal_induct S rule: tyS.strong_induct) (simp_all add: abs_fresh var_fresh_for_ty)
 
 lemma psubst_fresh_Ctxt:
-  fixes x::"var"
-  and   \<Gamma>::"Ctxt"
-  and   \<theta>::"Subst"
+  fixes x::"var" and \<Gamma>::"Ctxt" and \<theta>::"Subst"
   shows "x\<sharp>\<theta><\<Gamma>> = x\<sharp>\<Gamma>"
-by (induct \<Gamma>)
-   (auto simp add: fresh_list_cons fresh_list_nil fresh_prod var_fresh_for_tyS)
+  by (induct \<Gamma>) (auto simp add: fresh_list_cons fresh_list_nil fresh_prod var_fresh_for_tyS)
 
 lemma psubst_valid:
   fixes \<theta>::Subst
-  and   \<Gamma>::Ctxt
-  assumes a: "valid \<Gamma>"
+    and   \<Gamma>::Ctxt
+  assumes "valid \<Gamma>"
   shows "valid (\<theta><\<Gamma>>)"
-using a
-by (induct) 
-   (auto simp add: psubst_fresh_Ctxt)
+  using assms by (induct) (auto simp add: psubst_fresh_Ctxt)
 
 lemma psubst_in:
   fixes \<Gamma>::"Ctxt"
@@ -616,17 +583,14 @@
   and   S::"tyS"
   assumes a: "(x,S)\<in>set \<Gamma>"
   shows "(x,\<theta><S>)\<in>set (\<theta><\<Gamma>>)"
-using a
-by (induct \<Gamma>)
-   (auto simp add: calc_atm)
-
+  using a by (induct \<Gamma>) (auto simp add: calc_atm)
 
 lemma typing_preserved:
   fixes \<theta>::"Subst"
-  and   pi::"tvar prm"
-  assumes a: "\<Gamma> \<turnstile> t : T"
+    and   pi::"tvar prm"
+  assumes "\<Gamma> \<turnstile> t : T"
   shows "(\<theta><\<Gamma>>) \<turnstile> t : (\<theta><T>)"
-using a
+  using assms
 proof (nominal_induct \<Gamma> t T avoiding: \<theta> rule: typing.strong_induct)
   case (T_VAR \<Gamma> x S T)
   have a1: "valid \<Gamma>" by fact
@@ -662,14 +626,7 @@
   have a2: "\<theta><\<Gamma>> \<turnstile> t1 : \<theta><T1>" by fact 
   have a3: "\<theta><((x, close \<Gamma> T1)#\<Gamma>)> \<turnstile> t2 : \<theta><T2>" by fact
   from a2 a3 show "\<theta><\<Gamma>> \<turnstile> Let x be t1 in t2 : \<theta><T2>"
-    apply -
-    apply(rule better_T_LET)
-    apply(rule a1)
-    apply(rule a2)
-    apply(simp add: close_preserved vc)
-    done
+    by (simp add: a1 better_T_LET close_preserved vc)
 qed
 
-
-
 end
--- a/src/HOL/Nominal/Nominal.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Nominal/Nominal.thy	Thu May 23 20:22:52 2024 +0200
@@ -1,5 +1,6 @@
 theory Nominal 
-imports "HOL-Library.Infinite_Set" "HOL-Library.Old_Datatype"
+  imports "HOL-Library.Infinite_Set" "HOL-Library.Old_Datatype"
+
 keywords
   "atom_decl" :: thy_decl and
   "nominal_datatype" :: thy_defn and
@@ -41,7 +42,7 @@
 overloading
   perm_fun    \<equiv> "perm :: 'x prm \<Rightarrow> ('a\<Rightarrow>'b) \<Rightarrow> ('a\<Rightarrow>'b)"   (unchecked)
   perm_bool   \<equiv> "perm :: 'x prm \<Rightarrow> bool \<Rightarrow> bool"           (unchecked)
-  perm_set    \<equiv> "perm :: 'x prm \<Rightarrow> 'a set \<Rightarrow> 'a set"           (unchecked)
+  perm_set    \<equiv> "perm :: 'x prm \<Rightarrow> 'a set \<Rightarrow> 'a set"       (unchecked)
   perm_unit   \<equiv> "perm :: 'x prm \<Rightarrow> unit \<Rightarrow> unit"           (unchecked)
   perm_prod   \<equiv> "perm :: 'x prm \<Rightarrow> ('a\<times>'b) \<Rightarrow> ('a\<times>'b)"    (unchecked)
   perm_list   \<equiv> "perm :: 'x prm \<Rightarrow> 'a list \<Rightarrow> 'a list"     (unchecked)
@@ -138,7 +139,7 @@
   by (simp add: perm_bool)
 
 (* permutation on sets *)
-lemma empty_eqvt:
+lemma empty_eqvt[simp]:
   shows "pi\<bullet>{} = {}"
   by (simp add: perm_set_def)
 
@@ -209,11 +210,11 @@
   shows "(supp x) = {a::'x. \<not>a\<sharp>x}"
   by (simp add: fresh_def)
 
-lemma supp_unit:
+lemma supp_unit[simp]:
   shows "supp () = {}"
   by (simp add: supp_def)
 
-lemma supp_set_empty:
+lemma supp_set_empty[simp]:
   shows "supp {} = {}"
   by (force simp add: supp_def empty_eqvt)
 
@@ -229,7 +230,7 @@
   shows "(supp (nPair x y)) = (supp x)\<union>(supp y)"
   by  (force simp add: supp_def Collect_imp_eq Collect_neg_eq)
 
-lemma supp_list_nil:
+lemma supp_list_nil[simp]:
   shows "supp [] = {}"
   by (simp add: supp_def)
 
@@ -250,47 +251,47 @@
   shows "supp (rev xs) = (supp xs)"
   by (induct xs, auto simp add: supp_list_append supp_list_cons supp_list_nil)
 
-lemma supp_bool:
+lemma supp_bool[simp]:
   fixes x  :: "bool"
   shows "supp x = {}"
   by (cases "x") (simp_all add: supp_def)
 
-lemma supp_some:
+lemma supp_some[simp]:
   fixes x :: "'a"
   shows "supp (Some x) = (supp x)"
   by (simp add: supp_def)
 
-lemma supp_none:
+lemma supp_none[simp]:
   fixes x :: "'a"
   shows "supp (None) = {}"
   by (simp add: supp_def)
 
-lemma supp_int:
+lemma supp_int[simp]:
   fixes i::"int"
   shows "supp (i) = {}"
   by (simp add: supp_def perm_int_def)
 
-lemma supp_nat:
+lemma supp_nat[simp]:
   fixes n::"nat"
   shows "(supp n) = {}"
   by (simp add: supp_def perm_nat_def)
 
-lemma supp_char:
+lemma supp_char[simp]:
   fixes c::"char"
   shows "(supp c) = {}"
   by (simp add: supp_def perm_char_def)
   
-lemma supp_string:
+lemma supp_string[simp]:
   fixes s::"string"
   shows "(supp s) = {}"
   by (simp add: supp_def perm_string)
 
 (* lemmas about freshness *)
-lemma fresh_set_empty:
+lemma fresh_set_empty[simp]:
   shows "a\<sharp>{}"
   by (simp add: fresh_def supp_set_empty)
 
-lemma fresh_unit:
+lemma fresh_unit[simp]:
   shows "a\<sharp>()"
   by (simp add: fresh_def supp_unit)
 
@@ -301,7 +302,7 @@
   shows "a\<sharp>(x,y) = (a\<sharp>x \<and> a\<sharp>y)"
   by (simp add: fresh_def supp_prod)
 
-lemma fresh_list_nil:
+lemma fresh_list_nil[simp]:
   fixes a :: "'x"
   shows "a\<sharp>[]"
   by (simp add: fresh_def supp_list_nil) 
@@ -320,48 +321,48 @@
   shows "a\<sharp>(xs@ys) = (a\<sharp>xs \<and> a\<sharp>ys)"
   by (simp add: fresh_def supp_list_append)
 
-lemma fresh_list_rev:
+lemma fresh_list_rev[simp]:
   fixes a :: "'x"
   and   xs :: "'a list"
   shows "a\<sharp>(rev xs) = a\<sharp>xs"
   by (simp add: fresh_def supp_list_rev)
 
-lemma fresh_none:
+lemma fresh_none[simp]:
   fixes a :: "'x"
   shows "a\<sharp>None"
   by (simp add: fresh_def supp_none)
 
-lemma fresh_some:
+lemma fresh_some[simp]:
   fixes a :: "'x"
   and   x :: "'a"
   shows "a\<sharp>(Some x) = a\<sharp>x"
   by (simp add: fresh_def supp_some)
 
-lemma fresh_int:
+lemma fresh_int[simp]:
   fixes a :: "'x"
   and   i :: "int"
   shows "a\<sharp>i"
   by (simp add: fresh_def supp_int)
 
-lemma fresh_nat:
+lemma fresh_nat[simp]:
   fixes a :: "'x"
   and   n :: "nat"
   shows "a\<sharp>n"
   by (simp add: fresh_def supp_nat)
 
-lemma fresh_char:
+lemma fresh_char[simp]:
   fixes a :: "'x"
   and   c :: "char"
   shows "a\<sharp>c"
   by (simp add: fresh_def supp_char)
 
-lemma fresh_string:
+lemma fresh_string[simp]:
   fixes a :: "'x"
   and   s :: "string"
   shows "a\<sharp>s"
   by (simp add: fresh_def supp_string)
 
-lemma fresh_bool:
+lemma fresh_bool[simp]:
   fixes a :: "'x"
   and   b :: "bool"
   shows "a\<sharp>b"
@@ -726,17 +727,13 @@
   and   b  :: "'x"
   assumes at: "at TYPE('x)"
   shows "(pi1@pi2) \<triangleq> ((pi1\<bullet>pi2)@pi1)"
-apply(induct_tac pi2)
-apply(simp add: prm_eq_def)
-apply(auto simp add: prm_eq_def)
-apply(simp add: at2[OF at])
-apply(drule_tac x="aa" in spec)
-apply(drule sym)
-apply(simp)
-apply(simp add: at_append[OF at])
-apply(simp add: at2[OF at])
-apply(simp add: at_ds8_aux[OF at])
-done
+proof(induct pi2)
+  show "(pi1 @ []) \<triangleq> (pi1 \<bullet> [] @ pi1)"
+    by(simp add: prm_eq_def)
+  show "\<And>a l. (pi1 @ l) \<triangleq> (pi1 \<bullet> l @ pi1)  \<Longrightarrow>
+        (pi1 @ a # l) \<triangleq> (pi1 \<bullet> (a # l) @ pi1) "
+    by(auto simp add: prm_eq_def at at2 at_append at_ds8_aux)
+qed
 
 lemma at_ds9: 
   fixes pi1 :: "'x prm"
@@ -745,32 +742,16 @@
   and   b  :: "'x"
   assumes at: "at TYPE('x)"
   shows " ((rev pi2)@(rev pi1)) \<triangleq> ((rev pi1)@(rev (pi1\<bullet>pi2)))"
-apply(induct_tac pi2)
-apply(simp add: prm_eq_def)
-apply(auto simp add: prm_eq_def)
-apply(simp add: at_append[OF at])
-apply(simp add: at2[OF at] at1[OF at])
-apply(drule_tac x="swap(pi1\<bullet>a,pi1\<bullet>b) aa" in spec)
-apply(drule sym)
-apply(simp)
-apply(simp add: at_ds8_aux[OF at])
-apply(simp add: at_rev_pi[OF at])
-done
+  using at at_ds8 at_prm_rev_eq1 rev_append by fastforce
 
 lemma at_ds10:
   fixes pi :: "'x prm"
   and   a  :: "'x"
   and   b  :: "'x"
-  assumes at: "at TYPE('x)"
-  and     a:  "b\<sharp>(rev pi)"
+  assumes "at TYPE('x)"
+  and     "b\<sharp>(rev pi)"
   shows "([(pi\<bullet>a,b)]@pi) \<triangleq> (pi@[(a,b)])"
-using a
-apply -
-apply(rule at_prm_eq_trans)
-apply(rule at_ds2[OF at])
-apply(simp add: at_prm_fresh[OF at] at_rev_pi[OF at])
-apply(rule at_prm_eq_refl)
-done
+  by (metis assms at_bij1 at_ds2 at_prm_fresh)
 
 \<comment> \<open>there always exists an atom that is not being in a finite set\<close>
 lemma ex_in_inf:
@@ -778,14 +759,7 @@
   assumes at: "at TYPE('x)"
   and     fs: "finite A"
   obtains c::"'x" where "c\<notin>A"
-proof -
-  from  fs at4[OF at] have "infinite ((UNIV::'x set) - A)" 
-    by (simp add: Diff_infinite_finite)
-  hence "((UNIV::'x set) - A) \<noteq> ({}::'x set)" by (force simp only:)
-  then obtain c::"'x" where "c\<in>((UNIV::'x set) - A)" by force
-  then have "c\<notin>A" by simp
-  then show ?thesis ..
-qed
+  using at at4 ex_new_if_finite fs by blast
 
 text \<open>there always exists a fresh name for an object with finite support\<close>
 lemma at_exists_fresh': 
@@ -806,16 +780,8 @@
   fixes S::"'a set"
   assumes a: "at TYPE('a)"
   and     b: "finite S" 
-  shows "\<exists>x. x \<notin> S" 
-  using a b
-  apply(drule_tac S="UNIV::'a set" in Diff_infinite_finite)
-  apply(simp add: at_def)
-  apply(subgoal_tac "UNIV - S \<noteq> {}")
-  apply(simp only: ex_in_conv [symmetric])
-  apply(blast)
-  apply(rule notI)
-  apply(simp)
-  done
+  shows "\<exists>x. x \<notin> S"
+  by (meson a b ex_in_inf) 
 
 lemma at_different:
   assumes at: "at TYPE('x)"
@@ -823,12 +789,8 @@
 proof -
   have "infinite (UNIV::'x set)" by (rule at4[OF at])
   hence inf2: "infinite (UNIV-{a})" by (rule infinite_remove)
-  have "(UNIV-{a}) \<noteq> ({}::'x set)" 
-  proof (rule_tac ccontr, drule_tac notnotD)
-    assume "UNIV-{a} = ({}::'x set)"
-    with inf2 have "infinite ({}::'x set)" by simp
-    then show "False" by auto
-  qed
+  have "(UNIV-{a}) \<noteq> ({}::'x set)"
+    by (metis finite.emptyI inf2) 
   hence "\<exists>(b::'x). b\<in>(UNIV-{a})" by blast
   then obtain b::"'x" where mem2: "b\<in>(UNIV-{a})" by blast
   from mem2 have "a\<noteq>b" by blast
@@ -839,11 +801,7 @@
 lemma at_pt_inst:
   assumes at: "at TYPE('x)"
   shows "pt TYPE('x) TYPE('x)"
-apply(auto simp only: pt_def)
-apply(simp only: at1[OF at])
-apply(simp only: at_append[OF at]) 
-apply(simp only: prm_eq_def)
-done
+  using at at_append at_def prm_eq_def pt_def by fastforce
 
 section \<open>finite support properties\<close>
 (*===================================*)
@@ -858,56 +816,36 @@
   fixes a :: "'x"
   assumes at: "at TYPE('x)"
   shows "fs TYPE('x) TYPE('x)"
-apply(simp add: fs_def) 
-apply(simp add: at_supp[OF at])
-done
+  by (simp add: at at_supp fs_def)
 
 lemma fs_unit_inst:
   shows "fs TYPE(unit) TYPE('x)"
-apply(simp add: fs_def)
-apply(simp add: supp_unit)
-done
+  by(simp add: fs_def supp_unit)
 
 lemma fs_prod_inst:
   assumes fsa: "fs TYPE('a) TYPE('x)"
   and     fsb: "fs TYPE('b) TYPE('x)"
   shows "fs TYPE('a\<times>'b) TYPE('x)"
-apply(unfold fs_def)
-apply(auto simp add: supp_prod)
-apply(rule fs1[OF fsa])
-apply(rule fs1[OF fsb])
-done
+  by (simp add: assms fs1 supp_prod fs_def)
+
 
 lemma fs_nprod_inst:
   assumes fsa: "fs TYPE('a) TYPE('x)"
   and     fsb: "fs TYPE('b) TYPE('x)"
   shows "fs TYPE(('a,'b) nprod) TYPE('x)"
-apply(unfold fs_def, rule allI)
-apply(case_tac x)
-apply(auto simp add: supp_nprod)
-apply(rule fs1[OF fsa])
-apply(rule fs1[OF fsb])
-done
+  unfolding fs_def by (metis assms finite_Un fs_def nprod.exhaust supp_nprod)
 
 lemma fs_list_inst:
-  assumes fs: "fs TYPE('a) TYPE('x)"
+  assumes "fs TYPE('a) TYPE('x)"
   shows "fs TYPE('a list) TYPE('x)"
-apply(simp add: fs_def, rule allI)
-apply(induct_tac x)
-apply(simp add: supp_list_nil)
-apply(simp add: supp_list_cons)
-apply(rule fs1[OF fs])
-done
+  unfolding fs_def
+  by (clarify, induct_tac x) (auto simp: fs1 assms supp_list_cons)
 
 lemma fs_option_inst:
   assumes fs: "fs TYPE('a) TYPE('x)"
   shows "fs TYPE('a option) TYPE('x)"
-apply(simp add: fs_def, rule allI)
-apply(case_tac x)
-apply(simp add: supp_none)
-apply(simp add: supp_some)
-apply(rule fs1[OF fs])
-done
+  unfolding fs_def
+  by (metis assms finite.emptyI fs1 option.exhaust supp_none supp_some)
 
 section \<open>Lemmas about the permutation properties\<close>
 (*=================================================*)
@@ -954,13 +892,10 @@
   using cp by (simp add: cp_def)
 
 lemma cp_pt_inst:
-  assumes pt: "pt TYPE('a) TYPE('x)"
-  and     at: "at TYPE('x)"
+  assumes "pt TYPE('a) TYPE('x)"
+  and     "at TYPE('x)"
   shows "cp TYPE('a) TYPE('x) TYPE('x)"
-apply(auto simp add: cp_def pt2[OF pt,symmetric])
-apply(rule pt3[OF pt])
-apply(rule at_ds8[OF at])
-done
+  using assms at_ds8 cp_def pt2 pt3 by fastforce
 
 section \<open>disjointness properties\<close>
 (*=================================*)
@@ -998,8 +933,7 @@
   fixes a::"'x"
   assumes dj: "disjoint TYPE('x) TYPE('y)"
   shows "(supp a) = ({}::'y set)"
-apply(simp add: supp_def dj_perm_forget[OF dj])
-done
+  by (simp add: supp_def dj_perm_forget[OF dj])
 
 lemma at_fresh_ineq:
   fixes a :: "'x"
@@ -1016,53 +950,35 @@
   and     ptb: "pt TYPE('b) TYPE('x)"
   and     at:  "at TYPE('x)"
   shows  "pt TYPE('a\<Rightarrow>'b) TYPE('x)"
-apply(auto simp only: pt_def)
-apply(simp_all add: perm_fun_def)
-apply(simp add: pt1[OF pta] pt1[OF ptb])
-apply(simp add: pt2[OF pta] pt2[OF ptb])
-apply(subgoal_tac "(rev pi1) \<triangleq> (rev pi2)")(*A*)
-apply(simp add: pt3[OF pta] pt3[OF ptb])
-(*A*)
-apply(simp add: at_prm_rev_eq[OF at])
-done
-
-lemma pt_bool_inst:
+  unfolding pt_def using assms
+  by (auto simp add: perm_fun_def pt1 pt2 ptb pt3 pt3_rev)
+
+lemma pt_bool_inst[simp]:
   shows  "pt TYPE(bool) TYPE('x)"
   by (simp add: pt_def perm_bool_def)
 
 lemma pt_set_inst:
   assumes pt: "pt TYPE('a) TYPE('x)"
   shows  "pt TYPE('a set) TYPE('x)"
-apply(simp add: pt_def)
-apply(simp_all add: perm_set_def)
-apply(simp add: pt1[OF pt])
-apply(force simp add: pt2[OF pt] pt3[OF pt])
-done
-
-lemma pt_unit_inst:
+  unfolding pt_def
+  by(auto simp add: perm_set_def  pt1[OF pt] pt2[OF pt] pt3[OF pt])
+
+lemma pt_unit_inst[simp]:
   shows "pt TYPE(unit) TYPE('x)"
   by (simp add: pt_def)
 
 lemma pt_prod_inst:
   assumes pta: "pt TYPE('a) TYPE('x)"
   and     ptb: "pt TYPE('b) TYPE('x)"
-  shows  "pt TYPE('a \<times> 'b) TYPE('x)"
-  apply(auto simp add: pt_def)
-  apply(rule pt1[OF pta])
-  apply(rule pt1[OF ptb])
-  apply(rule pt2[OF pta])
-  apply(rule pt2[OF ptb])
-  apply(rule pt3[OF pta],assumption)
-  apply(rule pt3[OF ptb],assumption)
-  done
+shows  "pt TYPE('a \<times> 'b) TYPE('x)"
+  using assms pt1 pt2 pt3
+  by(auto simp add: pt_def)
 
 lemma pt_list_nil: 
   fixes xs :: "'a list"
   assumes pt: "pt TYPE('a) TYPE ('x)"
   shows "([]::'x prm)\<bullet>xs = xs" 
-apply(induct_tac xs)
-apply(simp_all add: pt1[OF pt])
-done
+  by (induct xs) (simp_all add: pt1[OF pt])
 
 lemma pt_list_append: 
   fixes pi1 :: "'x prm"
@@ -1070,9 +986,7 @@
   and   xs  :: "'a list"
   assumes pt: "pt TYPE('a) TYPE ('x)"
   shows "(pi1@pi2)\<bullet>xs = pi1\<bullet>(pi2\<bullet>xs)"
-apply(induct_tac xs)
-apply(simp_all add: pt2[OF pt])
-done
+  by (induct xs) (simp_all add: pt2[OF pt])
 
 lemma pt_list_prm_eq: 
   fixes pi1 :: "'x prm"
@@ -1080,55 +994,67 @@
   and   xs  :: "'a list"
   assumes pt: "pt TYPE('a) TYPE ('x)"
   shows "pi1 \<triangleq> pi2  \<Longrightarrow> pi1\<bullet>xs = pi2\<bullet>xs"
-apply(induct_tac xs)
-apply(simp_all add: prm_eq_def pt3[OF pt])
-done
+  by (induct xs) (simp_all add: pt3[OF pt])
 
 lemma pt_list_inst:
   assumes pt: "pt TYPE('a) TYPE('x)"
   shows  "pt TYPE('a list) TYPE('x)"
-apply(auto simp only: pt_def)
-apply(rule pt_list_nil[OF pt])
-apply(rule pt_list_append[OF pt])
-apply(rule pt_list_prm_eq[OF pt],assumption)
-done
+  by (simp add: pt pt_def pt_list_append pt_list_nil pt_list_prm_eq)
 
 lemma pt_option_inst:
   assumes pta: "pt TYPE('a) TYPE('x)"
   shows  "pt TYPE('a option) TYPE('x)"
-apply(auto simp only: pt_def)
-apply(case_tac "x")
-apply(simp_all add: pt1[OF pta])
-apply(case_tac "x")
-apply(simp_all add: pt2[OF pta])
-apply(case_tac "x")
-apply(simp_all add: pt3[OF pta])
-done
+proof -
+  have "([]::('x \<times> _) list) \<bullet> x = x" for x :: "'a option"
+    by (metis assms none_eqvt not_None_eq pt1 some_eqvt)
+  moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x"
+    for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a option"
+    by (metis assms none_eqvt option.collapse pt2 some_eqvt)
+  moreover have "pi1 \<bullet> x = pi2 \<bullet> x"
+    if "pi1 \<triangleq> pi2" for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a option"
+    using that pt3[OF pta] by (metis none_eqvt not_Some_eq some_eqvt)
+  ultimately show ?thesis
+    by (auto simp add: pt_def)
+qed
 
 lemma pt_noption_inst:
   assumes pta: "pt TYPE('a) TYPE('x)"
   shows  "pt TYPE('a noption) TYPE('x)"
-apply(auto simp only: pt_def)
-apply(case_tac "x")
-apply(simp_all add: pt1[OF pta])
-apply(case_tac "x")
-apply(simp_all add: pt2[OF pta])
-apply(case_tac "x")
-apply(simp_all add: pt3[OF pta])
-done
+proof -
+  have "([]::('x \<times> _) list) \<bullet> x = x" for x :: "'a noption"
+    by (metis assms nnone_eqvt noption.exhaust nsome_eqvt pt1)
+  moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x"
+    for pi1 pi2 :: "('x \<times> 'x) list" and x :: "'a noption"
+    using pt2[OF pta]
+    by (metis nnone_eqvt noption.exhaust nsome_eqvt)
+  moreover have "pi1 \<bullet> x = pi2 \<bullet> x"
+    if "pi1 \<triangleq> pi2"
+    for pi1 pi2 :: "('x \<times> 'x) list"
+      and x :: "'a noption"
+    using that pt3[OF pta] by (metis nnone_eqvt noption.exhaust nsome_eqvt)
+  ultimately show ?thesis
+    by (auto simp add: pt_def)
+qed
 
 lemma pt_nprod_inst:
   assumes pta: "pt TYPE('a) TYPE('x)"
   and     ptb: "pt TYPE('b) TYPE('x)"
   shows  "pt TYPE(('a,'b) nprod) TYPE('x)"
-  apply(auto simp add: pt_def)
-  apply(case_tac x)
-  apply(simp add: pt1[OF pta] pt1[OF ptb])
-  apply(case_tac x)
-  apply(simp add: pt2[OF pta] pt2[OF ptb])
-  apply(case_tac x)
-  apply(simp add: pt3[OF pta] pt3[OF ptb])
-  done
+proof -
+  have "([]::('x \<times> _) list) \<bullet> x = x"
+    for x :: "('a, 'b) nprod"
+    by (metis assms(1) nprod.exhaust perm_nprod.simps pt1 ptb)
+  moreover have "(pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x"
+    for pi1 pi2 :: "('x \<times> 'x) list" and x :: "('a, 'b) nprod"
+    using pt2[OF pta] pt2[OF ptb]
+    by (metis nprod.exhaust perm_nprod.simps)
+  moreover have "pi1 \<bullet> x = pi2 \<bullet> x"
+    if "pi1 \<triangleq> pi2" for pi1 pi2 :: "('x \<times> 'x) list" and x :: "('a, 'b) nprod"
+    using that pt3[OF pta] pt3[OF ptb] by (smt (verit) nprod.exhaust perm_nprod.simps)
+  ultimately show ?thesis
+    by (auto simp add: pt_def)
+qed
+
 
 section \<open>further lemmas for permutation types\<close>
 (*==============================================*)
@@ -1236,12 +1162,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "[(a,b)]\<bullet>([(b,a)]\<bullet>x) = x"
-apply(simp add: pt2[OF pt,symmetric])
-apply(rule trans)
-apply(rule pt3[OF pt])
-apply(rule at_ds5'[OF at])
-apply(rule pt1[OF pt])
-done
+  by (metis assms at_ds5 pt_def pt_swap_bij)
 
 lemma pt_swap_bij'':
   fixes a  :: "'x"
@@ -1249,11 +1170,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "[(a,a)]\<bullet>x = x"
-apply(rule trans)
-apply(rule pt3[OF pt])
-apply(rule at_ds1[OF at])
-apply(rule pt1[OF pt])
-done
+  by (metis assms at_ds1 pt_def)
 
 lemma supp_singleton:
   shows "supp {x} = supp x"
@@ -1320,14 +1237,6 @@
   shows "(pi\<bullet>x)\<in>X"
   using a by (simp add: pt_set_bij1[OF pt, OF at])
 
-(* FIXME: is this lemma needed anywhere? *)
-lemma pt_set_bij3:
-  fixes pi :: "'x prm"
-  and   x  :: "'a"
-  and   X  :: "'a set"
-  shows "pi\<bullet>(x\<in>X) = (x\<in>X)"
-by (simp add: perm_bool)
-
 lemma pt_subseteq_eqvt:
   fixes pi :: "'x prm"
   and   Y  :: "'a set"
@@ -1351,10 +1260,13 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "pi\<bullet>{x::'a. P x} = {x. P ((rev pi)\<bullet>x)}"
-apply(auto simp add: perm_set_def pt_rev_pi[OF pt, OF at])
-apply(rule_tac x="(rev pi)\<bullet>x" in exI)
-apply(simp add: pt_pi_rev[OF pt, OF at])
-done
+proof -
+  have "\<exists>y. x = pi \<bullet> y \<and> P y"
+    if "P (rev pi \<bullet> x)" for x
+    using that by (metis at pt pt_pi_rev)
+  then show ?thesis
+    by (auto simp add: perm_set_def pt_rev_pi [OF assms])
+qed
 
 \<comment> \<open>some helper lemmas for the pt_perm_supp_ineq lemma\<close>
 lemma Collect_permI: 
@@ -1459,14 +1371,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "(pi\<bullet>((supp x)::'x set)) = supp (pi\<bullet>x)"
-apply(rule pt_perm_supp_ineq)
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+  by (rule pt_perm_supp_ineq) (auto simp: assms at_pt_inst cp_pt_inst)
 
 lemma pt_supp_finite_pi:
   fixes  pi  :: "'x prm"
@@ -1475,10 +1380,7 @@
   and     at: "at TYPE('x)"
   and     f: "finite ((supp x)::'x set)"
   shows "finite ((supp (pi\<bullet>x))::'x set)"
-apply(simp add: pt_perm_supp[OF pt, OF at, symmetric])
-apply(simp add: pt_set_finite_ineq[OF at_pt_inst[OF at], OF at])
-apply(rule f)
-done
+  by (metis at at_pt_inst f pt pt_perm_supp pt_set_finite_ineq)
 
 lemma pt_fresh_left_ineq:  
   fixes  pi :: "'x prm"
@@ -1489,10 +1391,8 @@
   and     at:  "at TYPE('x)"
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
   shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x"
-apply(simp add: fresh_def)
-apply(simp add: pt_set_bij1[OF ptb, OF at])
-apply(simp add: pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp])
-done
+  using pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp] pt_set_bij1[OF ptb, OF at]
+  by (simp add: fresh_def)
 
 lemma pt_fresh_right_ineq:  
   fixes  pi :: "'x prm"
@@ -1503,10 +1403,7 @@
   and     at:  "at TYPE('x)"
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
   shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)"
-apply(simp add: fresh_def)
-apply(simp add: pt_set_bij1[OF ptb, OF at])
-apply(simp add: pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp])
-done
+  by (simp add: assms pt_fresh_left_ineq)
 
 lemma pt_fresh_bij_ineq:
   fixes  pi :: "'x prm"
@@ -1517,9 +1414,7 @@
   and     at:  "at TYPE('x)"
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
   shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x"
-apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp])
-apply(simp add: pt_rev_pi[OF ptb, OF at])
-done
+  using assms pt_bij1 pt_fresh_right_ineq by fastforce
 
 lemma pt_fresh_left:  
   fixes  pi :: "'x prm"
@@ -1528,14 +1423,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x"
-apply(rule pt_fresh_left_ineq)
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+  by (simp add: assms at_pt_inst cp_pt_inst pt_fresh_left_ineq)
 
 lemma pt_fresh_right:  
   fixes  pi :: "'x prm"
@@ -1544,14 +1432,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)"
-apply(rule pt_fresh_right_ineq)
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+  by (simp add: assms at_pt_inst cp_pt_inst pt_fresh_right_ineq)
 
 lemma pt_fresh_bij:
   fixes  pi :: "'x prm"
@@ -1560,14 +1441,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x"
-apply(rule pt_fresh_bij_ineq)
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+  by (metis assms pt_bij1 pt_fresh_right)
 
 lemma pt_fresh_bij1:
   fixes  pi :: "'x prm"
@@ -1796,21 +1670,20 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "pi\<bullet>(\<forall>(x::'a). P x) = (\<forall>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))"
-apply(auto simp add: perm_bool perm_fun_def)
-apply(drule_tac x="pi\<bullet>x" in spec)
-apply(simp add: pt_rev_pi[OF pt, OF at])
-done
+  by (smt (verit, ccfv_threshold) assms pt_bij1 true_eqvt)
 
 lemma pt_ex_eqvt:
   fixes  pi :: "'x prm"
   and     x :: "'a"
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
-  shows "pi\<bullet>(\<exists>(x::'a). P x) = (\<exists>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))"
-apply(auto simp add: perm_bool perm_fun_def)
-apply(rule_tac x="pi\<bullet>x" in exI) 
-apply(simp add: pt_rev_pi[OF pt, OF at])
-done
+shows "pi\<bullet>(\<exists>(x::'a). P x) = (\<exists>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))"
+proof -
+  have "\<And>x. P x \<Longrightarrow> P (rev pi \<bullet> pi \<bullet> x)"
+    by (simp add: assms(1) at pt_rev_pi)
+  then show ?thesis
+    by(auto simp add: perm_bool perm_fun_def)
+qed
 
 lemma pt_ex1_eqvt:
   fixes  pi :: "'x prm"
@@ -1828,12 +1701,7 @@
   and     at: "at TYPE('x)"
   and     unique: "\<exists>!x. P x"
   shows "pi\<bullet>(THE(x::'a). P x) = (THE(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))"
-  apply(rule the1_equality [symmetric])
-  apply(simp add: pt_ex1_eqvt[OF pt at,symmetric])
-  apply(simp add: perm_bool unique)
-  apply(simp add: perm_bool pt_rev_pi [OF pt at])
-  apply(rule theI'[OF unique])
-  done
+  by (smt (verit, best) assms perm_bool_def pt_rev_pi theI_unique unique)
 
 section \<open>facts about supports\<close>
 (*==============================*)
@@ -1934,13 +1802,17 @@
   assumes  pt: "pt TYPE('a) TYPE('x)"
   and      at: "at TYPE ('x)"
   and      a: "\<forall>x\<in>X. (\<forall>(a::'x) (b::'x). a\<notin>S\<and>b\<notin>S \<longrightarrow> ([(a,b)]\<bullet>x)\<in>X)"
-  shows  "S supports X"
-using a
-apply(auto simp add: supports_def)
-apply(simp add: pt_set_bij1a[OF pt, OF at])
-apply(force simp add: pt_swap_bij[OF pt, OF at])
-apply(simp add: pt_set_bij1a[OF pt, OF at])
-done
+shows  "S supports X"
+proof -
+  have "x \<in> X"
+    if "a \<notin> S" "b \<notin> S" and "x \<in> [(a, b)] \<bullet> X" for a b x
+    using that by (metis a assms(1) at pt_pi_rev pt_set_bij1a)
+  moreover have "x \<in> [(a, b)] \<bullet> X"
+    if "a \<notin> S" "b \<notin> S" and "x \<in> X" for a b x
+    using that by (simp add: a assms(1) at pt_set_bij1a)
+  ultimately show ?thesis
+    by (meson subsetI subset_antisym supports_def)
+qed
 
 lemma supports_fresh:
   fixes S :: "'x set"
@@ -1950,10 +1822,7 @@
   and     a2: "finite S"
   and     a3: "a\<notin>S"
   shows "a\<sharp>x"
-proof (simp add: fresh_def)
-  have "(supp x)\<subseteq>S" using a1 a2 by (rule supp_is_subset)
-  thus "a\<notin>(supp x)" using a3 by force
-qed
+  by (meson assms fresh_def in_mono supp_is_subset)
 
 lemma at_fin_set_supports:
   fixes X::"'x set"
@@ -1969,12 +1838,7 @@
   assumes a1:"infinite X"
   and     a2:"\<forall>b\<in>X. P(b)"
   shows "infinite {b\<in>X. P(b)}"
-  using a1 a2 
-  apply auto
-  apply (subgoal_tac "infinite (X - {b\<in>X. P b})")
-  apply (simp add: set_diff_eq)
-  apply (simp add: Diff_infinite_finite)
-  done
+  using assms rev_finite_subset by fastforce
 
 lemma at_fin_set_supp:
   fixes X::"'x set" 
@@ -2206,32 +2070,15 @@
 proof -
   have pt_x: "pt TYPE('x) TYPE('x)" by (force intro: at_pt_inst at)
   show ?thesis
-  proof (rule equalityI)
-    show "pi\<bullet>(\<Union>x\<in>X. f x) \<subseteq> (\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x)"
-      apply(auto simp add: perm_set_def)
-      apply(rule_tac x="pi\<bullet>xb" in exI)
-      apply(rule conjI)
-      apply(rule_tac x="xb" in exI)
-      apply(simp)
-      apply(subgoal_tac "(pi\<bullet>f) (pi\<bullet>xb) = pi\<bullet>(f xb)")(*A*)
-      apply(simp)
-      apply(rule pt_set_bij2[OF pt_x, OF at])
-      apply(assumption)
-      (*A*)
-      apply(rule sym)
-      apply(rule pt_fun_app_eq[OF pt, OF at])
-      done
-  next
-    show "(\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x) \<subseteq> pi\<bullet>(\<Union>x\<in>X. f x)"
-      apply(auto simp add: perm_set_def)
-      apply(rule_tac x="(rev pi)\<bullet>x" in exI)
-      apply(rule conjI)
-      apply(simp add: pt_pi_rev[OF pt_x, OF at])
-      apply(rule_tac x="xb" in bexI)
-      apply(simp add: pt_set_bij1[OF pt_x, OF at])
-      apply(simp add: pt_fun_app_eq[OF pt, OF at])
-      apply(assumption)
-      done
+  proof -
+    have "\<exists>x. (\<exists>u. x = pi \<bullet> u \<and> u \<in> X) \<and> pi \<bullet> z \<in> (pi \<bullet> f) x"
+      if "y \<in> X" and "z \<in> f y" for y z
+      using that by (metis assms at_pt_inst pt_fun_app_eq pt_set_bij)
+    moreover have "\<exists>u. x = pi \<bullet> u \<and> (\<exists>x\<in>X. u \<in> f x)"
+      if "x \<in> (pi \<bullet> f) (pi \<bullet> y)" and "y \<in> X" for x y
+      using that by (metis at at_pi_rev pt pt_fun_app_eq pt_set_bij1a pt_x)
+    ultimately show ?thesis
+      by (auto simp: perm_set_def)
   qed
 qed
 
@@ -2241,34 +2088,14 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "pi\<bullet>(X_to_Un_supp X) = ((X_to_Un_supp (pi\<bullet>X))::'x set)"
-  apply(simp add: X_to_Un_supp_def)
-  apply(simp add: UNION_f_eqvt[OF pt, OF at] perm_fun_def)
-  apply(simp add: pt_perm_supp[OF pt, OF at])
-  apply(simp add: pt_pi_rev[OF pt, OF at])
-  done
+  by (metis UNION_f_eqvt X_to_Un_supp_def assms pt_fun_eq pt_perm_supp)
 
 lemma Union_supports_set:
   fixes X::"('a set)"
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "(\<Union>x\<in>X. ((supp x)::'x set)) supports X"
-  apply(simp add: supports_def fresh_def[symmetric])
-  apply(rule allI)+
-  apply(rule impI)
-  apply(erule conjE)
-  apply(simp add: perm_set_def)
-  apply(auto)
-  apply(subgoal_tac "[(a,b)]\<bullet>xa = xa")(*A*)
-  apply(simp)
-  apply(rule pt_fresh_fresh[OF pt, OF at])
-  apply(force)
-  apply(force)
-  apply(rule_tac x="x" in exI)
-  apply(simp)
-  apply(rule sym)
-  apply(rule pt_fresh_fresh[OF pt, OF at])
-  apply(force)+
-  done
+  by (simp add: assms fresh_def pt_fresh_fresh supports_set)
 
 lemma Union_of_fin_supp_sets:
   fixes X::"('a set)"
@@ -2286,19 +2113,14 @@
   shows "(\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> supp X"
 proof -
   have "supp ((X_to_Un_supp X)::'x set) \<subseteq> ((supp X)::'x set)"  
-    apply(rule pt_empty_supp_fun_subset)
-    apply(force intro: pt_set_inst at_pt_inst pt at)+
-    apply(rule pt_eqvt_fun2b)
-    apply(force intro: pt_set_inst at_pt_inst pt at)+
-    apply(rule allI)+
-    apply(rule X_to_Un_supp_eqvt[OF pt, OF at])
-    done
+  proof (rule pt_empty_supp_fun_subset)
+    show "supp (\<lambda>a. X_to_Un_supp (a::'a set)::'x set) = ({}::'x set)"
+    by (simp add: X_to_Un_supp_eqvt at at_pt_inst pt pt_eqvt_fun2b pt_set_inst)
+  qed (use assms at_pt_inst pt_set_inst in auto)
   hence "supp (\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> ((supp X)::'x set)" by (simp add: X_to_Un_supp_def)
   moreover
   have "supp (\<Union>x\<in>X. ((supp x)::'x set)) = (\<Union>x\<in>X. ((supp x)::'x set))"
-    apply(rule at_fin_set_supp[OF at])
-    apply(rule Union_of_fin_supp_sets[OF fs, OF fi])
-    done
+    using Union_of_fin_supp_sets at at_fin_set_supp fi fs by auto
   ultimately show ?thesis by force
 qed
 
@@ -2309,12 +2131,15 @@
   and     fs: "fs TYPE('a) TYPE('x)" 
   and     fi: "finite X"
   shows "(supp X) = (\<Union>x\<in>X. ((supp x)::'x set))"
-apply(rule equalityI)
-apply(rule supp_is_subset)
-apply(rule Union_supports_set[OF pt, OF at])
-apply(rule Union_of_fin_supp_sets[OF fs, OF fi])
-apply(rule Union_included_in_supp[OF pt, OF at, OF fs, OF fi])
-done
+proof (rule equalityI)
+  have "finite (\<Union> (supp ` X)::'x set)"
+    using Union_of_fin_supp_sets fi fs by blast
+  then show "(supp X::'x set) \<subseteq> \<Union> (supp ` X)"
+    by (metis Union_supports_set at pt supp_is_subset)
+next
+  show "(\<Union>x\<in>X. (supp x::'x set)) \<subseteq> supp X"
+    by (simp add: Union_included_in_supp at fi fs pt)
+qed
 
 lemma supp_fin_union:
   fixes X::"('a set)"
@@ -2353,9 +2178,7 @@
   and     f1: "finite X"
   and     f2: "finite Y"
   shows "a\<sharp>(X\<union>Y) = (a\<sharp>X \<and> a\<sharp>Y)"
-apply(simp add: fresh_def)
-apply(simp add: supp_fin_union[OF pt, OF at, OF fs, OF f1, OF f2])
-done
+  by (simp add: assms fresh_def supp_fin_union)
 
 lemma fresh_fin_insert:
   fixes X::"('a set)"
@@ -2366,9 +2189,7 @@
   and     fs: "fs TYPE('a) TYPE('x)" 
   and     f:  "finite X"
   shows "a\<sharp>(insert x X) = (a\<sharp>x \<and> a\<sharp>X)"
-apply(simp add: fresh_def)
-apply(simp add: supp_fin_insert[OF pt, OF at, OF fs, OF f])
-done
+  by (simp add: assms fresh_def supp_fin_insert)
 
 lemma fresh_fin_insert1:
   fixes X::"('a set)"
@@ -2447,11 +2268,11 @@
 
 lemma fresh_star_Un_elim:
   "((S \<union> T) \<sharp>* c \<Longrightarrow> PROP C) \<equiv> (S \<sharp>* c \<Longrightarrow> T \<sharp>* c \<Longrightarrow> PROP C)"
-  apply rule
-  apply (simp_all add: fresh_star_def)
-  apply (erule meta_mp)
-  apply blast
-  done
+proof
+  assume \<section>: "(S \<union> T) \<sharp>* c \<Longrightarrow> PROP C" and c: "S \<sharp>* c" "T \<sharp>* c"
+  show "PROP C"
+    using c by (intro \<section>) (metis Un_iff fresh_star_set)
+qed (auto simp: fresh_star_def)
 
 lemma fresh_star_insert_elim:
   "(insert x S \<sharp>* c \<Longrightarrow> PROP C) \<equiv> (x \<sharp> c \<Longrightarrow> S \<sharp>* c \<Longrightarrow> PROP C)"
@@ -2485,22 +2306,22 @@
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
   shows "(pi\<bullet>a)\<sharp>*(pi\<bullet>x) = a\<sharp>*x"
   and   "(pi\<bullet>b)\<sharp>*(pi\<bullet>x) = b\<sharp>*x"
-apply(unfold fresh_star_def)
-apply(auto)
-apply(drule_tac x="pi\<bullet>xa" in bspec)
-apply(erule pt_set_bij2[OF ptb, OF at])
-apply(simp add: fresh_star_def pt_fresh_bij_ineq[OF pta, OF ptb, OF at, OF cp])
-apply(drule_tac x="(rev pi)\<bullet>xa" in bspec)
-apply(simp add: pt_set_bij1[OF ptb, OF at])
-apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp])
-apply(drule_tac x="pi\<bullet>xa" in bspec)
-apply(simp add: pt_set_bij1[OF ptb, OF at])
-apply(simp add: set_eqvt pt_rev_pi[OF pt_list_inst[OF ptb], OF at])
-apply(simp add: pt_fresh_bij_ineq[OF pta, OF ptb, OF at, OF cp])
-apply(drule_tac x="(rev pi)\<bullet>xa" in bspec)
-apply(simp add: pt_set_bij1[OF ptb, OF at] set_eqvt)
-apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp])
-done
+  unfolding fresh_star_def
+proof -
+  have "y \<sharp> x" if "\<forall>z\<in>pi \<bullet> a. z \<sharp> pi \<bullet> x" and "y \<in> a" for y
+    using that by (meson assms at pt_fresh_bij_ineq pt_set_bij2)
+  moreover have "y \<sharp> pi \<bullet> x" if "\<forall>z\<in>a. z \<sharp> x" and "y \<in> pi \<bullet> a" for y
+    using that by (simp add: assms pt_fresh_left_ineq pt_set_bij1a)
+  moreover have "y \<sharp> x"
+    if "\<forall>z\<in>set (pi \<bullet> b). z \<sharp> pi \<bullet> x" and "y \<in> set b" for y
+    using that by (metis at cp pt_fresh_bij_ineq pt_set_bij pta ptb set_eqvt)
+  moreover have "y \<sharp> pi \<bullet> x"
+    if "\<forall>z\<in>set b. z \<sharp> x" and "y \<in> set (pi \<bullet> b)" for y
+    using that by (metis at cp pt_fresh_left_ineq pt_set_bij1a pta ptb set_eqvt)
+  ultimately show "(\<forall>xa\<in>pi \<bullet> a. xa \<sharp> pi \<bullet> x) = (\<forall>xa\<in>a. xa \<sharp> x)" "(\<forall>xa\<in>set (pi \<bullet> b). xa \<sharp> pi \<bullet> x) = (\<forall>xa\<in>set b. xa \<sharp> x)"
+    by blast+
+qed
+
 
 lemma pt_fresh_star_bij:
   fixes  pi :: "'x prm"
@@ -2511,21 +2332,10 @@
   and     at: "at TYPE('x)"
   shows "(pi\<bullet>a)\<sharp>*(pi\<bullet>x) = a\<sharp>*x"
   and   "(pi\<bullet>b)\<sharp>*(pi\<bullet>x) = b\<sharp>*x"
-apply(rule pt_fresh_star_bij_ineq(1))
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-apply(rule pt_fresh_star_bij_ineq(2))
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+proof (rule pt_fresh_star_bij_ineq)
+  show "(pi \<bullet> b) \<sharp>* (pi \<bullet> x) = b \<sharp>* x"
+  by (simp add: at at_pt_inst cp_pt_inst pt pt_fresh_star_bij_ineq)
+qed (auto simp: at pt at_pt_inst cp_pt_inst)
 
 lemma pt_fresh_star_eqvt:
   fixes  pi :: "'x prm"
@@ -2582,16 +2392,9 @@
   shows "pi\<bullet>x = x"
 using a
 apply(induct pi)
+  apply (simp add: assms(1) pt1)
 apply(auto simp add: fresh_star_def fresh_list_cons fresh_prod pt1[OF pt])
-apply(subgoal_tac "((a,b)#pi)\<bullet>x = ([(a,b)]@pi)\<bullet>x")
-apply(simp only: pt2[OF pt])
-apply(rule pt_fresh_fresh[OF pt at])
-apply(simp add: fresh_def at_supp[OF at])
-apply(blast)
-apply(simp add: fresh_def at_supp[OF at])
-apply(blast)
-apply(simp add: pt2[OF pt])
-done
+  by (metis Cons_eq_append_conv append_self_conv2 assms(1) at at_fresh fresh_def pt2 pt_fresh_fresh)
 
 section \<open>Infrastructure lemmas for strong rule inductions\<close>
 (*==========================================================*)
@@ -2685,63 +2488,43 @@
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
   shows "cp TYPE ('a list) TYPE('x) TYPE('y)"
 using c1
-apply(simp add: cp_def)
-apply(auto)
-apply(induct_tac x)
-apply(auto)
-done
+apply(clarsimp simp add: cp_def)
+  by (induct_tac x) auto
 
 lemma cp_set_inst:
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
   shows "cp TYPE ('a set) TYPE('x) TYPE('y)"
-using c1
-apply(simp add: cp_def)
-apply(auto)
-apply(auto simp add: perm_set_def)
-apply(rule_tac x="pi2\<bullet>xc" in exI)
-apply(auto)
-done
+  using c1
+  unfolding cp_def perm_set_def
+  by (smt (verit) Collect_cong mem_Collect_eq)
+
 
 lemma cp_option_inst:
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
   shows "cp TYPE ('a option) TYPE('x) TYPE('y)"
-using c1
-apply(simp add: cp_def)
-apply(auto)
-apply(case_tac x)
-apply(auto)
-done
+  using c1 unfolding cp_def by (metis none_eqvt not_None_eq some_eqvt)
 
 lemma cp_noption_inst:
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
   shows "cp TYPE ('a noption) TYPE('x) TYPE('y)"
-using c1
-apply(simp add: cp_def)
-apply(auto)
-apply(case_tac x)
-apply(auto)
-done
+  using c1 unfolding cp_def
+  by (metis nnone_eqvt noption.exhaust nsome_eqvt)
 
 lemma cp_unit_inst:
   shows "cp TYPE (unit) TYPE('x) TYPE('y)"
-apply(simp add: cp_def)
-done
+  by (simp add: cp_def)
 
 lemma cp_bool_inst:
   shows "cp TYPE (bool) TYPE('x) TYPE('y)"
-apply(simp add: cp_def)
-apply(rule allI)+
-apply(induct_tac x)
-apply(simp_all)
-done
+  apply(clarsimp simp add: cp_def)
+  by (induct_tac x) auto
 
 lemma cp_prod_inst:
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
   and     c2: "cp TYPE ('b) TYPE('x) TYPE('y)"
   shows "cp TYPE ('a\<times>'b) TYPE('x) TYPE('y)"
 using c1 c2
-apply(simp add: cp_def)
-done
+  by (simp add: cp_def)
 
 lemma cp_fun_inst:
   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
@@ -2749,11 +2532,8 @@
   and     pt: "pt TYPE ('y) TYPE('x)"
   and     at: "at TYPE ('x)"
   shows "cp TYPE ('a\<Rightarrow>'b) TYPE('x) TYPE('y)"
-using c1 c2
-apply(auto simp add: cp_def perm_fun_def fun_eq_iff)
-apply(simp add: rev_eqvt[symmetric])
-apply(simp add: pt_rev_pi[OF pt_list_inst[OF pt_prod_inst[OF pt, OF pt]], OF at])
-done
+  using c1 c2
+  by(auto simp add: cp_def perm_fun_def fun_eq_iff at pt pt_list_inst pt_prod_inst pt_rev_pi rev_eqvt)
 
 
 section \<open>Andy's freshness lemma\<close>
@@ -2856,9 +2636,7 @@
   and     f1: "finite ((supp h)::'x set)"
   and     a: "a\<sharp>h" "a\<sharp>h a"
   shows "(fresh_fun h) = (h a)"
-apply(rule fresh_fun_app[OF pt, OF at, OF f1])
-apply(auto simp add: fresh_prod intro: a)
-done
+  by (meson assms fresh_fun_app fresh_prod pt)
 
 lemma fresh_fun_equiv_ineq:
   fixes h :: "'y\<Rightarrow>'a"
@@ -2938,11 +2716,7 @@
   and     f1: "finite ((supp h)::'x set)"
   and     a: "\<exists>(a::'x). a\<sharp>(h,h a)"
   shows "((supp h)::'x set) supports (fresh_fun h)"
-  apply(simp add: supports_def fresh_def[symmetric])
-  apply(auto)
-  apply(simp add: fresh_fun_equiv[OF pt, OF at, OF f1, OF a])
-  apply(simp add: pt_fresh_fresh[OF pt_fun_inst[OF at_pt_inst[OF at], OF pt], OF at, OF at])
-  done
+  by(simp flip: fresh_def add: supports_def assms at_pt_inst fresh_fun_equiv pt_fresh_fresh pt_fun_inst)
   
 section \<open>Abstraction function\<close>
 (*==============================*)
@@ -2951,7 +2725,7 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "pt TYPE('x\<Rightarrow>('a noption)) TYPE('x)"
-  by (rule pt_fun_inst[OF at_pt_inst[OF at],OF pt_noption_inst[OF pt],OF at])
+  by (simp add: at at_pt_inst pt pt_fun_inst pt_noption_inst)
 
 definition abs_fun :: "'x\<Rightarrow>'a\<Rightarrow>('x\<Rightarrow>('a noption))" (\<open>[_]._\<close> [100,100] 100) where 
   "[a].x \<equiv> (\<lambda>b. (if b=a then nSome(x) else (if b\<sharp>x then nSome([(a,b)]\<bullet>x) else nNone)))"
@@ -2973,26 +2747,22 @@
   and     ptb: "pt TYPE('y) TYPE('x)"
   and     at:  "at TYPE('x)"
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
-  shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)"
-  apply(simp add: abs_fun_def perm_fun_def abs_fun_if)
-  apply(simp only: fun_eq_iff)
-  apply(rule allI)
-  apply(subgoal_tac "(((rev pi)\<bullet>(xa::'y)) = (a::'y)) = (xa = pi\<bullet>a)")(*A*)
-  apply(subgoal_tac "(((rev pi)\<bullet>xa)\<sharp>x) = (xa\<sharp>(pi\<bullet>x))")(*B*)
-  apply(subgoal_tac "pi\<bullet>([(a,(rev pi)\<bullet>xa)]\<bullet>x) = [(pi\<bullet>a,xa)]\<bullet>(pi\<bullet>x)")(*C*)
-  apply(simp)
-(*C*)
-  apply(simp add: cp1[OF cp])
-  apply(simp add: pt_pi_rev[OF ptb, OF at])
-(*B*)
-  apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp])
-(*A*)
-  apply(rule iffI)
-  apply(rule pt_bij2[OF ptb, OF at, THEN sym])
-  apply(simp)
-  apply(rule pt_bij2[OF ptb, OF at])
-  apply(simp)
-done
+shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)"
+  unfolding fun_eq_iff
+proof
+  fix y
+  have "(((rev pi)\<bullet>y) = a) = (y = pi\<bullet>a)"
+    by (metis at pt_rev_pi ptb)
+  moreover
+  have "(((rev pi)\<bullet>y)\<sharp>x) = (y\<sharp>(pi\<bullet>x))"
+    by (simp add: assms pt_fresh_left_ineq)
+  moreover
+  have "pi\<bullet>([(a,(rev pi)\<bullet>y)]\<bullet>x) = [(pi\<bullet>a,y)]\<bullet>(pi\<bullet>x)"
+    using assms cp1[OF cp] by (simp add: pt_pi_rev)
+  ultimately
+  show "(pi \<bullet> [a].x) y = ([(pi \<bullet> a)].(pi \<bullet> x)) y"
+    by (simp add: abs_fun_def perm_fun_def)
+qed
 
 lemma abs_fun_pi:
   fixes a  :: "'x"
@@ -3001,25 +2771,14 @@
   assumes pt: "pt TYPE('a) TYPE('x)"
   and     at: "at TYPE('x)"
   shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)"
-apply(rule abs_fun_pi_ineq)
-apply(rule pt)
-apply(rule at_pt_inst)
-apply(rule at)+
-apply(rule cp_pt_inst)
-apply(rule pt)
-apply(rule at)
-done
+  by (simp add: abs_fun_pi_ineq at at_pt_inst cp_pt_inst pt)
 
 lemma abs_fun_eq1: 
   fixes x  :: "'a"
   and   y  :: "'a"
   and   a  :: "'x"
   shows "([a].x = [a].y) = (x = y)"
-apply(auto simp add: abs_fun_def)
-apply(auto simp add: fun_eq_iff)
-apply(drule_tac x="a" in spec)
-apply(simp)
-done
+  by (metis abs_fun_def noption.inject)
 
 lemma abs_fun_eq2:
   fixes x  :: "'a"
@@ -3210,10 +2969,7 @@
       and as: "[a].x = [b].y"
       and fr: "c\<noteq>a" "c\<noteq>b" "c\<sharp>x" "c\<sharp>y" 
   shows "x = [(a,c)]\<bullet>[(b,c)]\<bullet>y"
-using as fr
-apply(drule_tac sym)
-apply(simp add: abs_fun_fresh[OF pt, OF at] pt_swap_bij[OF pt, OF at])
-done
+  using assms by (metis abs_fun_fresh pt_swap_bij)
 
 lemma abs_fun_supp_approx:
   fixes x :: "'a"
@@ -3359,12 +3115,10 @@
   and     at:  "at TYPE('x)"
   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
   and     dj:  "disjoint TYPE('y) TYPE('x)"
-  shows "((supp ([a].x))::'x set) = (supp x)"
-apply(auto simp add: supp_def)
-apply(auto simp add: abs_fun_pi_ineq[OF pta, OF ptb, OF at, OF cp])
-apply(auto simp add: dj_perm_forget[OF dj])
-apply(auto simp add: abs_fun_eq1) 
-done
+shows "((supp ([a].x))::'x set) = (supp x)"
+unfolding supp_def
+  using abs_fun_pi_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj]
+  by (smt (verit, ccfv_threshold) Collect_cong abs_fun_eq1)
 
 lemma fresh_abs_fun_iff_ineq: 
   fixes a :: "'y"
@@ -3453,27 +3207,17 @@
   have pt_prm: "pt TYPE('x prm) TYPE('x)" 
     by (rule pt_list_inst[OF pt_prod_inst[OF pt, OF pt]])  
   from a show ?thesis
-    apply -
-    apply(auto simp add: prm_eq_def)
-    apply(rule_tac pi="rev pi3" in pt_bij4[OF pt, OF at])
-    apply(rule trans)
-    apply(rule pt_perm_compose[OF pt, OF at])
-    apply(simp add: pt_rev_pi[OF pt_prm, OF at])
-    apply(rule sym)
-    apply(rule trans)
-    apply(rule pt_perm_compose[OF pt, OF at])
-    apply(simp add: pt_rev_pi[OF pt_prm, OF at])
-    done
+    by (auto simp add: prm_eq_def at pt pt_perm_compose')
 qed
 
 (************************)
 (* Various eqvt-lemmas  *)
 
-lemma Zero_nat_eqvt:
+lemma Zero_nat_eqvt[simp]:
   shows "pi\<bullet>(0::nat) = 0" 
 by (auto simp add: perm_nat_def)
 
-lemma One_nat_eqvt:
+lemma One_nat_eqvt[simp]:
   shows "pi\<bullet>(1::nat) = 1"
 by (simp add: perm_nat_def)
 
@@ -3515,41 +3259,41 @@
   shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" 
 by (simp add:perm_nat_def) 
 
-lemma Zero_int_eqvt:
+lemma Zero_int_eqvt[simp]:
   shows "pi\<bullet>(0::int) = 0" 
 by (auto simp add: perm_int_def)
 
-lemma One_int_eqvt:
+lemma One_int_eqvt[simp]:
   shows "pi\<bullet>(1::int) = 1"
 by (simp add: perm_int_def)
 
-lemma numeral_int_eqvt: 
- shows "pi\<bullet>((numeral n)::int) = numeral n" 
-by (simp add: perm_int_def perm_int_def)
-
-lemma neg_numeral_int_eqvt:
- shows "pi\<bullet>((- numeral n)::int) = - numeral n"
-by (simp add: perm_int_def perm_int_def)
+lemma numeral_int_eqvt[simp]: 
+ shows "pi\<bullet>((numeral n)::int) = numeral n"
+  using perm_int_def by blast 
+
+lemma neg_numeral_int_eqvt[simp]:
+  shows "pi\<bullet>((- numeral n)::int) = - numeral n"
+  by (simp add: perm_int_def)
 
 lemma max_int_eqvt:
   fixes x::"int"
   shows "pi\<bullet>(max (x::int) y) = max (pi\<bullet>x) (pi\<bullet>y)" 
-by (simp add:perm_int_def) 
+  by (simp add:perm_int_def) 
 
 lemma min_int_eqvt:
   fixes x::"int"
   shows "pi\<bullet>(min x y) = min (pi\<bullet>x) (pi\<bullet>y)" 
-by (simp add:perm_int_def) 
+  by (simp add:perm_int_def) 
 
 lemma plus_int_eqvt:
   fixes x::"int"
   shows "pi\<bullet>(x + y) = (pi\<bullet>x) + (pi\<bullet>y)" 
-by (simp add:perm_int_def) 
+  by (simp add:perm_int_def) 
 
 lemma minus_int_eqvt:
   fixes x::"int"
   shows "pi\<bullet>(x - y) = (pi\<bullet>x) - (pi\<bullet>y)" 
-by (simp add:perm_int_def) 
+  by (simp add:perm_int_def) 
 
 lemma mult_int_eqvt:
   fixes x::"int"
@@ -3559,7 +3303,7 @@
 lemma div_int_eqvt:
   fixes x::"int"
   shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" 
-by (simp add:perm_int_def) 
+  by (simp add:perm_int_def) 
 
 (*******************************************************)
 (* Setup of the theorem attributes eqvt and eqvt_force *)
--- a/src/HOL/NthRoot.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/NthRoot.thy	Thu May 23 20:22:52 2024 +0200
@@ -745,7 +745,7 @@
       also have "\<dots> = n"
         using \<open>2 < n\<close> by (simp add: x_def)
       finally have "real (n - 1) * (real n / 2 * (x n)\<^sup>2) \<le> real (n - 1) * 1"
-        by simp
+        using that by auto
       then have "(x n)\<^sup>2 \<le> 2 / real n"
         using \<open>2 < n\<close> unfolding mult_le_cancel_left by (simp add: field_simps)
       from real_sqrt_le_mono[OF this] show ?thesis
--- a/src/HOL/Number_Theory/Quadratic_Reciprocity.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Number_Theory/Quadratic_Reciprocity.thy	Thu May 23 20:22:52 2024 +0200
@@ -185,24 +185,14 @@
 proof -
   obtain y k1 k2 where yk: "y = nat (fst res) + k1 * p" "y = nat (snd res) + k2 * q"
     using chinese_remainder[of p q] pq_coprime p_ge_0 q_ge_0 by fastforce
-  have "fst res = int (y - k1 * p)"
-    using \<open>0 \<le> fst res\<close> yk(1) by simp
-  moreover have "snd res = int (y - k2 * q)"
-    using \<open>0 \<le> snd res\<close> yk(2) by simp
-  ultimately have res: "res = (int (y - k1 * p), int (y - k2 * q))"
-    by (simp add: prod_eq_iff)
-  have y: "k1 * p \<le> y" "k2 * q \<le> y"
-    using yk by simp_all
-  from y have *: "[y = nat (fst res)] (mod p)" "[y = nat (snd res)] (mod q)"
-    by (auto simp add: res cong_le_nat intro: exI [of _ k1] exI [of _ k2])
-  from * have "(y mod (int p * int q)) mod int p = fst res" "(y mod (int p * int q)) mod int q = snd res"
-    using y apply (auto simp add: res of_nat_mult [symmetric] of_nat_mod [symmetric] mod_mod_cancel simp del: of_nat_mult)
-     apply (metis \<open>fst res = int (y - k1 * p)\<close> assms(1) assms(2) cong_def mod_pos_pos_trivial nat_int of_nat_mod)
-    apply (metis \<open>snd res = int (y - k2 * q)\<close> assms(3) assms(4) cong_def mod_pos_pos_trivial nat_int of_nat_mod)
-    done
-  then obtain x where "P_1 res x"
+  have "(y mod (int p * int q)) mod int p = fst res"
+    using assms by (simp add: mod_mod_cancel yk(1))
+  moreover have "(y mod (int p * int q)) mod int q = snd res"
+    using assms by (simp add: mod_mod_cancel yk(2))
+  ultimately obtain x where "P_1 res x"
     unfolding P_1_def
-    using Divides.pos_mod_bound Divides.pos_mod_sign pq_ge_0 by fastforce
+    using Divides.pos_mod_bound Divides.pos_mod_sign pq_ge_0
+    by (metis atLeastAtMost_iff zle_diff1_eq)
   moreover have "a = b" if "P_1 res a" "P_1 res b" for a b
   proof -
     from that have "int p * int q dvd a - b"
--- a/src/HOL/Probability/Sinc_Integral.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Probability/Sinc_Integral.thy	Thu May 23 20:22:52 2024 +0200
@@ -182,9 +182,10 @@
   have *: "interval_lebesgue_integrable lborel (ereal 0) (ereal T) (\<lambda>t. \<theta> * sinc (t * \<theta>))"
     by (intro interval_lebesgue_integrable_mult_right interval_integrable_isCont continuous_within_compose3 [OF isCont_sinc])
        auto
-  show ?thesis
-    by (rule interval_lebesgue_integrable_cong_AE[THEN iffD1, OF _ _ _ *])
-       (insert AE_lborel_singleton[of 0], auto)
+  have "0 \<notin> einterval (min (ereal 0) (ereal T)) (max (ereal 0) (ereal T))"
+    by (smt (verit, best) einterval_iff max_def min_def_raw order_less_le)
+  then show ?thesis
+    by (intro interval_lebesgue_integrable_cong_AE[THEN iffD1, OF _ _ _ *]) auto
 qed
 
 (* TODO: need a better version of FTC2 *)
--- a/src/HOL/Random.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Random.thy	Thu May 23 20:22:52 2024 +0200
@@ -84,7 +84,9 @@
 
 lemma pick_drop_zero:
   "pick (filter (\<lambda>(k, _). k > 0) xs) = pick xs"
-  by (induct xs) (auto simp add: fun_eq_iff less_natural_def minus_natural_def)
+  apply (induct xs) 
+  apply (auto  simp: fun_eq_iff less_natural.rep_eq split: prod.split)
+  by (metis diff_zero of_nat_0 of_nat_of_natural)
 
 lemma pick_same:
   "l < length xs \<Longrightarrow> Random.pick (map (Pair 1) xs) (natural_of_nat l) = nth xs l"
--- a/src/HOL/Real_Asymp/Multiseries_Expansion.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Real_Asymp/Multiseries_Expansion.thy	Thu May 23 20:22:52 2024 +0200
@@ -4219,14 +4219,17 @@
   hence "eventually (\<lambda>x. ?h x = g x - c * ln (b x) - 
            eval (C - const_expansion c * L) x * b x powr e) at_top" 
     (is "eventually (\<lambda>x. _ = ?h x) _") using assms(2)
-    by (auto simp: expands_to.simps scale_ms_def elim: eventually_elim2)
-  ultimately have **: "is_expansion_aux xs ?h (b # basis)" by (rule is_expansion_aux_cong)
+    apply (simp add: expands_to.simps scale_ms_def)
+    by (smt (verit) eventually_cong)
+  ultimately have **: "is_expansion_aux xs ?h (b # basis)" 
+    by (rule is_expansion_aux_cong)
   from assms(1,4) have "ms_exp_gt 0 (ms_aux_hd_exp xs)" "is_expansion C basis"
     by (auto simp: expands_to.simps elim!: is_expansion_aux_MSLCons)
   moreover from assms(1) have "length basis = expansion_level TYPE('a)"
     by (auto simp: expands_to.simps dest: is_expansion_aux_expansion_level)
   ultimately have "is_expansion_aux (MSLCons (C - scale_ms c L, e) xs) 
-                     (\<lambda>x. g x - c * ln (b x)) (b # basis)" using assms unfolding scale_ms_def
+                     (\<lambda>x. g x - c * ln (b x)) (b # basis)" 
+    using assms unfolding scale_ms_def
     by (intro is_expansion_aux.intros is_expansion_minus is_expansion_mult is_expansion_const * **)
        (simp_all add: basis_wf_Cons expands_to.simps)
   with assms(1) show ?thesis by (auto simp: expands_to.simps)
--- a/src/HOL/Transcendental.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/Transcendental.thy	Thu May 23 20:22:52 2024 +0200
@@ -71,147 +71,6 @@
     using z \<open>0 \<le> x\<close> by (auto intro!: summable_comparison_test[OF _  summable_geometric])
 qed
 
-subsection \<open>More facts about binomial coefficients\<close>
-
-text \<open>
-  These facts could have been proven before, but having real numbers
-  makes the proofs a lot easier.
-\<close>
-
-lemma central_binomial_odd:
-  "odd n \<Longrightarrow> n choose (Suc (n div 2)) = n choose (n div 2)"
-proof -
-  assume "odd n"
-  hence "Suc (n div 2) \<le> n" by presburger
-  hence "n choose (Suc (n div 2)) = n choose (n - Suc (n div 2))"
-    by (rule binomial_symmetric)
-  also from \<open>odd n\<close> have "n - Suc (n div 2) = n div 2" by presburger
-  finally show ?thesis .
-qed
-
-lemma binomial_less_binomial_Suc:
-  assumes k: "k < n div 2"
-  shows   "n choose k < n choose (Suc k)"
-proof -
-  from k have k': "k \<le> n" "Suc k \<le> n" by simp_all
-  from k' have "real (n choose k) = fact n / (fact k * fact (n - k))"
-    by (simp add: binomial_fact)
-  also from k' have "n - k = Suc (n - Suc k)" by simp
-  also from k' have "fact \<dots> = (real n - real k) * fact (n - Suc k)"
-    by (subst fact_Suc) (simp_all add: of_nat_diff)
-  also from k have "fact k = fact (Suc k) / (real k + 1)" by (simp add: field_simps)
-  also have "fact n / (fact (Suc k) / (real k + 1) * ((real n - real k) * fact (n - Suc k))) =
-               (n choose (Suc k)) * ((real k + 1) / (real n - real k))"
-    using k by (simp add: field_split_simps binomial_fact)
-  also from assms have "(real k + 1) / (real n - real k) < 1" by simp
-  finally show ?thesis using k by (simp add: mult_less_cancel_left)
-qed
-
-lemma binomial_strict_mono:
-  assumes "k < k'" "2*k' \<le> n"
-  shows   "n choose k < n choose k'"
-proof -
-  from assms have "k \<le> k' - 1" by simp
-  thus ?thesis
-  proof (induction rule: inc_induct)
-    case base
-    with assms binomial_less_binomial_Suc[of "k' - 1" n]
-      show ?case by simp
-  next
-    case (step k)
-    from step.prems step.hyps assms have "n choose k < n choose (Suc k)"
-      by (intro binomial_less_binomial_Suc) simp_all
-    also have "\<dots> < n choose k'" by (rule step.IH)
-    finally show ?case .
-  qed
-qed
-
-lemma binomial_mono:
-  assumes "k \<le> k'" "2*k' \<le> n"
-  shows   "n choose k \<le> n choose k'"
-  using assms binomial_strict_mono[of k k' n] by (cases "k = k'") simp_all
-
-lemma binomial_strict_antimono:
-  assumes "k < k'" "2 * k \<ge> n" "k' \<le> n"
-  shows   "n choose k > n choose k'"
-proof -
-  from assms have "n choose (n - k) > n choose (n - k')"
-    by (intro binomial_strict_mono) (simp_all add: algebra_simps)
-  with assms show ?thesis by (simp add: binomial_symmetric [symmetric])
-qed
-
-lemma binomial_antimono:
-  assumes "k \<le> k'" "k \<ge> n div 2" "k' \<le> n"
-  shows   "n choose k \<ge> n choose k'"
-proof (cases "k = k'")
-  case False
-  note not_eq = False
-  show ?thesis
-  proof (cases "k = n div 2 \<and> odd n")
-    case False
-    with assms(2) have "2*k \<ge> n" by presburger
-    with not_eq assms binomial_strict_antimono[of k k' n]
-      show ?thesis by simp
-  next
-    case True
-    have "n choose k' \<le> n choose (Suc (n div 2))"
-    proof (cases "k' = Suc (n div 2)")
-      case False
-      with assms True not_eq have "Suc (n div 2) < k'" by simp
-      with assms binomial_strict_antimono[of "Suc (n div 2)" k' n] True
-        show ?thesis by auto
-    qed simp_all
-    also from True have "\<dots> = n choose k" by (simp add: central_binomial_odd)
-    finally show ?thesis .
-  qed
-qed simp_all
-
-lemma binomial_maximum: "n choose k \<le> n choose (n div 2)"
-proof -
-  have "k \<le> n div 2 \<longleftrightarrow> 2*k \<le> n" by linarith
-  consider "2*k \<le> n" | "2*k \<ge> n" "k \<le> n" | "k > n" by linarith
-  thus ?thesis
-  proof cases
-    case 1
-    thus ?thesis by (intro binomial_mono) linarith+
-  next
-    case 2
-    thus ?thesis by (intro binomial_antimono) simp_all
-  qed (simp_all add: binomial_eq_0)
-qed
-
-lemma binomial_maximum': "(2*n) choose k \<le> (2*n) choose n"
-  using binomial_maximum[of "2*n"] by simp
-
-lemma central_binomial_lower_bound:
-  assumes "n > 0"
-  shows   "4^n / (2*real n) \<le> real ((2*n) choose n)"
-proof -
-  from binomial[of 1 1 "2*n"]
-    have "4 ^ n = (\<Sum>k\<le>2*n. (2*n) choose k)"
-    by (simp add: power_mult power2_eq_square One_nat_def [symmetric] del: One_nat_def)
-  also have "{..2*n} = {0<..<2*n} \<union> {0,2*n}" by auto
-  also have "(\<Sum>k\<in>\<dots>. (2*n) choose k) =
-             (\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) + (\<Sum>k\<in>{0,2*n}. (2*n) choose k)"
-    by (subst sum.union_disjoint) auto
-  also have "(\<Sum>k\<in>{0,2*n}. (2*n) choose k) \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)"
-    by (cases n) simp_all
-  also from assms have "\<dots> \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)"
-    by (intro sum_mono2) auto
-  also have "\<dots> = (2*n) choose n" by (rule choose_square_sum)
-  also have "(\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) \<le> (\<Sum>k\<in>{0<..<2*n}. (2*n) choose n)"
-    by (intro sum_mono binomial_maximum')
-  also have "\<dots> = card {0<..<2*n} * ((2*n) choose n)" by simp
-  also have "card {0<..<2*n} \<le> 2*n - 1" by (cases n) simp_all
-  also have "(2 * n - 1) * (2 * n choose n) + (2 * n choose n) = ((2*n) choose n) * (2*n)"
-    using assms by (simp add: algebra_simps)
-  finally have "4 ^ n \<le> (2 * n choose n) * (2 * n)" by simp_all
-  hence "real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))"
-    by (subst of_nat_le_iff)
-  with assms show ?thesis by (simp add: field_simps)
-qed
-
-
 subsection \<open>Properties of Power Series\<close>
 
 lemma powser_zero [simp]: "(\<Sum>n. f n * 0 ^ n) = f 0"
@@ -3061,8 +2920,9 @@
   shows "((\<lambda>x. f x powr g x) \<longlongrightarrow> a powr b) F"
   unfolding powr_def
 proof (rule filterlim_If)
-  from f show "((\<lambda>x. 0) \<longlongrightarrow> (if a = 0 then 0 else exp (b * ln a))) (inf F (principal {x. f x = 0}))"
-    by simp (auto simp: filterlim_iff eventually_inf_principal elim: eventually_mono dest: t1_space_nhds)
+  show "((\<lambda>x. 0) \<longlongrightarrow> (if a = 0 then 0 else exp (b * ln a))) (inf F (principal {x. f x = 0}))"
+    using tendsto_imp_eventually_ne [OF f] a
+    by (simp add: filterlim_iff eventually_inf_principal frequently_def)
   from f g a show "((\<lambda>x. exp (g x * ln (f x))) \<longlongrightarrow> (if a = 0 then 0 else exp (b * ln a)))
       (inf F (principal {x. f x \<noteq> 0}))"
     by (auto intro!: tendsto_intros intro: tendsto_mono inf_le1)
--- a/src/HOL/ex/HarmonicSeries.thy	Thu May 23 11:18:46 2024 +0200
+++ b/src/HOL/ex/HarmonicSeries.thy	Thu May 23 20:22:52 2024 +0200
@@ -103,7 +103,7 @@
         by (simp add: tmdef)
       also from mgt0 have
         "\<dots> = ((1/(real tm)) * real ((2::nat)^(m - 1)))"
-        by (auto simp: tmdef dest: two_pow_sub)
+        using tmdef two_pow_sub by presburger
       also have
         "\<dots> = (real (2::nat))^(m - 1) / (real (2::nat))^m"
         by (simp add: tmdef)