[STATEMENT]
lemma deriv_subc:
  fixes p :: \<open>('a, 'b) form\<close>
  assumes inf_params: \<open>infinite (UNIV :: 'a set)\<close>
  shows \<open>z \<turnstile> p \<Longrightarrow> subcs c s z \<turnstile> subc c s p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<turnstile> p \<Longrightarrow> subcs c s z \<turnstile> subc c s p
[PROOF STEP]
proof (induct z p arbitrary: c s rule: deriv.induct)
[PROOF STATE]
proof (state)
goal (18 subgoals):
 1. \<And>a G c s. a \<in> set G \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>G c s. subcs c s G \<turnstile> subc c s TT
 3. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 5. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 6. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 10. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
A total of 18 subgoals...
[PROOF STEP]
case (Assum p z)
[PROOF STATE]
proof (state)
this:
p \<in> set z

goal (18 subgoals):
 1. \<And>a G c s. a \<in> set G \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>G c s. subcs c s G \<turnstile> subc c s TT
 3. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 5. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 6. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 10. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
A total of 18 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> set z
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p \<in> set z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
using member_subc deriv.Assum
[PROOF STATE]
proof (prove)
using this:
p \<in> set z
?p \<in> set ?z \<Longrightarrow> subc ?c ?s ?p \<in> set (subcs ?c ?s ?z)
?a \<in> set ?G \<Longrightarrow> ?G \<turnstile> ?a

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s p

goal (17 subgoals):
 1. \<And>G c s. subcs c s G \<turnstile> subc c s TT
 2. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 4. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 5. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 10. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
A total of 17 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (17 subgoals):
 1. \<And>G c s. subcs c s G \<turnstile> subc c s TT
 2. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 4. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 5. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 10. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
A total of 17 subgoals...
[PROOF STEP]
case TTI
[PROOF STATE]
proof (state)
this:

goal (17 subgoals):
 1. \<And>G c s. subcs c s G \<turnstile> subc c s TT
 2. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 4. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 5. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 10. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
A total of 17 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcs c s G_ \<turnstile> subc c s TT
[PROOF STEP]
using deriv.TTI
[PROOF STATE]
proof (prove)
using this:
?G \<turnstile> TT

goal (1 subgoal):
 1. subcs c s G_ \<turnstile> subc c s TT
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c s G_ \<turnstile> subc c s TT

goal (16 subgoals):
 1. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 3. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 4. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 9. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 10. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
A total of 16 subgoals...
[PROOF STEP]
case FFE
[PROOF STATE]
proof (state)
this:
G_ \<turnstile> FF
subcs ?c ?s G_ \<turnstile> subc ?c ?s FF

goal (16 subgoals):
 1. \<And>G a c s. \<lbrakk>G \<turnstile> FF; \<And>c s. subcs c s G \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 3. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 4. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 9. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 10. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
A total of 16 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
G_ \<turnstile> FF
subcs ?c ?s G_ \<turnstile> subc ?c ?s FF
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
G_ \<turnstile> FF
subcs ?c ?s G_ \<turnstile> subc ?c ?s FF

goal (1 subgoal):
 1. subcs c s G_ \<turnstile> subc c s a_
[PROOF STEP]
using deriv.FFE
[PROOF STATE]
proof (prove)
using this:
G_ \<turnstile> FF
subcs ?c ?s G_ \<turnstile> subc ?c ?s FF
?G \<turnstile> FF \<Longrightarrow> ?G \<turnstile> ?a

goal (1 subgoal):
 1. subcs c s G_ \<turnstile> subc c s a_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcs c s G_ \<turnstile> subc c s a_

goal (15 subgoals):
 1. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 2. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 3. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 9. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 10. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
A total of 15 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (15 subgoals):
 1. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 2. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 3. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 9. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 10. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
A total of 15 subgoals...
[PROOF STEP]
case (NegI z p)
[PROOF STATE]
proof (state)
this:
z # p \<turnstile> FF
subcs ?c ?s (z # p) \<turnstile> subc ?c ?s FF

goal (15 subgoals):
 1. \<And>a G c s. \<lbrakk>a # G \<turnstile> FF; \<And>c s. subcs c s (a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Neg a)
 2. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 3. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 7. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 9. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 10. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
A total of 15 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z # p \<turnstile> FF
subcs ?c ?s (z # p) \<turnstile> subc ?c ?s FF
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z # p \<turnstile> FF
subcs ?c ?s (z # p) \<turnstile> subc ?c ?s FF

goal (1 subgoal):
 1. subcs c s p \<turnstile> subc c s (Neg z)
[PROOF STEP]
using deriv.NegI
[PROOF STATE]
proof (prove)
using this:
z # p \<turnstile> FF
subcs ?c ?s (z # p) \<turnstile> subc ?c ?s FF
?a # ?G \<turnstile> FF \<Longrightarrow> ?G \<turnstile> Neg ?a

goal (1 subgoal):
 1. subcs c s p \<turnstile> subc c s (Neg z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcs c s p \<turnstile> subc c s (Neg z)

goal (14 subgoals):
 1. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 2. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 9. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 10. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
A total of 14 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 2. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 9. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 10. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
A total of 14 subgoals...
[PROOF STEP]
case (NegE z p)
[PROOF STATE]
proof (state)
this:
z \<turnstile> Neg p
subcs ?c ?s z \<turnstile> subc ?c ?s (Neg p)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (14 subgoals):
 1. \<And>G a c s. \<lbrakk>G \<turnstile> Neg a; \<And>c s. subcs c s G \<turnstile> subc c s (Neg a); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s FF
 2. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 6. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 8. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 9. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 10. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
A total of 14 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> Neg p
subcs ?c ?s z \<turnstile> subc ?c ?s (Neg p)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Neg p
subcs ?c ?s z \<turnstile> subc ?c ?s (Neg p)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s FF
[PROOF STEP]
using deriv.NegE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Neg p
subcs ?c ?s z \<turnstile> subc ?c ?s (Neg p)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
\<lbrakk>?G \<turnstile> Neg ?a; ?G \<turnstile> ?a\<rbrakk> \<Longrightarrow> ?G \<turnstile> FF

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s FF
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s FF

goal (13 subgoals):
 1. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 8. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 10. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
A total of 13 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 8. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 10. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
A total of 13 subgoals...
[PROOF STEP]
case (Class p z)
[PROOF STATE]
proof (state)
this:
Neg p # z \<turnstile> FF
subcs ?c ?s (Neg p # z) \<turnstile> subc ?c ?s FF

goal (13 subgoals):
 1. \<And>a G c s. \<lbrakk>Neg a # G \<turnstile> FF; \<And>c s. subcs c s (Neg a # G) \<turnstile> subc c s FF\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 5. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 7. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 8. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 9. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 10. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
A total of 13 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Neg p # z \<turnstile> FF
subcs ?c ?s (Neg p # z) \<turnstile> subc ?c ?s FF
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Neg p # z \<turnstile> FF
subcs ?c ?s (Neg p # z) \<turnstile> subc ?c ?s FF

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
using deriv.Class
[PROOF STATE]
proof (prove)
using this:
Neg p # z \<turnstile> FF
subcs ?c ?s (Neg p # z) \<turnstile> subc ?c ?s FF
Neg ?a # ?G \<turnstile> FF \<Longrightarrow> ?G \<turnstile> ?a

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s p

goal (12 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
A total of 12 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
A total of 12 subgoals...
[PROOF STEP]
case (ImplE z p q)
[PROOF STATE]
proof (state)
this:
z \<turnstile> Impl p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Impl p q)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (12 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a b c s. \<lbrakk>G \<turnstile> Impl a b; \<And>c s. subcs c s G \<turnstile> subc c s (Impl a b); G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 9. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
A total of 12 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> Impl p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Impl p q)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Impl p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Impl p q)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
using deriv.ImplE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Impl p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Impl p q)
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
\<lbrakk>?G \<turnstile> Impl ?a ?b; ?G \<turnstile> ?a\<rbrakk> \<Longrightarrow> ?G \<turnstile> ?b

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s q

goal (11 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
A total of 11 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
A total of 11 subgoals...
[PROOF STEP]
case (ImplI z q p)
[PROOF STATE]
proof (state)
this:
z # q \<turnstile> p
subcs ?c ?s (z # q) \<turnstile> subc ?c ?s p

goal (11 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>a G b c s. \<lbrakk>a # G \<turnstile> b; \<And>c s. subcs c s (a # G) \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Impl a b)
 8. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 10. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
A total of 11 subgoals...
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z # q \<turnstile> p
subcs ?c ?s (z # q) \<turnstile> subc ?c ?s p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z # q \<turnstile> p
subcs ?c ?s (z # q) \<turnstile> subc ?c ?s p

goal (1 subgoal):
 1. subcs c s q \<turnstile> subc c s (Impl z p)
[PROOF STEP]
using deriv.ImplI
[PROOF STATE]
proof (prove)
using this:
z # q \<turnstile> p
subcs ?c ?s (z # q) \<turnstile> subc ?c ?s p
?a # ?G \<turnstile> ?b \<Longrightarrow> ?G \<turnstile> Impl ?a ?b

goal (1 subgoal):
 1. subcs c s q \<turnstile> subc c s (Impl z p)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s q \<turnstile> subc c s (Impl z p)

goal (10 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 10. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 10. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (OrE z p q r)
[PROOF STATE]
proof (state)
this:
z \<turnstile> Or p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Or p q)
p # z \<turnstile> r
subcs ?c ?s (p # z) \<turnstile> subc ?c ?s r
q # z \<turnstile> r
subcs ?c ?s (q # z) \<turnstile> subc ?c ?s r

goal (10 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a b c ca s. \<lbrakk>G \<turnstile> Or a b; \<And>c s. subcs c s G \<turnstile> subc c s (Or a b); a # G \<turnstile> c; \<And>ca s. subcs ca s (a # G) \<turnstile> subc ca s c; b # G \<turnstile> c; \<And>ca s. subcs ca s (b # G) \<turnstile> subc ca s c\<rbrakk> \<Longrightarrow> subcs ca s G \<turnstile> subc ca s c
 7. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 9. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 10. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> Or p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Or p q)
p # z \<turnstile> r
subcs ?c ?s (p # z) \<turnstile> subc ?c ?s r
q # z \<turnstile> r
subcs ?c ?s (q # z) \<turnstile> subc ?c ?s r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Or p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Or p q)
p # z \<turnstile> r
subcs ?c ?s (p # z) \<turnstile> subc ?c ?s r
q # z \<turnstile> r
subcs ?c ?s (q # z) \<turnstile> subc ?c ?s r

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s r
[PROOF STEP]
using deriv.OrE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Or p q
subcs ?c ?s z \<turnstile> subc ?c ?s (Or p q)
p # z \<turnstile> r
subcs ?c ?s (p # z) \<turnstile> subc ?c ?s r
q # z \<turnstile> r
subcs ?c ?s (q # z) \<turnstile> subc ?c ?s r
\<lbrakk>?G \<turnstile> Or ?a ?b; ?a # ?G \<turnstile> ?c; ?b # ?G \<turnstile> ?c\<rbrakk> \<Longrightarrow> ?G \<turnstile> ?c

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s r

goal (9 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 9. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 9. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (OrI1 z p q)
[PROOF STATE]
proof (state)
this:
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (9 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 6. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 8. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 9. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Or p q)
[PROOF STEP]
using deriv.OrI1
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p
subcs ?c ?s z \<turnstile> subc ?c ?s p
?G \<turnstile> ?a \<Longrightarrow> ?G \<turnstile> Or ?a ?b

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Or p q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Or p q)

goal (8 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 8. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 8. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (OrI2 z q p)
[PROOF STATE]
proof (state)
this:
z \<turnstile> q
subcs ?c ?s z \<turnstile> subc ?c ?s q

goal (8 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G b a c s. \<lbrakk>G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Or a b)
 5. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 7. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 8. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> q
subcs ?c ?s z \<turnstile> subc ?c ?s q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> q
subcs ?c ?s z \<turnstile> subc ?c ?s q

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Or p q)
[PROOF STEP]
using deriv.OrI2
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> q
subcs ?c ?s z \<turnstile> subc ?c ?s q
?G \<turnstile> ?b \<Longrightarrow> ?G \<turnstile> Or ?a ?b

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Or p q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Or p q)

goal (7 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 7. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 7. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (AndE1 z p q)
[PROOF STATE]
proof (state)
this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)

goal (7 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s a
 3. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 4. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 6. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 7. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
using deriv.AndE1
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)
?G \<turnstile> And ?a ?b \<Longrightarrow> ?G \<turnstile> ?a

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s p

goal (6 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 3. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 6. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 3. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 6. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (AndE2 z p q)
[PROOF STATE]
proof (state)
this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)

goal (6 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a b c s. \<lbrakk>G \<turnstile> And a b; \<And>c s. subcs c s G \<turnstile> subc c s (And a b)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
 3. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 5. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 6. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
using deriv.AndE2
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> And p q
subcs ?c ?s z \<turnstile> subc ?c ?s (And p q)
?G \<turnstile> And ?a ?b \<Longrightarrow> ?G \<turnstile> ?b

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s q

goal (5 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 5. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 5. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (AndI p z q)
[PROOF STATE]
proof (state)
this:
p \<turnstile> z
subcs ?c ?s p \<turnstile> subc ?c ?s z
p \<turnstile> q
subcs ?c ?s p \<turnstile> subc ?c ?s q

goal (5 subgoals):
 1. \<And>G a b c s. \<lbrakk>G \<turnstile> a; \<And>c s. subcs c s G \<turnstile> subc c s a; G \<turnstile> b; \<And>c s. subcs c s G \<turnstile> subc c s b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (And a b)
 2. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 4. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 5. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<turnstile> z
subcs ?c ?s p \<turnstile> subc ?c ?s z
p \<turnstile> q
subcs ?c ?s p \<turnstile> subc ?c ?s q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p \<turnstile> z
subcs ?c ?s p \<turnstile> subc ?c ?s z
p \<turnstile> q
subcs ?c ?s p \<turnstile> subc ?c ?s q

goal (1 subgoal):
 1. subcs c s p \<turnstile> subc c s (And z q)
[PROOF STEP]
using deriv.AndI
[PROOF STATE]
proof (prove)
using this:
p \<turnstile> z
subcs ?c ?s p \<turnstile> subc ?c ?s z
p \<turnstile> q
subcs ?c ?s p \<turnstile> subc ?c ?s q
\<lbrakk>?G \<turnstile> ?a; ?G \<turnstile> ?b\<rbrakk> \<Longrightarrow> ?G \<turnstile> And ?a ?b

goal (1 subgoal):
 1. subcs c s p \<turnstile> subc c s (And z q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subcs c s p \<turnstile> subc c s (And z q)

goal (4 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 4. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 4. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
case (ExistsE z p d q)
[PROOF STATE]
proof (state)
this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q

goal (4 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
 4. \<And>G a n b c s. \<lbrakk>G \<turnstile> Exists a; \<And>c s. subcs c s G \<turnstile> subc c s (Exists a); a[App n []/0] # G \<turnstile> b; \<And>c s. subcs c s (a[App n []/0] # G) \<turnstile> subc c s b; news n G; new n a; new n b\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
proof (cases \<open>c = d\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
 2. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = d

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
 2. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = d
[PROOF STEP]
have \<open>z \<turnstile> q\<close>
[PROOF STATE]
proof (prove)
using this:
c = d

goal (1 subgoal):
 1. z \<turnstile> q
[PROOF STEP]
using ExistsE deriv.ExistsE
[PROOF STATE]
proof (prove)
using this:
c = d
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q
\<lbrakk>?G \<turnstile> Exists ?a; ?a[App ?n []/0] # ?G \<turnstile> ?b; news ?n ?G; new ?n ?a; new ?n ?b\<rbrakk> \<Longrightarrow> ?G \<turnstile> ?b

goal (1 subgoal):
 1. z \<turnstile> q
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z \<turnstile> q

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
 2. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<turnstile> q

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
 2. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>new c q\<close> and \<open>news c z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new c q &&& news c z
[PROOF STEP]
using ExistsE True
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q
c = d

goal (1 subgoal):
 1. new c q &&& news c z
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
new c q
news c z

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
 2. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> q
new c q
news c z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> q
new c q
news c z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
using subc_new subcs_news
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> q
new c q
news c z
new ?c ?p \<Longrightarrow> subc ?c ?s ?p = ?p
news ?c ?z \<Longrightarrow> subcs ?c ?s ?z = ?z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s q

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> d

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
let ?params = \<open>params p \<union> params q \<union> (\<Union>p \<in> set z. params p) \<union> paramst s \<union> {c} \<union> {d}\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>finite ?params\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
[PROOF STEP]
obtain fresh where fresh: \<open>fresh \<notin> ?params\<close>
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_params
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
infinite UNIV

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson ex_new_if_finite infinite_UNIV_listI)
[PROOF STATE]
proof (state)
this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
let ?s = \<open>psubstt (id(d := fresh)) s\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
let ?f = \<open>id(d := fresh, fresh := d)\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have f: \<open>\<forall>x \<in> ?params. x \<noteq> c \<longrightarrow> ?f x \<noteq> ?f c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. \<forall>x\<in>params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>new_term d ?s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
using fresh psubst_new_free'(1)
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
?c \<noteq> ?n \<Longrightarrow> new_term ?n (psubstt (id(?n := ?c)) ?t)

goal (1 subgoal):
 1. new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
new_term d (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
have \<open>psubstt ?f ?s = psubstt (id(fresh := d)) ?s\<close>
[PROOF STATE]
proof (prove)
using this:
new_term d (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
[PROOF STEP]
by (metis fun_upd_twist psubstt_upd(1))
[PROOF STATE]
proof (state)
this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
[PROOF STEP]
have psubst_s: \<open>psubstt ?f ?s = s\<close>
[PROOF STATE]
proof (prove)
using this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>?f c = c\<close> and \<open>new_term (?f c) (App fresh [])\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id(d := fresh, fresh := d)) c = c &&& new_term ((id(d := fresh, fresh := d)) c) (App fresh [])
[PROOF STEP]
using False fresh
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. (id(d := fresh, fresh := d)) c = c &&& new_term ((id(d := fresh, fresh := d)) c) (App fresh [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(id(d := fresh, fresh := d)) c = c
new_term ((id(d := fresh, fresh := d)) c) (App fresh [])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>subcs c (psubstt ?f ?s) z \<turnstile> subc c (psubstt ?f ?s) (Exists p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)
[PROOF STEP]
using ExistsE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q

goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)
[PROOF STEP]
have exi_p:
      \<open>subcs c s z \<turnstile> Exists (subc c (liftt (psubstt ?f ?s)) p)\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)

goal (1 subgoal):
 1. subcs c s z \<turnstile> Exists (subc c (liftt (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s))) p)
[PROOF STEP]
using psubst_s
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) z \<turnstile> subc c (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (Exists p)
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. subcs c s z \<turnstile> Exists (subc c (liftt (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s))) p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> Exists (subc c (liftt (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s))) p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>news d z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news d z
[PROOF STEP]
using ExistsE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q

goal (1 subgoal):
 1. news d z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
news d z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
news d z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>news fresh z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news fresh z
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. news fresh z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
news fresh z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
news d z
news fresh z
[PROOF STEP]
have \<open>map (psubst ?f) z = z\<close>
[PROOF STATE]
proof (prove)
using this:
news d z
news fresh z

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) z = z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) z = z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) z = z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>\<forall>x \<in> \<Union>p \<in> set z. params p. x \<noteq> c \<longrightarrow> ?f x \<noteq> ?f c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
have psubst_z: \<open>map (psubst ?f) (subcs c ?s z) = subcs c s z\<close>
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z
[PROOF STEP]
using \<open>?f c = c\<close> psubst_s
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
(id(d := fresh, fresh := d)) c = c
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z
[PROOF STEP]
by (simp add: subcs_psubst)
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>psubst ?f (subc c ?s (subst p (App d []) 0)) =
        subc (?f c) (psubstt ?f ?s) (psubst ?f (subst p (App d []) 0))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))
[PROOF STEP]
by (simp add: subc_psubst)
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>\<dots> = subc c s (subst (psubst ?f p) (App fresh []) 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])
[PROOF STEP]
using psubst_subst psubst_s \<open>?f c = c\<close>
[PROOF STATE]
proof (prove)
using this:
psubst ?f (?P[?t/?i]) = psubst ?f ?P[psubstt ?f ?t/?i]
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
(id(d := fresh, fresh := d)) c = c

goal (1 subgoal):
 1. subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>\<dots> = subc c s (subst p (App fresh []) 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])
[PROOF STEP]
using ExistsE fresh
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])
[PROOF STEP]
have psubst_p: \<open>psubst ?f (subc c ?s (subst p (App d []) 0)) =
        subst (subc c (liftt s) p) (App fresh []) 0\<close>
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
using subc_sub_0_new \<open>new_term (?f c) (App fresh [])\<close> \<open>?f c = c\<close>
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])
new_term ?c ?t \<Longrightarrow> subc ?c ?s (?p[?t/0]) = subc ?c (liftt ?s) ?p[?t/0]
new_term ((id(d := fresh, fresh := d)) c) (App fresh [])
(id(d := fresh, fresh := d)) c = c

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>\<forall>x \<in> params q. x \<noteq> c \<longrightarrow> ?f x \<noteq> ?f c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
have psubst_q: \<open>psubst ?f (subc c ?s q) = subc c s q\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q) = subc c s q
[PROOF STEP]
using ExistsE fresh \<open>?f c = c\<close> psubst_s f
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>params q. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
(id(d := fresh, fresh := d)) c = c
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
\<forall>x\<in>params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q) = subc c s q
[PROOF STEP]
by (simp add: subc_psubst)
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q) = subc c s q

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>subcs c ?s (subst p (App d []) 0 # z) \<turnstile> subc c ?s q\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh)) s) (p[App d []/0] # z) \<turnstile> subc c (psubstt (id(d := fresh)) s) q
[PROOF STEP]
using ExistsE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Exists p
subcs ?c ?s z \<turnstile> subc ?c ?s (Exists p)
p[App d []/0] # z \<turnstile> q
subcs ?c ?s (p[App d []/0] # z) \<turnstile> subc ?c ?s q
news d z
new d p
new d q

goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh)) s) (p[App d []/0] # z) \<turnstile> subc c (psubstt (id(d := fresh)) s) q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(d := fresh)) s) (p[App d []/0] # z) \<turnstile> subc c (psubstt (id(d := fresh)) s) q

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(d := fresh)) s) (p[App d []/0] # z) \<turnstile> subc c (psubstt (id(d := fresh)) s) q
[PROOF STEP]
have \<open>subc c ?s (subst p (App d []) 0) # subcs c ?s z \<turnstile> subc c ?s q\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(d := fresh)) s) (p[App d []/0] # z) \<turnstile> subc c (psubstt (id(d := fresh)) s) q

goal (1 subgoal):
 1. subc c (psubstt (id(d := fresh)) s) (p[App d []/0]) # subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc c (psubstt (id(d := fresh)) s) (p[App d []/0]) # subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) q

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subc c (psubstt (id(d := fresh)) s) (p[App d []/0]) # subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) q
[PROOF STEP]
have \<open>psubst ?f (subc c ?s (subst p (App d []) 0)) # map (psubst ?f) (subcs c ?s z)
        \<turnstile> psubst ?f (subc c ?s q)\<close>
[PROOF STATE]
proof (prove)
using this:
subc c (psubstt (id(d := fresh)) s) (p[App d []/0]) # subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) q

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)
[PROOF STEP]
using deriv_psubst inf_params
[PROOF STATE]
proof (prove)
using this:
subc c (psubstt (id(d := fresh)) s) (p[App d []/0]) # subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) q
\<lbrakk>infinite UNIV; ?z \<turnstile> ?p\<rbrakk> \<Longrightarrow> map (psubst ?f) ?z \<turnstile> psubst ?f ?p
infinite UNIV

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)
[PROOF STEP]
have q: \<open>subst (subc c (liftt s) p) (App fresh []) 0 # subcs c s z \<turnstile> subc c s q\<close>
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)

goal (1 subgoal):
 1. subc c (liftt s) p[App fresh []/0] # subcs c s z \<turnstile> subc c s q
[PROOF STEP]
using psubst_q psubst_z psubst_p
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) # map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q)
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) q) = subc c s q
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. subc c (liftt s) p[App fresh []/0] # subcs c s z \<turnstile> subc c s q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc c (liftt s) p[App fresh []/0] # subcs c s z \<turnstile> subc c s q

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>new fresh (subc c (liftt s) p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new fresh (subc c (liftt s) p)
[PROOF STEP]
using fresh new_subc new_lift
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
\<lbrakk>new_term ?d ?s; new ?d ?p\<rbrakk> \<Longrightarrow> new ?d (subc ?c ?s ?p)
new_term ?c ?t \<Longrightarrow> new_term ?c (liftt ?t)
new_list ?c ?l \<Longrightarrow> new_list ?c (liftts ?l)

goal (1 subgoal):
 1. new fresh (subc c (liftt s) p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
new fresh (subc c (liftt s) p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
new fresh (subc c (liftt s) p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>new fresh (subc c s q)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new fresh (subc c s q)
[PROOF STEP]
using fresh new_subc
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
\<lbrakk>new_term ?d ?s; new ?d ?p\<rbrakk> \<Longrightarrow> new ?d (subc ?c ?s ?p)

goal (1 subgoal):
 1. new fresh (subc c s q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
new fresh (subc c s q)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
new fresh (subc c s q)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
have \<open>news fresh (subcs c s z)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news fresh (subcs c s z)
[PROOF STEP]
using fresh \<open>news fresh z\<close>
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> params q \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
news fresh z

goal (1 subgoal):
 1. news fresh (subcs c s z)
[PROOF STEP]
by (simp add: news_subcs)
[PROOF STATE]
proof (state)
this:
news fresh (subcs c s z)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> Exists p; \<And>c s. subcs c s z \<turnstile> subc c s (Exists p); p[App d []/0] # z \<turnstile> q; \<And>c s. subcs c s (p[App d []/0] # z) \<turnstile> subc c s q; news d z; new d p; new d q; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
new fresh (subc c (liftt s) p)
new fresh (subc c s q)
news fresh (subcs c s z)
[PROOF STEP]
show \<open>subcs c s z \<turnstile> subc c s q\<close>
[PROOF STATE]
proof (prove)
using this:
new fresh (subc c (liftt s) p)
new fresh (subc c s q)
news fresh (subcs c s z)

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
using deriv.ExistsE exi_p q psubst_s
[PROOF STATE]
proof (prove)
using this:
new fresh (subc c (liftt s) p)
new fresh (subc c s q)
news fresh (subcs c s z)
\<lbrakk>?G \<turnstile> Exists ?a; ?a[App ?n []/0] # ?G \<turnstile> ?b; news ?n ?G; new ?n ?a; new ?n ?b\<rbrakk> \<Longrightarrow> ?G \<turnstile> ?b
subcs c s z \<turnstile> Exists (subc c (liftt (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s))) p)
subc c (liftt s) p[App fresh []/0] # subcs c s z \<turnstile> subc c s q
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s q

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
case (ExistsI z p t)
[PROOF STATE]
proof (state)
this:
z \<turnstile> p[t/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[t/0])

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
let ?params = \<open>params p \<union> (\<Union>p \<in> set z. params p) \<union> paramst s \<union> paramst t \<union> {c}\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>finite ?params\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
[PROOF STEP]
obtain fresh where fresh: \<open>fresh \<notin> ?params\<close>
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_params
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
infinite UNIV

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson ex_new_if_finite infinite_UNIV_listI)
[PROOF STATE]
proof (state)
this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
let ?f = \<open>id(c := fresh)\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
let ?g = \<open>id(fresh := c)\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
let ?s = \<open>psubstt ?f s\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have c: \<open>?g c = c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id(fresh := c)) c = c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. (id(fresh := c)) c = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(id(fresh := c)) c = c

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have s: \<open>psubstt ?g ?s = s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have p: \<open>psubst ?g (Exists p) = Exists p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst (id(fresh := c)) (Exists p) = Exists p
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. psubst (id(fresh := c)) (Exists p) = Exists p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubst (id(fresh := c)) (Exists p) = Exists p

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>\<forall>x \<in> (\<Union>p \<in> set z. params p). x \<noteq> c \<longrightarrow> ?g x \<noteq> ?g c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>map (psubst ?g) z = z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (psubst (id(fresh := c))) z = z
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) z = z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) z = z

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z
[PROOF STEP]
have z: \<open>map (psubst ?g) (subcs c ?s z) = subcs c s z\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z
[PROOF STEP]
by (simp add: subcs_psubst)
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>new_term c ?s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term c (psubstt (id(c := fresh)) s)
[PROOF STEP]
using fresh psubst_new_free'
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}
?c \<noteq> ?n \<Longrightarrow> new_term ?n (psubstt (id(?n := ?c)) ?t)
?c \<noteq> ?n \<Longrightarrow> new_list ?n (psubstts (id(?n := ?c)) ?l)

goal (1 subgoal):
 1. new_term c (psubstt (id(c := fresh)) s)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
new_term c (psubstt (id(c := fresh)) s)

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
new_term c (psubstt (id(c := fresh)) s)
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subc c ?s (subst p (subc_term c ?s t) 0)\<close>
[PROOF STATE]
proof (prove)
using this:
new_term c (psubstt (id(c := fresh)) s)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
[PROOF STEP]
using ExistsI new_subc_put
[PROOF STATE]
proof (prove)
using this:
new_term c (psubstt (id(c := fresh)) s)
z \<turnstile> p[t/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[t/0])
new_term ?c ?s \<Longrightarrow> subc ?c ?s (?p[?t/?m]) = subc ?c ?s (?p[subc_term ?c ?s ?t/?m])

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>new_term c (subc_term c ?s t)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
using \<open>new_term c ?s\<close> new_subc_same'
[PROOF STATE]
proof (prove)
using this:
new_term c (psubstt (id(c := fresh)) s)
new_term ?c ?s \<Longrightarrow> new_term ?c (subc_term ?c ?s ?t)
new_term ?c ?s \<Longrightarrow> new_list ?c (subc_list ?c ?s ?l)

goal (1 subgoal):
 1. new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subst (subc c (liftt ?s) p) (subc_term c ?s t) 0\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
[PROOF STEP]
using subc_sub_0_new
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
new_term ?c ?t \<Longrightarrow> subc ?c ?s (?p[?t/0]) = subc ?c (liftt ?s) ?p[?t/0]

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subc c ?s (Exists p)\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)
[PROOF STEP]
using deriv.ExistsI
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
?G \<turnstile> ?a[?t/0] \<Longrightarrow> ?G \<turnstile> Exists ?a

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)
[PROOF STEP]
have \<open>map (psubst ?g) (subcs c ?s z) \<turnstile> psubst ?g (subc c ?s (Exists p))\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))
[PROOF STEP]
using deriv_psubst inf_params
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (Exists p)
\<lbrakk>infinite UNIV; ?z \<turnstile> ?p\<rbrakk> \<Longrightarrow> map (psubst ?f) ?z \<turnstile> psubst ?f ?p
infinite UNIV

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
have \<open>\<forall>x \<in> params (Exists p). x \<noteq> c \<longrightarrow> ?g x \<noteq> ?g c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. \<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (3 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
 3. \<And>G a t c s. \<lbrakk>G \<turnstile> a[t/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[t/0])\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Exists a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))
