[STATEMENT]
lemma veval'_correct:
  assumes "\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> v\<^sub>2" "wellformed t" "wellformed_venv \<Gamma>\<^sub>2"
  assumes "\<not> shadows_consts t" "not_shadows_vconsts_env \<Gamma>\<^sub>2"
  assumes "welldefined t"
  assumes "fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1"
  assumes "fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2"
  assumes "fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2"
  obtains v\<^sub>1 where "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1" "\<turnstile>\<^sub>v v\<^sub>1 \<approx> v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v\<^sub>1. \<lbrakk>rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> v\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply atomize_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> v\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> v\<^sub>2
pre_strong_term_class.wellformed t
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts t
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts t |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> v\<^sub>2
[PROOF STEP]
proof (induction arbitrary: \<Gamma>\<^sub>1)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case (const name \<Gamma>\<^sub>2 val\<^sub>2)
[PROOF STATE]
proof (state)
this:
name |\<notin>| C
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Sconst name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "fmrel_on_fset {|name|} vrelated (fmap_of_list rs) \<Gamma>\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| C
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Sconst name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. fmrel_on_fset {|name|} vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fmrel_on_fset {|name|} vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)
[PROOF STEP]
apply (rule fmrel_on_fsetD[where S = "{|name|}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. name |\<in>| {|name|}
 2. fmrel_on_fset {|name|} vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset {|name|} vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)
[PROOF STEP]
obtain val\<^sub>1 where "fmlookup (fmap_of_list rs) name = Some val\<^sub>1" "\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>fmlookup (fmap_of_list rs) name = Some val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using const
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>\<^sub>2 name)
name |\<notin>| C
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Sconst name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>fmlookup (fmap_of_list rs) name = Some val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
fmlookup (fmap_of_list rs) name = Some val\<^sub>1
\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "(name, val\<^sub>1) \<in> set rs"
[PROOF STATE]
proof (prove)
using this:
fmlookup (fmap_of_list rs) name = Some val\<^sub>1
\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (1 subgoal):
 1. (name, val\<^sub>1) \<in> set rs
[PROOF STEP]
by (auto dest: fmap_of_list_SomeD)
[PROOF STATE]
proof (state)
this:
(name, val\<^sub>1) \<in> set rs

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>\<^sub>1. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>; consts (Sconst name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sconst name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sconst name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 6. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (intro conjI exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> ?v\<^sub>1
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (rule veval.const)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (name, ?v\<^sub>1) \<in> set rs
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sconst name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case (var \<Gamma>\<^sub>2 name val\<^sub>2)
[PROOF STATE]
proof (state)
this:
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Svar name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "fmrel_on_fset {|name|} vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Svar name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. fmrel_on_fset {|name|} vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fmrel_on_fset {|name|} vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)
[PROOF STEP]
apply (rule fmrel_on_fsetD[where S = "{|name|}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. name |\<in>| {|name|}
 2. fmrel_on_fset {|name|} vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset {|name|} vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)
[PROOF STEP]
obtain val\<^sub>1 where "fmlookup \<Gamma>\<^sub>1 name = Some val\<^sub>1" "\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>fmlookup \<Gamma>\<^sub>1 name = Some val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using var
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup \<Gamma>\<^sub>1 name) (fmlookup \<Gamma>\<^sub>2 name)
fmlookup \<Gamma>\<^sub>2 name = Some val\<^sub>2
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (Svar name) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>fmlookup \<Gamma>\<^sub>1 name = Some val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
fmlookup \<Gamma>\<^sub>1 name = Some val\<^sub>1
\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>\<^sub>1. \<lbrakk>fmlookup \<Gamma> name = Some val; pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>; consts (Svar name) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Svar name)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Svar name)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 5. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (intro conjI exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> ?v\<^sub>1
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (rule veval.var)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmlookup \<Gamma>\<^sub>1 name = Some ?v\<^sub>1
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Svar name \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2

goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case abs
[PROOF STATE]
proof (state)
this:
pre_strong_term_class.wellformed (Sabs cs_)
wellformed_venv \<Gamma>_
\<not> shadows_consts (Sabs cs_)
not_shadows_vconsts_env \<Gamma>_
consts (Sabs cs_) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Sabs cs_)) vrelated \<Gamma>\<^sub>1 \<Gamma>_
fmrel_on_fset (consts (Sabs cs_)) vrelated (fmap_of_list rs) \<Gamma>_

goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>; consts (Sabs cs) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 4. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (Sabs cs_)
wellformed_venv \<Gamma>_
\<not> shadows_consts (Sabs cs_)
not_shadows_vconsts_env \<Gamma>_
consts (Sabs cs_) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (Sabs cs_)) vrelated \<Gamma>\<^sub>1 \<Gamma>_
fmrel_on_fset (consts (Sabs cs_)) vrelated (fmap_of_list rs) \<Gamma>_

goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs_ \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs_ \<Gamma>_
[PROOF STEP]
by (auto intro!: veval.abs vrelated.abs)
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v Sabs cs_ \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs_ \<Gamma>_

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case (comb \<Gamma>\<^sub>2 t cs \<Gamma>'\<^sub>2 u u'\<^sub>2 env\<^sub>2 pat rhs val\<^sub>2)
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
[PROOF STEP]
by (auto intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
[PROOF STEP]
obtain v where "\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2" "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
[PROOF STEP]
obtain \<Gamma>'\<^sub>1
    where "v = Vabs cs \<Gamma>'\<^sub>1"
      and "fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2"
      and "fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (1 subgoal):
 1. (\<And>\<Gamma>'\<^sub>1. \<lbrakk>v = Vabs cs \<Gamma>'\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
v = Vabs cs \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
v = Vabs cs \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2
[PROOF STEP]
have "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
\<turnstile>\<^sub>v v \<approx> Vabs cs \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
v = Vabs cs \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>1

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
by (auto intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
obtain u'\<^sub>1 where "\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2" "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2

goal (1 subgoal):
 1. (\<And>u'\<^sub>1. \<lbrakk>\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
[PROOF STEP]
by (rule vrelated.vfind_match_rel') fact
[PROOF STATE]
proof (state)
this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
[PROOF STEP]
obtain env\<^sub>1 where "vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs)" "fmrel vrelated env\<^sub>1 env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)

goal (1 subgoal):
 1. (\<And>env\<^sub>1. \<lbrakk>vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs); fmrel vrelated env\<^sub>1 env\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>vfind_match cs u'\<^sub>2 = _\<close>
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)

goal (1 subgoal):
 1. (\<And>env\<^sub>1. \<lbrakk>vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs); fmrel vrelated env\<^sub>1 env\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs)
fmrel vrelated env\<^sub>1 env\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "(pat, rhs) \<in> set cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) \<in> set cs
[PROOF STEP]
by (rule vfind_match_elem) fact
[PROOF STATE]
proof (state)
this:
(pat, rhs) \<in> set cs

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "vwellformed (Vabs cs \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>'\<^sub>2
 2. pre_strong_term_class.wellformed ?t
 3. wellformed_venv ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
using \<open>wellformed (t $\<^sub>s u)\<close>
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (t $\<^sub>s u)

goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "wellformed_venv \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. wellformed_venv \<Gamma>'\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "vwelldefined v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined v
[PROOF STEP]
apply (rule veval_welldefined)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. rs, ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v
 2. fmpred (\<lambda>_. vwelldefined) ?\<Gamma>
 3. consts ?t |\<subseteq>| all_consts
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts t |\<subseteq>| all_consts
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. consts t |\<subseteq>| all_consts
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vwelldefined v

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "vwelldefined (Vabs cs \<Gamma>'\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined v

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
unfolding \<open>v = _\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "linear pat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear pat
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vwellformed (Vabs cs \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. linear pat
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
linear pat

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "fmdom env\<^sub>1 = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env\<^sub>1 = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vmatch (mk_pat pat) ?v = Some env\<^sub>1
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfind_match ?cs2 ?v = Some (env\<^sub>1, pat, ?rhs2)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>1 = patvars (mk_pat pat)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
with \<open>linear pat\<close>
[PROOF STATE]
proof (chain)
picking this:
linear pat
fmdom env\<^sub>1 = patvars (mk_pat pat)
[PROOF STEP]
have "fmdom env\<^sub>1 = frees pat"
[PROOF STATE]
proof (prove)
using this:
linear pat
fmdom env\<^sub>1 = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env\<^sub>1 = frees pat
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>1 = frees pat

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "fmdom env\<^sub>2 = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env\<^sub>2 = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vmatch (mk_pat pat) ?v = Some env\<^sub>2
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfind_match ?cs2 ?v = Some (env\<^sub>2, pat, ?rhs2)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>2 = patvars (mk_pat pat)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
with \<open>linear pat\<close>
[PROOF STATE]
proof (chain)
picking this:
linear pat
fmdom env\<^sub>2 = patvars (mk_pat pat)
[PROOF STEP]
have "fmdom env\<^sub>2 = frees pat"
[PROOF STATE]
proof (prove)
using this:
linear pat
fmdom env\<^sub>2 = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env\<^sub>2 = frees pat
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>2 = frees pat

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
note fset_of_list_map[simp del]
[PROOF STATE]
proof (state)
this:
fset_of_list (map ?f ?xs) = ?f |`| fset_of_list ?xs

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
proof (rule comb)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 8. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
show "fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
fix name
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
assume "name |\<in>| frees rhs"
[PROOF STATE]
proof (state)
this:
name |\<in>| frees rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
show "rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
proof (cases "name |\<in>| frees pat")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
name |\<in>| frees pat

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "name |\<in>| fmdom env\<^sub>1" "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>1 &&& name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
using \<open>fmdom env\<^sub>1 = frees pat\<close> \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees pat
fmdom env\<^sub>1 = frees pat
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>1 &&& name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>1
name |\<in>| fmdom env\<^sub>2

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name" "fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>1
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
using \<open>fmrel vrelated env\<^sub>1 env\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name
fmrel vrelated env\<^sub>1 env\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
name |\<notin>| frees pat

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "name |\<notin>| fmdom env\<^sub>1" "name |\<notin>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat

goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>1 &&& name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
using \<open>fmdom env\<^sub>1 = frees pat\<close> \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat
fmdom env\<^sub>1 = frees pat
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>1 &&& name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name" "fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
have "name |\<in>| frees (Sabs cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. name |\<in>| frees (Sabs cs)
[PROOF STEP]
using False \<open>name |\<in>| frees rhs\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat
name |\<in>| frees rhs
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. name |\<in>| frees (Sabs cs)
[PROOF STEP]
apply (auto simp: ffUnion_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> fBex (fset_of_list (map (\<lambda>(pat, rhs). frees rhs |-| frees pat) cs)) ((|\<in>|) name)
[PROOF STEP]
apply (rule fBexI[where x = "frees rhs |-| frees pat"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> name |\<in>| frees rhs |-| frees pat
 2. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> frees rhs |-| frees pat |\<in>| fset_of_list (map (\<lambda>(pat, rhs). frees rhs |-| frees pat) cs)
[PROOF STEP]
apply (auto simp: fset_of_list_elem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
name |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
using \<open>fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>'\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts t
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<not> shadows_consts t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
thus "\<not> shadows_consts rhs"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
\<not> shadows_consts rhs

goal (6 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
show "not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. not_shadows_vconsts_env \<Gamma>'\<^sub>2
 2. not_shadows_vconsts_env env\<^sub>2
[PROOF STEP]
using \<open>not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)

goal (2 subgoals):
 1. not_shadows_vconsts_env \<Gamma>'\<^sub>2
 2. not_shadows_vconsts_env env\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env env\<^sub>2
[PROOF STEP]
apply (rule not_shadows_vconsts.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat4 ?v4 = Some env\<^sub>2
 2. not_shadows_vconsts ?v4
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs7 ?v4 = Some (env\<^sub>2, ?pat7, ?rhs7)
 2. not_shadows_vconsts ?v4
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts u'\<^sub>2
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>10 \<turnstile>\<^sub>v ?t10 \<down> u'\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>10
 3. \<not> shadows_consts ?t10
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. not_shadows_vconsts_env \<Gamma>\<^sub>2
 2. \<not> shadows_consts u
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts u
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<not> shadows_consts u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (5 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 5. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
show "fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
fix name
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
assume "name |\<in>| consts rhs"
[PROOF STATE]
proof (state)
this:
name |\<in>| consts rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
hence "name |\<in>| consts (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts rhs

goal (1 subgoal):
 1. name |\<in>| consts (Sabs cs)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts rhs
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. name |\<in>| consts (Sabs cs)
[PROOF STEP]
by (auto intro!: fBexI simp: fset_of_list_elem ffUnion_alt_def)
[PROOF STATE]
proof (state)
this:
name |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
hence "rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)
[PROOF STEP]
using \<open>fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts (Sabs cs)
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
have "name |\<notin>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
assume "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "fmlookup env\<^sub>2 name \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup env\<^sub>2 name \<noteq> None
[PROOF STEP]
by (meson fmdom_notI)
[PROOF STATE]
proof (state)
this:
fmlookup env\<^sub>2 name \<noteq> None

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmlookup env\<^sub>2 name \<noteq> None
[PROOF STEP]
obtain v where "fmlookup env\<^sub>2 name = Some v"
[PROOF STATE]
proof (prove)
using this:
fmlookup env\<^sub>2 name \<noteq> None

goal (1 subgoal):
 1. (\<And>v. fmlookup env\<^sub>2 name = Some v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fmlookup env\<^sub>2 name = Some v

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
fmlookup env\<^sub>2 name = Some v

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
by (auto intro: fmdomI)
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| frees pat"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| frees pat
[PROOF STEP]
using \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<in>| frees pat
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
name |\<in>| frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
have "welldefined rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
using \<open>vwelldefined (Vabs cs \<Gamma>'\<^sub>1)\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| fst |`| fset_of_list rs |\<union>| C"
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. name |\<in>| fst |`| fset_of_list rs |\<union>| C
[PROOF STEP]
using \<open>name |\<in>| consts rhs\<close>
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| all_consts
name |\<in>| consts rhs

goal (1 subgoal):
 1. name |\<in>| fst |`| fset_of_list rs |\<union>| C
[PROOF STEP]
by (auto simp: all_consts_def)
[PROOF STATE]
proof (state)
this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
have "\<not> shadows_consts pat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts pat
[PROOF STEP]
using \<open>not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. \<not> shadows_consts pat
[PROOF STEP]
by (auto simp: list_all_iff shadows_consts_def all_consts_def)
[PROOF STATE]
proof (state)
this:
\<not> shadows_consts pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>name |\<in>| frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat
name |\<in>| frees pat

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding shadows_consts_def fdisjnt_alt_def all_consts_def
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> fst |`| fset_of_list rs |\<union>| C |\<inter>| all_frees pat \<noteq> {||}
name |\<in>| frees pat

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)
name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
show "rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)"
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup \<Gamma>'\<^sub>2 name)
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (4 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
show "wellformed rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_strong_term_class.wellformed rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vwellformed (Vabs cs \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. pre_strong_term_class.wellformed rhs
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
pre_strong_term_class.wellformed rhs

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "wellformed_venv \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>'\<^sub>2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "wellformed_venv env\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv env\<^sub>2
[PROOF STEP]
apply (rule vwellformed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env\<^sub>2
 2. vwellformed ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env\<^sub>2, ?pat3, ?rhs3)
 2. vwellformed ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed u'\<^sub>2
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> u'\<^sub>2
 2. pre_strong_term_class.wellformed ?t6
 3. wellformed_venv ?\<Gamma>6
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
using \<open>wellformed (t $\<^sub>s u)\<close>
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (t $\<^sub>s u)

goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
wellformed_venv env\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wellformed_venv \<Gamma>'\<^sub>2
wellformed_venv env\<^sub>2
[PROOF STEP]
show "wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
wellformed_venv \<Gamma>'\<^sub>2
wellformed_venv env\<^sub>2

goal (1 subgoal):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (2 subgoals):
 1. consts rhs |\<subseteq>| all_consts
 2. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. consts rhs |\<subseteq>| all_consts
 2. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
show "welldefined rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
using \<open>vwelldefined (Vabs cs \<Gamma>'\<^sub>1)\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
[PROOF STEP]
using \<open>vwelldefined (Vabs cs \<Gamma>'\<^sub>1)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "fmpred (\<lambda>_. vwelldefined) env\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) env\<^sub>1
[PROOF STEP]
apply (rule vwelldefined.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env\<^sub>1
 2. vwelldefined ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env\<^sub>1, ?pat3, ?rhs3)
 2. vwelldefined ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined u'\<^sub>1
[PROOF STEP]
apply (rule veval_welldefined)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. rs, ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> u'\<^sub>1
 2. fmpred (\<lambda>_. vwelldefined) ?\<Gamma>6
 3. consts ?t6 |\<subseteq>| all_consts
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
 2. consts u |\<subseteq>| all_consts
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts u |\<subseteq>| all_consts
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'\<^sub>2
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. consts u |\<subseteq>| all_consts
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) env\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
fmpred (\<lambda>_. vwelldefined) env\<^sub>1
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
fmpred (\<lambda>_. vwelldefined) env\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
obtain val\<^sub>1 where "rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1" "\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1
\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vabs cs \<Gamma>'; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 3. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (intro conjI exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v\<^sub>1
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (rule veval.comb)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vabs ?cs2 ?\<Gamma>'2
 2. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> ?u'2
 3. vfind_match ?cs2 ?u'2 = Some (?env2, ?uu2, ?rhs2)
 4. rs, ?\<Gamma>'2 ++\<^sub>f ?env2 \<turnstile>\<^sub>v ?rhs2 \<down> ?v\<^sub>1
 5. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
next
  \<comment> \<open>Almost verbatim copy from \<open>comb\<close> case.\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case (rec_comb \<Gamma>\<^sub>2 t css name \<Gamma>'\<^sub>2 cs u u'\<^sub>2 env\<^sub>2 pat rhs val\<^sub>2)
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
[PROOF STEP]
by (auto intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
[PROOF STEP]
obtain v where "\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2" "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v \<and> \<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
[PROOF STEP]
obtain \<Gamma>'\<^sub>1
    where "v = Vrecabs css name \<Gamma>'\<^sub>1"
      and "fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2"
      and "fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v

goal (1 subgoal):
 1. (\<And>\<Gamma>'\<^sub>1. \<lbrakk>v = Vrecabs css name \<Gamma>'\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>fmlookup css name = Some cs\<close>
[PROOF STATE]
proof (prove)
using this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
fmlookup css name = Some cs

goal (1 subgoal):
 1. (\<And>\<Gamma>'\<^sub>1. \<lbrakk>v = Vrecabs css name \<Gamma>'\<^sub>1; fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2; fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
v = Vrecabs css name \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
v = Vrecabs css name \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)
[PROOF STEP]
have "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
\<turnstile>\<^sub>v v \<approx> Vrecabs css name \<Gamma>'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v
v = Vrecabs css name \<Gamma>'\<^sub>1
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>1

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
by (auto intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2
[PROOF STEP]
obtain u'\<^sub>1 where "\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2" "rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
\<exists>u\<^sub>1'. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u\<^sub>1' \<and> \<turnstile>\<^sub>v u\<^sub>1' \<approx> u'\<^sub>2

goal (1 subgoal):
 1. (\<And>u'\<^sub>1. \<lbrakk>\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<turnstile>\<^sub>v u'\<^sub>1 \<approx> u'\<^sub>2
rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> u'\<^sub>1

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
[PROOF STEP]
by (rule vrelated.vfind_match_rel') fact
[PROOF STATE]
proof (state)
this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
[PROOF STEP]
obtain env\<^sub>1 where "vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs)" "fmrel vrelated env\<^sub>1 env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)

goal (1 subgoal):
 1. (\<And>env\<^sub>1. \<lbrakk>vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs); fmrel vrelated env\<^sub>1 env\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>vfind_match cs u'\<^sub>2 = _\<close>
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel vrelated) (=)) (vfind_match cs u'\<^sub>1) (vfind_match cs u'\<^sub>2)
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)

goal (1 subgoal):
 1. (\<And>env\<^sub>1. \<lbrakk>vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs); fmrel vrelated env\<^sub>1 env\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases auto
[PROOF STATE]
proof (state)
this:
vfind_match cs u'\<^sub>1 = Some (env\<^sub>1, pat, rhs)
fmrel vrelated env\<^sub>1 env\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "(pat, rhs) \<in> set cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) \<in> set cs
[PROOF STEP]
by (rule vfind_match_elem) fact
[PROOF STATE]
proof (state)
this:
(pat, rhs) \<in> set cs

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>'\<^sub>2
 2. pre_strong_term_class.wellformed ?t
 3. wellformed_venv ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
using \<open>wellformed (t $\<^sub>s u)\<close>
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (t $\<^sub>s u)

goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "wellformed_venv \<Gamma>'\<^sub>2" "vwellformed (Vabs cs \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. wellformed_venv \<Gamma>'\<^sub>2 &&& vwellformed (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. wellformed_venv \<Gamma>'\<^sub>2 &&& vwellformed (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "vwelldefined v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined v
[PROOF STEP]
apply (rule veval_welldefined)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. rs, ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v
 2. fmpred (\<lambda>_. vwelldefined) ?\<Gamma>
 3. consts ?t |\<subseteq>| all_consts
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts t |\<subseteq>| all_consts
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. consts t |\<subseteq>| all_consts
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vwelldefined v

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined v

goal (1 subgoal):
 1. vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)
[PROOF STEP]
unfolding \<open>v = _\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
hence "vwelldefined (Vabs cs \<Gamma>'\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name \<Gamma>'\<^sub>1)
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "linear pat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear pat
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vwellformed (Vabs cs \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. linear pat
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
linear pat

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "fmdom env\<^sub>1 = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env\<^sub>1 = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vmatch (mk_pat pat) ?v = Some env\<^sub>1
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfind_match ?cs2 ?v = Some (env\<^sub>1, pat, ?rhs2)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>1 = patvars (mk_pat pat)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
with \<open>linear pat\<close>
[PROOF STATE]
proof (chain)
picking this:
linear pat
fmdom env\<^sub>1 = patvars (mk_pat pat)
[PROOF STEP]
have "fmdom env\<^sub>1 = frees pat"
[PROOF STATE]
proof (prove)
using this:
linear pat
fmdom env\<^sub>1 = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env\<^sub>1 = frees pat
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>1 = frees pat

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "fmdom env\<^sub>2 = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env\<^sub>2 = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vmatch (mk_pat pat) ?v = Some env\<^sub>2
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfind_match ?cs2 ?v = Some (env\<^sub>2, pat, ?rhs2)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>2 = patvars (mk_pat pat)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
with \<open>linear pat\<close>
[PROOF STATE]
proof (chain)
picking this:
linear pat
fmdom env\<^sub>2 = patvars (mk_pat pat)
[PROOF STEP]
have "fmdom env\<^sub>2 = frees pat"
[PROOF STATE]
proof (prove)
using this:
linear pat
fmdom env\<^sub>2 = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env\<^sub>2 = frees pat
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
fmdom env\<^sub>2 = frees pat

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
note fset_of_list_map[simp del]
[PROOF STATE]
proof (state)
this:
fset_of_list (map ?f ?xs) = ?f |`| fset_of_list ?xs

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
proof (rule rec_comb)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 8. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>'\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts t
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<not> shadows_consts t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)

goal (8 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 5. consts rhs |\<subseteq>| all_consts
 6. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 7. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 8. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
thus "\<not> shadows_consts rhs"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> rec_comb
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)
(pat, rhs) \<in> set cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
\<not> shadows_consts rhs

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
hence "fdisjnt all_consts (frees rhs)"
[PROOF STATE]
proof (prove)
using this:
\<not> shadows_consts rhs

goal (1 subgoal):
 1. fdisjnt all_consts (frees rhs)
[PROOF STEP]
by (rule shadows_consts_frees)
[PROOF STATE]
proof (state)
this:
fdisjnt all_consts (frees rhs)

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts_env \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env \<Gamma>'\<^sub>2
[PROOF STEP]
using \<open>not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. not_shadows_vconsts_env \<Gamma>'\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env \<Gamma>'\<^sub>2

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env \<Gamma>'\<^sub>2

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css)
[PROOF STEP]
using \<open>not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. not_shadows_vconsts_env (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css)
[PROOF STEP]
by (auto intro: fmdomI)
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts_env env\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env env\<^sub>2
[PROOF STEP]
apply (rule not_shadows_vconsts.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env\<^sub>2
 2. not_shadows_vconsts ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env\<^sub>2, ?pat3, ?rhs3)
 2. not_shadows_vconsts ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts u'\<^sub>2
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> u'\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>6
 3. \<not> shadows_consts ?t6
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. not_shadows_vconsts_env \<Gamma>\<^sub>2
 2. \<not> shadows_consts u
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts u
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<not> shadows_consts u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env env\<^sub>2

goal (7 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 4. consts rhs |\<subseteq>| all_consts
 5. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 6. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 7. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
not_shadows_vconsts_env \<Gamma>'\<^sub>2
not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)
not_shadows_vconsts_env env\<^sub>2
[PROOF STEP]
show "not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts_env \<Gamma>'\<^sub>2
not_shadows_vconsts_env (mk_rec_env css \<Gamma>'\<^sub>2)
not_shadows_vconsts_env env\<^sub>2

goal (1 subgoal):
 1. not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (6 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 5. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 6. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
have "not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
using \<open>not_shadows_vconsts (Vrecabs _ _ _)\<close> rec_comb
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>'\<^sub>2)
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)

goal (6 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 5. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 6. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
show "fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
fix name
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
assume "name |\<in>| frees rhs"
[PROOF STATE]
proof (state)
this:
name |\<in>| frees rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
name |\<in>| frees rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
have "fmdom css |\<subseteq>| all_consts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom css |\<subseteq>| all_consts
[PROOF STEP]
using \<open>vwelldefined (Vrecabs _ _ _)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name__ \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. fmdom css |\<subseteq>| all_consts
[PROOF STEP]
unfolding all_consts_def
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name__ \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. fmdom css |\<subseteq>| fst |`| fset_of_list rs |\<union>| C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmdom css |\<subseteq>| all_consts

goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
name |\<in>| frees rhs
fmdom css |\<subseteq>| all_consts
[PROOF STEP]
have "name |\<notin>| fmdom css"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees rhs
fmdom css |\<subseteq>| all_consts

goal (1 subgoal):
 1. name |\<notin>| fmdom css
[PROOF STEP]
using \<open>fdisjnt _ (frees rhs)\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees rhs
fmdom css |\<subseteq>| all_consts
fdisjnt all_consts (frees rhs)

goal (1 subgoal):
 1. name |\<notin>| fmdom css
[PROOF STEP]
unfolding fdisjnt_alt_def
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees rhs
fmdom css |\<subseteq>| all_consts
all_consts |\<inter>| frees rhs = {||}

goal (1 subgoal):
 1. name |\<notin>| fmdom css
[PROOF STEP]
by (metis (full_types) fempty_iff finterI fset_rev_mp)
[PROOF STATE]
proof (state)
this:
name |\<notin>| fmdom css

goal (1 subgoal):
 1. \<And>x. x |\<in>| frees rhs \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
show "rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
proof (cases "name |\<in>| frees pat")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
name |\<in>| frees pat

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "name |\<in>| fmdom env\<^sub>1" "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>1 &&& name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
using \<open>fmdom env\<^sub>1 = frees pat\<close> \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| frees pat
fmdom env\<^sub>1 = frees pat
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>1 &&& name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>1
name |\<in>| fmdom env\<^sub>2

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence
                "fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name"
                "fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>1
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name

goal (2 subgoals):
 1. name |\<in>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
 2. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
using \<open>fmrel vrelated env\<^sub>1 env\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup env\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup env\<^sub>2 name
fmrel vrelated env\<^sub>1 env\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
name |\<notin>| frees pat

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence "name |\<notin>| fmdom env\<^sub>1" "name |\<notin>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat

goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>1 &&& name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
using \<open>fmdom env\<^sub>1 = frees pat\<close> \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat
fmdom env\<^sub>1 = frees pat
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>1 &&& name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
hence
                "fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name"
                "fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
[PROOF STEP]
using \<open>name |\<notin>| fmdom css\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| fmdom env\<^sub>1
name |\<notin>| fmdom env\<^sub>2
name |\<notin>| fmdom css

goal (1 subgoal):
 1. fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name &&& fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
have "name |\<in>| frees (Sabs cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. name |\<in>| frees (Sabs cs)
[PROOF STEP]
using False \<open>name |\<in>| frees rhs\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| frees pat
name |\<in>| frees rhs
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. name |\<in>| frees (Sabs cs)
[PROOF STEP]
apply (auto simp: ffUnion_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> fBex (fset_of_list (map (\<lambda>(pat, rhs). frees rhs |-| frees pat) cs)) ((|\<in>|) name)
[PROOF STEP]
apply (rule fBexI[where x = "frees rhs |-| frees pat"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> name |\<in>| frees rhs |-| frees pat
 2. \<lbrakk>name |\<notin>| frees pat; name |\<in>| frees rhs; (pat, rhs) \<in> set cs\<rbrakk> \<Longrightarrow> frees rhs |-| frees pat |\<in>| fset_of_list (map (\<lambda>(pat, rhs). frees rhs |-| frees pat) cs)
[PROOF STEP]
apply (auto simp: fset_of_list_elem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
name |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. name |\<notin>| frees pat \<Longrightarrow> rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
using \<open>fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name = fmlookup \<Gamma>'\<^sub>1 name
fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name = fmlookup \<Gamma>'\<^sub>2 name
name |\<in>| frees (Sabs cs)
fmrel_on_fset (frees (Sabs cs)) vrelated \<Gamma>'\<^sub>1 \<Gamma>'\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (frees rhs) vrelated (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (5 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
 5. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
show "fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
fix name
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
assume "name |\<in>| consts rhs"
[PROOF STATE]
proof (state)
this:
name |\<in>| consts rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
hence "name |\<in>| consts (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts rhs

goal (1 subgoal):
 1. name |\<in>| consts (Sabs cs)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts rhs
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. name |\<in>| consts (Sabs cs)
[PROOF STEP]
by (auto intro!: fBexI simp: fset_of_list_elem ffUnion_alt_def)
[PROOF STATE]
proof (state)
this:
name |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
hence "rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)
[PROOF STEP]
using \<open>fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| consts (Sabs cs)
fmrel_on_fset (consts (Sabs cs)) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
have "name |\<notin>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
assume "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "fmlookup env\<^sub>2 name \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. fmlookup env\<^sub>2 name \<noteq> None
[PROOF STEP]
by (meson fmdom_notI)
[PROOF STATE]
proof (state)
this:
fmlookup env\<^sub>2 name \<noteq> None

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmlookup env\<^sub>2 name \<noteq> None
[PROOF STEP]
obtain v where "fmlookup env\<^sub>2 name = Some v"
[PROOF STATE]
proof (prove)
using this:
fmlookup env\<^sub>2 name \<noteq> None

goal (1 subgoal):
 1. (\<And>v. fmlookup env\<^sub>2 name = Some v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fmlookup env\<^sub>2 name = Some v

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| fmdom env\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
fmlookup env\<^sub>2 name = Some v

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2
[PROOF STEP]
by (auto intro: fmdomI)
[PROOF STATE]
proof (state)
this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| frees pat"
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2

goal (1 subgoal):
 1. name |\<in>| frees pat
[PROOF STEP]
using \<open>fmdom env\<^sub>2 = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fmdom env\<^sub>2
fmdom env\<^sub>2 = frees pat

goal (1 subgoal):
 1. name |\<in>| frees pat
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
name |\<in>| frees pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
have "vwelldefined (Vabs cs \<Gamma>'\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
using \<open>vwelldefined (Vrecabs css _ \<Gamma>'\<^sub>1)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name__ \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vrecabs css name__ \<Gamma>'\<^sub>1)
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name__ \<Gamma>'\<^sub>2
fmlookup css name__ = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name__ \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "welldefined rhs"
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> rec_comb
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
(pat, rhs) \<in> set cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name__ \<Gamma>'\<^sub>2
fmlookup css name__ = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name__ \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
hence "name |\<in>| fst |`| fset_of_list rs |\<union>| C"
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. name |\<in>| fst |`| fset_of_list rs |\<union>| C
[PROOF STEP]
using \<open>name |\<in>| consts rhs\<close> all_consts_def
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| all_consts
name |\<in>| consts rhs
all_consts = fst |`| fset_of_list rs |\<union>| C

goal (1 subgoal):
 1. name |\<in>| fst |`| fset_of_list rs |\<union>| C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
have "\<not> shadows_consts pat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts pat
[PROOF STEP]
using \<open>not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>'\<^sub>2)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. \<not> shadows_consts pat
[PROOF STEP]
by (auto simp: list_all_iff shadows_consts_def all_consts_def)
[PROOF STATE]
proof (state)
this:
\<not> shadows_consts pat

goal (1 subgoal):
 1. name |\<in>| fmdom env\<^sub>2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>name |\<in>| frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> shadows_consts pat
name |\<in>| frees pat

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding shadows_consts_def fdisjnt_alt_def all_consts_def
[PROOF STATE]
proof (prove)
using this:
name |\<in>| fst |`| fset_of_list rs |\<union>| C
\<not> fst |`| fset_of_list rs |\<union>| C |\<inter>| all_frees pat \<noteq> {||}
name |\<in>| frees pat

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. \<And>x. x |\<in>| consts rhs \<Longrightarrow> rel_option vrelated (fmlookup (fmap_of_list rs) x) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)
name |\<notin>| fmdom env\<^sub>2
[PROOF STEP]
show "rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)"
[PROOF STATE]
proof (prove)
using this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2) name)
name |\<notin>| fmdom env\<^sub>2

goal (1 subgoal):
 1. rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rel_option vrelated (fmlookup (fmap_of_list rs) name) (fmlookup (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2) name)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (4 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. pre_strong_term_class.wellformed rhs
 2. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 3. consts rhs |\<subseteq>| all_consts
 4. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
show "wellformed rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_strong_term_class.wellformed rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vwellformed (Vabs cs \<Gamma>'\<^sub>2)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. pre_strong_term_class.wellformed rhs
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
pre_strong_term_class.wellformed rhs

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "wellformed_venv \<Gamma>'\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>'\<^sub>2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>'\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "wellformed_venv env\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv env\<^sub>2
[PROOF STEP]
apply (rule vwellformed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env\<^sub>2
 2. vwellformed ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env\<^sub>2, ?pat3, ?rhs3)
 2. vwellformed ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed u'\<^sub>2
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> u'\<^sub>2
 2. pre_strong_term_class.wellformed ?t6
 3. wellformed_venv ?\<Gamma>6
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
using \<open>wellformed (t $\<^sub>s u)\<close>
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (t $\<^sub>s u)

goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
wellformed_venv env\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wellformed_venv env\<^sub>2

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "wellformed_venv (mk_rec_env css \<Gamma>'\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv (mk_rec_env css \<Gamma>'\<^sub>2)
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css)
[PROOF STEP]
using \<open>vwellformed (Vrecabs _ _ _)\<close>
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. wellformed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>'\<^sub>2) css)
[PROOF STEP]
by (auto intro: fmdomI)
[PROOF STATE]
proof (state)
this:
wellformed_venv (mk_rec_env css \<Gamma>'\<^sub>2)

goal (3 subgoals):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
 2. consts rhs |\<subseteq>| all_consts
 3. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wellformed_venv \<Gamma>'\<^sub>2
wellformed_venv env\<^sub>2
wellformed_venv (mk_rec_env css \<Gamma>'\<^sub>2)
[PROOF STEP]
show "wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)"
[PROOF STATE]
proof (prove)
using this:
wellformed_venv \<Gamma>'\<^sub>2
wellformed_venv env\<^sub>2
wellformed_venv (mk_rec_env css \<Gamma>'\<^sub>2)

goal (1 subgoal):
 1. wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)

goal (2 subgoals):
 1. consts rhs |\<subseteq>| all_consts
 2. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. consts rhs |\<subseteq>| all_consts
 2. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
show "welldefined rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
using \<open>vwelldefined (Vabs cs \<Gamma>'\<^sub>1)\<close> \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. consts rhs |\<subseteq>| all_consts
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| all_consts

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
[PROOF STEP]
using \<open>vwelldefined (Vabs cs \<Gamma>'\<^sub>1)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined (Vabs cs \<Gamma>'\<^sub>1)

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
have "fmpred (\<lambda>_. vwelldefined) env\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) env\<^sub>1
[PROOF STEP]
apply (rule vwelldefined.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env\<^sub>1
 2. vwelldefined ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env\<^sub>1, ?pat3, ?rhs3)
 2. vwelldefined ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined u'\<^sub>1
[PROOF STEP]
apply (rule veval_welldefined)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. rs, ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> u'\<^sub>1
 2. fmpred (\<lambda>_. vwelldefined) ?\<Gamma>6
 3. consts ?t6 |\<subseteq>| all_consts
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
 2. consts u |\<subseteq>| all_consts
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts u |\<subseteq>| all_consts
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'\<^sub>2
fmlookup css name = Some cs
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v u \<down> u'\<^sub>2
vfind_match cs u'\<^sub>2 = Some (env\<^sub>2, pat, rhs)
\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2 \<turnstile>\<^sub>v rhs \<down> val\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees t) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>\<^sub>2; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<^sub>2; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees u) vrelated ?\<Gamma>\<^sub>14 \<Gamma>\<^sub>2; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'\<^sub>2
\<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) ?\<Gamma>\<^sub>14; fmrel_on_fset (frees rhs) vrelated ?\<Gamma>\<^sub>14 (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>'\<^sub>2 ++\<^sub>f mk_rec_env css \<Gamma>'\<^sub>2 ++\<^sub>f env\<^sub>2)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, ?\<Gamma>\<^sub>14 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (t $\<^sub>s u) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. consts u |\<subseteq>| all_consts
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) env\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
fmpred (\<lambda>_. vwelldefined) env\<^sub>1
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)"
[PROOF STATE]
proof (prove)
using this:
fmpred (\<lambda>_. vwelldefined) \<Gamma>'\<^sub>1
fmpred (\<lambda>_. vwelldefined) env\<^sub>1

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined) (\<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
obtain val\<^sub>1 where "rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1" "\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<exists>val\<^sub>1. rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1 \<and> \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (1 subgoal):
 1. (\<And>val\<^sub>1. \<lbrakk>rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1; \<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rs, \<Gamma>'\<^sub>1 ++\<^sub>f env\<^sub>1 \<turnstile>\<^sub>v rhs \<down> val\<^sub>1
\<turnstile>\<^sub>v val\<^sub>1 \<approx> val\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>\<^sub>1. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>; consts t |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vrecabs css name \<Gamma>'; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>; consts u |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees u) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts u) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> u'; vfind_match cs u' = Some (env, uv_, rhs); \<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>\<^sub>1. \<lbrakk>pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); consts rhs |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees rhs) vrelated \<Gamma>\<^sub>1 (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fmrel_on_fset (consts rhs) vrelated (fmap_of_list rs) (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v rhs \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val; pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>; consts (t $\<^sub>s u) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (t $\<^sub>s u)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (t $\<^sub>s u)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val
 2. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (intro conjI exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v\<^sub>1
 2. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply (rule veval.rec_comb)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> Vrecabs ?css2 ?name2 ?\<Gamma>'2
 2. fmlookup ?css2 ?name2 = Some ?cs2
 3. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v u \<down> ?u'2
 4. vfind_match ?cs2 ?u'2 = Some (?env2, ?uv2, ?rhs2)
 5. rs, ?\<Gamma>'2 ++\<^sub>f ?env2 \<turnstile>\<^sub>v ?rhs2 \<down> ?v\<^sub>1
 6. \<turnstile>\<^sub>v ?v\<^sub>1 \<approx> val\<^sub>2
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t $\<^sub>s u \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> val\<^sub>2

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
case (constr name \<Gamma>\<^sub>2 ts us\<^sub>2)
[PROOF STATE]
proof (state)
this:
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (name $$ ts) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
have "list_all2 (\<lambda>t u\<^sub>2. (\<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2)) ts us\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>t u\<^sub>2. \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2) ts us\<^sub>2
[PROOF STEP]
using \<open>list_all2 _ ts us\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2

goal (1 subgoal):
 1. list_all2 (\<lambda>t u\<^sub>2. \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2) ts us\<^sub>2
[PROOF STEP]
proof (rule list.rel_mono_strong, elim conjE impE allE exE)
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> pre_strong_term_class.wellformed z
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> wellformed_venv \<Gamma>\<^sub>2
 3. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> \<not> shadows_consts z
 4. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2
 5. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> consts z |\<subseteq>| all_consts
 6. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined) (?x9 z yb)
 7. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated (?x9 z yb) \<Gamma>\<^sub>2
 8. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 9. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, ?x9 z yb \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
fix t u\<^sub>2
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> pre_strong_term_class.wellformed z
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> wellformed_venv \<Gamma>\<^sub>2
 3. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> \<not> shadows_consts z
 4. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2
 5. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> consts z |\<subseteq>| all_consts
 6. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined) (?x9 z yb)
 7. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated (?x9 z yb) \<Gamma>\<^sub>2
 8. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 9. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, ?x9 z yb \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
assume "t \<in> set ts" "u\<^sub>2 \<in> set us\<^sub>2"
[PROOF STATE]
proof (state)
this:
t \<in> set ts
u\<^sub>2 \<in> set us\<^sub>2

goal (9 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> pre_strong_term_class.wellformed z
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> wellformed_venv \<Gamma>\<^sub>2
 3. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> \<not> shadows_consts z
 4. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2
 5. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> consts z |\<subseteq>| all_consts
 6. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined) (?x9 z yb)
 7. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated (?x9 z yb) \<Gamma>\<^sub>2
 8. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 9. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, ?x9 z yb \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
assume "\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> u\<^sub>2"
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>2 \<turnstile>\<^sub>v t \<down> u\<^sub>2

goal (9 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> pre_strong_term_class.wellformed z
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> wellformed_venv \<Gamma>\<^sub>2
 3. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> \<not> shadows_consts z
 4. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2
 5. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> consts z |\<subseteq>| all_consts
 6. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined) (?x9 z yb)
 7. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated (?x9 z yb) \<Gamma>\<^sub>2
 8. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 9. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, ?x9 z yb \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
show "wellformed t" "welldefined t" "\<not> shadows_consts t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_strong_term_class.wellformed t &&& consts t |\<subseteq>| all_consts &&& \<not> shadows_consts t
[PROOF STEP]
using constr \<open>t \<in> set ts\<close>
[PROOF STATE]
proof (prove)
using this:
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (name $$ ts) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
t \<in> set ts

goal (1 subgoal):
 1. pre_strong_term_class.wellformed t &&& consts t |\<subseteq>| all_consts &&& \<not> shadows_consts t
[PROOF STEP]
unfolding welldefined.list_comb wellformed.list_comb shadows.list_comb
[PROOF STATE]
proof (prove)
using this:
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (const name) \<and> list_all pre_strong_term_class.wellformed ts
wellformed_venv \<Gamma>\<^sub>2
\<not> (shadows_consts (const name) \<or> list_ex shadows_consts ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (const name) |\<subseteq>| all_consts \<and> list_all (\<lambda>t. consts t |\<subseteq>| all_consts) ts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
t \<in> set ts

goal (1 subgoal):
 1. pre_strong_term_class.wellformed t &&& consts t |\<subseteq>| all_consts &&& \<not> shadows_consts t
[PROOF STEP]
by (auto simp: list_all_iff list_ex_iff)
[PROOF STATE]
proof (state)
this:
pre_strong_term_class.wellformed t
consts t |\<subseteq>| all_consts
\<not> shadows_consts t

goal (6 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> wellformed_venv \<Gamma>\<^sub>2
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2
 3. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined) (?x9 z yb)
 4. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated (?x9 z yb) \<Gamma>\<^sub>2
 5. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 6. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, ?x9 z yb \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
show
        "wellformed_venv \<Gamma>\<^sub>2"
        "not_shadows_vconsts_env \<Gamma>\<^sub>2"
        "fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv \<Gamma>\<^sub>2 &&& not_shadows_vconsts_env \<Gamma>\<^sub>2 &&& fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
[PROOF STEP]
by fact+
[PROOF STATE]
proof (state)
this:
wellformed_venv \<Gamma>\<^sub>2
not_shadows_vconsts_env \<Gamma>\<^sub>2
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1

goal (3 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 3. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
have "consts t |\<in>| fset_of_list (map consts ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts t |\<in>| fset_of_list (map consts ts)
[PROOF STEP]
using \<open>t \<in> set ts\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> set ts

goal (1 subgoal):
 1. consts t |\<in>| fset_of_list (map consts ts)
[PROOF STEP]
by (simp add: fset_of_list_elem)
[PROOF STATE]
proof (state)
this:
consts t |\<in>| fset_of_list (map consts ts)

goal (3 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 3. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
hence "consts t |\<subseteq>| consts (name $$ ts)"
[PROOF STATE]
proof (prove)
using this:
consts t |\<in>| fset_of_list (map consts ts)

goal (1 subgoal):
 1. consts t |\<subseteq>| consts (name $$ ts)
[PROOF STEP]
unfolding consts_list_comb
[PROOF STATE]
proof (prove)
using this:
consts t |\<in>| fset_of_list (map consts ts)

goal (1 subgoal):
 1. consts t |\<subseteq>| consts (const name) |\<union>| ffUnion (fset_of_list (map consts ts))
[PROOF STEP]
by (metis ffUnion_subset_elem le_supI2)
[PROOF STATE]
proof (state)
this:
consts t |\<subseteq>| consts (name $$ ts)

goal (3 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (consts z) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
 3. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
thus "fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
consts t |\<subseteq>| consts (name $$ ts)

goal (1 subgoal):
 1. fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
[PROOF STEP]
using constr
[PROOF STATE]
proof (prove)
using this:
consts t |\<subseteq>| consts (name $$ ts)
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (name $$ ts) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2
[PROOF STEP]
by (blast intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (consts t) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (2 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
have "frees t |\<in>| fset_of_list (map frees ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees t |\<in>| fset_of_list (map frees ts)
[PROOF STEP]
using \<open>t \<in> set ts\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> set ts

goal (1 subgoal):
 1. frees t |\<in>| fset_of_list (map frees ts)
[PROOF STEP]
by (simp add: fset_of_list_elem)
[PROOF STATE]
proof (state)
this:
frees t |\<in>| fset_of_list (map frees ts)

goal (2 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
hence "frees t |\<subseteq>| frees (name $$ ts)"
[PROOF STATE]
proof (prove)
using this:
frees t |\<in>| fset_of_list (map frees ts)

goal (1 subgoal):
 1. frees t |\<subseteq>| frees (name $$ ts)
[PROOF STEP]
unfolding frees_list_comb const_sterm_def freess_def
[PROOF STATE]
proof (prove)
using this:
frees t |\<in>| fset_of_list (map frees ts)

goal (1 subgoal):
 1. frees t |\<subseteq>| frees (Sconst name) |\<union>| (ffUnion \<circ> fset_of_list \<circ> map frees) ts
[PROOF STEP]
by (auto intro!: ffUnion_subset_elem)
[PROOF STATE]
proof (state)
this:
frees t |\<subseteq>| frees (name $$ ts)

goal (2 subgoals):
 1. \<And>z yb. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb\<rbrakk> \<Longrightarrow> fmrel_on_fset (frees z) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
 2. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
thus "fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
frees t |\<subseteq>| frees (name $$ ts)

goal (1 subgoal):
 1. fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
[PROOF STEP]
using constr
[PROOF STATE]
proof (prove)
using this:
frees t |\<subseteq>| frees (name $$ ts)
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (name $$ ts) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
[PROOF STEP]
by (blast intro: fmrel_on_fsubset)
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (frees t) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<And>z yb v\<^sub>1. \<lbrakk>z \<in> set ts; yb \<in> set us\<^sub>2; list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2; \<Gamma>\<^sub>2 \<turnstile>\<^sub>v z \<down> yb; rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> v\<^sub>1; \<turnstile>\<^sub>v v\<^sub>1 \<approx> yb\<rbrakk> \<Longrightarrow> \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v z \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> yb
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>t u\<^sub>2. \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2) ts us\<^sub>2

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 (\<lambda>t u\<^sub>2. \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2) ts us\<^sub>2
[PROOF STEP]
obtain us\<^sub>1 where "list_all2 (veval rs \<Gamma>\<^sub>1) ts us\<^sub>1" "list_all2 vrelated us\<^sub>1 us\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>t u\<^sub>2. \<exists>u\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v t \<down> u\<^sub>1 \<and> \<turnstile>\<^sub>v u\<^sub>1 \<approx> u\<^sub>2) ts us\<^sub>2

goal (1 subgoal):
 1. (\<And>us\<^sub>1. \<lbrakk>list_all2 (veval rs \<Gamma>\<^sub>1) ts us\<^sub>1; list_all2 vrelated us\<^sub>1 us\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by induction auto
[PROOF STATE]
proof (state)
this:
list_all2 (veval rs \<Gamma>\<^sub>1) ts us\<^sub>1
list_all2 vrelated us\<^sub>1 us\<^sub>2

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>\<^sub>1. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma> \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma> \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us; pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>; consts (name $$ ts) |\<subseteq>| all_consts; fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1; fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>; fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<rbrakk> \<Longrightarrow> \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
list_all2 (veval rs \<Gamma>\<^sub>1) ts us\<^sub>1
list_all2 vrelated us\<^sub>1 us\<^sub>2

goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us\<^sub>2
[PROOF STEP]
using constr
[PROOF STATE]
proof (prove)
using this:
list_all2 (veval rs \<Gamma>\<^sub>1) ts us\<^sub>1
list_all2 vrelated us\<^sub>1 us\<^sub>2
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma>\<^sub>2 \<turnstile>\<^sub>v x1 \<down> x2 \<and> (pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma>\<^sub>2 \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma>\<^sub>2 \<longrightarrow> consts x1 |\<subseteq>| all_consts \<longrightarrow> (\<forall>x. fmpred (\<lambda>_. vwelldefined) x \<longrightarrow> fmrel_on_fset (frees x1) vrelated x \<Gamma>\<^sub>2 \<longrightarrow> fmrel_on_fset (consts x1) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2 \<longrightarrow> (\<exists>v\<^sub>1. rs, x \<turnstile>\<^sub>v x1 \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> x2)))) ts us\<^sub>2
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>\<^sub>2
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>\<^sub>2
consts (name $$ ts) |\<subseteq>| all_consts
fmpred (\<lambda>_. vwelldefined) \<Gamma>\<^sub>1
fmrel_on_fset (frees (name $$ ts)) vrelated \<Gamma>\<^sub>1 \<Gamma>\<^sub>2
fmrel_on_fset (consts (name $$ ts)) vrelated (fmap_of_list rs) \<Gamma>\<^sub>2

goal (1 subgoal):
 1. \<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us\<^sub>2
[PROOF STEP]
by (auto intro: veval.constr vrelated.constr)
[PROOF STATE]
proof (state)
this:
\<exists>v\<^sub>1. rs, \<Gamma>\<^sub>1 \<turnstile>\<^sub>v name $$ ts \<down> v\<^sub>1 \<and> \<turnstile>\<^sub>v v\<^sub>1 \<approx> Vconstr name us\<^sub>2

goal:
No subgoals!
[PROOF STEP]
qed