[STATEMENT]
lemma (in constants) veval'_agree_eq:
  assumes "\<Gamma> \<turnstile>\<^sub>v t \<down> v" "fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>"
  assumes "closed_venv \<Gamma>" "closed_except t (fmdom \<Gamma>)"
  assumes "wellformed t" "wellformed_venv \<Gamma>" "fdisjnt C (fmdom \<Gamma>)"
  assumes "consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C" "fmpred (\<lambda>_. vwelldefined') \<Gamma>"
  assumes "\<not> shadows_consts t" "not_shadows_vconsts_env \<Gamma>"
  obtains v' where "\<Gamma>' \<turnstile>\<^sub>v t \<down> v'" "v' \<approx>\<^sub>e v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> v
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts t
not_shadows_vconsts_env \<Gamma>

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

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>' thesis. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sconst name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 6. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "name |\<in>| ids (Sconst name)"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| C
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sconst name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. name |\<in>| ids (Sconst name)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| C
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (frees (Sconst name) |\<union>| consts (Sconst name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sconst name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>

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

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>' thesis. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sconst name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 6. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with const
[PROOF STATE]
proof (chain)
picking this:
name |\<notin>| C
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sconst name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>
name |\<in>| ids (Sconst name)
[PROOF STEP]
have "rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)"
[PROOF STATE]
proof (prove)
using this:
name |\<notin>| C
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sconst name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>
name |\<in>| ids (Sconst name)

goal (1 subgoal):
 1. rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)

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

goal (1 subgoal):
 1. (\<And>val'. \<lbrakk>fmlookup \<Gamma>' name = Some val'; val' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>fmlookup \<Gamma> name = Some val\<close>
[PROOF STATE]
proof (prove)
using this:
rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)
fmlookup \<Gamma> name = Some val

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

goal (6 subgoals):
 1. \<And>name \<Gamma> val \<Gamma>' thesis. \<lbrakk>name |\<notin>| C; fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sconst name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sconst name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sconst name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 6. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma>' name = Some val'
val' \<approx>\<^sub>e val

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using const
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma>' name = Some val'
val' \<approx>\<^sub>e val
name |\<notin>| C
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sconst name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sconst name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sconst name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sconst name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sconst name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sconst name)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (auto intro: veval'.const)
[PROOF STATE]
proof (state)
this:
thesis

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (var \<Gamma> name val)
[PROOF STATE]
proof (state)
this:
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "name |\<in>| ids (Svar name)"
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. name |\<in>| ids (Svar name)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (frees (Svar name) |\<union>| consts (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>

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

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with var
[PROOF STATE]
proof (chain)
picking this:
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>
name |\<in>| ids (Svar name)
[PROOF STEP]
have "rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)"
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>
name |\<in>| ids (Svar name)

goal (1 subgoal):
 1. rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)
[PROOF STEP]
by (auto dest: fmrel_on_fsetD)
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)

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

goal (1 subgoal):
 1. (\<And>val'. \<lbrakk>fmlookup \<Gamma>' name = Some val'; val' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>fmlookup \<Gamma> name = Some val\<close>
[PROOF STATE]
proof (prove)
using this:
rel_option erelated (fmlookup \<Gamma>' name) (fmlookup \<Gamma> name)
fmlookup \<Gamma> name = Some val

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

goal (5 subgoals):
 1. \<And>\<Gamma> name val \<Gamma>' thesis. \<lbrakk>fmlookup \<Gamma> name = Some val; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Svar name) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Svar name); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Svar name); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 5. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma>' name = Some val'
val' \<approx>\<^sub>e val

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using var
[PROOF STATE]
proof (prove)
using this:
fmlookup \<Gamma>' name = Some val'
val' \<approx>\<^sub>e val
fmlookup \<Gamma> name = Some val
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Svar name \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Svar name)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Svar name) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Svar name)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Svar name) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Svar name)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (auto intro: veval'.var)
[PROOF STATE]
proof (state)
this:
thesis

goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (abs \<Gamma> cs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> ?v'4; ?v'4 \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sabs cs) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sabs cs)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sabs cs)
not_shadows_vconsts_env \<Gamma>

goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "Vabs cs \<Gamma>' \<approx>\<^sub>e Vabs cs \<Gamma>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> ?v'4; ?v'4 \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sabs cs) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sabs cs)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sabs cs)
not_shadows_vconsts_env \<Gamma>

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

goal (4 subgoals):
 1. \<And>\<Gamma> cs \<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (Sabs cs) (fmdom \<Gamma>); pre_strong_term_class.wellformed (Sabs cs); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (Sabs cs); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 4. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Vabs cs \<Gamma>' \<approx>\<^sub>e Vabs cs \<Gamma>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using abs