\<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
show \<open>subcs c s z \<turnstile> subc c s (Exists p)\<close>
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))
\<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Exists p)
[PROOF STEP]
using c s p z
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (Exists p))
\<forall>x\<in>params (Exists p). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
(id(fresh := c)) c = c
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
psubst (id(fresh := c)) (Exists p) = Exists p
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Exists p)
[PROOF STEP]
by (simp add: subc_psubst)
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Exists p)

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
case (ForallE z p t)
[PROOF STATE]
proof (state)
this:
z \<turnstile> Forall p
subcs ?c ?s z \<turnstile> subc ?c ?s (Forall p)

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
let ?params = \<open>params p \<union> (\<Union>p \<in> set z. params p) \<union> paramst s \<union> paramst t \<union> {c}\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>finite ?params\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
[PROOF STEP]
obtain fresh where fresh: \<open>fresh \<notin> ?params\<close>
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_params
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c})
infinite UNIV

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson ex_new_if_finite infinite_UNIV_listI)
[PROOF STATE]
proof (state)
this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
let ?f = \<open>id(c := fresh)\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
let ?g = \<open>id(fresh := c)\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
let ?s = \<open>psubstt ?f s\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have c: \<open>?g c = c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id(fresh := c)) c = c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. (id(fresh := c)) c = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(id(fresh := c)) c = c

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have s: \<open>psubstt ?g ?s = s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have p: \<open>psubst ?g (subst p t 0) = subst p t 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst (id(fresh := c)) (p[t/0]) = p[t/0]
[PROOF STEP]
using fresh psubst_new psubst_subst subst_new psubst_new'(1)
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}
new ?c ?p \<Longrightarrow> psubst (id(?c := ?x)) ?p = ?p
psubst ?f (?P[?t/?i]) = psubst ?f ?P[psubstt ?f ?t/?i]
\<lbrakk>new_term ?c ?s; new ?c ?p\<rbrakk> \<Longrightarrow> new ?c (?p[?s/?m])
new_term ?c ?t \<Longrightarrow> psubstt (id(?c := ?x)) ?t = ?t

goal (1 subgoal):
 1. psubst (id(fresh := c)) (p[t/0]) = p[t/0]
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
psubst (id(fresh := c)) (p[t/0]) = p[t/0]

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>\<forall>x \<in> (\<Union>p \<in> set z. params p). x \<noteq> c \<longrightarrow> ?g x \<noteq> ?g c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>map (psubst ?g) z = z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (psubst (id(fresh := c))) z = z
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) z = z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) z = z

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z
[PROOF STEP]
have z: \<open>map (psubst ?g) (subcs c ?s z) = subcs c s z\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
map (psubst (id(fresh := c))) z = z
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z
[PROOF STEP]
by (simp add: subcs_psubst)
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>new_term c ?s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term c (psubstt (id(c := fresh)) s)
[PROOF STEP]
using fresh psubst_new_free'
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}
?c \<noteq> ?n \<Longrightarrow> new_term ?n (psubstt (id(?n := ?c)) ?t)
?c \<noteq> ?n \<Longrightarrow> new_list ?n (psubstts (id(?n := ?c)) ?l)

goal (1 subgoal):
 1. new_term c (psubstt (id(c := fresh)) s)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
new_term c (psubstt (id(c := fresh)) s)

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> Forall (subc c (liftt ?s) p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)
[PROOF STEP]
using ForallE
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Forall p
subcs ?c ?s z \<turnstile> subc ?c ?s (Forall p)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subst (subc c (liftt ?s) p) (subc_term c ?s t) 0\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
[PROOF STEP]
using deriv.ForallE
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> Forall (subc c (liftt (psubstt (id(c := fresh)) s)) p)
?G \<turnstile> Forall ?a \<Longrightarrow> ?G \<turnstile> ?a[?t/0]

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>new_term c (subc_term c ?s t)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
using \<open>new_term c ?s\<close> new_subc_same'
[PROOF STATE]
proof (prove)
using this:
new_term c (psubstt (id(c := fresh)) s)
new_term ?c ?s \<Longrightarrow> new_term ?c (subc_term ?c ?s ?t)
new_term ?c ?s \<Longrightarrow> new_list ?c (subc_list ?c ?s ?l)

goal (1 subgoal):
 1. new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subc c ?s (subst p (subc_term c ?s t) 0)\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (liftt (psubstt (id(c := fresh)) s)) p[subc_term c (psubstt (id(c := fresh)) s) t/0]
new_term c (subc_term c (psubstt (id(c := fresh)) s) t)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subc c ?s (subst p t 0)\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])
[PROOF STEP]
using new_subc_put \<open>new_term c ?s\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[subc_term c (psubstt (id(c := fresh)) s) t/0])
new_term ?c ?s \<Longrightarrow> subc ?c ?s (?p[?t/?m]) = subc ?c ?s (?p[subc_term ?c ?s ?t/?m])
new_term c (psubstt (id(c := fresh)) s)

goal (1 subgoal):
 1. subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])
[PROOF STEP]
have \<open>map (psubst ?g) (subcs c ?s z) \<turnstile> psubst ?g (subc c ?s (subst p t 0))\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))
[PROOF STEP]
using deriv_psubst inf_params
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(c := fresh)) s) z \<turnstile> subc c (psubstt (id(c := fresh)) s) (p[t/0])
\<lbrakk>infinite UNIV; ?z \<turnstile> ?p\<rbrakk> \<Longrightarrow> map (psubst ?f) ?z \<turnstile> psubst ?f ?p
infinite UNIV

goal (1 subgoal):
 1. map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
have \<open>\<forall>x \<in> params (subst p t 0). x \<noteq> c \<longrightarrow> ?g x \<noteq> ?g c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
using fresh p psubst_new_free
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> paramst t \<union> {c}
psubst (id(fresh := c)) (p[t/0]) = p[t/0]
?c \<noteq> ?n \<Longrightarrow> new ?n (psubst (id(?n := ?c)) ?p)

goal (1 subgoal):
 1. \<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
by (metis fun_upd_apply id_apply)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (2 subgoals):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
 2. \<And>G a t c s. \<lbrakk>G \<turnstile> Forall a; \<And>c s. subcs c s G \<turnstile> subc c s (Forall a)\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (a[t/0])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))
\<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
[PROOF STEP]
show \<open>subcs c s z \<turnstile> subc c s (subst p t 0)\<close>
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))
\<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (p[t/0])
[PROOF STEP]
using c s p z
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) \<turnstile> psubst (id(fresh := c)) (subc c (psubstt (id(c := fresh)) s) (p[t/0]))
\<forall>x\<in>params (p[t/0]). x \<noteq> c \<longrightarrow> (id(fresh := c)) x \<noteq> (id(fresh := c)) c
(id(fresh := c)) c = c
psubstt (id(fresh := c)) (psubstt (id(c := fresh)) s) = s
psubst (id(fresh := c)) (p[t/0]) = p[t/0]
map (psubst (id(fresh := c))) (subcs c (psubstt (id(c := fresh)) s) z) = subcs c s z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (p[t/0])
[PROOF STEP]
by (simp add: subc_psubst)
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (p[t/0])

goal (1 subgoal):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
[PROOF STEP]
case (ForallI z p d)
[PROOF STATE]
proof (state)
this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p

goal (1 subgoal):
 1. \<And>G a n c s. \<lbrakk>G \<turnstile> a[App n []/0]; \<And>c s. subcs c s G \<turnstile> subc c s (a[App n []/0]); news n G; new n a\<rbrakk> \<Longrightarrow> subcs c s G \<turnstile> subc c s (Forall a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
proof (cases \<open>c = d\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
 2. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = d

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
 2. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = d
[PROOF STEP]
have \<open>z \<turnstile> Forall p\<close>
[PROOF STATE]
proof (prove)
using this:
c = d

goal (1 subgoal):
 1. z \<turnstile> Forall p
[PROOF STEP]
using ForallI deriv.ForallI
[PROOF STATE]
proof (prove)
using this:
c = d
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p
\<lbrakk>?G \<turnstile> ?a[App ?n []/0]; news ?n ?G; new ?n ?a\<rbrakk> \<Longrightarrow> ?G \<turnstile> Forall ?a

goal (1 subgoal):
 1. z \<turnstile> Forall p
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z \<turnstile> Forall p

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
 2. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<turnstile> Forall p

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
 2. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>new c p\<close> and \<open>news c z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new c p &&& news c z
[PROOF STEP]
using ForallI True
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p
c = d

goal (1 subgoal):
 1. new c p &&& news c z
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
new c p
news c z

goal (2 subgoals):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c = d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
 2. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<turnstile> Forall p
new c p
news c z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> Forall p
new c p
news c z

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
by (simp add: subcs_news)
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Forall p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> d

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
let ?params = \<open>params p \<union> (\<Union>p \<in> set z. params p) \<union> paramst s \<union> {c} \<union> {d}\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>finite ?params\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
[PROOF STEP]
obtain fresh where fresh: \<open>fresh \<notin> ?params\<close>
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_params
[PROOF STATE]
proof (prove)
using this:
finite (params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d})
infinite UNIV

goal (1 subgoal):
 1. (\<And>fresh. fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson ex_new_if_finite infinite_UNIV_listI)
[PROOF STATE]
proof (state)
this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
let ?s = \<open>psubstt (id(d := fresh)) s\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
let ?f = \<open>id(d := fresh, fresh := d)\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have f: \<open>\<forall>x \<in> ?params. x \<noteq> c \<longrightarrow> ?f x \<noteq> ?f c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. \<forall>x\<in>params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}. x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>new_term d ?s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
using fresh psubst_new_free'
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
?c \<noteq> ?n \<Longrightarrow> new_term ?n (psubstt (id(?n := ?c)) ?t)
?c \<noteq> ?n \<Longrightarrow> new_list ?n (psubstts (id(?n := ?c)) ?l)

goal (1 subgoal):
 1. new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
new_term d (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
new_term d (psubstt (id(d := fresh)) s)
[PROOF STEP]
have \<open>psubstt ?f ?s = psubstt (id(fresh := d)) ?s\<close>
[PROOF STATE]
proof (prove)
using this:
new_term d (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
[PROOF STEP]
by (metis fun_upd_twist psubstt_upd(1))
[PROOF STATE]
proof (state)
this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
[PROOF STEP]
have psubst_s: \<open>psubstt ?f ?s = s\<close>
[PROOF STATE]
proof (prove)
using this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = psubstt (id(fresh := d)) (psubstt (id(d := fresh)) s)
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>?f c = c\<close> and \<open>new_term c (App fresh [])\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id(d := fresh, fresh := d)) c = c &&& new_term c (App fresh [])
[PROOF STEP]
using False fresh
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. (id(d := fresh, fresh := d)) c = c &&& new_term c (App fresh [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(id(d := fresh, fresh := d)) c = c
new_term c (App fresh [])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>psubst ?f (subc c ?s (subst p (App d []) 0)) =
      subc (?f c) (psubstt ?f ?s) (psubst ?f (subst p (App d []) 0))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))
[PROOF STEP]
by (simp add: subc_psubst)
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>\<dots> = subc c s (subst (psubst ?f p) (App fresh []) 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])
[PROOF STEP]
using \<open>?f c = c\<close> psubst_subst psubst_s
[PROOF STATE]
proof (prove)
using this:
(id(d := fresh, fresh := d)) c = c
psubst ?f (?P[?t/?i]) = psubst ?f ?P[psubstt ?f ?t/?i]
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
subc ((id(d := fresh, fresh := d)) c) (psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s)) (psubst (id(d := fresh, fresh := d)) (p[App d []/0])) = subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>\<dots> = subc c s (subst p (App fresh []) 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])
[PROOF STEP]
using ForallI fresh
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subc c s (psubst (id(d := fresh, fresh := d)) p[App fresh []/0]) = subc c s (p[App fresh []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])
[PROOF STEP]
have psubst_p: \<open>psubst ?f (subc c ?s (subst p (App d []) 0)) =
        subst (subc c (liftt s) p) (App fresh []) 0\<close>
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
using subc_sub_0_new \<open>new_term c (App fresh [])\<close>
[PROOF STATE]
proof (prove)
using this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c s (p[App fresh []/0])
new_term ?c ?t \<Longrightarrow> subc ?c ?s (?p[?t/0]) = subc ?c (liftt ?s) ?p[?t/0]
new_term c (App fresh [])

goal (1 subgoal):
 1. psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>news d z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news d z
[PROOF STEP]
using ForallI
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p

goal (1 subgoal):
 1. news d z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
news d z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
news d z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>news fresh z\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news fresh z
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. news fresh z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
news fresh z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
news d z
news fresh z
[PROOF STEP]
have \<open>map (psubst ?f) z = z\<close>
[PROOF STATE]
proof (prove)
using this:
news d z
news fresh z

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) z = z
[PROOF STEP]
by (induct z) simp_all
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) z = z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) z = z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>\<forall>x \<in> \<Union>p \<in> set z. params p. x \<noteq> c \<longrightarrow> ?f x \<noteq> ?f c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
[PROOF STEP]
have psubst_z: \<open>map (psubst ?f) (subcs c ?s z) = subcs c s z\<close>
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z
[PROOF STEP]
using \<open>?f c = c\<close> psubst_s
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) z = z
\<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> (id(d := fresh, fresh := d)) x \<noteq> (id(d := fresh, fresh := d)) c
(id(d := fresh, fresh := d)) c = c
psubstt (id(d := fresh, fresh := d)) (psubstt (id(d := fresh)) s) = s

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z
[PROOF STEP]
by (simp add: subcs_psubst)
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>subcs c ?s z \<turnstile> subc c ?s (subst p (App d []) 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])
[PROOF STEP]
using ForallI
[PROOF STATE]
proof (prove)
using this:
z \<turnstile> p[App d []/0]
subcs ?c ?s z \<turnstile> subc ?c ?s (p[App d []/0])
news d z
new d p

goal (1 subgoal):
 1. subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])
[PROOF STEP]
have \<open>map (psubst ?f) (subcs c ?s z) \<turnstile> psubst ?f (subc c ?s (subst p (App d []) 0))\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
using deriv_psubst inf_params
[PROOF STATE]
proof (prove)
using this:
subcs c (psubstt (id(d := fresh)) s) z \<turnstile> subc c (psubstt (id(d := fresh)) s) (p[App d []/0])
\<lbrakk>infinite UNIV; ?z \<turnstile> ?p\<rbrakk> \<Longrightarrow> map (psubst ?f) ?z \<turnstile> psubst ?f ?p
infinite UNIV

goal (1 subgoal):
 1. map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
have \<open>subcs c s z \<turnstile> psubst ?f (subc c ?s (subst p (App d []) 0))\<close>
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))

goal (1 subgoal):
 1. subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
using psubst_z
[PROOF STATE]
proof (prove)
using this:
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
map (psubst (id(d := fresh, fresh := d))) (subcs c (psubstt (id(d := fresh)) s) z) = subcs c s z

goal (1 subgoal):
 1. subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
[PROOF STEP]
have sub_p: \<open>subcs c s z \<turnstile> subst (subc c (liftt s) p) (App fresh []) 0\<close>
[PROOF STATE]
proof (prove)
using this:
subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
using psubst_p
[PROOF STATE]
proof (prove)
using this:
subcs c s z \<turnstile> psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0]))
psubst (id(d := fresh, fresh := d)) (subc c (psubstt (id(d := fresh)) s) (p[App d []/0])) = subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c (liftt s) p[App fresh []/0]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>new_term fresh s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. new_term fresh s
[PROOF STEP]
using fresh
[PROOF STATE]
proof (prove)
using this:
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}

goal (1 subgoal):
 1. new_term fresh s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
new_term fresh s

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
new_term fresh s
[PROOF STEP]
have \<open>new_term fresh (liftt s)\<close>
[PROOF STATE]
proof (prove)
using this:
new_term fresh s

goal (1 subgoal):
 1. new_term fresh (liftt s)
[PROOF STEP]
using new_lift
[PROOF STATE]
proof (prove)
using this:
new_term fresh s
new_term ?c ?t \<Longrightarrow> new_term ?c (liftt ?t)
new_list ?c ?l \<Longrightarrow> new_list ?c (liftts ?l)

goal (1 subgoal):
 1. new_term fresh (liftt s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
new_term fresh (liftt s)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
new_term fresh (liftt s)
[PROOF STEP]
have \<open>new fresh (subc c (liftt s) p)\<close>
[PROOF STATE]
proof (prove)
using this:
new_term fresh (liftt s)

goal (1 subgoal):
 1. new fresh (subc c (liftt s) p)
[PROOF STEP]
using fresh new_subc
[PROOF STATE]
proof (prove)
using this:
new_term fresh (liftt s)
fresh \<notin> params p \<union> \<Union> (params ` set z) \<union> paramst s \<union> {c} \<union> {d}
\<lbrakk>new_term ?d ?s; new ?d ?p\<rbrakk> \<Longrightarrow> new ?d (subc ?c ?s ?p)

goal (1 subgoal):
 1. new fresh (subc c (liftt s) p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
new fresh (subc c (liftt s) p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
new fresh (subc c (liftt s) p)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
have \<open>news fresh (subcs c s z)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. news fresh (subcs c s z)
[PROOF STEP]
using \<open>news fresh z\<close> \<open>new_term fresh s\<close> news_subcs
[PROOF STATE]
proof (prove)
using this:
news fresh z
new_term fresh s
\<lbrakk>new_term ?d ?s; news ?d ?z\<rbrakk> \<Longrightarrow> news ?d (subcs ?c ?s ?z)

goal (1 subgoal):
 1. news fresh (subcs c s z)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
news fresh (subcs c s z)

goal (1 subgoal):
 1. \<lbrakk>z \<turnstile> p[App d []/0]; \<And>c s. subcs c s z \<turnstile> subc c s (p[App d []/0]); news d z; new d p; c \<noteq> d\<rbrakk> \<Longrightarrow> subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
new fresh (subc c (liftt s) p)
news fresh (subcs c s z)
[PROOF STEP]
show \<open>subcs c s z \<turnstile> subc c s (Forall p)\<close>
[PROOF STATE]
proof (prove)
using this:
new fresh (subc c (liftt s) p)
news fresh (subcs c s z)

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
using deriv.ForallI sub_p
[PROOF STATE]
proof (prove)
using this:
new fresh (subc c (liftt s) p)
news fresh (subcs c s z)
\<lbrakk>?G \<turnstile> ?a[App ?n []/0]; news ?n ?G; new ?n ?a\<rbrakk> \<Longrightarrow> ?G \<turnstile> Forall ?a
subcs c s z \<turnstile> subc c (liftt s) p[App fresh []/0]

goal (1 subgoal):
 1. subcs c s z \<turnstile> subc c s (Forall p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Forall p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subcs c s z \<turnstile> subc c s (Forall p)

goal:
No subgoals!
[PROOF STEP]
qed