[PROOF STATE]
proof (prove)
using this:
Vabs cs \<Gamma>' \<approx>\<^sub>e Vabs cs \<Gamma>
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v Sabs cs \<down> ?v'4; ?v'4 \<approx>\<^sub>e Vabs cs \<Gamma>\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (Sabs cs) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (Sabs cs)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (Sabs cs) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (Sabs cs)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (auto intro: veval'.abs)
[PROOF STATE]
proof (state)
this:
thesis

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (comb \<Gamma> t cs \<Gamma>\<^sub>\<Lambda> u v\<^sub>2 env pat rhs val)
[PROOF STATE]
proof (state)
this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
apply (rule fmrel_on_fsubset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmrel_on_fset ?S erelated \<Gamma>' \<Gamma>
 2. ids t |\<subseteq>| ?S
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ids t |\<subseteq>| ids (t $\<^sub>s u)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees t |\<union>| consts t |\<subseteq>| frees (t $\<^sub>s u) |\<union>| consts (t $\<^sub>s u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
obtain v\<^sub>1' where "\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'" "v\<^sub>1' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>

goal (1 subgoal):
 1. (\<And>v\<^sub>1'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'; v\<^sub>1' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'
v\<^sub>1' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
obtain \<Gamma>\<^sub>\<Lambda>' where "v\<^sub>1' = Vabs cs \<Gamma>\<^sub>\<Lambda>'" "fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'
v\<^sub>1' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. (\<And>\<Gamma>\<^sub>\<Lambda>'. \<lbrakk>v\<^sub>1' = Vabs cs \<Gamma>\<^sub>\<Lambda>'; fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: erelated.cases)
[PROOF STATE]
proof (state)
this:
v\<^sub>1' = Vabs cs \<Gamma>\<^sub>\<Lambda>'
fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
apply (rule fmrel_on_fsubset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmrel_on_fset ?S erelated \<Gamma>' \<Gamma>
 2. ids u |\<subseteq>| ?S
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ids u |\<subseteq>| ids (t $\<^sub>s u)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees u |\<union>| consts u |\<subseteq>| frees (t $\<^sub>s u) |\<union>| consts (t $\<^sub>s u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>

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

goal (1 subgoal):
 1. (\<And>v\<^sub>2'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'; v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>v\<^sub>2'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'; v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply (erule comb.IH(2))
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
 2. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_venv \<Gamma>
 3. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_except u (fmdom \<Gamma>)
 4. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> pre_strong_term_class.wellformed u
 5. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> wellformed_venv \<Gamma>
 6. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fdisjnt C (fmdom \<Gamma>)
 7. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 8. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma>
 9. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> \<not> shadows_consts u
 10. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (10 subgoals):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
 2. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_venv \<Gamma>
 3. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_except u (fmdom \<Gamma>)
 4. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> pre_strong_term_class.wellformed u
 5. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> wellformed_venv \<Gamma>
 6. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fdisjnt C (fmdom \<Gamma>)
 7. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 8. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma>
 9. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> \<not> shadows_consts u
 10. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'
v\<^sub>2' \<approx>\<^sub>e v\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
[PROOF STEP]
using \<open>v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
v\<^sub>2' \<approx>\<^sub>e v\<^sub>2

goal (1 subgoal):
 1. rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
[PROOF STEP]
by (rule erelated.vfind_match_rel')
[PROOF STATE]
proof (state)
this:
rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)

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

goal (1 subgoal):
 1. (\<And>env'. \<lbrakk>fmrel erelated env' env; vfind_match cs v\<^sub>2' = Some (env', pat, rhs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_closed)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vclosed v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed v\<^sub>2
[PROOF STEP]
apply (rule veval'_closed)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
vclosed v\<^sub>2

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
by (auto simp: Sterm.closed_except_simps)
[PROOF STATE]
proof (state)
this:
closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
unfolding closed_except_def
[PROOF STATE]
proof (prove)
using this:
frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 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>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[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>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "linear pat"
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. linear pat
[PROOF STEP]
using \<open>vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "frees pat = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
using this:
linear pat

goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat)
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
frees pat = patvars (mk_pat pat)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "fmdom env = frees pat"
[PROOF STATE]
proof (prove)
using this:
frees pat = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env = frees pat
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> fmdom env = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> vmatch (mk_pat pat) ?v1 = Some env
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> vfind_match ?cs3 ?v1 = Some (env, pat, ?rhs3)
[PROOF STEP]
apply (rule comb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env = frees pat

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| C" "fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| C &&& fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| C &&& fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| C
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain val' where "\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'" "val' \<approx>\<^sub>e val"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>val'. \<lbrakk>\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'; val' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (erule comb.IH)
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 3. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. pre_strong_term_class.wellformed rhs
 5. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 7. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 8. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 9. \<not> shadows_consts rhs
 10. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. closed_venv \<Gamma>\<^sub>\<Lambda>
 2. closed_venv env
[PROOF STEP]
using \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. closed_venv \<Gamma>\<^sub>\<Lambda>
 2. closed_venv env
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_venv env
[PROOF STEP]
apply (rule vclosed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat4 ?v4 = Some env
 2. vclosed ?v4
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs7 ?v4 = Some (env, ?pat7, ?rhs7)
 2. vclosed ?v4
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed v\<^sub>2
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (9 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. pre_strong_term_class.wellformed rhs
 4. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 6. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 7. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 8. \<not> shadows_consts rhs
 9. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. pre_strong_term_class.wellformed rhs
 4. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 6. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 7. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 8. \<not> shadows_consts rhs
 9. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[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>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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 (8 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 5. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 6. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 7. \<not> shadows_consts rhs
 8. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 5. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 6. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 7. \<not> shadows_consts rhs
 8. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wellformed_venv \<Gamma>\<^sub>\<Lambda>
 2. wellformed_venv env
[PROOF STEP]
using \<open>vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. wellformed_venv \<Gamma>\<^sub>\<Lambda>
 2. wellformed_venv env
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv env
[PROOF STEP]
apply (rule vwellformed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat4 ?v4 = Some env
 2. vwellformed ?v4
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs7 ?v4 = Some (env, ?pat7, ?rhs7)
 2. vwellformed ?v4
[PROOF STEP]
apply (rule comb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed v\<^sub>2
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>9 \<turnstile>\<^sub>v ?t9 \<down> v\<^sub>2
 2. pre_strong_term_class.wellformed ?t9
 3. wellformed_venv ?\<Gamma>9
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (7 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 5. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. \<not> shadows_consts rhs
 7. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 5. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. \<not> shadows_consts rhs
 7. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close> \<open>fmdom env = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
fmdom env = frees pat

goal (1 subgoal):
 1. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fmdom env = fmdom env'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env = fmdom env'
[PROOF STEP]
using \<open>fmrel erelated env' env\<close>
[PROOF STATE]
proof (prove)
using this:
fmrel erelated env' env

goal (1 subgoal):
 1. fmdom env = fmdom env'
[PROOF STEP]
by (metis fmrel_fmdom_eq)
[PROOF STATE]
proof (state)
this:
fmdom env = fmdom env'

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
fix id
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
assume "id |\<in>| ids rhs"
[PROOF STATE]
proof (state)
this:
id |\<in>| ids rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
thus "rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| ids rhs

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs |\<union>| consts rhs

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
proof (cases rule: funion_strictE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case A
[PROOF STATE]
proof (state)
this:
id |\<in>| frees rhs

goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
using \<open>closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
unfolding closed_except_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs
frees rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
proof (cases rule: funion_strictE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case A
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env

goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| fmdom env'"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env

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

goal (1 subgoal):
 1. id |\<in>| fmdom env'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env'

goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
id |\<in>| fmdom env
id |\<in>| fmdom env'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env
id |\<in>| fmdom env'

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>fmrel erelated env' env\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env
id |\<in>| fmdom env'
fmrel erelated env' env

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case B
[PROOF STATE]
proof (state)
this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<notin>| frees pat"
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

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

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| frees (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| frees pat

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| ffUnion ((\<lambda>(pat, rhs). frees rhs |-| frees pat) |`| fset_of_list cs)
[PROOF STEP]
unfolding ffUnion_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> fBex ((\<lambda>(pat, rhs). frees rhs |-| frees pat) |`| fset_of_list cs) ((|\<in>|) id)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> fBex (fset_of_list cs) (\<lambda>x. id |\<in>| (case x of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat))
[PROOF STEP]
apply (rule fBexI[where x = "(pat, rhs)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| (case (pat, rhs) of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat)
 2. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
using \<open>id |\<in>| frees rhs\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs

goal (2 subgoals):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| (case (pat, rhs) of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat)
 2. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
unfolding fset_of_list_elem
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) \<in> set cs
[PROOF STEP]
apply (rule \<open>(pat, rhs) \<in> set cs\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| ids (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| ids (Sabs cs)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs) |\<union>| consts (Sabs cs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<in>| ids (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
have "id |\<notin>| fmdom env'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
unfolding \<open>fmdom env = fmdom env'\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<notin>| fmdom env'

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>id |\<notin>| fmdom env\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'
id |\<notin>| fmdom env

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env\<rbrakk> \<Longrightarrow> id |\<in>| ?S2
 2. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S2 erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>id |\<in>| ids (Sabs cs)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case B
[PROOF STATE]
proof (state)
this:
id |\<notin>| frees rhs
id |\<in>| consts rhs

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
have "id |\<in>| consts (Sabs cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<in>| consts (Sabs cs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<in>| ffUnion ((\<lambda>(uu_, y). consts y) |`| fset_of_list cs)
[PROOF STEP]
unfolding ffUnion_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBex ((\<lambda>(uu_, y). consts y) |`| fset_of_list cs) ((|\<in>|) id)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBex (fset_of_list cs) (\<lambda>x. id |\<in>| (case x of (uu_, x) \<Rightarrow> consts x))
[PROOF STEP]
apply (rule fBexI[where x = "(pat, rhs)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<in>| (case (pat, rhs) of (uu_, x) \<Rightarrow> consts x)
 2. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<in>| consts rhs
 2. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
unfolding fset_of_list_elem
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) \<in> set cs
[PROOF STEP]
apply (rule \<open>(pat, rhs) \<in> set cs\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| ids (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| ids (Sabs cs)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs) |\<union>| consts (Sabs cs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
id |\<in>| ids (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>fmdom env = fmdom env'\<close>
[PROOF STATE]
proof (prove)
using this:
fmdom env = fmdom env'

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 2. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrelD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel erelated env' env
 2. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>fmrel erelated env' env\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> id |\<in>| ?S11
 2. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S11 erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>id |\<in>| ids (Sabs cs)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmdom env = fmdom env'; id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)

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

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

goal (5 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. \<not> shadows_consts rhs
 5. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. \<not> shadows_consts rhs
 5. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>
 2. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
have "vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>
 2. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
thus "fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
have "vwelldefined' v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' v\<^sub>2
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed u
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts u
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed u
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts u
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' v\<^sub>2

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined') env"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
apply (rule vmatch_welldefined')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env
 2. vwelldefined' ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env, ?pat3, ?rhs3)
 2. vwelldefined' ?v
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined') env

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using \<open>vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fdisjnt C (fmdom env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (fmdom env)
[PROOF STEP]
unfolding \<open>fmdom env = _\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (frees pat)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fdisjnt C (frees pat)
[PROOF STEP]
by (auto simp: list_all_iff all_consts_def fdisjnt_alt_def)
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom env)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
fdisjnt C (fmdom env)
[PROOF STEP]
show "fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))"
[PROOF STATE]
proof (prove)
using this:
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
fdisjnt C (fmdom env)

goal (1 subgoal):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
unfolding fdisjnt_alt_def
[PROOF STATE]
proof (prove)
using this:
C |\<inter>| fmdom \<Gamma>\<^sub>\<Lambda> = {||}
C |\<inter>| fmdom env = {||}

goal (1 subgoal):
 1. C |\<inter>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) = {||}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (3 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. \<not> shadows_consts rhs
 3. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. \<not> shadows_consts rhs
 3. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "\<not> shadows_consts rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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 (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
using \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "not_shadows_vconsts_env env"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env env
[PROOF STEP]
apply (rule not_shadows_vconsts.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env
 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, ?pat3, ?rhs3)
 2. not_shadows_vconsts ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts v\<^sub>2
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> v\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>6
 3. \<not> shadows_consts ?t6
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> v\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>6
 3. \<not> shadows_consts ?t6
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env env

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
not_shadows_vconsts_env env
[PROOF STEP]
show "not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
not_shadows_vconsts_env env

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

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
show "consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
using \<open>consts rhs |\<subseteq>| _\<close>
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| C

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
[PROOF STEP]
proof (rule veval'.comb)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> Vabs ?cs ?\<Gamma>'
 2. \<Gamma>' \<turnstile>\<^sub>v u \<down> ?u'
 3. vfind_match ?cs ?u' = Some (?env, ?uu, ?rhs)
 4. ?\<Gamma>' ++\<^sub>f ?env \<turnstile>\<^sub>v ?rhs \<down> val'
[PROOF STEP]
show "\<Gamma>' \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>'
[PROOF STEP]
using \<open>\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'\<close>
[PROOF STATE]
proof (prove)
using this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'

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

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

goal (3 subgoals):
 1. \<Gamma>' \<turnstile>\<^sub>v u \<down> ?u'
 2. vfind_match cs ?u' = Some (?env, ?uu, ?rhs)
 3. \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f ?env \<turnstile>\<^sub>v ?rhs \<down> val'
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'

goal (3 subgoals):
 1. \<And>\<Gamma> t cs \<Gamma>' u u' env uu_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; vfind_match cs u' = Some (env, uu_, rhs); \<Gamma>' ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>' ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>' ++\<^sub>f env)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 3. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
\<Gamma> \<turnstile>\<^sub>v t \<down> Vabs cs \<Gamma>\<^sub>\<Lambda>
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vabs cs \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (rec_comb \<Gamma> t css name \<Gamma>\<^sub>\<Lambda> cs u v\<^sub>2 env pat rhs val)
[PROOF STATE]
proof (state)
this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
apply (rule fmrel_on_fsubset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmrel_on_fset ?S erelated \<Gamma>' \<Gamma>
 2. ids t |\<subseteq>| ?S
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ids t |\<subseteq>| ids (t $\<^sub>s u)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees t |\<union>| consts t |\<subseteq>| frees (t $\<^sub>s u) |\<union>| consts (t $\<^sub>s u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
obtain v\<^sub>1' where "\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'" "v\<^sub>1' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>

goal (1 subgoal):
 1. (\<And>v\<^sub>1'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'; v\<^sub>1' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'
v\<^sub>1' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
obtain \<Gamma>\<^sub>\<Lambda>'
    where "v\<^sub>1' = Vrecabs css name \<Gamma>\<^sub>\<Lambda>'"
      and "pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css"
[PROOF STATE]
proof (prove)
using this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'
v\<^sub>1' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. (\<And>\<Gamma>\<^sub>\<Lambda>'. \<lbrakk>v\<^sub>1' = Vrecabs css name \<Gamma>\<^sub>\<Lambda>'; pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: erelated.cases)
[PROOF STATE]
proof (state)
this:
v\<^sub>1' = Vrecabs css name \<Gamma>\<^sub>\<Lambda>'
pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
apply (rule fmrel_on_fsubset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fmrel_on_fset ?S erelated \<Gamma>' \<Gamma>
 2. ids u |\<subseteq>| ?S
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ids u |\<subseteq>| ids (t $\<^sub>s u)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees u |\<union>| consts u |\<subseteq>| frees (t $\<^sub>s u) |\<union>| consts (t $\<^sub>s u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
[PROOF STEP]
obtain v\<^sub>2' where "\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'" "v\<^sub>2' \<approx>\<^sub>e v\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>

goal (1 subgoal):
 1. (\<And>v\<^sub>2'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'; v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>v\<^sub>2'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'; v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply (erule rec_comb.IH(2))
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
 2. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_venv \<Gamma>
 3. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_except u (fmdom \<Gamma>)
 4. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> pre_strong_term_class.wellformed u
 5. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> wellformed_venv \<Gamma>
 6. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fdisjnt C (fmdom \<Gamma>)
 7. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 8. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma>
 9. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> \<not> shadows_consts u
 10. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (10 subgoals):
 1. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>
 2. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_venv \<Gamma>
 3. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> closed_except u (fmdom \<Gamma>)
 4. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> pre_strong_term_class.wellformed u
 5. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> wellformed_venv \<Gamma>
 6. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fdisjnt C (fmdom \<Gamma>)
 7. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 8. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma>
 9. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> \<not> shadows_consts u
 10. fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma> \<Longrightarrow> not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
\<Gamma>' \<turnstile>\<^sub>v u \<down> v\<^sub>2'
v\<^sub>2' \<approx>\<^sub>e v\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
[PROOF STEP]
using \<open>v\<^sub>2' \<approx>\<^sub>e v\<^sub>2\<close>
[PROOF STATE]
proof (prove)
using this:
v\<^sub>2' \<approx>\<^sub>e v\<^sub>2

goal (1 subgoal):
 1. rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
[PROOF STEP]
by (rule erelated.vfind_match_rel')
[PROOF STATE]
proof (state)
this:
rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)

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

goal (1 subgoal):
 1. (\<And>env'. \<lbrakk>fmrel erelated env' env; vfind_match cs v\<^sub>2' = Some (env', pat, rhs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
rel_option (rel_prod (fmrel erelated) (=)) (vfind_match cs v\<^sub>2') (vfind_match cs v\<^sub>2)
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_closed)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vclosed v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed v\<^sub>2
[PROOF STEP]
apply (rule veval'_closed)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (5 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. closed_except ?t (fmdom ?\<Gamma>)
 3. closed_venv ?\<Gamma>
 4. pre_strong_term_class.wellformed ?t
 5. wellformed_venv ?\<Gamma>
[PROOF STEP]
by (auto simp: closed_except_def)
[PROOF STATE]
proof (state)
this:
vclosed v\<^sub>2

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
by (auto simp: Sterm.closed_except_simps)
[PROOF STATE]
proof (state)
this:
closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
closed_except (Sabs cs) (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
unfolding closed_except_def
[PROOF STATE]
proof (prove)
using this:
frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
frees (Sabs cs) |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
[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>\<Lambda>
 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>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (2 subgoals):
 1. pre_strong_term_class.wellformed t
 2. wellformed_venv \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[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>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "linear pat"
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs

goal (1 subgoal):
 1. linear pat
[PROOF STEP]
using \<open>vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "frees pat = patvars (mk_pat pat)"
[PROOF STATE]
proof (prove)
using this:
linear pat

goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat)
[PROOF STEP]
by (simp add: mk_pat_frees)
[PROOF STATE]
proof (state)
this:
frees pat = patvars (mk_pat pat)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "fmdom env = frees pat"
[PROOF STATE]
proof (prove)
using this:
frees pat = patvars (mk_pat pat)

goal (1 subgoal):
 1. fmdom env = frees pat
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> fmdom env = patvars (mk_pat pat)
[PROOF STEP]
apply (rule vmatch_dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> vmatch (mk_pat pat) ?v1 = Some env
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frees pat = patvars (mk_pat pat) \<Longrightarrow> vfind_match ?cs3 ?v1 = Some (env, pat, ?rhs3)
[PROOF STEP]
apply (rule rec_comb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmdom env = frees pat

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css)" "fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css) &&& fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>fmlookup css name = Some cs\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
(pat, rhs) \<in> set cs
fmlookup css name = Some cs

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css) &&& fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
by (auto simp: list_all_iff dest!: fmpredD[where m = css])
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css)
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
[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>\<Lambda>
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (3 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
 2. not_shadows_vconsts_env ?\<Gamma>
 3. \<not> shadows_consts ?t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain val' where "\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'" "val' \<approx>\<^sub>e val"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>val'. \<lbrakk>\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'; val' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (erule rec_comb.IH)
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 3. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. pre_strong_term_class.wellformed rhs
 5. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 7. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 8. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 9. \<not> shadows_consts rhs
 10. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. closed_venv env
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. closed_venv \<Gamma>\<^sub>\<Lambda>
 2. closed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. closed_venv env
[PROOF STEP]
using \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. closed_venv \<Gamma>\<^sub>\<Lambda>
 2. closed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. closed_venv env
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. closed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. closed_venv env
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. closed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css)
 2. closed_venv env
[PROOF STEP]
using \<open>vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vclosed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. closed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css)
 2. closed_venv env
[PROOF STEP]
apply (auto intro: fmdomI)[]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_venv env
[PROOF STEP]
apply (rule vclosed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat19 ?v19 = Some env
 2. vclosed ?v19
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs22 ?v19 = Some (env, ?pat22, ?rhs22)
 2. vclosed ?v19
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vclosed v\<^sub>2
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (9 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. pre_strong_term_class.wellformed rhs
 4. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 6. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 7. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 8. \<not> shadows_consts rhs
 9. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. pre_strong_term_class.wellformed rhs
 4. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 6. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 7. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 8. \<not> shadows_consts rhs
 9. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[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>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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 (8 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 5. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 6. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 7. \<not> shadows_consts rhs
 8. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 5. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 6. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 7. \<not> shadows_consts rhs
 8. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. wellformed_venv env
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. wellformed_venv \<Gamma>\<^sub>\<Lambda>
 2. wellformed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. wellformed_venv env
[PROOF STEP]
using \<open>vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. wellformed_venv \<Gamma>\<^sub>\<Lambda>
 2. wellformed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. wellformed_venv env
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wellformed_venv (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. wellformed_venv env
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wellformed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css)
 2. wellformed_venv env
[PROOF STEP]
using \<open>vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vwellformed (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (2 subgoals):
 1. wellformed_venv (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css)
 2. wellformed_venv env
[PROOF STEP]
apply (auto intro: fmdomI)[]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellformed_venv env
[PROOF STEP]
apply (rule vwellformed.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat19 ?v19 = Some env
 2. vwellformed ?v19
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs22 ?v19 = Some (env, ?pat22, ?rhs22)
 2. vwellformed ?v19
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwellformed v\<^sub>2
[PROOF STEP]
apply (rule veval'_wellformed)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>25 \<turnstile>\<^sub>v ?t25 \<down> v\<^sub>2
 2. pre_strong_term_class.wellformed ?t25
 3. wellformed_venv ?\<Gamma>25
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (2 subgoals):
 1. pre_strong_term_class.wellformed u
 2. wellformed_venv \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (7 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 5. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. \<not> shadows_consts rhs
 7. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 5. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. \<not> shadows_consts rhs
 7. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close> \<open>fmdom env = frees pat\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
vclosed (Vabs cs \<Gamma>\<^sub>\<Lambda>)
fmdom env = frees pat

goal (1 subgoal):
 1. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
by (auto simp: list_all_iff closed_except_def)
[PROOF STATE]
proof (state)
this:
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (7 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 4. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 5. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 6. \<not> shadows_consts rhs
 7. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
thus "closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))"
[PROOF STATE]
proof (prove)
using this:
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (1 subgoal):
 1. closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
unfolding closed_except_def
[PROOF STATE]
proof (prove)
using this:
frees rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (1 subgoal):
 1. frees rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fmdom env = fmdom env'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom env = fmdom env'
[PROOF STEP]
using \<open>fmrel erelated env' env\<close>
[PROOF STATE]
proof (prove)
using this:
fmrel erelated env' env

goal (1 subgoal):
 1. fmdom env = fmdom env'
[PROOF STEP]
by (metis fmrel_fmdom_eq)
[PROOF STATE]
proof (state)
this:
fmdom env = fmdom env'

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids rhs) erelated (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>') css) (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>') css) x) (fmlookup (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css) x)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (map_option (\<lambda>cs. Vrecabs css x \<Gamma>\<^sub>\<Lambda>') (fmlookup css x)) (map_option (\<lambda>cs. Vrecabs css x \<Gamma>\<^sub>\<Lambda>) (fmlookup css x))
[PROOF STEP]
unfolding option.rel_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option (\<lambda>xa y. Vrecabs css x \<Gamma>\<^sub>\<Lambda>' \<approx>\<^sub>e Vrecabs css x \<Gamma>\<^sub>\<Lambda>) (fmlookup css x) (fmlookup css x)
[PROOF STEP]
apply (rule option.rel_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. x |\<in>| ids rhs \<Longrightarrow> Vrecabs css x \<Gamma>\<^sub>\<Lambda>' \<approx>\<^sub>e Vrecabs css x \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule erelated.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. x |\<in>| ids rhs \<Longrightarrow> pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css
[PROOF STEP]
apply (rule \<open>pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
using \<open>pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css\<close> rec_comb
[PROOF STATE]
proof (prove)
using this:
pred_fmap (\<lambda>cs. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>) css
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css) = fmdom (fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>') css)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')

goal (6 subgoals):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 2. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 3. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 5. \<not> shadows_consts rhs
 6. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (ids rhs) erelated (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
fix id
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
assume "id |\<in>| ids rhs"
[PROOF STATE]
proof (state)
this:
id |\<in>| ids rhs

goal (1 subgoal):
 1. \<And>x. x |\<in>| ids rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') x) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) x)
[PROOF STEP]
thus "rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| ids rhs

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs |\<union>| consts rhs

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
proof (cases rule: funion_strictE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case A
[PROOF STATE]
proof (state)
this:
id |\<in>| frees rhs

goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
using \<open>closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs
closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
unfolding closed_except_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs
frees rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (1 subgoal):
 1. id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (2 subgoals):
 1. id |\<in>| frees rhs \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env |\<union>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
proof (cases rule: funion_strictE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case A
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env

goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| fmdom env'"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env

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

goal (1 subgoal):
 1. id |\<in>| fmdom env'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<in>| fmdom env'

goal (2 subgoals):
 1. id |\<in>| fmdom env \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
 2. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
id |\<in>| fmdom env
id |\<in>| fmdom env'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env
id |\<in>| fmdom env'

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>fmrel erelated env' env\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| fmdom env
id |\<in>| fmdom env'
fmrel erelated env' env

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case B
[PROOF STATE]
proof (state)
this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<notin>| frees pat"
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

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

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| frees (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| frees pat

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| ffUnion ((\<lambda>(pat, rhs). frees rhs |-| frees pat) |`| fset_of_list cs)
[PROOF STEP]
unfolding ffUnion_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> fBex ((\<lambda>(pat, rhs). frees rhs |-| frees pat) |`| fset_of_list cs) ((|\<in>|) id)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> fBex (fset_of_list cs) (\<lambda>x. id |\<in>| (case x of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat))
[PROOF STEP]
apply (rule fBexI[where x = "(pat, rhs)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| (case (pat, rhs) of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat)
 2. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
using \<open>id |\<in>| frees rhs\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees rhs

goal (2 subgoals):
 1. id |\<notin>| frees pat \<Longrightarrow> id |\<in>| (case (pat, rhs) of (pat, rhs) \<Rightarrow> frees rhs |-| frees pat)
 2. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
unfolding fset_of_list_elem
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| frees pat \<Longrightarrow> (pat, rhs) \<in> set cs
[PROOF STEP]
apply (rule \<open>(pat, rhs) \<in> set cs\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| ids (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| ids (Sabs cs)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| frees (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs) |\<union>| consts (Sabs cs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<in>| ids (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
have "id |\<notin>| fmdom env'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
unfolding \<open>fmdom env = fmdom env'\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'
id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>

goal (1 subgoal):
 1. id |\<notin>| fmdom env'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
id |\<notin>| fmdom env'

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env; id |\<in>| fmdom \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>id |\<notin>| fmdom env\<close> \<open>fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<close>
[PROOF STATE]
proof (prove)
using this:
id |\<notin>| fmdom env'
id |\<notin>| fmdom env
fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') id) (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) id)
 2. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> id |\<in>| ?S10
 2. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S10 erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>id |\<in>| ids rhs\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> id |\<in>| ?S13
 2. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S13 erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>id |\<in>| ids (Sabs cs)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| fmdom env'; id |\<notin>| fmdom env; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)

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

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
case B
[PROOF STATE]
proof (state)
this:
id |\<notin>| frees rhs
id |\<in>| consts rhs

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
have "id |\<in>| consts (Sabs cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<in>| consts (Sabs cs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id |\<in>| ffUnion ((\<lambda>(uu_, y). consts y) |`| fset_of_list cs)
[PROOF STEP]
unfolding ffUnion_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBex ((\<lambda>(uu_, y). consts y) |`| fset_of_list cs) ((|\<in>|) id)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fBex (fset_of_list cs) (\<lambda>x. id |\<in>| (case x of (uu_, x) \<Rightarrow> consts x))
[PROOF STEP]
apply (rule fBexI[where x = "(pat, rhs)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<in>| (case (pat, rhs) of (uu_, x) \<Rightarrow> consts x)
 2. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. id |\<in>| consts rhs
 2. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) |\<in>| fset_of_list cs
[PROOF STEP]
unfolding fset_of_list_elem
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pat, rhs) \<in> set cs
[PROOF STEP]
apply (rule \<open>(pat, rhs) \<in> set cs\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
hence "id |\<in>| ids (Sabs cs)"
[PROOF STATE]
proof (prove)
using this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| ids (Sabs cs)
[PROOF STEP]
unfolding ids_def
[PROOF STATE]
proof (prove)
using this:
id |\<in>| consts (Sabs cs)

goal (1 subgoal):
 1. id |\<in>| frees (Sabs cs) |\<union>| consts (Sabs cs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
id |\<in>| ids (Sabs cs)

goal (1 subgoal):
 1. \<lbrakk>id |\<notin>| frees rhs; id |\<in>| consts rhs\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
using \<open>fmdom env = fmdom env'\<close> \<open>fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')\<close>
[PROOF STATE]
proof (prove)
using this:
fmdom env = fmdom env'
fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>')

goal (1 subgoal):
 1. rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') id) (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) id)
 3. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 4. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrelD)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel erelated env' env
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') id) (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) id)
 3. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 4. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>fmrel erelated env' env\<close>)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') id) (fmlookup (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) id)
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 3. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> id |\<in>| ?S21
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S21 erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 4. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>id |\<in>| ids rhs\<close>)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 3. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids rhs) erelated (mk_rec_env css \<Gamma>\<^sub>\<Lambda>') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup env' id) (fmlookup env id)
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrelD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<in>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel erelated env' env
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule \<open>fmrel erelated env' env\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> rel_option erelated (fmlookup \<Gamma>\<^sub>\<Lambda>' id) (fmlookup \<Gamma>\<^sub>\<Lambda> id)
[PROOF STEP]
apply (rule fmrel_on_fsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> id |\<in>| ?S26
 2. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset ?S26 erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>id |\<in>| ids (Sabs cs)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmdom env = fmdom env'; fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>) = fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom (mk_rec_env css \<Gamma>\<^sub>\<Lambda>'); id |\<notin>| fmdom env'\<rbrakk> \<Longrightarrow> fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
apply (rule \<open>fmrel_on_fset (ids (Sabs cs)) erelated \<Gamma>\<^sub>\<Lambda>' \<Gamma>\<^sub>\<Lambda>\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rel_option erelated (fmlookup (\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env') id) (fmlookup (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) id)

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

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

goal (5 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. \<not> shadows_consts rhs
 5. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
 4. \<not> shadows_consts rhs
 5. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
proof (intro fmpred_add)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>
 2. fmpred (\<lambda>_. vwelldefined') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
have "vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed t
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts t
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (3 subgoals):
 1. fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>
 2. fmpred (\<lambda>_. vwelldefined') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
 3. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
thus "fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda>" "fmpred (\<lambda>_. vwelldefined') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') \<Gamma>\<^sub>\<Lambda> &&& fmpred (\<lambda>_. vwelldefined') (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

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

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
have "vwelldefined' v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vwelldefined' v\<^sub>2
[PROOF STEP]
apply (rule veval'_welldefined')
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. ?\<Gamma> \<turnstile>\<^sub>v ?t \<down> v\<^sub>2
 2. fdisjnt C (fmdom ?\<Gamma>)
 3. consts ?t |\<subseteq>| fmdom ?\<Gamma> |\<union>| C
 4. fmpred (\<lambda>_. vwelldefined') ?\<Gamma>
 5. pre_strong_term_class.wellformed ?t
 6. wellformed_venv ?\<Gamma>
 7. \<not> shadows_consts ?t
 8. not_shadows_vconsts_env ?\<Gamma>
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed u
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts u
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (7 subgoals):
 1. fdisjnt C (fmdom \<Gamma>)
 2. consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. fmpred (\<lambda>_. vwelldefined') \<Gamma>
 4. pre_strong_term_class.wellformed u
 5. wellformed_venv \<Gamma>
 6. \<not> shadows_consts u
 7. not_shadows_vconsts_env \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vwelldefined' v\<^sub>2

goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
show "fmpred (\<lambda>_. vwelldefined') env"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmpred (\<lambda>_. vwelldefined') env
[PROOF STEP]
apply (rule vmatch_welldefined')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env
 2. vwelldefined' ?v
[PROOF STEP]
apply (rule vfind_match_elem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vfind_match ?cs3 ?v = Some (env, ?pat3, ?rhs3)
 2. vwelldefined' ?v
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined') env

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fdisjnt C (fmdom env)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (fmdom env)
[PROOF STEP]
unfolding \<open>fmdom env = _\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (frees pat)
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fdisjnt C (frees pat)
[PROOF STEP]
by (auto simp: list_all_iff all_consts_def fdisjnt_alt_def)
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom env)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom env)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "fdisjnt C (fmdom css)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdisjnt C (fmdom css)
[PROOF STEP]
using \<open>vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
vwelldefined' (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fdisjnt C (fmdom css)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom css)

goal (4 subgoals):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
 2. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 3. \<not> shadows_consts rhs
 4. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fdisjnt C (fmdom env)
fdisjnt C (fmdom css)
[PROOF STEP]
show "fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))"
[PROOF STATE]
proof (prove)
using this:
fdisjnt C (fmdom env)
fdisjnt C (fmdom css)

goal (1 subgoal):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
using \<open>fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
fdisjnt C (fmdom env)
fdisjnt C (fmdom css)
fdisjnt C (fmdom \<Gamma>\<^sub>\<Lambda>)

goal (1 subgoal):
 1. fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))
[PROOF STEP]
unfolding fdisjnt_alt_def mk_rec_env_def
[PROOF STATE]
proof (prove)
using this:
C |\<inter>| fmdom env = {||}
C |\<inter>| fmdom css = {||}
C |\<inter>| fmdom \<Gamma>\<^sub>\<Lambda> = {||}

goal (1 subgoal):
 1. C |\<inter>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css ++\<^sub>f env) = {||}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env))

goal (3 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. \<not> shadows_consts rhs
 3. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. \<not> shadows_consts rhs
 3. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
show "\<not> shadows_consts rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> shadows_consts rhs
[PROOF STEP]
using \<open>(pat, rhs) \<in> set cs\<close> \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
(pat, rhs) \<in> set cs
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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 (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
[PROOF STEP]
using \<open>not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vabs cs \<Gamma>\<^sub>\<Lambda>)

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

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "not_shadows_vconsts_env env"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env env
[PROOF STEP]
apply (rule not_shadows_vconsts.vmatch_env)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. vmatch ?pat ?v = Some env
 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, ?pat3, ?rhs3)
 2. not_shadows_vconsts ?v
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts v\<^sub>2
[PROOF STEP]
apply (rule veval'_shadows)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> v\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>6
 3. \<not> shadows_consts ?t6
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesisa__
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

goal (3 subgoals):
 1. ?\<Gamma>6 \<turnstile>\<^sub>v ?t6 \<down> v\<^sub>2
 2. not_shadows_vconsts_env ?\<Gamma>6
 3. \<not> shadows_consts ?t6
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env env

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_shadows_vconsts_env env

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
have "not_shadows_vconsts_env (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_shadows_vconsts_env (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
[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>\<Lambda>) css)
[PROOF STEP]
using \<open>not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)\<close>
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts (Vrecabs css name \<Gamma>\<^sub>\<Lambda>)

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

goal (2 subgoals):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
 2. not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
not_shadows_vconsts_env env
not_shadows_vconsts_env (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)
[PROOF STEP]
show "not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)"
[PROOF STATE]
proof (prove)
using this:
not_shadows_vconsts_env \<Gamma>\<^sub>\<Lambda>
not_shadows_vconsts_env env
not_shadows_vconsts_env (mk_rec_env css \<Gamma>\<^sub>\<Lambda>)

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

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
show "consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
using \<open>consts rhs |\<subseteq>| _\<close>
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css)

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C
[PROOF STEP]
unfolding mk_rec_env_def
[PROOF STATE]
proof (prove)
using this:
consts rhs |\<subseteq>| fmdom \<Gamma>\<^sub>\<Lambda> |\<union>| (C |\<union>| fmdom css)

goal (1 subgoal):
 1. consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f fmmap_keys (\<lambda>name cs. Vrecabs css name \<Gamma>\<^sub>\<Lambda>) css ++\<^sub>f env) |\<union>| C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
[PROOF STEP]
proof (rule veval'.rec_comb)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> Vrecabs ?css ?name ?\<Gamma>'
 2. fmlookup ?css ?name = Some ?cs
 3. \<Gamma>' \<turnstile>\<^sub>v u \<down> ?u'
 4. vfind_match ?cs ?u' = Some (?env, ?uv, ?rhs)
 5. ?\<Gamma>' ++\<^sub>f mk_rec_env ?css ?\<Gamma>' ++\<^sub>f ?env \<turnstile>\<^sub>v ?rhs \<down> val'
[PROOF STEP]
show "\<Gamma>' \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>'
[PROOF STEP]
using \<open>\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'\<close>
[PROOF STATE]
proof (prove)
using this:
\<Gamma>' \<turnstile>\<^sub>v t \<down> v\<^sub>1'

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

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

goal (4 subgoals):
 1. fmlookup css name = Some ?cs
 2. \<Gamma>' \<turnstile>\<^sub>v u \<down> ?u'
 3. vfind_match ?cs ?u' = Some (?env, ?uv, ?rhs)
 4. \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f ?env \<turnstile>\<^sub>v ?rhs \<down> val'
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'

goal (2 subgoals):
 1. \<And>\<Gamma> t css name \<Gamma>' cs u u' env uv_ rhs val \<Gamma>'' thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>'; \<And>\<Gamma>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids t) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; fmlookup css name = Some cs; \<Gamma> \<turnstile>\<^sub>v u \<down> u'; \<And>\<Gamma>' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e u'\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids u) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis; 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>'' thesis. \<lbrakk>\<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids rhs) erelated \<Gamma>'' (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>' ++\<^sub>f mk_rec_env css \<Gamma>' ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<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)\<rbrakk> \<Longrightarrow> thesis; \<And>v'. \<lbrakk>\<Gamma>'' \<turnstile>\<^sub>v t $\<^sub>s u \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>'' \<Gamma>; closed_venv \<Gamma>; closed_except (t $\<^sub>s u) (fmdom \<Gamma>); pre_strong_term_class.wellformed (t $\<^sub>s u); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (t $\<^sub>s u); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
 2. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using rec_comb
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<^sub>\<Lambda>' ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda>' ++\<^sub>f env' \<turnstile>\<^sub>v rhs \<down> val'
val' \<approx>\<^sub>e val
\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> val'
\<Gamma> \<turnstile>\<^sub>v t \<down> Vrecabs css name \<Gamma>\<^sub>\<Lambda>
fmlookup css name = Some cs
\<Gamma> \<turnstile>\<^sub>v u \<down> v\<^sub>2
vfind_match cs v\<^sub>2 = Some (env, pat, rhs)
\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env \<turnstile>\<^sub>v rhs \<down> val
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v t \<down> v'; v' \<approx>\<^sub>e Vrecabs css name \<Gamma>\<^sub>\<Lambda>\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids t) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except t (fmdom \<Gamma>); pre_strong_term_class.wellformed t; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts t; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v u \<down> v'; v' \<approx>\<^sub>e v\<^sub>2\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids u) erelated ?\<Gamma>'4 \<Gamma>; closed_venv \<Gamma>; closed_except u (fmdom \<Gamma>); pre_strong_term_class.wellformed u; wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts u |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts u; not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<And>v'. \<lbrakk>?\<Gamma>'4 \<turnstile>\<^sub>v rhs \<down> v'; v' \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> ?thesis4; fmrel_on_fset (ids rhs) erelated ?\<Gamma>'4 (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); closed_except rhs (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); pre_strong_term_class.wellformed rhs; wellformed_venv (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); fdisjnt C (fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)); consts rhs |\<subseteq>| fmdom (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env) |\<union>| C; fmpred (\<lambda>_. vwelldefined') (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env); \<not> shadows_consts rhs; not_shadows_vconsts_env (\<Gamma>\<^sub>\<Lambda> ++\<^sub>f mk_rec_env css \<Gamma>\<^sub>\<Lambda> ++\<^sub>f env)\<rbrakk> \<Longrightarrow> ?thesis4
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t $\<^sub>s u \<down> ?v'4; ?v'4 \<approx>\<^sub>e val\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (t $\<^sub>s u)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (t $\<^sub>s u) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (t $\<^sub>s u)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (t $\<^sub>s u) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (t $\<^sub>s u)
not_shadows_vconsts_env \<Gamma>

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

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (constr name \<Gamma> ts us)
[PROOF STATE]
proof (state)
this:
name |\<in>| C
list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us
\<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> ?v'4; ?v'4 \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis
fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>
closed_venv \<Gamma>
closed_except (name $$ ts) (fmdom \<Gamma>)
pre_strong_term_class.wellformed (name $$ ts)
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C
fmpred (\<lambda>_. vwelldefined') \<Gamma>
\<not> shadows_consts (name $$ ts)
not_shadows_vconsts_env \<Gamma>

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts
[PROOF STEP]
apply (rule list_allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set ts \<Longrightarrow> fmrel_on_fset (ids x) erelated \<Gamma>' \<Gamma> \<and> closed_except x (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x \<and> consts x |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set ts \<Longrightarrow> fmrel_on_fset (ids x) erelated \<Gamma>' \<Gamma>
 2. \<And>x. x \<in> set ts \<Longrightarrow> closed_except x (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x \<and> consts x |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x
[PROOF STEP]
apply (rule fmrel_on_fsubset)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> set ts \<Longrightarrow> fmrel_on_fset (?S5 x) erelated \<Gamma>' \<Gamma>
 2. \<And>x. x \<in> set ts \<Longrightarrow> ids x |\<subseteq>| ?S5 x
 3. \<And>x. x \<in> set ts \<Longrightarrow> closed_except x (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x \<and> consts x |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x
[PROOF STEP]
apply (rule constr)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set ts \<Longrightarrow> ids x |\<subseteq>| ids (name $$ ts)
 2. \<And>x. x \<in> set ts \<Longrightarrow> closed_except x (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x \<and> consts x |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> ids x_ |\<subseteq>| ids (name $$ ts)
[PROOF STEP]
unfolding ids_list_comb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> ids x_ |\<subseteq>| ids (const name) |\<union>| ffUnion (fset_of_list (map ids ts))
[PROOF STEP]
by (induct ts; auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set ts \<Longrightarrow> closed_except x (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x \<and> consts x |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> closed_except x_ (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed x_ \<and> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts x_
[PROOF STEP]
apply (intro conjI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. x_ \<in> set ts \<Longrightarrow> closed_except x_ (fmdom \<Gamma>)
 2. x_ \<in> set ts \<Longrightarrow> pre_strong_term_class.wellformed x_
 3. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
 4. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> closed_except x_ (fmdom \<Gamma>)
[PROOF STEP]
using \<open>closed_except (name $$ ts) (fmdom \<Gamma>)\<close>
[PROOF STATE]
proof (prove)
using this:
closed_except (name $$ ts) (fmdom \<Gamma>)

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> closed_except x_ (fmdom \<Gamma>)
[PROOF STEP]
unfolding closed.list_comb
[PROOF STATE]
proof (prove)
using this:
closed_except (const name) (fmdom \<Gamma>) \<and> list_all (\<lambda>t. closed_except t (fmdom \<Gamma>)) ts

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> closed_except x_ (fmdom \<Gamma>)
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x_ \<in> set ts \<Longrightarrow> pre_strong_term_class.wellformed x_
 2. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
 3. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> pre_strong_term_class.wellformed x_
[PROOF STEP]
using \<open>wellformed (name $$ ts)\<close>
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (name $$ ts)

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> pre_strong_term_class.wellformed x_
[PROOF STEP]
unfolding wellformed.list_comb
[PROOF STATE]
proof (prove)
using this:
pre_strong_term_class.wellformed (const name) \<and> list_all pre_strong_term_class.wellformed ts

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> pre_strong_term_class.wellformed x_
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
 2. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
[PROOF STEP]
using \<open>consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C\<close>
[PROOF STATE]
proof (prove)
using this:
consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
[PROOF STEP]
unfolding consts_list_comb
[PROOF STATE]
proof (prove)
using this:
consts (const name) |\<union>| ffUnion (fset_of_list (map consts ts)) |\<subseteq>| fmdom \<Gamma> |\<union>| C

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> consts x_ |\<subseteq>| fmdom \<Gamma> |\<union>| C
[PROOF STEP]
by (metis Ball_set constr.prems(8) special_constants.sconsts_list_comb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
using \<open>\<not> shadows_consts (name $$ ts)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> shadows_consts (name $$ ts)

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
unfolding shadows.list_comb
[PROOF STATE]
proof (prove)
using this:
\<not> (shadows_consts (const name) \<or> list_ex shadows_consts ts)

goal (1 subgoal):
 1. x_ \<in> set ts \<Longrightarrow> \<not> shadows_consts x_
[PROOF STEP]
by (auto simp: list_ex_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain us' where "list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>list_all2 _ _ _\<close> \<open>list_all _ ts\<close>
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts

goal (1 subgoal):
 1. (\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (induction arbitrary: thesis rule: list.rel_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a21 a22 b21 b22 thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v a21 \<down> b21 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v a21 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e b21 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids a21) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except a21 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed a21 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts a21 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts a21 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa); \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) a22 b22 us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) a22\<rbrakk> \<Longrightarrow> thesis; \<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (a21 # a22) (b21 # b22) us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (a21 # a22)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (Cons t ts u us)
[PROOF STATE]
proof (state)
this:
\<Gamma> \<turnstile>\<^sub>v t \<down> u \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v t \<down> xb \<longrightarrow> xb \<approx>\<^sub>e u \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids t) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except t (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed t \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts t \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)
\<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> ?thesis4; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts\<rbrakk> \<Longrightarrow> ?thesis4
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (t # ts) (u # us) ?us'4 \<Longrightarrow> thesis
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (t # ts)

goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a21 a22 b21 b22 thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v a21 \<down> b21 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v a21 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e b21 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids a21) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except a21 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed a21 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts a21 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts a21 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa); \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) a22 b22 us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) a22\<rbrakk> \<Longrightarrow> thesis; \<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (a21 # a22) (b21 # b22) us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (a21 # a22)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Gamma> \<turnstile>\<^sub>v t \<down> u \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v t \<down> xb \<longrightarrow> xb \<approx>\<^sub>e u \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids t) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except t (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed t \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts t \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)
\<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> ?thesis4; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts\<rbrakk> \<Longrightarrow> ?thesis4
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (t # ts) (u # us) ?us'4 \<Longrightarrow> thesis
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (t # ts)
[PROOF STEP]
obtain us' where "list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'"
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> u \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v t \<down> xb \<longrightarrow> xb \<approx>\<^sub>e u \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids t) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except t (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed t \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts t \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)
\<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> ?thesis4; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts\<rbrakk> \<Longrightarrow> ?thesis4
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (t # ts) (u # us) ?us'4 \<Longrightarrow> thesisc__
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (t # ts)

goal (1 subgoal):
 1. (\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'

goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a21 a22 b21 b22 thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v a21 \<down> b21 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v a21 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e b21 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids a21) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except a21 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed a21 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts a21 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts a21 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa); \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) a22 b22 us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) a22\<rbrakk> \<Longrightarrow> thesis; \<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (a21 # a22) (b21 # b22) us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (a21 # a22)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have
        "fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>" "closed_except t (fmdom \<Gamma>)"
        "wellformed t" "consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C" "\<not> shadows_consts t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> &&& closed_except t (fmdom \<Gamma>)) &&& pre_strong_term_class.wellformed t &&& consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C &&& \<not> shadows_consts t
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<Gamma> \<turnstile>\<^sub>v t \<down> u \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v t \<down> xb \<longrightarrow> xb \<approx>\<^sub>e u \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids t) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except t (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed t \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts t \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)
\<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us' \<Longrightarrow> ?thesis4; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) ts\<rbrakk> \<Longrightarrow> ?thesis4
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (t # ts) (u # us) ?us'4 \<Longrightarrow> thesis
list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (t # ts)

goal (1 subgoal):
 1. (fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> &&& closed_except t (fmdom \<Gamma>)) &&& pre_strong_term_class.wellformed t &&& consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C &&& \<not> shadows_consts t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
\<not> shadows_consts t

goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a21 a22 b21 b22 thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v a21 \<down> b21 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v a21 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e b21 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids a21) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except a21 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed a21 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts a21 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts a21 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa); \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) a22 b22 us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) a22\<rbrakk> \<Longrightarrow> thesis; \<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (a21 # a22) (b21 # b22) us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (a21 # a22)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
\<not> shadows_consts t
[PROOF STEP]
obtain u' where "\<Gamma>' \<turnstile>\<^sub>v t \<down> u'" "u' \<approx>\<^sub>e u"
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
\<not> shadows_consts t

goal (1 subgoal):
 1. (\<And>u'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t \<down> u'; u' \<approx>\<^sub>e u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>closed_venv \<Gamma>\<close> \<open>wellformed_venv \<Gamma>\<close> \<open>fdisjnt C (fmdom \<Gamma>)\<close> \<open>fmpred (\<lambda>_. vwelldefined') \<Gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
\<not> shadows_consts t
closed_venv \<Gamma>
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
fmpred (\<lambda>_. vwelldefined') \<Gamma>

goal (1 subgoal):
 1. (\<And>u'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v t \<down> u'; u' \<approx>\<^sub>e u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>not_shadows_vconsts_env \<Gamma>\<close> Cons.hyps
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma>
closed_except t (fmdom \<Gamma>)
pre_strong_term_class.wellformed t
consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C
\<not> shadows_consts t
closed_venv \<Gamma>
wellformed_venv \<Gamma>
fdisjnt C (fmdom \<Gamma>)
fmpred (\<lambda>_. vwelldefined') \<Gamma>
not_shadows_vconsts_env \<Gamma>
\<Gamma> \<turnstile>\<^sub>v t \<down> u \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v t \<down> xb \<longrightarrow> xb \<approx>\<^sub>e u \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids t) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except t (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed t \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts t \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)

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

goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a21 a22 b21 b22 thesis. \<lbrakk>\<Gamma> \<turnstile>\<^sub>v a21 \<down> b21 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v a21 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e b21 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids a21) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except a21 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed a21 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts a21 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts a21 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa); \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) a22 b22 us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) a22\<rbrakk> \<Longrightarrow> thesis; \<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (a21 # a22) (b21 # b22) us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) (a21 # a22)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule Cons.prems)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) (t # ts) (u # us) ?us'4
[PROOF STEP]
apply (rule list_all3_cons)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us ?zs6
 2. \<Gamma>' \<turnstile>\<^sub>v t \<down> ?z6 \<and> ?z6 \<approx>\<^sub>e u
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> ?z6 \<and> ?z6 \<approx>\<^sub>e u
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Gamma>' \<turnstile>\<^sub>v t \<down> ?z6
 2. ?z6 \<approx>\<^sub>e u
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<And>thesis. \<lbrakk>\<And>us'. list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) [] [] us' \<Longrightarrow> thesis; list_all (\<lambda>t. fmrel_on_fset (ids t) erelated \<Gamma>' \<Gamma> \<and> closed_except t (fmdom \<Gamma>) \<and> pre_strong_term_class.wellformed t \<and> consts t |\<subseteq>| fmdom \<Gamma> |\<union>| C \<and> \<not> shadows_consts t) []\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'

goal (1 subgoal):
 1. \<And>name \<Gamma> ts us \<Gamma>' thesis. \<lbrakk>name |\<in>| C; list_all2 (\<lambda>x1 x2. \<Gamma> \<turnstile>\<^sub>v x1 \<down> x2 \<and> (\<forall>x xa. (\<forall>xb. x \<turnstile>\<^sub>v x1 \<down> xb \<longrightarrow> xb \<approx>\<^sub>e x2 \<longrightarrow> xa) \<longrightarrow> fmrel_on_fset (ids x1) erelated x \<Gamma> \<longrightarrow> closed_venv \<Gamma> \<longrightarrow> closed_except x1 (fmdom \<Gamma>) \<longrightarrow> pre_strong_term_class.wellformed x1 \<longrightarrow> wellformed_venv \<Gamma> \<longrightarrow> fdisjnt C (fmdom \<Gamma>) \<longrightarrow> consts x1 |\<subseteq>| fmdom \<Gamma> |\<union>| C \<longrightarrow> fmpred (\<lambda>_. vwelldefined') \<Gamma> \<longrightarrow> \<not> shadows_consts x1 \<longrightarrow> not_shadows_vconsts_env \<Gamma> \<longrightarrow> xa)) ts us; \<And>v'. \<lbrakk>\<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> v'; v' \<approx>\<^sub>e Vconstr name us\<rbrakk> \<Longrightarrow> thesis; fmrel_on_fset (ids (name $$ ts)) erelated \<Gamma>' \<Gamma>; closed_venv \<Gamma>; closed_except (name $$ ts) (fmdom \<Gamma>); pre_strong_term_class.wellformed (name $$ ts); wellformed_venv \<Gamma>; fdisjnt C (fmdom \<Gamma>); consts (name $$ ts) |\<subseteq>| fmdom \<Gamma> |\<union>| C; fmpred (\<lambda>_. vwelldefined') \<Gamma>; \<not> shadows_consts (name $$ ts); not_shadows_vconsts_env \<Gamma>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule constr.prems)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Gamma>' \<turnstile>\<^sub>v name $$ ts \<down> ?v'4
 2. ?v'4 \<approx>\<^sub>e Vconstr name us
[PROOF STEP]
apply (rule veval'.constr[where us = us'])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. name |\<in>| C
 2. list_all2 (veval' \<Gamma>') ts us'
 3. Vconstr name us' \<approx>\<^sub>e Vconstr name us
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. list_all2 (veval' \<Gamma>') ts us'
 2. Vconstr name us' \<approx>\<^sub>e Vconstr name us
[PROOF STEP]
using \<open>list_all3 _ ts us us'\<close>
[PROOF STATE]
proof (prove)
using this:
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'

goal (2 subgoals):
 1. list_all2 (veval' \<Gamma>') ts us'
 2. Vconstr name us' \<approx>\<^sub>e Vconstr name us
[PROOF STEP]
apply (induct; auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vconstr name us' \<approx>\<^sub>e Vconstr name us
[PROOF STEP]
apply (rule erelated.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 erelated us' us
[PROOF STEP]
using \<open>list_all3 _ ts us us'\<close>
[PROOF STATE]
proof (prove)
using this:
list_all3 (\<lambda>t u u'. \<Gamma>' \<turnstile>\<^sub>v t \<down> u' \<and> u' \<approx>\<^sub>e u) ts us us'

goal (1 subgoal):
 1. list_all2 erelated us' us
[PROOF STEP]
apply (induct; auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed