Welcome to Abella 2.0.5-dev
Abella < Specification "trans".
Reading specification "/home/fac05/gopalan/test/sparrow/compiler-correctness/website/wang-phd-thesis/code/./trans" (from "/home/fac05/gopalan/test/sparrow/compiler-correctness/website/wang-phd-thesis/code/.")

Abella < Import "util".
Importing from /home/fac05/gopalan/test/sparrow/compiler-correctness/website/wang-phd-thesis/code/./util

Abella < Close nat,ty,tm,tm',list tm,list tm',map tm tm',list (map tm tm').

Abella < Define sctx : (list o) -> prop by 
sctx nil;
nabla x, sctx (of x T :: L) := sctx L /\ {is_sty T}.

Abella < Define vars_of_sctx : (list o) -> (list tm) -> prop by 
vars_of_sctx nil nil;
nabla x, vars_of_sctx (of x T :: L) (x :: L') := vars_of_sctx L L'.

Abella < Theorem sctx_mem : 
forall SL O, sctx SL -> member O SL ->
  (exists X T, O = of X T /\ name X /\ {is_sty T}).


============================
 forall SL O, sctx SL -> member O SL ->
   (exists X T, O = of X T /\ name X /\ {is_sty T})

sctx_mem < induction on 2.

IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
============================
 forall SL O, sctx SL -> member O SL @ ->
   (exists X T, O = of X T /\ name X /\ {is_sty T})

sctx_mem < intros.

Variables: SL O
IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H1 : sctx SL
H2 : member O SL @
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

sctx_mem < case H2.
Subgoal 1:

Variables: O L
IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H1 : sctx (O :: L)
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

Subgoal 2 is:
 exists X T, O = of X T /\ name X /\ {is_sty T}

sctx_mem < case H1.
Subgoal 1:

Variables: L1 T
IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H3 : sctx L1
H4 : {is_sty T}
============================
 exists X T1, of n1 T = of X T1 /\ name X /\ {is_sty T1}

Subgoal 2 is:
 exists X T, O = of X T /\ name X /\ {is_sty T}

sctx_mem < search.
Subgoal 2:

Variables: O L B
IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H1 : sctx (B :: L)
H3 : member O L *
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

sctx_mem < case H1.
Subgoal 2:

Variables: O L1 T
IH : forall SL O, sctx SL -> member O SL * ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H3 : member (O n1) L1 *
H4 : sctx L1
H5 : {is_sty T}
============================
 exists X T, O n1 = of X T /\ name X /\ {is_sty T}

sctx_mem < backchain IH.
Proof completed.
Abella < Theorem sctx_var_mem : 
forall L T M, sctx L -> {L |- of M T} -> name M -> member (of M T) L.


============================
 forall L T M, sctx L -> {L |- of M T} -> name M -> member (of M T) L

sctx_var_mem < intros.

Variables: L T M
H1 : sctx L
H2 : {L |- of M T}
H3 : name M
============================
 member (of M T) L

sctx_var_mem < case H3.

Variables: L T
H1 : sctx (L n1)
H2 : {L n1 |- of n1 T}
============================
 member (of n1 T) (L n1)

sctx_var_mem < case H2.

Variables: L T F
H1 : sctx (L n1)
H4 : {L n1, [F n1] |- of n1 T}
H5 : member (F n1) (L n1)
============================
 member (of n1 T) (L n1)

sctx_var_mem < apply sctx_mem to H1 H5.

Variables: L T X T1
H1 : sctx (L n1)
H4 : {L n1, [of (X n1) T1] |- of n1 T}
H5 : member (of (X n1) T1) (L n1)
H6 : name (X n1)
H7 : {is_sty T1}
============================
 member (of n1 T) (L n1)

sctx_var_mem < case H4.

Variables: L T
H1 : sctx (L n1)
H5 : member (of n1 T) (L n1)
H6 : name n1
H7 : {is_sty T}
============================
 member (of n1 T) (L n1)

sctx_var_mem < search.
Proof completed.
Abella < Theorem sof_nat_inv : 
forall L N T, sctx L -> {L |- of (nat N) T} -> T = tnat.


============================
 forall L N T, sctx L -> {L |- of (nat N) T} -> T = tnat

sof_nat_inv < intros.

Variables: L N T
H1 : sctx L
H2 : {L |- of (nat N) T}
============================
 T = tnat

sof_nat_inv < case H2.
Subgoal 1:

Variables: L N
H1 : sctx L
============================
 tnat = tnat

Subgoal 2 is:
 T = tnat

sof_nat_inv < search.
Subgoal 2:

Variables: L N T F
H1 : sctx L
H3 : {L, [F] |- of (nat N) T}
H4 : member F L
============================
 T = tnat

sof_nat_inv < apply sctx_mem to _ H4.
Subgoal 2:

Variables: L N T X T1
H1 : sctx L
H3 : {L, [of X T1] |- of (nat N) T}
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 T = tnat

sof_nat_inv < case H3.
Subgoal 2:

Variables: L N T
H1 : sctx L
H4 : member (of (nat N) T) L
H5 : name (nat N)
H6 : {is_sty T}
============================
 T = tnat

sof_nat_inv < case H5.
Proof completed.
Abella < Theorem sof_pair_inv : 
forall L M1 M2 T, sctx L -> {L |- of (pair M1 M2) T} ->
  (exists T1 T2, T = prod T1 T2).


============================
 forall L M1 M2 T, sctx L -> {L |- of (pair M1 M2) T} ->
   (exists T1 T2, T = prod T1 T2)

sof_pair_inv < intros.

Variables: L M1 M2 T
H1 : sctx L
H2 : {L |- of (pair M1 M2) T}
============================
 exists T1 T2, T = prod T1 T2

sof_pair_inv < case H2.
Subgoal 1:

Variables: L M1 M2 T2 T1
H1 : sctx L
H3 : {L |- of M1 T1}
H4 : {L |- of M2 T2}
============================
 exists T3 T4, prod T1 T2 = prod T3 T4

Subgoal 2 is:
 exists T1 T2, T = prod T1 T2

sof_pair_inv < search.
Subgoal 2:

Variables: L M1 M2 T F
H1 : sctx L
H3 : {L, [F] |- of (pair M1 M2) T}
H4 : member F L
============================
 exists T1 T2, T = prod T1 T2

sof_pair_inv < apply sctx_mem to _ H4.
Subgoal 2:

Variables: L M1 M2 T X T1
H1 : sctx L
H3 : {L, [of X T1] |- of (pair M1 M2) T}
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 exists T1 T2, T = prod T1 T2

sof_pair_inv < case H3.
Subgoal 2:

Variables: L M1 M2 T
H1 : sctx L
H4 : member (of (pair M1 M2) T) L
H5 : name (pair M1 M2)
H6 : {is_sty T}
============================
 exists T1 T2, T = prod T1 T2

sof_pair_inv < case H5.
Proof completed.
Abella < Theorem sof_unit_inv : 
forall L T, sctx L -> {L |- of unit T} -> T = tunit.


============================
 forall L T, sctx L -> {L |- of unit T} -> T = tunit

sof_unit_inv < intros.

Variables: L T
H1 : sctx L
H2 : {L |- of unit T}
============================
 T = tunit

sof_unit_inv < case H2.
Subgoal 1:

Variables: L
H1 : sctx L
============================
 tunit = tunit

Subgoal 2 is:
 T = tunit

sof_unit_inv < search.
Subgoal 2:

Variables: L T F
H1 : sctx L
H3 : {L, [F] |- of unit T}
H4 : member F L
============================
 T = tunit

sof_unit_inv < apply sctx_mem to _ H4.
Subgoal 2:

Variables: L T X T1
H1 : sctx L
H3 : {L, [of X T1] |- of unit T}
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 T = tunit

sof_unit_inv < case H3.
Subgoal 2:

Variables: L T
H1 : sctx L
H4 : member (of unit T) L
H5 : name unit
H6 : {is_sty T}
============================
 T = tunit

sof_unit_inv < case H5.
Proof completed.
Abella < Theorem sctx_focus_inv : 
forall L D G, sctx L -> member D L -> {L, [D] |- G} ->
  (exists A T, G = of A T /\ name A).


============================
 forall L D G, sctx L -> member D L -> {L, [D] |- G} ->
   (exists A T, G = of A T /\ name A)

sctx_focus_inv < intros.

Variables: L D G
H1 : sctx L
H2 : member D L
H3 : {L, [D] |- G}
============================
 exists A T, G = of A T /\ name A

sctx_focus_inv < apply sctx_mem to H1 H2.

Variables: L G X T
H1 : sctx L
H2 : member (of X T) L
H3 : {L, [of X T] |- G}
H4 : name X
H5 : {is_sty T}
============================
 exists A T, G = of A T /\ name A

sctx_focus_inv < case H3.

Variables: L X T
H1 : sctx L
H2 : member (of X T) L
H4 : name X
H5 : {is_sty T}
============================
 exists A T1, of X T = of A T1 /\ name A

sctx_focus_inv < search.
Proof completed.
Abella < Theorem s_is_sty_str : 
forall L T, sctx L -> {L |- is_sty T} -> {is_sty T}.


============================
 forall L T, sctx L -> {L |- is_sty T} -> {is_sty T}

s_is_sty_str < induction on 2.

IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
============================
 forall L T, sctx L -> {L |- is_sty T}@ -> {is_sty T}

s_is_sty_str < intros.

Variables: L T
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H2 : {L |- is_sty T}@
============================
 {is_sty T}

s_is_sty_str < case H2.
Subgoal 1:

Variables: L
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
============================
 {is_sty tnat}

Subgoal 2 is:
 {is_sty tunit}

Subgoal 3 is:
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < search.
Subgoal 2:

Variables: L
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
============================
 {is_sty tunit}

Subgoal 3 is:
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < search.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < apply IH to _ H3.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < apply IH to _ H4.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < search.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < apply IH to _ H3.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < apply IH to _ H4.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

s_is_sty_str < search.
Subgoal 5:

Variables: L T F
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L, [F] |- is_sty T}*
H4 : member F L
============================
 {is_sty T}

s_is_sty_str < apply sctx_mem to H1 H4.
Subgoal 5:

Variables: L T X T1
IH : forall L T, sctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : sctx L
H3 : {L, [of X T1] |- is_sty T}*
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 {is_sty T}

s_is_sty_str < case H3.
Proof completed.
Abella < Theorem sof_is_sty : 
forall L M T, sctx L -> {L |- of M T} -> {is_sty T}.


============================
 forall L M T, sctx L -> {L |- of M T} -> {is_sty T}

sof_is_sty < induction on 2.

IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
============================
 forall L M T, sctx L -> {L |- of M T}@ -> {is_sty T}

sof_is_sty < intros.

Variables: L M T
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H2 : {L |- of M T}@
============================
 {is_sty T}

sof_is_sty < case H2.
Subgoal 1:

Variables: L N
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
============================
 {is_sty tnat}

Subgoal 2 is:
 {is_sty tnat}

Subgoal 3 is:
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 2:

Variables: L M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 tnat}*
============================
 {is_sty tnat}

Subgoal 3 is:
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 3:

Variables: L M2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 tnat}*
H4 : {L |- of M2 tnat}*
============================
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 4:

Variables: L T M2 M1 M3
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M3 tnat}*
H4 : {L |- of M1 T}*
H5 : {L |- of M2 T}*
============================
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < backchain IH with M = M1.
Subgoal 5:

Variables: L
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
============================
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H3.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
H5 : {is_sty T1}
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H4.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T T2)}*
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H3.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T T2)}*
H4 : {is_sty (prod T T2)}
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < case H4.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T T2)}*
H5 : {is_sty T}
H6 : {is_sty T2}
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T1 T)}*
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H3.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T1 T)}*
H4 : {is_sty (prod T1 T)}
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < case H4.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (prod T1 T)}*
H5 : {is_sty T1}
H6 : {is_sty T}
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 T1}*
H4 : {L, of n1 T1 |- of (R n1) T}*
============================
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H3.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 T1}*
H4 : {L, of n1 T1 |- of (R n1) T}*
H5 : {is_sty T1}
============================
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < backchain IH with L = of n1 T1 :: L, M = R n1.
Subgoal 10:

Variables: L T2 T1 R
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H4 : {L |- is_sty (arr T1 T2)}*
============================
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < backchain s_is_sty_str with L = L.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < apply IH to _ H3.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
H5 : {is_sty (arr T1 T)}
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < case H5.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
H6 : {is_sty T1}
H7 : {is_sty T}
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

sof_is_sty < search.
Subgoal 12:

Variables: L M T F
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L, [F] |- of M T}*
H4 : member F L
============================
 {is_sty T}

sof_is_sty < apply sctx_mem to H1 H4.
Subgoal 12:

Variables: L M T X T1
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H3 : {L, [of X T1] |- of M T}*
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 {is_sty T}

sof_is_sty < case H3.
Subgoal 12:

Variables: L M T
IH : forall L M T, sctx L -> {L |- of M T}* -> {is_sty T}
H1 : sctx L
H4 : member (of M T) L
H5 : name M
H6 : {is_sty T}
============================
 {is_sty T}

sof_is_sty < search.
Proof completed.
Abella < Define tm_sctx : (list o) -> prop by 
tm_sctx nil;
nabla x, tm_sctx (tm x :: L) := tm_sctx L.

Abella < Define vars_of_tm_sctx : (list o) -> (list tm) -> prop by 
vars_of_tm_sctx nil nil;
nabla x, vars_of_tm_sctx (tm x :: L) (x :: L') := vars_of_tm_sctx L L'.

Abella < Theorem tm_sctx_mem : 
forall E L, tm_sctx L -> member E L -> (exists X, E = tm X /\ name X).


============================
 forall E L, tm_sctx L -> member E L -> (exists X, E = tm X /\ name X)

tm_sctx_mem < induction on 2.

IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
============================
 forall E L, tm_sctx L -> member E L @ -> (exists X, E = tm X /\ name X)

tm_sctx_mem < intros.

Variables: E L
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_sctx L
H2 : member E L @
============================
 exists X, E = tm X /\ name X

tm_sctx_mem < case H2.
Subgoal 1:

Variables: E L1
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_sctx (E :: L1)
============================
 exists X, E = tm X /\ name X

Subgoal 2 is:
 exists X, E = tm X /\ name X

tm_sctx_mem < case H1.
Subgoal 1:

Variables: L2
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : tm_sctx L2
============================
 exists X, tm n1 = tm X /\ name X

Subgoal 2 is:
 exists X, E = tm X /\ name X

tm_sctx_mem < search.
Subgoal 2:

Variables: E L1 B
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_sctx (B :: L1)
H3 : member E L1 *
============================
 exists X, E = tm X /\ name X

tm_sctx_mem < case H1.
Subgoal 2:

Variables: E L2
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : member (E n1) L2 *
H4 : tm_sctx L2
============================
 exists X, E n1 = tm X /\ name X

tm_sctx_mem < apply IH to _ H3.
Subgoal 2:

Variables: L2 X
IH : forall E L, tm_sctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : member (tm (X n1)) L2 *
H4 : tm_sctx L2
H5 : name (X n1)
============================
 exists X1, tm (X n1) = tm X1 /\ name X1

tm_sctx_mem < search.
Proof completed.
Abella < Theorem sctx_to_tm_sctx : 
forall L Vs, sctx L -> vars_of_sctx L Vs ->
  (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs).


============================
 forall L Vs, sctx L -> vars_of_sctx L Vs ->
   (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)

sctx_to_tm_sctx < induction on 2.

IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
============================
 forall L Vs, sctx L -> vars_of_sctx L Vs @ ->
   (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)

sctx_to_tm_sctx < intros.

Variables: L Vs
IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
H1 : sctx L
H2 : vars_of_sctx L Vs @
============================
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs

sctx_to_tm_sctx < case H2.
Subgoal 1:

IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
H1 : sctx nil
============================
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL nil

Subgoal 2 is:
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL (n1 :: L')

sctx_to_tm_sctx < search.
Subgoal 2:

Variables: L' L1 T
IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
H1 : sctx (of n1 T :: L1)
H3 : vars_of_sctx L1 L' *
============================
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL (n1 :: L')

sctx_to_tm_sctx < case H1.
Subgoal 2:

Variables: L' L1 T
IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
H3 : vars_of_sctx L1 L' *
H4 : sctx L1
H5 : {is_sty T}
============================
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL (n1 :: L')

sctx_to_tm_sctx < apply IH to _ H3.
Subgoal 2:

Variables: L' L1 T SL
IH : forall L Vs, sctx L -> vars_of_sctx L Vs * ->
       (exists SL, tm_sctx SL /\ vars_of_tm_sctx SL Vs)
H3 : vars_of_sctx L1 L' *
H4 : sctx L1
H5 : {is_sty T}
H6 : tm_sctx SL
H7 : vars_of_tm_sctx SL L'
============================
 exists SL, tm_sctx SL /\ vars_of_tm_sctx SL (n1 :: L')

sctx_to_tm_sctx < search.
Proof completed.
Abella < Theorem sctx_tm_sctx_sync : 
forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
  member (of M T) L -> member (tm M) SL.


============================
 forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
   member (of M T) L -> member (tm M) SL

sctx_tm_sctx_sync < induction on 3.

IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
============================
 forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
   member (of M T) L @ -> member (tm M) SL

sctx_tm_sctx_sync < intros.

Variables: L Vs SL M T
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_sctx L Vs
H2 : vars_of_tm_sctx SL Vs
H3 : member (of M T) L @
============================
 member (tm M) SL

sctx_tm_sctx_sync < case H3.
Subgoal 1:

Variables: Vs SL M T L1
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_sctx (of M T :: L1) Vs
H2 : vars_of_tm_sctx SL Vs
============================
 member (tm M) SL

Subgoal 2 is:
 member (tm M) SL

sctx_tm_sctx_sync < case H1.
Subgoal 1:

Variables: SL T L' L2
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H2 : vars_of_tm_sctx (SL n1) (n1 :: L')
H4 : vars_of_sctx L2 L'
============================
 member (tm n1) (SL n1)

Subgoal 2 is:
 member (tm M) SL

sctx_tm_sctx_sync < case H2.
Subgoal 1:

Variables: T L' L2 L3
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : vars_of_sctx L2 L'
H5 : vars_of_tm_sctx L3 L'
============================
 member (tm n1) (tm n1 :: L3)

Subgoal 2 is:
 member (tm M) SL

sctx_tm_sctx_sync < search.
Subgoal 2:

Variables: Vs SL M T L1 B
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_sctx (B :: L1) Vs
H2 : vars_of_tm_sctx SL Vs
H4 : member (of M T) L1 *
============================
 member (tm M) SL

sctx_tm_sctx_sync < case H1.
Subgoal 2:

Variables: SL M T L' L2 T1
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H2 : vars_of_tm_sctx (SL n1) (n1 :: L')
H4 : member (of (M n1) T) L2 *
H5 : vars_of_sctx L2 L'
============================
 member (tm (M n1)) (SL n1)

sctx_tm_sctx_sync < case H2.
Subgoal 2:

Variables: M T L' L2 T1 L3
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : member (of (M n1) T) L2 *
H5 : vars_of_sctx L2 L'
H6 : vars_of_tm_sctx L3 L'
============================
 member (tm (M n1)) (tm n1 :: L3)

sctx_tm_sctx_sync < unfold.
Subgoal 2:

Variables: M T L' L2 T1 L3
IH : forall L Vs SL M T, vars_of_sctx L Vs -> vars_of_tm_sctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : member (of (M n1) T) L2 *
H5 : vars_of_sctx L2 L'
H6 : vars_of_tm_sctx L3 L'
============================
 member (tm (M n1)) L3

sctx_tm_sctx_sync < backchain IH.
Proof completed.
Abella < Theorem sclosed_tm_prune_aux : 
forall M L, nabla x, tm_sctx L -> {L |- tm (M x)} -> (exists M', M = y\M').


============================
 forall M L, nabla x, tm_sctx L -> {L |- tm (M x)} -> (exists M', M = y\M')

sclosed_tm_prune_aux < induction on 2.

IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
============================
 forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}@ -> (exists M', M = y\M')

sclosed_tm_prune_aux < intros.

Variables: M L
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H2 : {L |- tm (M n1)}@
============================
 exists M', M = y\M'

sclosed_tm_prune_aux < case H2.
Subgoal 1:

Variables: L N
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
============================
 exists M', z1\nat N = y\M'

Subgoal 2 is:
 exists M', z1\pred (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 2:

Variables: L M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\pred (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 2:

Variables: L M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\pred M' = y\M'1

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 3:

Variables: L M2 M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 3:

Variables: L M2 M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\plus M' (M2 z1) = y\M'1

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H4.
Subgoal 3:

Variables: L M' M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\plus M' M'1 = y\M'2

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 4:

Variables: L M2 M1 M3
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M3 n1)}*
H4 : {L |- tm (M1 n1)}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 4:

Variables: L M2 M1 M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M1 n1)}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\ifz M' (M1 z1) (M2 z1) = y\M'1

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H4.
Subgoal 4:

Variables: L M2 M' M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M'2, z1\ifz M' M'1 (M2 z1) = y\M'2

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H5.
Subgoal 4:

Variables: L M' M'1 M'2
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
H5 : {L |- tm M'2}*
============================
 exists M'3, z1\ifz M' M'1 M'2 = y\M'3

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 5:

Variables: L
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
============================
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 6:

Variables: L M2 M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 6:

Variables: L M2 M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\pair M' (M2 z1) = y\M'1

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H4.
Subgoal 6:

Variables: L M' M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\pair M' M'1 = y\M'2

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 7:

Variables: L M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 7:

Variables: L M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\fst M' = y\M'1

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 8:

Variables: L M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 8:

Variables: L M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\snd M' = y\M'1

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 9:

Variables: L R M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L, tm n2 |- tm (R n1 n2)}*
============================
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 9:

Variables: L R M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L, tm n2 |- tm (R n1 n2)}*
============================
 exists M'1, z1\let M' (R z1) = y\M'1

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H4.
Subgoal 9:

Variables: L M' M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L, tm n2 |- tm (M'1 n2)}*
============================
 exists M'2, z1\let M' (z2\M'1 z2) = y\M'2

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 10:

Variables: L R
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L, tm n2, tm n3 |- tm (R n1 n2 n3)}*
============================
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 10:

Variables: L M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L, tm n2, tm n3 |- tm (M' n3 n2)}*
============================
 exists M'1, z1\fix (z2\z3\M' z3 z2) = y\M'1

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 11:

Variables: L M2 M1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H3.
Subgoal 11:

Variables: L M2 M'
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\app M' (M2 z1) = y\M'1

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < apply IH to _ H4.
Subgoal 11:

Variables: L M' M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\app M' M'1 = y\M'2

Subgoal 12 is:
 exists M', M = y\M'

sclosed_tm_prune_aux < search.
Subgoal 12:

Variables: M L F
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L, [F n1] |- tm (M n1)}*
H4 : member (F n1) L
============================
 exists M', M = y\M'

sclosed_tm_prune_aux < apply tm_sctx_mem to H1 H4.
Subgoal 12:

Variables: M L X
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H3 : {L, [tm (X n1)] |- tm (M n1)}*
H4 : member (tm (X n1)) L
H5 : name (X n1)
============================
 exists M', M = y\M'

sclosed_tm_prune_aux < case H3.
Subgoal 12:

Variables: M L
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H4 : member (tm (M n1)) L
H5 : name (M n1)
============================
 exists M', M = y\M'

sclosed_tm_prune_aux < apply member_prune to H4.
Subgoal 12:

Variables: L M'1
IH : forall M L, nabla x, tm_sctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_sctx L
H4 : member (tm M'1) L
H5 : name M'1
============================
 exists M', z1\M'1 = y\M'

sclosed_tm_prune_aux < search.
Proof completed.
Abella < Theorem sclosed_tm_prune : 
forall M, nabla x, {tm (M x)} -> (exists M', M = y\M').


============================
 forall M, nabla x, {tm (M x)} -> (exists M', M = y\M')

sclosed_tm_prune < intros.

Variables: M
H1 : {tm (M n1)}
============================
 exists M', M = y\M'

sclosed_tm_prune < apply sclosed_tm_prune_aux to _ H1.

Variables: M'
H1 : {tm M'}
============================
 exists M'1, z1\M' = y\M'1

sclosed_tm_prune < search.
Proof completed.
Abella < Theorem sof_to_tm : 
forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
  tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T} -> {SL |- tm M}.


============================
 forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
   tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T} -> {SL |- tm M}

sof_to_tm < induction on 6.

IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
============================
 forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
   tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}@ -> {SL |- tm M}

sof_to_tm < intros.

Variables: L Vs SL M T
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H6 : {L |- of M T}@
============================
 {SL |- tm M}

sof_to_tm < case H6.
Subgoal 1:

Variables: L Vs SL N
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
============================
 {SL |- tm (nat N)}

Subgoal 2 is:
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 2:

Variables: L Vs SL M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
============================
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 2.1:

Variables: L Vs SL M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
============================
 {SL |- tm M1}

Subgoal 2 is:
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH.
Subgoal 2:

Variables: L Vs SL M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {L |- of M2 tnat}*
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 3.1:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {L |- of M2 tnat}*
============================
 {SL |- tm M1}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {L |- of M2 tnat}*
H9 : {SL |- tm M1}
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M2}.
Subgoal 3.2:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {L |- of M2 tnat}*
H9 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tnat}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 tnat}*
H8 : {L |- of M2 tnat}*
H9 : {SL |- tm M1}
H10 : {SL |- tm M2}
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 4.1:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
============================
 {SL |- tm M1}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
H10 : {SL |- tm M1}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M2}.
Subgoal 4.2:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
H10 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
H10 : {SL |- tm M1}
H11 : {SL |- tm M2}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M3}.
Subgoal 4.3:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
H10 : {SL |- tm M1}
H11 : {SL |- tm M2}
============================
 {SL |- tm M3}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = tnat.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M3 tnat}*
H8 : {L |- of M1 T}*
H9 : {L |- of M2 T}*
H10 : {SL |- tm M1}
H11 : {SL |- tm M2}
H12 : {SL |- tm M3}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 5:

Variables: L Vs SL
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty tunit}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
============================
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (prod T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < case H1.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
H9 : {is_sty T1}
H10 : {is_sty T2}
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 6.1:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
H9 : {is_sty T1}
H10 : {is_sty T2}
============================
 {SL |- tm M1}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = T1.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
H9 : {is_sty T1}
H10 : {is_sty T2}
H11 : {SL |- tm M1}
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M2}.
Subgoal 6.2:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
H9 : {is_sty T1}
H10 : {is_sty T2}
H11 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = T2.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L |- of M2 T2}*
H9 : {is_sty T1}
H10 : {is_sty T2}
H11 : {SL |- tm M1}
H12 : {SL |- tm M2}
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 7:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T T2)}*
============================
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 7.1:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T T2)}*
============================
 {SL |- tm M1}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = prod T T2.
Subgoal 7.1:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T T2)}*
============================
 {is_sty (prod T T2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain sof_is_sty.
Subgoal 7:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T T2)}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 8:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T1 T)}*
============================
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 8.1:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T1 T)}*
============================
 {SL |- tm M1}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = prod T1 T.
Subgoal 8.1:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T1 T)}*
============================
 {is_sty (prod T1 T)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain sof_is_sty.
Subgoal 8:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (prod T1 T)}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < apply sof_is_sty to _ H7.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
H9 : {is_sty T1}
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 9.1:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
H9 : {is_sty T1}
============================
 {SL |- tm M1}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = T1.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
H9 : {is_sty T1}
H10 : {SL |- tm M1}
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL, tm n1 |- tm (R n1)}.
Subgoal 9.2:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
H9 : {is_sty T1}
H10 : {SL |- tm M1}
============================
 {SL, tm n1 |- tm (R n1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with L = of n1 T1 :: L, T = T.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 T1}*
H8 : {L, of n1 T1 |- of (R n1) T}*
H9 : {is_sty T1}
H10 : {SL |- tm M1}
H11 : {SL, tm n1 |- tm (R n1)}
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (arr T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H8 : {L |- is_sty (arr T1 T2)}*
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < apply s_is_sty_str to _ H8.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (arr T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H8 : {L |- is_sty (arr T1 T2)}*
H9 : {is_sty (arr T1 T2)}
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < case H9.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (arr T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H8 : {L |- is_sty (arr T1 T2)}*
H10 : {is_sty T1}
H11 : {is_sty T2}
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL, tm n1, tm n2 |- tm (R n1 n2)}.
Subgoal 10.1:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (arr T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H8 : {L |- is_sty (arr T1 T2)}*
H10 : {is_sty T1}
H11 : {is_sty T2}
============================
 {SL, tm n1, tm n2 |- tm (R n1 n2)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with L = of n2 T1 :: of n1 (arr T1 T2) :: L, T = T2.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty (arr T1 T2)}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H8 : {L |- is_sty (arr T1 T2)}*
H10 : {is_sty T1}
H11 : {is_sty T2}
H12 : {SL, tm n1, tm n2 |- tm (R n1 n2)}
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M1}.
Subgoal 11.1:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
============================
 {SL |- tm M1}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = arr T1 T.
Subgoal 11.1:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
============================
 {is_sty (arr T1 T)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain sof_is_sty.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
H9 : {SL |- tm M1}
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < assert {SL |- tm M2}.
Subgoal 11.2:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
H9 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain IH with T = T1.
Subgoal 11.2:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
H9 : {SL |- tm M1}
============================
 {is_sty T1}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain sof_is_sty.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L |- of M1 (arr T1 T)}*
H8 : {L |- of M2 T1}*
H9 : {SL |- tm M1}
H10 : {SL |- tm M2}
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < search.
Subgoal 12:

Variables: L Vs SL M T F
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, [F] |- of M T}*
H8 : member F L
============================
 {SL |- tm M}

sof_to_tm < apply sctx_mem to _ H8.
Subgoal 12:

Variables: L Vs SL M T X T1
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H7 : {L, [of X T1] |- of M T}*
H8 : member (of X T1) L
H9 : name X
H10 : {is_sty T1}
============================
 {SL |- tm M}

sof_to_tm < case H7.
Subgoal 12:

Variables: L Vs SL M T
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H8 : member (of M T) L
H9 : name M
H10 : {is_sty T}
============================
 {SL |- tm M}

sof_to_tm < assert member (tm M) SL.
Subgoal 12.1:

Variables: L Vs SL M T
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H8 : member (of M T) L
H9 : name M
H10 : {is_sty T}
============================
 member (tm M) SL

Subgoal 12 is:
 {SL |- tm M}

sof_to_tm < backchain sctx_tm_sctx_sync.
Subgoal 12:

Variables: L Vs SL M T
IH : forall L Vs SL M T, {is_sty T} -> sctx L -> vars_of_sctx L Vs ->
       tm_sctx SL -> vars_of_tm_sctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : {is_sty T}
H2 : sctx L
H3 : vars_of_sctx L Vs
H4 : tm_sctx SL
H5 : vars_of_tm_sctx SL Vs
H8 : member (of M T) L
H9 : name M
H10 : {is_sty T}
H11 : member (tm M) SL
============================
 {SL |- tm M}

sof_to_tm < search.
Proof completed.
Abella < Define ctx : (list o) -> prop by 
ctx nil;
ctx (of X T :: L) := ctx L /\ name X /\ {is_sty T} /\ (forall T', member (of X T') L -> T = T').

Abella < Define vars_of_ctx : (list o) -> (list tm) -> prop by 
vars_of_ctx nil nil;
vars_of_ctx (of X T :: L) (X :: Vs) := vars_of_ctx L Vs.

Abella < Theorem ctx_islist : 
forall L, ctx L -> is_list L.


============================
 forall L, ctx L -> is_list L

ctx_islist < induction on 1.

IH : forall L, ctx L * -> is_list L
============================
 forall L, ctx L @ -> is_list L

ctx_islist < intros.

Variables: L
IH : forall L, ctx L * -> is_list L
H1 : ctx L @
============================
 is_list L

ctx_islist < case H1.
Subgoal 1:

IH : forall L, ctx L * -> is_list L
============================
 is_list nil

Subgoal 2 is:
 is_list (of X T :: L1)

ctx_islist < search.
Subgoal 2:

Variables: L1 T X
IH : forall L, ctx L * -> is_list L
H2 : ctx L1 *
H3 : name X
H4 : {is_sty T}
H5 : forall T', member (of X T') L1 -> T = T'
============================
 is_list (of X T :: L1)

ctx_islist < unfold.
Subgoal 2:

Variables: L1 T X
IH : forall L, ctx L * -> is_list L
H2 : ctx L1 *
H3 : name X
H4 : {is_sty T}
H5 : forall T', member (of X T') L1 -> T = T'
============================
 is_list L1

ctx_islist < backchain IH.
Proof completed.
Abella < Theorem ctx_mem : 
forall SL O, ctx SL -> member O SL ->
  (exists X T, O = of X T /\ name X /\ {is_sty T}).


============================
 forall SL O, ctx SL -> member O SL ->
   (exists X T, O = of X T /\ name X /\ {is_sty T})

ctx_mem < induction on 1.

IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
============================
 forall SL O, ctx SL @ -> member O SL ->
   (exists X T, O = of X T /\ name X /\ {is_sty T})

ctx_mem < intros.

Variables: SL O
IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H1 : ctx SL @
H2 : member O SL
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

ctx_mem < case H1.
Subgoal 1:

Variables: O
IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H2 : member O nil
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

Subgoal 2 is:
 exists X T, O = of X T /\ name X /\ {is_sty T}

ctx_mem < case H2.
Subgoal 2:

Variables: O L T X
IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H2 : member O (of X T :: L)
H3 : ctx L *
H4 : name X
H5 : {is_sty T}
H6 : forall T', member (of X T') L -> T = T'
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

ctx_mem < case H2.
Subgoal 2.1:

Variables: L T X
IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H3 : ctx L *
H4 : name X
H5 : {is_sty T}
H6 : forall T', member (of X T') L -> T = T'
============================
 exists X1 T1, of X T = of X1 T1 /\ name X1 /\ {is_sty T1}

Subgoal 2.2 is:
 exists X T, O = of X T /\ name X /\ {is_sty T}

ctx_mem < search.
Subgoal 2.2:

Variables: O L T X
IH : forall SL O, ctx SL * -> member O SL ->
       (exists X T, O = of X T /\ name X /\ {is_sty T})
H3 : ctx L *
H4 : name X
H5 : {is_sty T}
H6 : forall T', member (of X T') L -> T = T'
H7 : member O L
============================
 exists X T, O = of X T /\ name X /\ {is_sty T}

ctx_mem < backchain IH.
Proof completed.
Abella < Theorem ctx_mem_sync : 
forall L X T T', ctx L -> member (of X T) L -> member (of X T') L -> T = T'.


============================
 forall L X T T', ctx L -> member (of X T) L -> member (of X T') L -> T = T'

ctx_mem_sync < induction on 2.

IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
============================
 forall L X T T', ctx L -> member (of X T) L @ -> member (of X T') L -> T =
 T'

ctx_mem_sync < intros.

Variables: L X T T'
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx L
H2 : member (of X T) L @
H3 : member (of X T') L
============================
 T = T'

ctx_mem_sync < case H2.
Subgoal 1:

Variables: X T T' L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (of X T :: L1)
H3 : member (of X T') (of X T :: L1)
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx_mem_sync < case H3.
Subgoal 1.1:

Variables: X T L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (of X T :: L1)
============================
 T = T

Subgoal 1.2 is:
 T = T'

Subgoal 2 is:
 T = T'

ctx_mem_sync < search.
Subgoal 1.2:

Variables: X T T' L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (of X T :: L1)
H4 : member (of X T') L1
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx_mem_sync < case H1.
Subgoal 1.2:

Variables: X T T' L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H4 : member (of X T') L1
H5 : ctx L1
H6 : name X
H7 : {is_sty T}
H8 : forall T', member (of X T') L1 -> T = T'
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx_mem_sync < backchain H8.
Subgoal 2:

Variables: X T T' L1 B
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (B :: L1)
H3 : member (of X T') (B :: L1)
H4 : member (of X T) L1 *
============================
 T = T'

ctx_mem_sync < case H3.
Subgoal 2.1:

Variables: X T T' L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (of X T' :: L1)
H4 : member (of X T) L1 *
============================
 T = T'

Subgoal 2.2 is:
 T = T'

ctx_mem_sync < case H1.
Subgoal 2.1:

Variables: X T T' L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H4 : member (of X T) L1 *
H5 : ctx L1
H6 : name X
H7 : {is_sty T'}
H8 : forall T'1, member (of X T'1) L1 -> T' = T'1
============================
 T = T'

Subgoal 2.2 is:
 T = T'

ctx_mem_sync < apply H8 to H4.
Subgoal 2.1:

Variables: X T L1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H4 : member (of X T) L1 *
H5 : ctx L1
H6 : name X
H7 : {is_sty T}
H8 : forall T'1, member (of X T'1) L1 -> T = T'1
============================
 T = T

Subgoal 2.2 is:
 T = T'

ctx_mem_sync < search.
Subgoal 2.2:

Variables: X T T' L1 B
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H1 : ctx (B :: L1)
H4 : member (of X T) L1 *
H5 : member (of X T') L1
============================
 T = T'

ctx_mem_sync < case H1.
Subgoal 2.2:

Variables: X T T' L1 T1 X1
IH : forall L X T T', ctx L -> member (of X T) L * -> member (of X T') L ->
       T =
     T'
H4 : member (of X T) L1 *
H5 : member (of X T') L1
H6 : ctx L1
H7 : name X1
H8 : {is_sty T1}
H9 : forall T', member (of X1 T') L1 -> T1 = T'
============================
 T = T'

ctx_mem_sync < backchain IH.
Proof completed.
Abella < Theorem ctx_extend : 
forall L T, nabla x, ctx L -> {is_sty T} -> ctx (of x T :: L).


============================
 forall L T, nabla x, ctx L -> {is_sty T} -> ctx (of x T :: L)

ctx_extend < intros.

Variables: L T
H1 : ctx L
H2 : {is_sty T}
============================
 ctx (of n1 T :: L)

ctx_extend < unfold.
Subgoal 1:

Variables: L T
H1 : ctx L
H2 : {is_sty T}
============================
 ctx L

Subgoal 2 is:
 name n1

Subgoal 3 is:
 {is_sty T}

Subgoal 4 is:
 forall T', member (of n1 T') L -> T = T'

ctx_extend < search.
Subgoal 2:

Variables: L T
H1 : ctx L
H2 : {is_sty T}
============================
 name n1

Subgoal 3 is:
 {is_sty T}

Subgoal 4 is:
 forall T', member (of n1 T') L -> T = T'

ctx_extend < search.
Subgoal 3:

Variables: L T
H1 : ctx L
H2 : {is_sty T}
============================
 {is_sty T}

Subgoal 4 is:
 forall T', member (of n1 T') L -> T = T'

ctx_extend < search.
Subgoal 4:

Variables: L T
H1 : ctx L
H2 : {is_sty T}
============================
 forall T', member (of n1 T') L -> T = T'

ctx_extend < intros.
Subgoal 4:

Variables: L T T'
H1 : ctx L
H2 : {is_sty T}
H3 : member (of n1 T') L
============================
 T = T'

ctx_extend < apply member_prune to H3.
Proof completed.
Abella < Theorem is_sty_str : 
forall L T, ctx L -> {L |- is_sty T} -> {is_sty T}.


============================
 forall L T, ctx L -> {L |- is_sty T} -> {is_sty T}

is_sty_str < induction on 2.

IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
============================
 forall L T, ctx L -> {L |- is_sty T}@ -> {is_sty T}

is_sty_str < intros.

Variables: L T
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H2 : {L |- is_sty T}@
============================
 {is_sty T}

is_sty_str < case H2.
Subgoal 1:

Variables: L
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
============================
 {is_sty tnat}

Subgoal 2 is:
 {is_sty tunit}

Subgoal 3 is:
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < search.
Subgoal 2:

Variables: L
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
============================
 {is_sty tunit}

Subgoal 3 is:
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < search.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < apply IH to _ H3.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < apply IH to _ H4.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (prod T1 T2)}

Subgoal 4 is:
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < search.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < apply IH to _ H3.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < apply IH to _ H4.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- is_sty T1}*
H4 : {L |- is_sty T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (arr T1 T2)}

Subgoal 5 is:
 {is_sty T}

is_sty_str < search.
Subgoal 5:

Variables: L T F
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L, [F] |- is_sty T}*
H4 : member F L
============================
 {is_sty T}

is_sty_str < apply ctx_mem to H1 H4.
Subgoal 5:

Variables: L T X T1
IH : forall L T, ctx L -> {L |- is_sty T}* -> {is_sty T}
H1 : ctx L
H3 : {L, [of X T1] |- is_sty T}*
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 {is_sty T}

is_sty_str < case H3.
Proof completed.
Abella < Theorem of_is_sty : 
forall L M T, ctx L -> {L |- of M T} -> {is_sty T}.


============================
 forall L M T, ctx L -> {L |- of M T} -> {is_sty T}

of_is_sty < induction on 2.

IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
============================
 forall L M T, ctx L -> {L |- of M T}@ -> {is_sty T}

of_is_sty < intros.

Variables: L M T
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H2 : {L |- of M T}@
============================
 {is_sty T}

of_is_sty < case H2.
Subgoal 1:

Variables: L N
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
============================
 {is_sty tnat}

Subgoal 2 is:
 {is_sty tnat}

Subgoal 3 is:
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 2:

Variables: L M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 tnat}*
============================
 {is_sty tnat}

Subgoal 3 is:
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 3:

Variables: L M2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 tnat}*
H4 : {L |- of M2 tnat}*
============================
 {is_sty tnat}

Subgoal 4 is:
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 4:

Variables: L T M2 M1 M3
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M3 tnat}*
H4 : {L |- of M1 T}*
H5 : {L |- of M2 T}*
============================
 {is_sty T}

Subgoal 5 is:
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < backchain IH with M = M1.
Subgoal 5:

Variables: L
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
============================
 {is_sty tunit}

Subgoal 6 is:
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H3.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
H5 : {is_sty T1}
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H4.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L |- of M2 T2}*
H5 : {is_sty T1}
H6 : {is_sty T2}
============================
 {is_sty (prod T1 T2)}

Subgoal 7 is:
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T T2)}*
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H3.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T T2)}*
H4 : {is_sty (prod T T2)}
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < case H4.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T T2)}*
H5 : {is_sty T}
H6 : {is_sty T2}
============================
 {is_sty T}

Subgoal 8 is:
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T1 T)}*
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H3.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T1 T)}*
H4 : {is_sty (prod T1 T)}
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < case H4.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (prod T1 T)}*
H5 : {is_sty T1}
H6 : {is_sty T}
============================
 {is_sty T}

Subgoal 9 is:
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L, of n1 T1 |- of (R n1) T}*
============================
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H3.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L, of n1 T1 |- of (R n1) T}*
H5 : {is_sty T1}
============================
 {is_sty T}

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < backchain IH with L = of n1 T1 :: L, M = R n1.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 T1}*
H4 : {L, of n1 T1 |- of (R n1) T}*
H5 : {is_sty T1}
============================
 ctx (of n1 T1 :: L)

Subgoal 10 is:
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < backchain ctx_extend.
Subgoal 10:

Variables: L T2 T1 R
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H4 : {L |- is_sty (arr T1 T2)}*
============================
 {is_sty (arr T1 T2)}

Subgoal 11 is:
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < backchain is_sty_str with L = L.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < apply IH to _ H3.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
H5 : {is_sty (arr T1 T)}
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < case H5.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L |- of M1 (arr T1 T)}*
H4 : {L |- of M2 T1}*
H6 : {is_sty T1}
H7 : {is_sty T}
============================
 {is_sty T}

Subgoal 12 is:
 {is_sty T}

of_is_sty < search.
Subgoal 12:

Variables: L M T F
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L, [F] |- of M T}*
H4 : member F L
============================
 {is_sty T}

of_is_sty < apply ctx_mem to H1 H4.
Subgoal 12:

Variables: L M T X T1
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H3 : {L, [of X T1] |- of M T}*
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 {is_sty T}

of_is_sty < case H3.
Subgoal 12:

Variables: L M T
IH : forall L M T, ctx L -> {L |- of M T}* -> {is_sty T}
H1 : ctx L
H4 : member (of M T) L
H5 : name M
H6 : {is_sty T}
============================
 {is_sty T}

of_is_sty < search.
Proof completed.
Abella < Theorem sty_to_cty : 
forall T, {is_sty T} -> {is_cty T}.


============================
 forall T, {is_sty T} -> {is_cty T}

sty_to_cty < induction on 1.

IH : forall T, {is_sty T}* -> {is_cty T}
============================
 forall T, {is_sty T}@ -> {is_cty T}

sty_to_cty < intros.

Variables: T
IH : forall T, {is_sty T}* -> {is_cty T}
H1 : {is_sty T}@
============================
 {is_cty T}

sty_to_cty < case H1.
Subgoal 1:

IH : forall T, {is_sty T}* -> {is_cty T}
============================
 {is_cty tnat}

Subgoal 2 is:
 {is_cty tunit}

Subgoal 3 is:
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

sty_to_cty < search.
Subgoal 2:

IH : forall T, {is_sty T}* -> {is_cty T}
============================
 {is_cty tunit}

Subgoal 3 is:
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

sty_to_cty < search.
Subgoal 3:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

sty_to_cty < apply IH to H2.
Subgoal 3:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
H4 : {is_cty T1}
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

sty_to_cty < apply IH to H3.
Subgoal 3:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
H4 : {is_cty T1}
H5 : {is_cty T2}
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

sty_to_cty < search.
Subgoal 4:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
============================
 {is_cty (arr T1 T2)}

sty_to_cty < apply IH to H2.
Subgoal 4:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
H4 : {is_cty T1}
============================
 {is_cty (arr T1 T2)}

sty_to_cty < apply IH to H3.
Subgoal 4:

Variables: T2 T1
IH : forall T, {is_sty T}* -> {is_cty T}
H2 : {is_sty T1}*
H3 : {is_sty T2}*
H4 : {is_cty T1}
H5 : {is_cty T2}
============================
 {is_cty (arr T1 T2)}

sty_to_cty < search.
Proof completed.
Abella < Theorem ctx_name : 
forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs} -> name X.


============================
 forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs} -> name X

ctx_name < induction on 3.

IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
============================
 forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}@ -> name X

ctx_name < intros.

Variables: L Vs X
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : {memb X Vs}@
============================
 name X

ctx_name < case H3.
Subgoal 1:

Variables: L X L1
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H1 : ctx L
H2 : vars_of_ctx L (X :: L1)
============================
 name X

Subgoal 2 is:
 name X

ctx_name < case H2.
Subgoal 1:

Variables: X L1 L2 T
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H1 : ctx (of X T :: L2)
H4 : vars_of_ctx L2 L1
============================
 name X

Subgoal 2 is:
 name X

ctx_name < case H1.
Subgoal 1:

Variables: X L1 L2 T
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H4 : vars_of_ctx L2 L1
H5 : ctx L2
H6 : name X
H7 : {is_sty T}
H8 : forall T', member (of X T') L2 -> T = T'
============================
 name X

Subgoal 2 is:
 name X

ctx_name < search.
Subgoal 2:

Variables: L X L1 X1
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H1 : ctx L
H2 : vars_of_ctx L (X1 :: L1)
H4 : {memb X L1}*
============================
 name X

ctx_name < case H2.
Subgoal 2:

Variables: X L1 X1 L2 T
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H1 : ctx (of X1 T :: L2)
H4 : {memb X L1}*
H5 : vars_of_ctx L2 L1
============================
 name X

ctx_name < case H1.
Subgoal 2:

Variables: X L1 X1 L2 T
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H4 : {memb X L1}*
H5 : vars_of_ctx L2 L1
H6 : ctx L2
H7 : name X1
H8 : {is_sty T}
H9 : forall T', member (of X1 T') L2 -> T = T'
============================
 name X

ctx_name < apply IH to _ _ H4.
Subgoal 2:

Variables: X L1 X1 L2 T
IH : forall L Vs X, ctx L -> vars_of_ctx L Vs -> {memb X Vs}* -> name X
H4 : {memb X L1}*
H5 : vars_of_ctx L2 L1
H6 : ctx L2
H7 : name X1
H8 : {is_sty T}
H9 : forall T', member (of X1 T') L2 -> T = T'
H10 : name X
============================
 name X

ctx_name < search.
Proof completed.
Abella < Theorem ctx_subset : 
forall L L', ctx L -> subset L' L -> ctx L'.


============================
 forall L L', ctx L -> subset L' L -> ctx L'

ctx_subset < induction on 2.

IH : forall L L', ctx L -> subset L' L * -> ctx L'
============================
 forall L L', ctx L -> subset L' L @ -> ctx L'

ctx_subset < intros.

Variables: L L'
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H2 : subset L' L @
============================
 ctx L'

ctx_subset < case H2.
Subgoal 1:

Variables: L
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
============================
 ctx nil

Subgoal 2 is:
 ctx (X :: L1)

ctx_subset < search.
Subgoal 2:

Variables: L L1 X
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member X L
H4 : subset L1 L *
============================
 ctx (X :: L1)

ctx_subset < apply ctx_mem to _ H3.
Subgoal 2:

Variables: L L1 X1 T
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
============================
 ctx (of X1 T :: L1)

ctx_subset < unfold.
Subgoal 2.1:

Variables: L L1 X1 T
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
============================
 ctx L1

Subgoal 2.2 is:
 name X1

Subgoal 2.3 is:
 {is_sty T}

Subgoal 2.4 is:
 forall T', member (of X1 T') L1 -> T = T'

ctx_subset < backchain IH.
Subgoal 2.2:

Variables: L L1 X1 T
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
============================
 name X1

Subgoal 2.3 is:
 {is_sty T}

Subgoal 2.4 is:
 forall T', member (of X1 T') L1 -> T = T'

ctx_subset < search.
Subgoal 2.3:

Variables: L L1 X1 T
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
============================
 {is_sty T}

Subgoal 2.4 is:
 forall T', member (of X1 T') L1 -> T = T'

ctx_subset < search.
Subgoal 2.4:

Variables: L L1 X1 T
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
============================
 forall T', member (of X1 T') L1 -> T = T'

ctx_subset < intros.
Subgoal 2.4:

Variables: L L1 X1 T T'
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
H7 : member (of X1 T') L1
============================
 T = T'

ctx_subset < apply subset_mem_trans to H4 H7.
Subgoal 2.4:

Variables: L L1 X1 T T'
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T) L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T}
H7 : member (of X1 T') L1
H8 : member (of X1 T') L
============================
 T = T'

ctx_subset < apply ctx_mem_sync to _ H3 H8.
Subgoal 2.4:

Variables: L L1 X1 T'
IH : forall L L', ctx L -> subset L' L * -> ctx L'
H1 : ctx L
H3 : member (of X1 T') L
H4 : subset L1 L *
H5 : name X1
H6 : {is_sty T'}
H7 : member (of X1 T') L1
H8 : member (of X1 T') L
============================
 T' = T'

ctx_subset < search.
Proof completed.
Abella < Theorem of_nat_inv : 
forall L N T, ctx L -> {L |- of (nat N) T} -> T = tnat.


============================
 forall L N T, ctx L -> {L |- of (nat N) T} -> T = tnat

of_nat_inv < intros.

Variables: L N T
H1 : ctx L
H2 : {L |- of (nat N) T}
============================
 T = tnat

of_nat_inv < case H2.
Subgoal 1:

Variables: L N
H1 : ctx L
============================
 tnat = tnat

Subgoal 2 is:
 T = tnat

of_nat_inv < search.
Subgoal 2:

Variables: L N T F
H1 : ctx L
H3 : {L, [F] |- of (nat N) T}
H4 : member F L
============================
 T = tnat

of_nat_inv < apply ctx_mem to _ H4.
Subgoal 2:

Variables: L N T X T1
H1 : ctx L
H3 : {L, [of X T1] |- of (nat N) T}
H4 : member (of X T1) L
H5 : name X
H6 : {is_sty T1}
============================
 T = tnat

of_nat_inv < case H3.
Subgoal 2:

Variables: L N T
H1 : ctx L
H4 : member (of (nat N) T) L
H5 : name (nat N)
H6 : {is_sty T}
============================
 T = tnat

of_nat_inv < case H5.
Proof completed.
Abella < Theorem of_var_inv : 
forall M L T, ctx L -> {L |- of M T} -> name M -> member (of M T) L.


============================
 forall M L T, ctx L -> {L |- of M T} -> name M -> member (of M T) L

of_var_inv < intros.

Variables: M L T
H1 : ctx L
H2 : {L |- of M T}
H3 : name M
============================
 member (of M T) L

of_var_inv < case H3.

Variables: L T
H1 : ctx (L n1)
H2 : {L n1 |- of n1 T}
============================
 member (of n1 T) (L n1)

of_var_inv < case H2.

Variables: L T F
H1 : ctx (L n1)
H4 : {L n1, [F n1] |- of n1 T}
H5 : member (F n1) (L n1)
============================
 member (of n1 T) (L n1)

of_var_inv < apply ctx_mem to _ H5.

Variables: L T X T1
H1 : ctx (L n1)
H4 : {L n1, [of (X n1) T1] |- of n1 T}
H5 : member (of (X n1) T1) (L n1)
H6 : name (X n1)
H7 : {is_sty T1}
============================
 member (of n1 T) (L n1)

of_var_inv < case H4.

Variables: L T
H1 : ctx (L n1)
H5 : member (of n1 T) (L n1)
H6 : name n1
H7 : {is_sty T}
============================
 member (of n1 T) (L n1)

of_var_inv < search.
Proof completed.
Abella < Theorem of_weakening : 
forall L L' M T, ctx L -> subset L L' -> {L |- of M T} -> {L' |- of M T}.


============================
 forall L L' M T, ctx L -> subset L L' -> {L |- of M T} -> {L' |- of M T}

of_weakening < induction on 3.

IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
============================
 forall L L' M T, ctx L -> subset L L' -> {L |- of M T}@ -> {L' |- of M T}

of_weakening < intros.

Variables: L L' M T
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H3 : {L |- of M T}@
============================
 {L' |- of M T}

of_weakening < case H3.
Subgoal 1:

Variables: L L' N
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
============================
 {L' |- of (nat N) tnat}

Subgoal 2 is:
 {L' |- of (pred M1) tnat}

Subgoal 3 is:
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 2:

Variables: L L' M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 tnat}*
============================
 {L' |- of (pred M1) tnat}

Subgoal 3 is:
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 2:

Variables: L L' M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 tnat}*
H5 : {L' |- of M1 tnat}
============================
 {L' |- of (pred M1) tnat}

Subgoal 3 is:
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 3:

Variables: L L' M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 tnat}*
H5 : {L |- of M2 tnat}*
============================
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 3:

Variables: L L' M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 tnat}*
H5 : {L |- of M2 tnat}*
H6 : {L' |- of M1 tnat}
============================
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H5.
Subgoal 3:

Variables: L L' M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 tnat}*
H5 : {L |- of M2 tnat}*
H6 : {L' |- of M1 tnat}
H7 : {L' |- of M2 tnat}
============================
 {L' |- of (plus M1 M2) tnat}

Subgoal 4 is:
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 4:

Variables: L L' T M2 M1 M3
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M3 tnat}*
H5 : {L |- of M1 T}*
H6 : {L |- of M2 T}*
============================
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 4:

Variables: L L' T M2 M1 M3
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M3 tnat}*
H5 : {L |- of M1 T}*
H6 : {L |- of M2 T}*
H7 : {L' |- of M3 tnat}
============================
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H5.
Subgoal 4:

Variables: L L' T M2 M1 M3
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M3 tnat}*
H5 : {L |- of M1 T}*
H6 : {L |- of M2 T}*
H7 : {L' |- of M3 tnat}
H8 : {L' |- of M1 T}
============================
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H6.
Subgoal 4:

Variables: L L' T M2 M1 M3
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M3 tnat}*
H5 : {L |- of M1 T}*
H6 : {L |- of M2 T}*
H7 : {L' |- of M3 tnat}
H8 : {L' |- of M1 T}
H9 : {L' |- of M2 T}
============================
 {L' |- of (ifz M3 M1 M2) T}

Subgoal 5 is:
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 5:

Variables: L L'
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
============================
 {L' |- of unit tunit}

Subgoal 6 is:
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 6:

Variables: L L' T2 M2 T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L |- of M2 T2}*
============================
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 6:

Variables: L L' T2 M2 T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L |- of M2 T2}*
H6 : {L' |- of M1 T1}
============================
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H5.
Subgoal 6:

Variables: L L' T2 M2 T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L |- of M2 T2}*
H6 : {L' |- of M1 T1}
H7 : {L' |- of M2 T2}
============================
 {L' |- of (pair M1 M2) (prod T1 T2)}

Subgoal 7 is:
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 7:

Variables: L L' T T2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (prod T T2)}*
============================
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 7:

Variables: L L' T T2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (prod T T2)}*
H5 : {L' |- of M1 (prod T T2)}
============================
 {L' |- of (fst M1) T}

Subgoal 8 is:
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 8:

Variables: L L' T T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (prod T1 T)}*
============================
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 8:

Variables: L L' T T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (prod T1 T)}*
H5 : {L' |- of M1 (prod T1 T)}
============================
 {L' |- of (snd M1) T}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 9:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
============================
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 9:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
H6 : {L' |- of M1 T1}
============================
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H5 with L' = of n1 T1 :: L'.
Subgoal 9.1:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
H6 : {L' |- of M1 T1}
============================
 subset (of n1 T1 :: L) (of n1 T1 :: L')

Subgoal 9.2 is:
 ctx (of n1 T1 :: L)

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain subset_extend.
Subgoal 9.2:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
H6 : {L' |- of M1 T1}
============================
 ctx (of n1 T1 :: L)

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain ctx_extend.
Subgoal 9.2:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
H6 : {L' |- of M1 T1}
============================
 {is_sty T1}

Subgoal 9 is:
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain of_is_sty.
Subgoal 9:

Variables: L L' T R T1 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 T1}*
H5 : {L, of n1 T1 |- of (R n1) T}*
H6 : {L' |- of M1 T1}
H7 : {L', of n1 T1 |- of (R n1) T}
============================
 {L' |- of (let M1 R) T}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 10:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
============================
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply is_sty_str to _ H5.
Subgoal 10:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4 with L' = of n2 T1 :: of n1 (arr T1 T2) :: L'.
Subgoal 10.1:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 subset (of n2 T1 :: of n1 (arr T1 T2) :: L)
   (of n2 T1 :: of n1 (arr T1 T2) :: L')

Subgoal 10.2 is:
 ctx (of n2 T1 :: of n1 (arr T1 T2) :: L)

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain subset_extend.
Subgoal 10.1:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 subset (of n1 (arr T1 T2) :: L) (of n1 (arr T1 T2) :: L')

Subgoal 10.2 is:
 ctx (of n2 T1 :: of n1 (arr T1 T2) :: L)

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain subset_extend.
Subgoal 10.2:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 ctx (of n2 T1 :: of n1 (arr T1 T2) :: L)

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain ctx_extend.
Subgoal 10.2.1:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 ctx (of n1 (arr T1 T2) :: L)

Subgoal 10.2.2 is:
 {is_sty T1}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain ctx_extend.
Subgoal 10.2.2:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
============================
 {is_sty T1}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < case H6.
Subgoal 10.2.2:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H7 : {is_sty T1}
H8 : {is_sty T2}
============================
 {is_sty T1}

Subgoal 10 is:
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 10:

Variables: L L' T2 T1 R
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H5 : {L |- is_sty (arr T1 T2)}*
H6 : {is_sty (arr T1 T2)}
H7 : {L', of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}
============================
 {L' |- of (fix R) (arr T1 T2)}

Subgoal 11 is:
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 11:

Variables: L L' T T1 M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (arr T1 T)}*
H5 : {L |- of M2 T1}*
============================
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H4.
Subgoal 11:

Variables: L L' T T1 M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (arr T1 T)}*
H5 : {L |- of M2 T1}*
H6 : {L' |- of M1 (arr T1 T)}
============================
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < apply IH to _ _ H5.
Subgoal 11:

Variables: L L' T T1 M2 M1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L |- of M1 (arr T1 T)}*
H5 : {L |- of M2 T1}*
H6 : {L' |- of M1 (arr T1 T)}
H7 : {L' |- of M2 T1}
============================
 {L' |- of (app M1 M2) T}

Subgoal 12 is:
 {L' |- of M T}

of_weakening < search.
Subgoal 12:

Variables: L L' M T F
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, [F] |- of M T}*
H5 : member F L
============================
 {L' |- of M T}

of_weakening < apply ctx_mem to _ H5.
Subgoal 12:

Variables: L L' M T X T1
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H4 : {L, [of X T1] |- of M T}*
H5 : member (of X T1) L
H6 : name X
H7 : {is_sty T1}
============================
 {L' |- of M T}

of_weakening < case H4.
Subgoal 12:

Variables: L L' M T
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H5 : member (of M T) L
H6 : name M
H7 : {is_sty T}
============================
 {L' |- of M T}

of_weakening < assert member (of M T) L'.
Subgoal 12.1:

Variables: L L' M T
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H5 : member (of M T) L
H6 : name M
H7 : {is_sty T}
============================
 member (of M T) L'

Subgoal 12 is:
 {L' |- of M T}

of_weakening < backchain subset_mem_trans.
Subgoal 12:

Variables: L L' M T
IH : forall L L' M T, ctx L -> subset L L' -> {L |- of M T}* ->
       {L' |- of M T}
H1 : ctx L
H2 : subset L L'
H5 : member (of M T) L
H6 : name M
H7 : {is_sty T}
H8 : member (of M T) L'
============================
 {L' |- of M T}

of_weakening < search.
Proof completed.
Abella < Theorem ctx_focus_inv : 
forall L D G, ctx L -> member D L -> {L, [D] |- G} ->
  (exists A T, G = of A T /\ name A).


============================
 forall L D G, ctx L -> member D L -> {L, [D] |- G} ->
   (exists A T, G = of A T /\ name A)

ctx_focus_inv < intros.

Variables: L D G
H1 : ctx L
H2 : member D L
H3 : {L, [D] |- G}
============================
 exists A T, G = of A T /\ name A

ctx_focus_inv < apply ctx_mem to H1 H2.

Variables: L G X T
H1 : ctx L
H2 : member (of X T) L
H3 : {L, [of X T] |- G}
H4 : name X
H5 : {is_sty T}
============================
 exists A T, G = of A T /\ name A

ctx_focus_inv < case H3.

Variables: L X T
H1 : ctx L
H2 : member (of X T) L
H4 : name X
H5 : {is_sty T}
============================
 exists A T1, of X T = of A T1 /\ name A

ctx_focus_inv < search.
Proof completed.
Abella < Define tm_ctx : (list o) -> prop by 
tm_ctx nil;
tm_ctx (tm X :: L) := tm_ctx L /\ name X.

Abella < Define vars_of_tm_ctx : (list o) -> (list tm) -> prop by 
vars_of_tm_ctx nil nil;
vars_of_tm_ctx (tm X :: L) (X :: L') := vars_of_tm_ctx L L'.

Abella < Theorem tm_ctx_mem : 
forall E L, tm_ctx L -> member E L -> (exists X, E = tm X /\ name X).


============================
 forall E L, tm_ctx L -> member E L -> (exists X, E = tm X /\ name X)

tm_ctx_mem < induction on 2.

IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
============================
 forall E L, tm_ctx L -> member E L @ -> (exists X, E = tm X /\ name X)

tm_ctx_mem < intros.

Variables: E L
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_ctx L
H2 : member E L @
============================
 exists X, E = tm X /\ name X

tm_ctx_mem < case H2.
Subgoal 1:

Variables: E L1
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_ctx (E :: L1)
============================
 exists X, E = tm X /\ name X

Subgoal 2 is:
 exists X, E = tm X /\ name X

tm_ctx_mem < case H1.
Subgoal 1:

Variables: L1 X
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : tm_ctx L1
H4 : name X
============================
 exists X1, tm X = tm X1 /\ name X1

Subgoal 2 is:
 exists X, E = tm X /\ name X

tm_ctx_mem < search.
Subgoal 2:

Variables: E L1 B
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H1 : tm_ctx (B :: L1)
H3 : member E L1 *
============================
 exists X, E = tm X /\ name X

tm_ctx_mem < case H1.
Subgoal 2:

Variables: E L1 X
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : member E L1 *
H4 : tm_ctx L1
H5 : name X
============================
 exists X, E = tm X /\ name X

tm_ctx_mem < apply IH to _ H3.
Subgoal 2:

Variables: L1 X X1
IH : forall E L, tm_ctx L -> member E L * -> (exists X, E = tm X /\ name X)
H3 : member (tm X1) L1 *
H4 : tm_ctx L1
H5 : name X
H6 : name X1
============================
 exists X, tm X1 = tm X /\ name X

tm_ctx_mem < search.
Proof completed.
Abella < Theorem ctx_mem_to_lst_mem : 
forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L -> {memb X Vs}.


============================
 forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L -> {memb X Vs}

ctx_mem_to_lst_mem < induction on 2.

IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
============================
 forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L @ -> {memb X Vs}

ctx_mem_to_lst_mem < intros.

Variables: L Vs X T
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H1 : vars_of_ctx L Vs
H2 : member (of X T) L @
============================
 {memb X Vs}

ctx_mem_to_lst_mem < case H2.
Subgoal 1:

Variables: Vs X T L1
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H1 : vars_of_ctx (of X T :: L1) Vs
============================
 {memb X Vs}

Subgoal 2 is:
 {memb X Vs}

ctx_mem_to_lst_mem < case H1.
Subgoal 1:

Variables: X T L1 Vs1
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H3 : vars_of_ctx L1 Vs1
============================
 {memb X (X :: Vs1)}

Subgoal 2 is:
 {memb X Vs}

ctx_mem_to_lst_mem < search.
Subgoal 2:

Variables: Vs X T L1 B
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H1 : vars_of_ctx (B :: L1) Vs
H3 : member (of X T) L1 *
============================
 {memb X Vs}

ctx_mem_to_lst_mem < case H1.
Subgoal 2:

Variables: X T L1 Vs1 X1 T1
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H3 : member (of X T) L1 *
H4 : vars_of_ctx L1 Vs1
============================
 {memb X (X1 :: Vs1)}

ctx_mem_to_lst_mem < apply IH to H4 H3.
Subgoal 2:

Variables: X T L1 Vs1 X1 T1
IH : forall L Vs X T, vars_of_ctx L Vs -> member (of X T) L * -> {memb X Vs}
H3 : member (of X T) L1 *
H4 : vars_of_ctx L1 Vs1
H5 : {memb X Vs1}
============================
 {memb X (X1 :: Vs1)}

ctx_mem_to_lst_mem < search.
Proof completed.
Abella < Theorem lst_mem_to_ctx_mem : 
forall L Vs X, vars_of_ctx L Vs -> {memb X Vs} ->
  (exists T, member (of X T) L).


============================
 forall L Vs X, vars_of_ctx L Vs -> {memb X Vs} ->
   (exists T, member (of X T) L)

lst_mem_to_ctx_mem < induction on 2.

IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
============================
 forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}@ ->
   (exists T, member (of X T) L)

lst_mem_to_ctx_mem < intros.

Variables: L Vs X
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H1 : vars_of_ctx L Vs
H2 : {memb X Vs}@
============================
 exists T, member (of X T) L

lst_mem_to_ctx_mem < case H2.
Subgoal 1:

Variables: L X L1
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H1 : vars_of_ctx L (X :: L1)
============================
 exists T, member (of X T) L

Subgoal 2 is:
 exists T, member (of X T) L

lst_mem_to_ctx_mem < case H1.
Subgoal 1:

Variables: X L1 L2 T
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H3 : vars_of_ctx L2 L1
============================
 exists T1, member (of X T1) (of X T :: L2)

Subgoal 2 is:
 exists T, member (of X T) L

lst_mem_to_ctx_mem < search.
Subgoal 2:

Variables: L X L1 X1
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H1 : vars_of_ctx L (X1 :: L1)
H3 : {memb X L1}*
============================
 exists T, member (of X T) L

lst_mem_to_ctx_mem < case H1.
Subgoal 2:

Variables: X L1 X1 L2 T
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H3 : {memb X L1}*
H4 : vars_of_ctx L2 L1
============================
 exists T1, member (of X T1) (of X1 T :: L2)

lst_mem_to_ctx_mem < apply IH to H4 H3.
Subgoal 2:

Variables: X L1 X1 L2 T T1
IH : forall L Vs X, vars_of_ctx L Vs -> {memb X Vs}* ->
       (exists T, member (of X T) L)
H3 : {memb X L1}*
H4 : vars_of_ctx L2 L1
H5 : member (of X T1) L2
============================
 exists T1, member (of X T1) (of X1 T :: L2)

lst_mem_to_ctx_mem < search.
Proof completed.
Abella < Theorem ctx_to_tm_ctx : 
forall L Vs, ctx L -> vars_of_ctx L Vs ->
  (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs).


============================
 forall L Vs, ctx L -> vars_of_ctx L Vs ->
   (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)

ctx_to_tm_ctx < induction on 2.

IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
============================
 forall L Vs, ctx L -> vars_of_ctx L Vs @ ->
   (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)

ctx_to_tm_ctx < intros.

Variables: L Vs
IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
H1 : ctx L
H2 : vars_of_ctx L Vs @
============================
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs

ctx_to_tm_ctx < case H2.
Subgoal 1:

IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
H1 : ctx nil
============================
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL nil

Subgoal 2 is:
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL (X :: Vs1)

ctx_to_tm_ctx < search.
Subgoal 2:

Variables: Vs1 X L1 T
IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
H1 : ctx (of X T :: L1)
H3 : vars_of_ctx L1 Vs1 *
============================
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL (X :: Vs1)

ctx_to_tm_ctx < case H1.
Subgoal 2:

Variables: Vs1 X L1 T
IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
H3 : vars_of_ctx L1 Vs1 *
H4 : ctx L1
H5 : name X
H6 : {is_sty T}
H7 : forall T', member (of X T') L1 -> T = T'
============================
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL (X :: Vs1)

ctx_to_tm_ctx < apply IH to _ H3.
Subgoal 2:

Variables: Vs1 X L1 T SL
IH : forall L Vs, ctx L -> vars_of_ctx L Vs * ->
       (exists SL, tm_ctx SL /\ vars_of_tm_ctx SL Vs)
H3 : vars_of_ctx L1 Vs1 *
H4 : ctx L1
H5 : name X
H6 : {is_sty T}
H7 : forall T', member (of X T') L1 -> T = T'
H8 : tm_ctx SL
H9 : vars_of_tm_ctx SL Vs1
============================
 exists SL, tm_ctx SL /\ vars_of_tm_ctx SL (X :: Vs1)

ctx_to_tm_ctx < search.
Proof completed.
Abella < Theorem ctx_tm_ctx_sync : 
forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
  member (of M T) L -> member (tm M) SL.


============================
 forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
   member (of M T) L -> member (tm M) SL

ctx_tm_ctx_sync < induction on 3.

IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
============================
 forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
   member (of M T) L @ -> member (tm M) SL

ctx_tm_ctx_sync < intros.

Variables: L Vs SL M T
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_ctx L Vs
H2 : vars_of_tm_ctx SL Vs
H3 : member (of M T) L @
============================
 member (tm M) SL

ctx_tm_ctx_sync < case H3.
Subgoal 1:

Variables: Vs SL M T L1
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_ctx (of M T :: L1) Vs
H2 : vars_of_tm_ctx SL Vs
============================
 member (tm M) SL

Subgoal 2 is:
 member (tm M) SL

ctx_tm_ctx_sync < case H1.
Subgoal 1:

Variables: SL M T L1 Vs1
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H2 : vars_of_tm_ctx SL (M :: Vs1)
H4 : vars_of_ctx L1 Vs1
============================
 member (tm M) SL

Subgoal 2 is:
 member (tm M) SL

ctx_tm_ctx_sync < case H2.
Subgoal 1:

Variables: M T L1 Vs1 L2
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : vars_of_ctx L1 Vs1
H5 : vars_of_tm_ctx L2 Vs1
============================
 member (tm M) (tm M :: L2)

Subgoal 2 is:
 member (tm M) SL

ctx_tm_ctx_sync < search.
Subgoal 2:

Variables: Vs SL M T L1 B
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H1 : vars_of_ctx (B :: L1) Vs
H2 : vars_of_tm_ctx SL Vs
H4 : member (of M T) L1 *
============================
 member (tm M) SL

ctx_tm_ctx_sync < case H1.
Subgoal 2:

Variables: SL M T L1 Vs1 X T1
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H2 : vars_of_tm_ctx SL (X :: Vs1)
H4 : member (of M T) L1 *
H5 : vars_of_ctx L1 Vs1
============================
 member (tm M) SL

ctx_tm_ctx_sync < case H2.
Subgoal 2:

Variables: M T L1 Vs1 X T1 L2
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : member (of M T) L1 *
H5 : vars_of_ctx L1 Vs1
H6 : vars_of_tm_ctx L2 Vs1
============================
 member (tm M) (tm X :: L2)

ctx_tm_ctx_sync < unfold.
Subgoal 2:

Variables: M T L1 Vs1 X T1 L2
IH : forall L Vs SL M T, vars_of_ctx L Vs -> vars_of_tm_ctx SL Vs ->
       member (of M T) L * -> member (tm M) SL
H4 : member (of M T) L1 *
H5 : vars_of_ctx L1 Vs1
H6 : vars_of_tm_ctx L2 Vs1
============================
 member (tm M) L2

ctx_tm_ctx_sync < backchain IH.
Proof completed.
Abella < Theorem tm_cut : 
forall L M V, nabla x, {tm V} -> tm_ctx (L x) -> {L x, tm x |- tm (M x)} ->
  {L x |- tm (M V)}.


============================
 forall L M V, nabla x, {tm V} -> tm_ctx (L x) -> {L x, tm x |- tm (M x)} ->
   {L x |- tm (M V)}

tm_cut < induction on 3.

IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
============================
 forall L M V, nabla x, {tm V} -> tm_ctx (L x) -> {L x, tm x |- tm (M x)}@ ->
   {L x |- tm (M V)}

tm_cut < intros.

Variables: L M V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H3 : {L n1, tm n1 |- tm (M n1)}@
============================
 {L n1 |- tm (M V)}

tm_cut < case H3.
Subgoal 1:

Variables: L V N
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
============================
 {L n1 |- tm (nat N)}

Subgoal 2 is:
 {L n1 |- tm (pred (M1 V))}

Subgoal 3 is:
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 2:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
============================
 {L n1 |- tm (pred (M1 V))}

Subgoal 3 is:
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 2:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (pred (M1 V))}

Subgoal 3 is:
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 3:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
============================
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 3:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H5.
Subgoal 3:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
H7 : {L n1 |- tm (M2 V)}
============================
 {L n1 |- tm (plus (M1 V) (M2 V))}

Subgoal 4 is:
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 4:

Variables: L V M2 M1 M3
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M3 n1)}*
H5 : {L n1, tm n1 |- tm (M1 n1)}*
H6 : {L n1, tm n1 |- tm (M2 n1)}*
============================
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 4:

Variables: L V M2 M1 M3
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M3 n1)}*
H5 : {L n1, tm n1 |- tm (M1 n1)}*
H6 : {L n1, tm n1 |- tm (M2 n1)}*
H7 : {L n1 |- tm (M3 V)}
============================
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H5.
Subgoal 4:

Variables: L V M2 M1 M3
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M3 n1)}*
H5 : {L n1, tm n1 |- tm (M1 n1)}*
H6 : {L n1, tm n1 |- tm (M2 n1)}*
H7 : {L n1 |- tm (M3 V)}
H8 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H6.
Subgoal 4:

Variables: L V M2 M1 M3
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M3 n1)}*
H5 : {L n1, tm n1 |- tm (M1 n1)}*
H6 : {L n1, tm n1 |- tm (M2 n1)}*
H7 : {L n1 |- tm (M3 V)}
H8 : {L n1 |- tm (M1 V)}
H9 : {L n1 |- tm (M2 V)}
============================
 {L n1 |- tm (ifz (M3 V) (M1 V) (M2 V))}

Subgoal 5 is:
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 5:

Variables: L V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
============================
 {L n1 |- tm unit}

Subgoal 6 is:
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 6:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
============================
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 6:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H5.
Subgoal 6:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
H7 : {L n1 |- tm (M2 V)}
============================
 {L n1 |- tm (pair (M1 V) (M2 V))}

Subgoal 7 is:
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 7:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
============================
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 7:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (fst (M1 V))}

Subgoal 8 is:
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 8:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
============================
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 8:

Variables: L V M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (snd (M1 V))}

Subgoal 9 is:
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 9:

Variables: L V R M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1, tm n2 |- tm (R n1 n2)}*
============================
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 9:

Variables: L V R M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1, tm n2 |- tm (R n1 n2)}*
H6 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H5 with x = n1.
Subgoal 9:

Variables: L V R M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1, tm n2 |- tm (R n1 n2)}*
H6 : {L n1 |- tm (M1 V)}
H7 : {L n1, tm n2 |- tm (R V n2)}
============================
 {L n1 |- tm (let (M1 V) (R V))}

Subgoal 10 is:
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 10:

Variables: L V R
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, tm n2, tm n3 |- tm (R n1 n2 n3)}*
============================
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4 with x = n1.
Subgoal 10:

Variables: L V R
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, tm n2, tm n3 |- tm (R n1 n2 n3)}*
H5 : {L n1, tm n2, tm n3 |- tm (R V n2 n3)}
============================
 {L n1 |- tm (fix (R V))}

Subgoal 11 is:
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 11:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
============================
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H4.
Subgoal 11:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
============================
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < apply IH to _ _ H5.
Subgoal 11:

Variables: L V M2 M1
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1 |- tm (M1 n1)}*
H5 : {L n1, tm n1 |- tm (M2 n1)}*
H6 : {L n1 |- tm (M1 V)}
H7 : {L n1 |- tm (M2 V)}
============================
 {L n1 |- tm (app (M1 V) (M2 V))}

Subgoal 12 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 12:

Variables: L M V F
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, [F n1] |- tm (M n1)}*
H5 : member (F n1) (tm n1 :: L n1)
============================
 {L n1 |- tm (M V)}

tm_cut < case H5.
Subgoal 12.1:

Variables: L M V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, [tm n1] |- tm (M n1)}*
============================
 {L n1 |- tm (M V)}

Subgoal 12.2 is:
 {L n1 |- tm (M V)}

tm_cut < case H4.
Subgoal 12.1:

Variables: L V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
============================
 {L n1 |- tm V}

Subgoal 12.2 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 12.2:

Variables: L M V F
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, [F n1] |- tm (M n1)}*
H6 : member (F n1) (L n1)
============================
 {L n1 |- tm (M V)}

tm_cut < apply tm_ctx_mem to H2 H6.
Subgoal 12.2:

Variables: L M V X
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, [tm (X n1)] |- tm (M n1)}*
H6 : member (tm (X n1)) (L n1)
H7 : name (X n1)
============================
 {L n1 |- tm (M V)}

tm_cut < case H7.
Subgoal 12.2.1:

Variables: L M V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm (V n2)}
H2 : tm_ctx (L n2 n1)
H4 : {L n2 n1, tm n1, [tm n2] |- tm (M n2 n1)}*
H6 : member (tm n2) (L n2 n1)
============================
 {L n2 n1 |- tm (M n2 (V n2))}

Subgoal 12.2.2 is:
 {L n1 |- tm (M V)}

tm_cut < case H4.
Subgoal 12.2.1:

Variables: L V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm (V n2)}
H2 : tm_ctx (L n2 n1)
H6 : member (tm n2) (L n2 n1)
============================
 {L n2 n1 |- tm n2}

Subgoal 12.2.2 is:
 {L n1 |- tm (M V)}

tm_cut < search.
Subgoal 12.2.2:

Variables: L M V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H4 : {L n1, tm n1, [tm n1] |- tm (M n1)}*
H6 : member (tm n1) (L n1)
============================
 {L n1 |- tm (M V)}

tm_cut < case H4.
Subgoal 12.2.2:

Variables: L V
IH : forall L M V, nabla x, {tm V} -> tm_ctx (L x) ->
       {L x, tm x |- tm (M x)}* -> {L x |- tm (M V)}
H1 : {tm V}
H2 : tm_ctx (L n1)
H6 : member (tm n1) (L n1)
============================
 {L n1 |- tm V}

tm_cut < search.
Proof completed.
Abella < Theorem closed_tm_prune_aux : 
forall M L, nabla x, tm_ctx L -> {L |- tm (M x)} -> (exists M', M = y\M').


============================
 forall M L, nabla x, tm_ctx L -> {L |- tm (M x)} -> (exists M', M = y\M')

closed_tm_prune_aux < induction on 2.

IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
============================
 forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}@ -> (exists M', M = y\M')

closed_tm_prune_aux < intros.

Variables: M L
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H2 : {L |- tm (M n1)}@
============================
 exists M', M = y\M'

closed_tm_prune_aux < case H2.
Subgoal 1:

Variables: L N
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
============================
 exists M', z1\nat N = y\M'

Subgoal 2 is:
 exists M', z1\pred (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 2:

Variables: L M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\pred (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 2:

Variables: L M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\pred M' = y\M'1

Subgoal 3 is:
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 3:

Variables: L M2 M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\plus (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 3:

Variables: L M2 M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\plus M' (M2 z1) = y\M'1

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H4.
Subgoal 3:

Variables: L M' M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\plus M' M'1 = y\M'2

Subgoal 4 is:
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 4:

Variables: L M2 M1 M3
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M3 n1)}*
H4 : {L |- tm (M1 n1)}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M', z1\ifz (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 4:

Variables: L M2 M1 M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M1 n1)}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\ifz M' (M1 z1) (M2 z1) = y\M'1

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H4.
Subgoal 4:

Variables: L M2 M' M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
H5 : {L |- tm (M2 n1)}*
============================
 exists M'2, z1\ifz M' M'1 (M2 z1) = y\M'2

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H5.
Subgoal 4:

Variables: L M' M'1 M'2
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
H5 : {L |- tm M'2}*
============================
 exists M'3, z1\ifz M' M'1 M'2 = y\M'3

Subgoal 5 is:
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 5:

Variables: L
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
============================
 exists M', z1\unit = y\M'

Subgoal 6 is:
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 6:

Variables: L M2 M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\pair (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 6:

Variables: L M2 M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\pair M' (M2 z1) = y\M'1

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H4.
Subgoal 6:

Variables: L M' M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\pair M' M'1 = y\M'2

Subgoal 7 is:
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 7:

Variables: L M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\fst (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 7:

Variables: L M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\fst M' = y\M'1

Subgoal 8 is:
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 8:

Variables: L M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
============================
 exists M', z1\snd (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 8:

Variables: L M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
============================
 exists M'1, z1\snd M' = y\M'1

Subgoal 9 is:
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 9:

Variables: L R M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L, tm n2 |- tm (R n1 n2)}*
============================
 exists M', z1\let (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 9:

Variables: L R M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L, tm n2 |- tm (R n1 n2)}*
============================
 exists M'1, z1\let M' (R z1) = y\M'1

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H4.
Subgoal 9:

Variables: L M' M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L, tm n2 |- tm (M'1 n2)}*
============================
 exists M'2, z1\let M' (z2\M'1 z2) = y\M'2

Subgoal 10 is:
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 10:

Variables: L R
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L, tm n2, tm n3 |- tm (R n1 n2 n3)}*
============================
 exists M', z1\fix (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 10:

Variables: L M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L, tm n2, tm n3 |- tm (M' n3 n2)}*
============================
 exists M'1, z1\fix (z2\z3\M' z3 z2) = y\M'1

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 10:

Variables: L M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L, tm n2, tm n3 |- tm (M'1 n2 n3)}*
============================
 exists M'2, z1\fix (z2\z3\M'1 z2 z3) = y\M'2

Subgoal 11 is:
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 11:

Variables: L M2 M1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm (M1 n1)}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M', z1\app (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H3.
Subgoal 11:

Variables: L M2 M'
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm (M2 n1)}*
============================
 exists M'1, z1\app M' (M2 z1) = y\M'1

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < apply IH to _ H4.
Subgoal 11:

Variables: L M' M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L |- tm M'}*
H4 : {L |- tm M'1}*
============================
 exists M'2, z1\app M' M'1 = y\M'2

Subgoal 12 is:
 exists M', M = y\M'

closed_tm_prune_aux < search.
Subgoal 12:

Variables: M L F
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L, [F n1] |- tm (M n1)}*
H4 : member (F n1) L
============================
 exists M', M = y\M'

closed_tm_prune_aux < apply tm_ctx_mem to H1 H4.
Subgoal 12:

Variables: M L X
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H3 : {L, [tm (X n1)] |- tm (M n1)}*
H4 : member (tm (X n1)) L
H5 : name (X n1)
============================
 exists M', M = y\M'

closed_tm_prune_aux < case H3.
Subgoal 12:

Variables: M L
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H4 : member (tm (M n1)) L
H5 : name (M n1)
============================
 exists M', M = y\M'

closed_tm_prune_aux < apply member_prune to H4.
Subgoal 12:

Variables: L M'1
IH : forall M L, nabla x, tm_ctx L -> {L |- tm (M x)}* ->
       (exists M', M = y\M')
H1 : tm_ctx L
H4 : member (tm M'1) L
H5 : name M'1
============================
 exists M', z1\M'1 = y\M'

closed_tm_prune_aux < search.
Proof completed.
Abella < Theorem closed_tm_prune : 
forall M, nabla x, {tm (M x)} -> (exists M', M = y\M').


============================
 forall M, nabla x, {tm (M x)} -> (exists M', M = y\M')

closed_tm_prune < intros.

Variables: M
H1 : {tm (M n1)}
============================
 exists M', M = y\M'

closed_tm_prune < apply closed_tm_prune_aux to _ H1.

Variables: M'
H1 : {tm M'}
============================
 exists M'1, z1\M' = y\M'1

closed_tm_prune < search.
Proof completed.
Abella < Theorem of_to_tm : 
forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
  vars_of_tm_ctx SL Vs -> {L |- of M T} -> {SL |- tm M}.


============================
 forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
   vars_of_tm_ctx SL Vs -> {L |- of M T} -> {SL |- tm M}

of_to_tm < induction on 5.

IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
============================
 forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
   vars_of_tm_ctx SL Vs -> {L |- of M T}@ -> {SL |- tm M}

of_to_tm < intros.

Variables: L Vs SL M T
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H5 : {L |- of M T}@
============================
 {SL |- tm M}

of_to_tm < case H5.
Subgoal 1:

Variables: L Vs SL N
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
============================
 {SL |- tm (nat N)}

Subgoal 2 is:
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 2:

Variables: L Vs SL M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
============================
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 2.1:

Variables: L Vs SL M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
============================
 {SL |- tm M1}

Subgoal 2 is:
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 2:

Variables: L Vs SL M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {SL |- tm M1}
============================
 {SL |- tm (pred M1)}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {L |- of M2 tnat}*
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 3.1:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {L |- of M2 tnat}*
============================
 {SL |- tm M1}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {L |- of M2 tnat}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M2}.
Subgoal 3.2:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {L |- of M2 tnat}*
H8 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 3 is:
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 3:

Variables: L Vs SL M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 tnat}*
H7 : {L |- of M2 tnat}*
H8 : {SL |- tm M1}
H9 : {SL |- tm M2}
============================
 {SL |- tm (plus M1 M2)}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 4.1:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
============================
 {SL |- tm M1}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
H9 : {SL |- tm M1}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M2}.
Subgoal 4.2:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
H9 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
H9 : {SL |- tm M1}
H10 : {SL |- tm M2}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M3}.
Subgoal 4.3:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
H9 : {SL |- tm M1}
H10 : {SL |- tm M2}
============================
 {SL |- tm M3}

Subgoal 4 is:
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 4:

Variables: L Vs SL T M2 M1 M3
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M3 tnat}*
H7 : {L |- of M1 T}*
H8 : {L |- of M2 T}*
H9 : {SL |- tm M1}
H10 : {SL |- tm M2}
H11 : {SL |- tm M3}
============================
 {SL |- tm (ifz M3 M1 M2)}

Subgoal 5 is:
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 5:

Variables: L Vs SL
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
============================
 {SL |- tm unit}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L |- of M2 T2}*
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 6.1:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L |- of M2 T2}*
============================
 {SL |- tm M1}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L |- of M2 T2}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M2}.
Subgoal 6.2:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L |- of M2 T2}*
H8 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 6 is:
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 6:

Variables: L Vs SL T2 M2 T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L |- of M2 T2}*
H8 : {SL |- tm M1}
H9 : {SL |- tm M2}
============================
 {SL |- tm (pair M1 M2)}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 7:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T T2)}*
============================
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 7.1:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T T2)}*
============================
 {SL |- tm M1}

Subgoal 7 is:
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 7:

Variables: L Vs SL T T2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T T2)}*
H7 : {SL |- tm M1}
============================
 {SL |- tm (fst M1)}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 8:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T1 T)}*
============================
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 8.1:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T1 T)}*
============================
 {SL |- tm M1}

Subgoal 8 is:
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 8:

Variables: L Vs SL T T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (prod T1 T)}*
H7 : {SL |- tm M1}
============================
 {SL |- tm (snd M1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 9.1:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
============================
 {SL |- tm M1}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL, tm n1 |- tm (R n1)}.
Subgoal 9.2:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
H8 : {SL |- tm M1}
============================
 {SL, tm n1 |- tm (R n1)}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH with L = of n1 T1 :: L.
Subgoal 9.2:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
H8 : {SL |- tm M1}
============================
 ctx (of n1 T1 :: L)

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain ctx_extend.
Subgoal 9.2:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
H8 : {SL |- tm M1}
============================
 {is_sty T1}

Subgoal 9 is:
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain of_is_sty.
Subgoal 9:

Variables: L Vs SL T R T1 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 T1}*
H7 : {L, of n1 T1 |- of (R n1) T}*
H8 : {SL |- tm M1}
H9 : {SL, tm n1 |- tm (R n1)}
============================
 {SL |- tm (let M1 R)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < apply is_sty_str to _ H7.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL, tm n1, tm n2 |- tm (R n1 n2)}.
Subgoal 10.1:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
============================
 {SL, tm n1, tm n2 |- tm (R n1 n2)}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH with L = of n2 T1 :: of n1 (arr T1 T2) :: L.
Subgoal 10.1:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
============================
 ctx (of n2 T1 :: of n1 (arr T1 T2) :: L)

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain ctx_extend.
Subgoal 10.1.1:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
============================
 ctx (of n1 (arr T1 T2) :: L)

Subgoal 10.1.2 is:
 {is_sty T1}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain ctx_extend.
Subgoal 10.1.2:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
============================
 {is_sty T1}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < case H8.
Subgoal 10.1.2:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H9 : {is_sty T1}
H10 : {is_sty T2}
============================
 {is_sty T1}

Subgoal 10 is:
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 10:

Variables: L Vs SL T2 T1 R
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, of n1 (arr T1 T2), of n2 T1 |- of (R n1 n2) T2}*
H7 : {L |- is_sty (arr T1 T2)}*
H8 : {is_sty (arr T1 T2)}
H9 : {SL, tm n1, tm n2 |- tm (R n1 n2)}
============================
 {SL |- tm (fix R)}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (arr T1 T)}*
H7 : {L |- of M2 T1}*
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M1}.
Subgoal 11.1:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (arr T1 T)}*
H7 : {L |- of M2 T1}*
============================
 {SL |- tm M1}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (arr T1 T)}*
H7 : {L |- of M2 T1}*
H8 : {SL |- tm M1}
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < assert {SL |- tm M2}.
Subgoal 11.2:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (arr T1 T)}*
H7 : {L |- of M2 T1}*
H8 : {SL |- tm M1}
============================
 {SL |- tm M2}

Subgoal 11 is:
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain IH.
Subgoal 11:

Variables: L Vs SL T T1 M2 M1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L |- of M1 (arr T1 T)}*
H7 : {L |- of M2 T1}*
H8 : {SL |- tm M1}
H9 : {SL |- tm M2}
============================
 {SL |- tm (app M1 M2)}

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < search.
Subgoal 12:

Variables: L Vs SL M T F
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, [F] |- of M T}*
H7 : member F L
============================
 {SL |- tm M}

of_to_tm < apply ctx_mem to _ H7.
Subgoal 12:

Variables: L Vs SL M T X T1
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H6 : {L, [of X T1] |- of M T}*
H7 : member (of X T1) L
H8 : name X
H9 : {is_sty T1}
============================
 {SL |- tm M}

of_to_tm < case H6.
Subgoal 12:

Variables: L Vs SL M T
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H7 : member (of M T) L
H8 : name M
H9 : {is_sty T}
============================
 {SL |- tm M}

of_to_tm < assert member (tm M) SL.
Subgoal 12.1:

Variables: L Vs SL M T
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H7 : member (of M T) L
H8 : name M
H9 : {is_sty T}
============================
 member (tm M) SL

Subgoal 12 is:
 {SL |- tm M}

of_to_tm < backchain ctx_tm_ctx_sync.
Subgoal 12:

Variables: L Vs SL M T
IH : forall L Vs SL M T, ctx L -> vars_of_ctx L Vs -> tm_ctx SL ->
       vars_of_tm_ctx SL Vs -> {L |- of M T}* -> {SL |- tm M}
H1 : ctx L
H2 : vars_of_ctx L Vs
H3 : tm_ctx SL
H4 : vars_of_tm_ctx SL Vs
H7 : member (of M T) L
H8 : name M
H9 : {is_sty T}
H10 : member (tm M) SL
============================
 {SL |- tm M}

of_to_tm < search.
Proof completed.
Abella < Define ctx' : (list o) -> prop by 
ctx' nil;
nabla x, ctx' (of' x T :: L) := ctx' L /\ {is_cty T}.

Abella < Define vars_of_ctx' : (list o) -> (list tm') -> prop by 
vars_of_ctx' nil nil;
vars_of_ctx' (of' X T :: L) (X :: Vs) := vars_of_ctx' L Vs.

Abella < Theorem ctx'_islist : 
forall L, ctx' L -> is_list L.


============================
 forall L, ctx' L -> is_list L

ctx'_islist < induction on 1.

IH : forall L, ctx' L * -> is_list L
============================
 forall L, ctx' L @ -> is_list L

ctx'_islist < intros.

Variables: L
IH : forall L, ctx' L * -> is_list L
H1 : ctx' L @
============================
 is_list L

ctx'_islist < case H1.
Subgoal 1:

IH : forall L, ctx' L * -> is_list L
============================
 is_list nil

Subgoal 2 is:
 is_list (of' n1 T :: L1)

ctx'_islist < search.
Subgoal 2:

Variables: L1 T
IH : forall L, ctx' L * -> is_list L
H2 : ctx' L1 *
H3 : {is_cty T}
============================
 is_list (of' n1 T :: L1)

ctx'_islist < unfold.
Subgoal 2:

Variables: L1 T
IH : forall L, ctx' L * -> is_list L
H2 : ctx' L1 *
H3 : {is_cty T}
============================
 is_list L1

ctx'_islist < backchain IH.
Proof completed.
Abella < Theorem ctx'_mem : 
forall E L, ctx' L -> member E L ->
  (exists M T, E = of' M T /\ name M /\ {is_cty T}).


============================
 forall E L, ctx' L -> member E L ->
   (exists M T, E = of' M T /\ name M /\ {is_cty T})

ctx'_mem < induction on 2.

IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
============================
 forall E L, ctx' L -> member E L @ ->
   (exists M T, E = of' M T /\ name M /\ {is_cty T})

ctx'_mem < intros.

Variables: E L
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H1 : ctx' L
H2 : member E L @
============================
 exists M T, E = of' M T /\ name M /\ {is_cty T}

ctx'_mem < case H2.
Subgoal 1:

Variables: E L1
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H1 : ctx' (E :: L1)
============================
 exists M T, E = of' M T /\ name M /\ {is_cty T}

Subgoal 2 is:
 exists M T, E = of' M T /\ name M /\ {is_cty T}

ctx'_mem < case H1.
Subgoal 1:

Variables: L2 T
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H3 : ctx' L2
H4 : {is_cty T}
============================
 exists M T1, of' n1 T = of' M T1 /\ name M /\ {is_cty T1}

Subgoal 2 is:
 exists M T, E = of' M T /\ name M /\ {is_cty T}

ctx'_mem < search.
Subgoal 2:

Variables: E L1 B
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H1 : ctx' (B :: L1)
H3 : member E L1 *
============================
 exists M T, E = of' M T /\ name M /\ {is_cty T}

ctx'_mem < case H1.
Subgoal 2:

Variables: E L2 T
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H3 : member (E n1) L2 *
H4 : ctx' L2
H5 : {is_cty T}
============================
 exists M T, E n1 = of' M T /\ name M /\ {is_cty T}

ctx'_mem < apply IH to _ H3.
Subgoal 2:

Variables: L2 T M T1
IH : forall E L, ctx' L -> member E L * ->
       (exists M T, E = of' M T /\ name M /\ {is_cty T})
H3 : member (of' (M n1) T1) L2 *
H4 : ctx' L2
H5 : {is_cty T}
H6 : name (M n1)
H7 : {is_cty T1}
============================
 exists M1 T, of' (M n1) T1 = of' M1 T /\ name M1 /\ {is_cty T}

ctx'_mem < search.
Proof completed.
Abella < Theorem ctx'_var_mem : 
forall L T M, ctx' L -> {L |- of' M T} -> name M -> member (of' M T) L.


============================
 forall L T M, ctx' L -> {L |- of' M T} -> name M -> member (of' M T) L

ctx'_var_mem < intros.

Variables: L T M
H1 : ctx' L
H2 : {L |- of' M T}
H3 : name M
============================
 member (of' M T) L

ctx'_var_mem < case H3.

Variables: L T
H1 : ctx' (L n1)
H2 : {L n1 |- of' n1 T}
============================
 member (of' n1 T) (L n1)

ctx'_var_mem < case H2.

Variables: L T F
H1 : ctx' (L n1)
H4 : {L n1, [F n1] |- of' n1 T}
H5 : member (F n1) (L n1)
============================
 member (of' n1 T) (L n1)

ctx'_var_mem < apply ctx'_mem to H1 H5.

Variables: L T M1 T1
H1 : ctx' (L n1)
H4 : {L n1, [of' (M1 n1) T1] |- of' n1 T}
H5 : member (of' (M1 n1) T1) (L n1)
H6 : name (M1 n1)
H7 : {is_cty T1}
============================
 member (of' n1 T) (L n1)

ctx'_var_mem < case H4.

Variables: L T
H1 : ctx' (L n1)
H5 : member (of' n1 T) (L n1)
H6 : name n1
H7 : {is_cty T}
============================
 member (of' n1 T) (L n1)

ctx'_var_mem < search.
Proof completed.
Abella < Theorem ctx'_mem_sync : 
forall L X T T', ctx' L -> member (of' X T) L -> member (of' X T') L -> T =
T'.


============================
 forall L X T T', ctx' L -> member (of' X T) L -> member (of' X T') L -> T =
 T'

ctx'_mem_sync < induction on 2.

IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
============================
 forall L X T T', ctx' L -> member (of' X T) L @ -> member (of' X T') L ->
   T =
 T'

ctx'_mem_sync < intros.

Variables: L X T T'
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' L
H2 : member (of' X T) L @
H3 : member (of' X T') L
============================
 T = T'

ctx'_mem_sync < case H2.
Subgoal 1:

Variables: X T T' L1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (of' X T :: L1)
H3 : member (of' X T') (of' X T :: L1)
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx'_mem_sync < case H3.
Subgoal 1.1:

Variables: X T L1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (of' X T :: L1)
============================
 T = T

Subgoal 1.2 is:
 T = T'

Subgoal 2 is:
 T = T'

ctx'_mem_sync < search.
Subgoal 1.2:

Variables: X T T' L1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (of' X T :: L1)
H4 : member (of' X T') L1
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx'_mem_sync < case H1.
Subgoal 1.2:

Variables: T T' L2
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H4 : member (of' n1 T') L2
H5 : ctx' L2
H6 : {is_cty T}
============================
 T = T'

Subgoal 2 is:
 T = T'

ctx'_mem_sync < apply member_prune to H4.
Subgoal 2:

Variables: X T T' L1 B
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (B :: L1)
H3 : member (of' X T') (B :: L1)
H4 : member (of' X T) L1 *
============================
 T = T'

ctx'_mem_sync < case H3.
Subgoal 2.1:

Variables: X T T' L1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (of' X T' :: L1)
H4 : member (of' X T) L1 *
============================
 T = T'

Subgoal 2.2 is:
 T = T'

ctx'_mem_sync < case H1.
Subgoal 2.1:

Variables: T T' L2
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H4 : member (of' n1 T) L2 *
H5 : ctx' L2
H6 : {is_cty T'}
============================
 T = T'

Subgoal 2.2 is:
 T = T'

ctx'_mem_sync < apply member_prune to H4.
Subgoal 2.2:

Variables: X T T' L1 B
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H1 : ctx' (B :: L1)
H4 : member (of' X T) L1 *
H5 : member (of' X T') L1
============================
 T = T'

ctx'_mem_sync < case H1.
Subgoal 2.2:

Variables: X T T' L2 T1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H4 : member (of' (X n1) T) L2 *
H5 : member (of' (X n1) T') L2
H6 : ctx' L2
H7 : {is_cty T1}
============================
 T = T'

ctx'_mem_sync < apply IH to _ H4 H5.
Subgoal 2.2:

Variables: X T' L2 T1
IH : forall L X T T', ctx' L -> member (of' X T) L * ->
       member (of' X T') L -> T =
     T'
H4 : member (of' (X n1) T') L2 *
H5 : member (of' (X n1) T') L2
H6 : ctx' L2
H7 : {is_cty T1}
============================
 T' = T'

ctx'_mem_sync < search.
Proof completed.
Abella < Theorem vars_of_ctx'_prune2 : 
forall L Vs, nabla x, vars_of_ctx' L (Vs x) -> (exists Vs', Vs = y\Vs').


============================
 forall L Vs, nabla x, vars_of_ctx' L (Vs x) -> (exists Vs', Vs = y\Vs')

vars_of_ctx'_prune2 < induction on 1.

IH : forall L Vs, nabla x, vars_of_ctx' L (Vs x) * ->
       (exists Vs', Vs = y\Vs')
============================
 forall L Vs, nabla x, vars_of_ctx' L (Vs x) @ -> (exists Vs', Vs = y\Vs')

vars_of_ctx'_prune2 < intros.

Variables: L Vs
IH : forall L Vs, nabla x, vars_of_ctx' L (Vs x) * ->
       (exists Vs', Vs = y\Vs')
H1 : vars_of_ctx' L (Vs n1) @
============================
 exists Vs', Vs = y\Vs'

vars_of_ctx'_prune2 < case H1.
Subgoal 1:

IH : forall L Vs, nabla x, vars_of_ctx' L (Vs x) * ->
       (exists Vs', Vs = y\Vs')
============================
 exists Vs', z1\nil = y\Vs'

Subgoal 2 is:
 exists Vs', z1\L2 :: Vs1 z1 = y\Vs'

vars_of_ctx'_prune2 < search.
Subgoal 2:

Variables: Vs1 L2 L3 T
IH : forall L Vs, nabla x, vars_of_ctx' L (Vs x) * ->
       (exists Vs', Vs = y\Vs')
H2 : vars_of_ctx' L3 (Vs1 n1) *
============================
 exists Vs', z1\L2 :: Vs1 z1 = y\Vs'

vars_of_ctx'_prune2 < apply IH to H2.
Subgoal 2:

Variables: L2 L3 T Vs'
IH : forall L Vs, nabla x, vars_of_ctx' L (Vs x) * ->
       (exists Vs', Vs = y\Vs')
H2 : vars_of_ctx' L3 Vs' *
============================
 exists Vs'1, z1\L2 :: Vs' = y\Vs'1

vars_of_ctx'_prune2 < search.
Proof completed.
Abella < Theorem of'_nat_inv : 
forall L N T, ctx' L -> {L |- of' (nat' N) T} -> T = tnat.


============================
 forall L N T, ctx' L -> {L |- of' (nat' N) T} -> T = tnat

of'_nat_inv < intros.

Variables: L N T
H1 : ctx' L
H2 : {L |- of' (nat' N) T}
============================
 T = tnat

of'_nat_inv < case H2.
Subgoal 1:

Variables: L N
H1 : ctx' L
============================
 tnat = tnat

Subgoal 2 is:
 T = tnat

of'_nat_inv < search.
Subgoal 2:

Variables: L N T F
H1 : ctx' L
H3 : {L, [F] |- of' (nat' N) T}
H4 : member F L
============================
 T = tnat

of'_nat_inv < apply ctx'_mem to _ H4.
Subgoal 2:

Variables: L N T M T1
H1 : ctx' L
H3 : {L, [of' M T1] |- of' (nat' N) T}
H4 : member (of' M T1) L
H5 : name M
H6 : {is_cty T1}
============================
 T = tnat

of'_nat_inv < case H3.
Subgoal 2:

Variables: L N T
H1 : ctx' L
H4 : member (of' (nat' N) T) L
H5 : name (nat' N)
H6 : {is_cty T}
============================
 T = tnat

of'_nat_inv < case H5.
Proof completed.
Abella < Theorem is_cty_str : 
forall L T, ctx' L -> {L |- is_cty T} -> {is_cty T}.


============================
 forall L T, ctx' L -> {L |- is_cty T} -> {is_cty T}

is_cty_str < induction on 2.

IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
============================
 forall L T, ctx' L -> {L |- is_cty T}@ -> {is_cty T}

is_cty_str < intros.

Variables: L T
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H2 : {L |- is_cty T}@
============================
 {is_cty T}

is_cty_str < case H2.
Subgoal 1:

Variables: L
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
============================
 {is_cty tnat}

Subgoal 2 is:
 {is_cty tunit}

Subgoal 3 is:
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < search.
Subgoal 2:

Variables: L
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
============================
 {is_cty tunit}

Subgoal 3 is:
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < search.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H3.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H4.
Subgoal 3:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
H6 : {is_cty T2}
============================
 {is_cty (prod T1 T2)}

Subgoal 4 is:
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < search.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
============================
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H3.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
============================
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H4.
Subgoal 4:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
H6 : {is_cty T2}
============================
 {is_cty (arr T1 T2)}

Subgoal 5 is:
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < search.
Subgoal 5:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
============================
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H3.
Subgoal 5:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
============================
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < apply IH to _ H4.
Subgoal 5:

Variables: L T2 T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- is_cty T1}*
H4 : {L |- is_cty T2}*
H5 : {is_cty T1}
H6 : {is_cty T2}
============================
 {is_cty (arr' T1 T2)}

Subgoal 6 is:
 {is_cty T}

is_cty_str < search.
Subgoal 6:

Variables: L T F
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, [F] |- is_cty T}*
H4 : member F L
============================
 {is_cty T}

is_cty_str < apply ctx'_mem to H1 H4.
Subgoal 6:

Variables: L T M T1
IH : forall L T, ctx' L -> {L |- is_cty T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, [of' M T1] |- is_cty T}*
H4 : member (of' M T1) L
H5 : name M
H6 : {is_cty T1}
============================
 {is_cty T}

is_cty_str < case H3.
Proof completed.
Abella < Theorem of'_is_cty : 
forall L M T, ctx' L -> {L |- of' M T} -> {is_cty T}.


============================
 forall L M T, ctx' L -> {L |- of' M T} -> {is_cty T}

of'_is_cty < induction on 2.

IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
============================
 forall L M T, ctx' L -> {L |- of' M T}@ -> {is_cty T}

of'_is_cty < intros.

Variables: L M T
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H2 : {L |- of' M T}@
============================
 {is_cty T}

of'_is_cty < case H2.
Subgoal 1:

Variables: L N
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
============================
 {is_cty tnat}

Subgoal 2 is:
 {is_cty tnat}

Subgoal 3 is:
 {is_cty tnat}

Subgoal 4 is:
 {is_cty T}

Subgoal 5 is:
 {is_cty tunit}

Subgoal 6 is:
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 2:

Variables: L M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 tnat}*
============================
 {is_cty tnat}

Subgoal 3 is:
 {is_cty tnat}

Subgoal 4 is:
 {is_cty T}

Subgoal 5 is:
 {is_cty tunit}

Subgoal 6 is:
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 3:

Variables: L M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 tnat}*
H4 : {L |- of' M2 tnat}*
============================
 {is_cty tnat}

Subgoal 4 is:
 {is_cty T}

Subgoal 5 is:
 {is_cty tunit}

Subgoal 6 is:
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 4:

Variables: L T M2 M1 M3
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M3 tnat}*
H4 : {L |- of' M1 T}*
H5 : {L |- of' M2 T}*
============================
 {is_cty T}

Subgoal 5 is:
 {is_cty tunit}

Subgoal 6 is:
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < backchain IH with M = M1.
Subgoal 5:

Variables: L
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
============================
 {is_cty tunit}

Subgoal 6 is:
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L |- of' M2 T2}*
============================
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L |- of' M2 T2}*
H5 : {is_cty T1}
============================
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H4.
Subgoal 6:

Variables: L T2 M2 T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L |- of' M2 T2}*
H5 : {is_cty T1}
H6 : {is_cty T2}
============================
 {is_cty (prod T1 T2)}

Subgoal 7 is:
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T T2)}*
============================
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T T2)}*
H4 : {is_cty (prod T T2)}
============================
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H4.
Subgoal 7:

Variables: L T T2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T T2)}*
H5 : {is_cty T}
H6 : {is_cty T2}
============================
 {is_cty T}

Subgoal 8 is:
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T1 T)}*
============================
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T1 T)}*
H4 : {is_cty (prod T1 T)}
============================
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H4.
Subgoal 8:

Variables: L T T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (prod T1 T)}*
H5 : {is_cty T1}
H6 : {is_cty T}
============================
 {is_cty T}

Subgoal 9 is:
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of' (R n1) T}*
============================
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of' (R n1) T}*
H5 : {is_cty T1}
============================
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H4.
Subgoal 9:

Variables: L T R T1 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of' (R n1) T}*
H5 : {is_cty T1}
H6 : {is_cty T}
============================
 {is_cty T}

Subgoal 10 is:
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 10:

Variables: L T1 T2 R
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, of' n1 T1 |- of' (R n1) T2}*
H4 : {L |- is_cty T1}*
============================
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply is_cty_str to _ H4.
Subgoal 10:

Variables: L T1 T2 R
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, of' n1 T1 |- of' (R n1) T2}*
H4 : {L |- is_cty T1}*
H5 : {is_cty T1}
============================
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 10:

Variables: L T1 T2 R
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, of' n1 T1 |- of' (R n1) T2}*
H4 : {L |- is_cty T1}*
H5 : {is_cty T1}
H6 : {is_cty T2}
============================
 {is_cty (arr' T1 T2)}

Subgoal 11 is:
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr' T1 T)}*
H4 : {L |- of' M2 T1}*
============================
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr' T1 T)}*
H4 : {L |- of' M2 T1}*
H5 : {is_cty (arr' T1 T)}
============================
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H5.
Subgoal 11:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr' T1 T)}*
H4 : {L |- of' M2 T1}*
H6 : {is_cty T1}
H7 : {is_cty T}
============================
 {is_cty T}

Subgoal 12 is:
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 12:

Variables: L TL E T2 T1 F
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H4 : {L |- of' E TL}*
============================
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 12:

Variables: L TL E T2 T1 F
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H4 : {L |- of' E TL}*
H5 : {is_cty (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}
============================
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H5.
Subgoal 12:

Variables: L TL E T2 T1 F
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H4 : {L |- of' E TL}*
H6 : {is_cty (prod (arr T1 T2) (prod T1 TL))}
H7 : {is_cty T2}
============================
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H6.
Subgoal 12:

Variables: L TL E T2 T1 F
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H4 : {L |- of' E TL}*
H7 : {is_cty T2}
H8 : {is_cty (arr T1 T2)}
H9 : {is_cty (prod T1 TL)}
============================
 {is_cty (arr T1 T2)}

Subgoal 13 is:
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 13:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr T1 T)}*
H4 : {L |- of' M2 T1}*
============================
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < apply IH to _ H3.
Subgoal 13:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr T1 T)}*
H4 : {L |- of' M2 T1}*
H5 : {is_cty (arr T1 T)}
============================
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < case H5.
Subgoal 13:

Variables: L T T1 M2 M1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 (arr T1 T)}*
H4 : {L |- of' M2 T1}*
H6 : {is_cty T1}
H7 : {is_cty T}
============================
 {is_cty T}

Subgoal 14 is:
 {is_cty T}

of'_is_cty < search.
Subgoal 14:

Variables: L M T F
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, [F] |- of' M T}*
H4 : member F L
============================
 {is_cty T}

of'_is_cty < apply ctx'_mem to H1 H4.
Subgoal 14:

Variables: L M T M1 T1
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, [of' M1 T1] |- of' M T}*
H4 : member (of' M1 T1) L
H5 : name M1
H6 : {is_cty T1}
============================
 {is_cty T}

of'_is_cty < case H3.
Subgoal 14:

Variables: L M T
IH : forall L M T, ctx' L -> {L |- of' M T}* -> {is_cty T}
H1 : ctx' L
H4 : member (of' M T) L
H5 : name M
H6 : {is_cty T}
============================
 {is_cty T}

of'_is_cty < search.
Proof completed.
Abella < Theorem of'_str : 
forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
  {L, of' x T1 |- of' M T} -> {L |- of' M T}.


============================
 forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
   {L, of' x T1 |- of' M T} -> {L |- of' M T}

of'_str < induction on 3.

IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
============================
 forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
   {L, of' x T1 |- of' M T}@ -> {L |- of' M T}

of'_str < intros.

Variables: L M T1 T
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H3 : {L, of' n1 T1 |- of' M T}@
============================
 {L |- of' M T}

of'_str < case H3.
Subgoal 1:

Variables: L T1 N
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
============================
 {L |- of' (nat' N) tnat}

Subgoal 2 is:
 {L |- of' (pred' M2) tnat}

Subgoal 3 is:
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 2:

Variables: L T1 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 tnat}*
============================
 {L |- of' (pred' M2) tnat}

Subgoal 3 is:
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 2:

Variables: L T1 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 tnat}*
H5 : {L |- of' M2 tnat}
============================
 {L |- of' (pred' M2) tnat}

Subgoal 3 is:
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 3:

Variables: L T1 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 tnat}*
H5 : {L, of' n1 T1 |- of' M4 tnat}*
============================
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 3:

Variables: L T1 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 tnat}*
H5 : {L, of' n1 T1 |- of' M4 tnat}*
H6 : {L |- of' M3 tnat}
============================
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 3:

Variables: L T1 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 tnat}*
H5 : {L, of' n1 T1 |- of' M4 tnat}*
H6 : {L |- of' M3 tnat}
H7 : {L |- of' M4 tnat}
============================
 {L |- of' (plus' M3 M4) tnat}

Subgoal 4 is:
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 4:

Variables: L T1 T M6 M5 M4
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M4 tnat}*
H5 : {L, of' n1 T1 |- of' M5 T}*
H6 : {L, of' n1 T1 |- of' M6 T}*
============================
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 4:

Variables: L T1 T M6 M5 M4
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M4 tnat}*
H5 : {L, of' n1 T1 |- of' M5 T}*
H6 : {L, of' n1 T1 |- of' M6 T}*
H7 : {L |- of' M4 tnat}
============================
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 4:

Variables: L T1 T M6 M5 M4
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M4 tnat}*
H5 : {L, of' n1 T1 |- of' M5 T}*
H6 : {L, of' n1 T1 |- of' M6 T}*
H7 : {L |- of' M4 tnat}
H8 : {L |- of' M5 T}
============================
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H6.
Subgoal 4:

Variables: L T1 T M6 M5 M4
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M4 tnat}*
H5 : {L, of' n1 T1 |- of' M5 T}*
H6 : {L, of' n1 T1 |- of' M6 T}*
H7 : {L |- of' M4 tnat}
H8 : {L |- of' M5 T}
H9 : {L |- of' M6 T}
============================
 {L |- of' (ifz' M4 M5 M6) T}

Subgoal 5 is:
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 5:

Variables: L T1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
============================
 {L |- of' unit' tunit}

Subgoal 6 is:
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 6:

Variables: L T1 T2 M4 T3 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 T3}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
============================
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 6:

Variables: L T1 T2 M4 T3 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 T3}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 T3}
============================
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 6:

Variables: L T1 T2 M4 T3 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 T3}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 T3}
H7 : {L |- of' M4 T2}
============================
 {L |- of' (pair' M3 M4) (prod T3 T2)}

Subgoal 7 is:
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 7:

Variables: L T1 T T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 (prod T T2)}*
============================
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 7:

Variables: L T1 T T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 (prod T T2)}*
H5 : {L |- of' M2 (prod T T2)}
============================
 {L |- of' (fst' M2) T}

Subgoal 8 is:
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 8:

Variables: L T1 T T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 (prod T2 T)}*
============================
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 8:

Variables: L T1 T T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 (prod T2 T)}*
H5 : {L |- of' M2 (prod T2 T)}
============================
 {L |- of' (snd' M2) T}

Subgoal 9 is:
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 9:

Variables: L T1 T M3 T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 T2}*
H5 : {L, of' n1 T1, of' n2 T2 |- of' (M3 n2) T}*
============================
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply of'_is_cty to _ H4.
Subgoal 9:

Variables: L T1 T M3 T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 T2}*
H5 : {L, of' n1 T1, of' n2 T2 |- of' (M3 n2) T}*
H6 : {is_cty T2}
============================
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 9:

Variables: L T1 T M3 T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 T2}*
H5 : {L, of' n1 T1, of' n2 T2 |- of' (M3 n2) T}*
H6 : {is_cty T2}
H7 : {L |- of' M2 T2}
============================
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 9:

Variables: L T1 T M3 T2 M2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M2 T2}*
H5 : {L, of' n1 T1, of' n2 T2 |- of' (M3 n2) T}*
H6 : {is_cty T2}
H7 : {L |- of' M2 T2}
H8 : {L, of' n2 T2 |- of' (M3 n2) T}
============================
 {L |- of' (let' M2 M3) T}

Subgoal 10 is:
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 10:

Variables: L T1 T3 T2 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, of' n2 T3 |- of' (M1 n2) T2}*
H5 : {L, of' n1 T1 |- is_cty T3}*
============================
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply is_cty_str to _ H5.
Subgoal 10:

Variables: L T1 T3 T2 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, of' n2 T3 |- of' (M1 n2) T2}*
H5 : {L, of' n1 T1 |- is_cty T3}*
H6 : {is_cty T3}
============================
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 10:

Variables: L T1 T3 T2 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, of' n2 T3 |- of' (M1 n2) T2}*
H5 : {L, of' n1 T1 |- is_cty T3}*
H6 : {is_cty T3}
H7 : {L, of' n2 T3 |- of' (M1 n2) T2}
============================
 {L |- of' (abs' M1) (arr' T3 T2)}

Subgoal 11 is:
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 11:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr' T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
============================
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 11:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr' T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 (arr' T2 T)}
============================
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 11:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr' T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 (arr' T2 T)}
H7 : {L |- of' M4 T2}
============================
 {L |- of' (app' M3 M4) T}

Subgoal 12 is:
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 12:

Variables: L T1 TL M2 T2 T3 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M1 (arr' (prod (arr T3 T2) (prod T3 TL)) T2)}*
H5 : {L, of' n1 T1 |- of' M2 TL}*
============================
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 12:

Variables: L T1 TL M2 T2 T3 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M1 (arr' (prod (arr T3 T2) (prod T3 TL)) T2)}*
H5 : {L, of' n1 T1 |- of' M2 TL}*
H6 : {L |- of' M1 (arr' (prod (arr T3 T2) (prod T3 TL)) T2)}
============================
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 12:

Variables: L T1 TL M2 T2 T3 M1
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M1 (arr' (prod (arr T3 T2) (prod T3 TL)) T2)}*
H5 : {L, of' n1 T1 |- of' M2 TL}*
H6 : {L |- of' M1 (arr' (prod (arr T3 T2) (prod T3 TL)) T2)}
H7 : {L |- of' M2 TL}
============================
 {L |- of' (clos' M1 M2) (arr T3 T2)}

Subgoal 13 is:
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 13:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
============================
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H4.
Subgoal 13:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 (arr T2 T)}
============================
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < apply IH to _ _ H5.
Subgoal 13:

Variables: L T1 T T2 M4 M3
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1 |- of' M3 (arr T2 T)}*
H5 : {L, of' n1 T1 |- of' M4 T2}*
H6 : {L |- of' M3 (arr T2 T)}
H7 : {L |- of' M4 T2}
============================
 {L |- of' (open' M3 (f\e\app' f (pair' M3 (pair' M4 e)))) T}

Subgoal 14 is:
 {L |- of' M T}

of'_str < search.
Subgoal 14:

Variables: L M T1 T F
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, [F n1] |- of' M T}*
H5 : member (F n1) (of' n1 T1 :: L)
============================
 {L |- of' M T}

of'_str < apply ctx'_mem to _ H5.
Subgoal 14:

Variables: L M T1 T M1 T2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, [of' (M1 n1) T2] |- of' M T}*
H5 : member (of' (M1 n1) T2) (of' n1 T1 :: L)
H6 : name (M1 n1)
H7 : {is_cty T2}
============================
 {L |- of' M T}

of'_str < case H5.
Subgoal 14.1:

Variables: L M T1 T
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, [of' n1 T1] |- of' M T}*
H6 : name n1
H7 : {is_cty T1}
============================
 {L |- of' M T}

Subgoal 14.2 is:
 {L |- of' M T}

of'_str < case H4.
Subgoal 14.2:

Variables: L M T1 T M1 T2
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H4 : {L, of' n1 T1, [of' (M1 n1) T2] |- of' M T}*
H6 : name (M1 n1)
H7 : {is_cty T2}
H8 : member (of' (M1 n1) T2) L
============================
 {L |- of' M T}

of'_str < case H4.
Subgoal 14.2:

Variables: L M T1 T
IH : forall L M T1 T, nabla x, ctx' L -> {is_cty T1} ->
       {L, of' x T1 |- of' M T}* -> {L |- of' M T}
H1 : ctx' L
H2 : {is_cty T1}
H6 : name M
H7 : {is_cty T}
H8 : member (of' M T) L
============================
 {L |- of' M T}

of'_str < search.
Proof completed.
Abella < Theorem of''_env_str : 
forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
  {L, of' x T |- of''_env FE TE} -> {L |- of''_env FE TE}.


============================
 forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
   {L, of' x T |- of''_env FE TE} -> {L |- of''_env FE TE}

of''_env_str < induction on 3.

IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
============================
 forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
   {L, of' x T |- of''_env FE TE}@ -> {L |- of''_env FE TE}

of''_env_str < intros.

Variables: L FE T TE
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H3 : {L, of' n1 T |- of''_env FE TE}@
============================
 {L |- of''_env FE TE}

of''_env_str < case H3.
Subgoal 1:

Variables: L T
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
============================
 {L |- of''_env nil tunit}

Subgoal 2 is:
 {L |- of''_env (FE1 :: FE2) (prod T1 TE1)}

Subgoal 3 is:
 {L |- of''_env FE TE}

of''_env_str < search.
Subgoal 2:

Variables: L T TE1 FE2 T1 FE1
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H4 : {L, of' n1 T |- of' FE1 T1}*
H5 : {L, of' n1 T |- of''_env FE2 TE1}*
============================
 {L |- of''_env (FE1 :: FE2) (prod T1 TE1)}

Subgoal 3 is:
 {L |- of''_env FE TE}

of''_env_str < apply of'_str to _ _ H4.
Subgoal 2:

Variables: L T TE1 FE2 T1 FE1
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H4 : {L, of' n1 T |- of' FE1 T1}*
H5 : {L, of' n1 T |- of''_env FE2 TE1}*
H6 : {L |- of' FE1 T1}
============================
 {L |- of''_env (FE1 :: FE2) (prod T1 TE1)}

Subgoal 3 is:
 {L |- of''_env FE TE}

of''_env_str < apply IH to _ _ H5.
Subgoal 2:

Variables: L T TE1 FE2 T1 FE1
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H4 : {L, of' n1 T |- of' FE1 T1}*
H5 : {L, of' n1 T |- of''_env FE2 TE1}*
H6 : {L |- of' FE1 T1}
H7 : {L |- of''_env FE2 TE1}
============================
 {L |- of''_env (FE1 :: FE2) (prod T1 TE1)}

Subgoal 3 is:
 {L |- of''_env FE TE}

of''_env_str < search.
Subgoal 3:

Variables: L FE T TE F
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H4 : {L, of' n1 T, [F n1] |- of''_env FE TE}*
H5 : member (F n1) (of' n1 T :: L)
============================
 {L |- of''_env FE TE}

of''_env_str < apply ctx'_mem to _ H5.
Subgoal 3:

Variables: L FE T TE M T1
IH : forall L FE T TE, nabla x, ctx' L -> {is_cty T} ->
       {L, of' x T |- of''_env FE TE}* -> {L |- of''_env FE TE}
H1 : ctx' L
H2 : {is_cty T}
H4 : {L, of' n1 T, [of' (M n1) T1] |- of''_env FE TE}*
H5 : member (of' (M n1) T1) (of' n1 T :: L)
H6 : name (M n1)
H7 : {is_cty T1}
============================
 {L |- of''_env FE TE}

of''_env_str < case H4.
Proof completed.
Abella < Theorem ctx'_focus_inv : 
forall L D G, ctx' L -> member D L -> {L, [D] |- G} ->
  (exists A T, G = of' A T /\ name A).


============================
 forall L D G, ctx' L -> member D L -> {L, [D] |- G} ->
   (exists A T, G = of' A T /\ name A)

ctx'_focus_inv < intros.

Variables: L D G
H1 : ctx' L
H2 : member D L
H3 : {L, [D] |- G}
============================
 exists A T, G = of' A T /\ name A

ctx'_focus_inv < apply ctx'_mem to H1 H2.

Variables: L G M T
H1 : ctx' L
H2 : member (of' M T) L
H3 : {L, [of' M T] |- G}
H4 : name M
H5 : {is_cty T}
============================
 exists A T, G = of' A T /\ name A

ctx'_focus_inv < case H3.

Variables: L M T
H1 : ctx' L
H2 : member (of' M T) L
H4 : name M
H5 : {is_cty T}
============================
 exists A T1, of' M T = of' A T1 /\ name A

ctx'_focus_inv < search.
Proof completed.
Abella < Theorem of''_env_is_cty : 
forall L FE TE, ctx' L -> {L |- of''_env FE TE} -> {is_cty TE}.


============================
 forall L FE TE, ctx' L -> {L |- of''_env FE TE} -> {is_cty TE}

of''_env_is_cty < induction on 2.

IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
============================
 forall L FE TE, ctx' L -> {L |- of''_env FE TE}@ -> {is_cty TE}

of''_env_is_cty < intros.

Variables: L FE TE
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H2 : {L |- of''_env FE TE}@
============================
 {is_cty TE}

of''_env_is_cty < case H2.
Subgoal 1:

Variables: L
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
============================
 {is_cty tunit}

Subgoal 2 is:
 {is_cty (prod T TE1)}

Subgoal 3 is:
 {is_cty TE}

of''_env_is_cty < search.
Subgoal 2:

Variables: L TE1 ML T M
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H3 : {L |- of' M T}*
H4 : {L |- of''_env ML TE1}*
============================
 {is_cty (prod T TE1)}

Subgoal 3 is:
 {is_cty TE}

of''_env_is_cty < apply of'_is_cty to _ H3.
Subgoal 2:

Variables: L TE1 ML T M
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H3 : {L |- of' M T}*
H4 : {L |- of''_env ML TE1}*
H5 : {is_cty T}
============================
 {is_cty (prod T TE1)}

Subgoal 3 is:
 {is_cty TE}

of''_env_is_cty < apply IH to _ H4.
Subgoal 2:

Variables: L TE1 ML T M
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H3 : {L |- of' M T}*
H4 : {L |- of''_env ML TE1}*
H5 : {is_cty T}
H6 : {is_cty TE1}
============================
 {is_cty (prod T TE1)}

Subgoal 3 is:
 {is_cty TE}

of''_env_is_cty < search.
Subgoal 3:

Variables: L FE TE F
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H3 : {L, [F] |- of''_env FE TE}*
H4 : member F L
============================
 {is_cty TE}

of''_env_is_cty < apply ctx'_mem to _ H4.
Subgoal 3:

Variables: L FE TE M T
IH : forall L FE TE, ctx' L -> {L |- of''_env FE TE}* -> {is_cty TE}
H1 : ctx' L
H3 : {L, [of' M T] |- of''_env FE TE}*
H4 : member (of' M T) L
H5 : name M
H6 : {is_cty T}
============================
 {is_cty TE}

of''_env_is_cty < case H3.
Proof completed.
Abella < Theorem of''_env_tm'_list : 
forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE} -> is_list FE1.


============================
 forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE} -> is_list FE1

of''_env_tm'_list < induction on 2.

IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
============================
 forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}@ -> is_list FE1

of''_env_tm'_list < intros.

Variables: L FE1 TE
IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
H1 : ctx' L
H2 : {L |- of''_env FE1 TE}@
============================
 is_list FE1

of''_env_tm'_list < case H2.
Subgoal 1:

Variables: L
IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
H1 : ctx' L
============================
 is_list nil

Subgoal 2 is:
 is_list (M :: ML)

Subgoal 3 is:
 is_list FE1

of''_env_tm'_list < search.
Subgoal 2:

Variables: L TE1 ML T M
IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
H1 : ctx' L
H3 : {L |- of' M T}*
H4 : {L |- of''_env ML TE1}*
============================
 is_list (M :: ML)

Subgoal 3 is:
 is_list FE1

of''_env_tm'_list < apply IH to _ H4.
Subgoal 2:

Variables: L TE1 ML T M
IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
H1 : ctx' L
H3 : {L |- of' M T}*
H4 : {L |- of''_env ML TE1}*
H5 : is_list ML
============================
 is_list (M :: ML)

Subgoal 3 is:
 is_list FE1

of''_env_tm'_list < search.
Subgoal 3:

Variables: L FE1 TE F
IH : forall L FE1 TE, ctx' L -> {L |- of''_env FE1 TE}* -> is_list FE1
H1 : ctx' L
H3 : {L, [F] |- of''_env FE1 TE}*
H4 : member F L
============================
 is_list FE1

of''_env_tm'_list < apply ctx'_focus_inv to _ _ H3.
Proof completed.
Abella < Theorem of''_body_is_cty : 
forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T} ->
  {is_cty T}.


============================
 forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T} ->
   {is_cty T}

of''_body_is_cty < induction on 3.

IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
============================
 forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}@ ->
   {is_cty T}

of''_body_is_cty < intros.

Variables: L TE M T
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty TE}
H3 : {L |- of''_body TE M T}@
============================
 {is_cty T}

of''_body_is_cty < case H3.
Subgoal 1:

Variables: L T M1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty tunit}
H4 : {L |- of' M1 T}*
============================
 {is_cty T}

Subgoal 2 is:
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_body_is_cty < apply of'_is_cty to _ H4.
Subgoal 1:

Variables: L T M1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty tunit}
H4 : {L |- of' M1 T}*
H5 : {is_cty T}
============================
 {is_cty T}

Subgoal 2 is:
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_body_is_cty < search.
Subgoal 2:

Variables: L T T2 R TE1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty (prod T2 TE1)}
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_body_is_cty < case H2.
Subgoal 2:

Variables: L T T2 R TE1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {is_cty T2}
H7 : {is_cty TE1}
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_body_is_cty < apply IH to _ _ H4.
Subgoal 2:

Variables: L T T2 R TE1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {is_cty T2}
H7 : {is_cty TE1}
H8 : {is_cty T}
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_body_is_cty < search.
Subgoal 3:

Variables: L TE M T F
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty TE}
H4 : {L, [F] |- of''_body TE M T}*
H5 : member F L
============================
 {is_cty T}

of''_body_is_cty < apply ctx'_mem to _ H5.
Subgoal 3:

Variables: L TE M T M1 T1
IH : forall L TE M T, ctx' L -> {is_cty TE} -> {L |- of''_body TE M T}* ->
       {is_cty T}
H1 : ctx' L
H2 : {is_cty TE}
H4 : {L, [of' M1 T1] |- of''_body TE M T}*
H5 : member (of' M1 T1) L
H6 : name M1
H7 : {is_cty T1}
============================
 {is_cty T}

of''_body_is_cty < case H4.
Proof completed.
Abella < Theorem of''_is_cty : 
forall L M T, ctx' L -> {L |- of'' M T} -> {is_cty T}.


============================
 forall L M T, ctx' L -> {L |- of'' M T} -> {is_cty T}

of''_is_cty < induction on 2.

IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
============================
 forall L M T, ctx' L -> {L |- of'' M T}@ -> {is_cty T}

of''_is_cty < intros.

Variables: L M T
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H2 : {L |- of'' M T}@
============================
 {is_cty T}

of''_is_cty < case H2.
Subgoal 1:

Variables: L T M1
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T}*
============================
 {is_cty T}

Subgoal 2 is:
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_is_cty < apply of'_is_cty to _ H3.
Subgoal 1:

Variables: L T M1
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T}*
H4 : {is_cty T}
============================
 {is_cty T}

Subgoal 2 is:
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_is_cty < search.
Subgoal 2:

Variables: L T R L1 T1 M1
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_is_cty < apply of'_is_cty to _ H3.
Subgoal 2:

Variables: L T R L1 T1 M1
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H5 : {is_cty T1}
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_is_cty < apply IH to _ H4.
Subgoal 2:

Variables: L T R L1 T1 M1
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H5 : {is_cty T1}
H6 : {is_cty T}
============================
 {is_cty T}

Subgoal 3 is:
 {is_cty T}

of''_is_cty < search.
Subgoal 3:

Variables: L M T F
IH : forall L M T, ctx' L -> {L |- of'' M T}* -> {is_cty T}
H1 : ctx' L
H3 : {L, [F] |- of'' M T}*
H4 : member F L
============================
 {is_cty T}

of''_is_cty < apply ctx'_focus_inv to _ _ H3.
Proof completed.
Abella < Theorem of''_to_alter_ver : 
forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T} ->
  (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}).


============================
 forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T} ->
   (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})

of''_to_alter_ver < induction on 2.

IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
============================
 forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}@ ->
   (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})

of''_to_alter_ver < intros.

Variables: L FE M T
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H2 : {L |- of'' (htm FE M) T}@
============================
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < case H2.
Subgoal 1:

Variables: L T M1
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L |- of' M1 T}*
============================
 exists TE, {L |- of''_env nil TE} /\ {L |- of''_body TE (hbase M1) T}

Subgoal 2 is:
 exists TE, {L |- of''_env (M1 :: L1) TE} /\ {L |- of''_body TE (habs R) T}

Subgoal 3 is:
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < search.
Subgoal 2:

Variables: L T R L1 T1 M1
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
============================
 exists TE, {L |- of''_env (M1 :: L1) TE} /\ {L |- of''_body TE (habs R) T}

Subgoal 3 is:
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < apply of'_is_cty to _ H3.
Subgoal 2:

Variables: L T R L1 T1 M1
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H5 : {is_cty T1}
============================
 exists TE, {L |- of''_env (M1 :: L1) TE} /\ {L |- of''_body TE (habs R) T}

Subgoal 3 is:
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < apply IH to _ H4.
Subgoal 2:

Variables: L T R L1 T1 M1 TE
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H5 : {is_cty T1}
H6 : {L, of' n1 T1 |- of''_env L1 TE}
H7 : {L, of' n1 T1 |- of''_body TE (R n1) T}
============================
 exists TE, {L |- of''_env (M1 :: L1) TE} /\ {L |- of''_body TE (habs R) T}

Subgoal 3 is:
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < apply of''_env_str to _ _ H6.
Subgoal 2:

Variables: L T R L1 T1 M1 TE
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L |- of' M1 T1}*
H4 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H5 : {is_cty T1}
H6 : {L, of' n1 T1 |- of''_env L1 TE}
H7 : {L, of' n1 T1 |- of''_body TE (R n1) T}
H8 : {L |- of''_env L1 TE}
============================
 exists TE, {L |- of''_env (M1 :: L1) TE} /\ {L |- of''_body TE (habs R) T}

Subgoal 3 is:
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < search.
Subgoal 3:

Variables: L FE M T F
IH : forall L FE M T, ctx' L -> {L |- of'' (htm FE M) T}* ->
       (exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T})
H1 : ctx' L
H3 : {L, [F] |- of'' (htm FE M) T}*
H4 : member F L
============================
 exists TE, {L |- of''_env FE TE} /\ {L |- of''_body TE M T}

of''_to_alter_ver < apply ctx'_focus_inv to _ _ H3.
Proof completed.
Abella < Theorem of''_from_alter_ver : 
forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
  {L |- of''_body TE M T} -> {L |- of'' (htm FE M) T}.


============================
 forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
   {L |- of''_body TE M T} -> {L |- of'' (htm FE M) T}

of''_from_alter_ver < induction on 3.

IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
============================
 forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
   {L |- of''_body TE M T}@ -> {L |- of'' (htm FE M) T}

of''_from_alter_ver < intros.

Variables: L FE TE M T
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H2 : {L |- of''_env FE TE}
H3 : {L |- of''_body TE M T}@
============================
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < case H3.
Subgoal 1:

Variables: L FE T M1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H2 : {L |- of''_env FE tunit}
H4 : {L |- of' M1 T}*
============================
 {L |- of'' (htm FE (hbase M1)) T}

Subgoal 2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < case H2.
Subgoal 1.1:

Variables: L T M1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L |- of' M1 T}*
============================
 {L |- of'' (htm nil (hbase M1)) T}

Subgoal 1.2 is:
 {L |- of'' (htm FE (hbase M1)) T}

Subgoal 2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < search.
Subgoal 1.2:

Variables: L FE T M1 F
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L |- of' M1 T}*
H5 : {L, [F] |- of''_env FE tunit}
H6 : member F L
============================
 {L |- of'' (htm FE (hbase M1)) T}

Subgoal 2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < apply ctx'_focus_inv to _ _ H5.
Subgoal 2:

Variables: L FE T T2 R TE1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H2 : {L |- of''_env FE (prod T2 TE1)}
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
============================
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < case H2.
Subgoal 2.1:

Variables: L T T2 R TE1 ML M1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {L |- of' M1 T2}
H7 : {L |- of''_env ML TE1}
============================
 {L |- of'' (htm (M1 :: ML) (habs R)) T}

Subgoal 2.2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < apply is_cty_str to _ H5.
Subgoal 2.1:

Variables: L T T2 R TE1 ML M1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {L |- of' M1 T2}
H7 : {L |- of''_env ML TE1}
H8 : {is_cty T2}
============================
 {L |- of'' (htm (M1 :: ML) (habs R)) T}

Subgoal 2.2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < apply IH to _ H7 H4.
Subgoal 2.1:

Variables: L T T2 R TE1 ML M1
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {L |- of' M1 T2}
H7 : {L |- of''_env ML TE1}
H8 : {is_cty T2}
H9 : {L, of' n1 T2 |- of'' (htm ML (R n1)) T}
============================
 {L |- of'' (htm (M1 :: ML) (habs R)) T}

Subgoal 2.2 is:
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < search.
Subgoal 2.2:

Variables: L FE T T2 R TE1 F
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H4 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H5 : {L |- is_cty T2}*
H6 : {L, [F] |- of''_env FE (prod T2 TE1)}
H7 : member F L
============================
 {L |- of'' (htm FE (habs R)) T}

Subgoal 3 is:
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < apply ctx'_focus_inv to _ _ H6.
Subgoal 3:

Variables: L FE TE M T F
IH : forall L FE TE M T, ctx' L -> {L |- of''_env FE TE} ->
       {L |- of''_body TE M T}* -> {L |- of'' (htm FE M) T}
H1 : ctx' L
H2 : {L |- of''_env FE TE}
H4 : {L, [F] |- of''_body TE M T}*
H5 : member F L
============================
 {L |- of'' (htm FE M) T}

of''_from_alter_ver < apply ctx'_focus_inv to _ _ H4.
Proof completed.
Abella < Define tm'_ctx : (list o) -> prop by 
tm'_ctx nil;
nabla x, tm'_ctx (tm' x :: L) := tm'_ctx L.

Abella < Define vars_of_tm'_ctx : (list o) -> (list tm') -> prop by 
vars_of_tm'_ctx nil nil;
nabla x, vars_of_tm'_ctx (tm' x :: L) (x :: L') := vars_of_tm'_ctx L L'.

Abella < Theorem vars_of_tm'_ctx_prune1 : 
forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs -> (exists L', L = y\L').


============================
 forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs -> (exists L', L = y\L')

vars_of_tm'_ctx_prune1 < induction on 1.

IH : forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs * ->
       (exists L', L = y\L')
============================
 forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs @ -> (exists L', L = y\L')

vars_of_tm'_ctx_prune1 < intros.

Variables: L Vs
IH : forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs * ->
       (exists L', L = y\L')
H1 : vars_of_tm'_ctx (L n1) Vs @
============================
 exists L', L = y\L'

vars_of_tm'_ctx_prune1 < case H1.
Subgoal 1:

IH : forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs * ->
       (exists L', L = y\L')
============================
 exists L', z1\nil = y\L'

Subgoal 2 is:
 exists L', z2\tm' n2 :: L1 z2 = y\L'

vars_of_tm'_ctx_prune1 < search.
Subgoal 2:

Variables: Vs1 L1
IH : forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs * ->
       (exists L', L = y\L')
H2 : vars_of_tm'_ctx (L1 n1) Vs1 *
============================
 exists L', z2\tm' n2 :: L1 z2 = y\L'

vars_of_tm'_ctx_prune1 < apply IH to H2.
Subgoal 2:

Variables: Vs1 L'
IH : forall L Vs, nabla x, vars_of_tm'_ctx (L x) Vs * ->
       (exists L', L = y\L')
H2 : vars_of_tm'_ctx L' Vs1 *
============================
 exists L'1, z2\tm' n2 :: L' = y\L'1

vars_of_tm'_ctx_prune1 < search.
Proof completed.
Abella < Theorem tm'_ctx_mem : 
forall E L, tm'_ctx L -> member E L -> (exists X, E = tm' X /\ name X).


============================
 forall E L, tm'_ctx L -> member E L -> (exists X, E = tm' X /\ name X)

tm'_ctx_mem < induction on 2.

IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
============================
 forall E L, tm'_ctx L -> member E L @ -> (exists X, E = tm' X /\ name X)

tm'_ctx_mem < intros.

Variables: E L
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H1 : tm'_ctx L
H2 : member E L @
============================
 exists X, E = tm' X /\ name X

tm'_ctx_mem < case H2.
Subgoal 1:

Variables: E L1
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H1 : tm'_ctx (E :: L1)
============================
 exists X, E = tm' X /\ name X

Subgoal 2 is:
 exists X, E = tm' X /\ name X

tm'_ctx_mem < case H1.
Subgoal 1:

Variables: L2
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H3 : tm'_ctx L2
============================
 exists X, tm' n1 = tm' X /\ name X

Subgoal 2 is:
 exists X, E = tm' X /\ name X

tm'_ctx_mem < search.
Subgoal 2:

Variables: E L1 B
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H1 : tm'_ctx (B :: L1)
H3 : member E L1 *
============================
 exists X, E = tm' X /\ name X

tm'_ctx_mem < case H1.
Subgoal 2:

Variables: E L2
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H3 : member (E n1) L2 *
H4 : tm'_ctx L2
============================
 exists X, E n1 = tm' X /\ name X

tm'_ctx_mem < apply IH to _ H3.
Subgoal 2:

Variables: L2 X
IH : forall E L, tm'_ctx L -> member E L * -> (exists X, E = tm' X /\ name X)
H3 : member (tm' (X n1)) L2 *
H4 : tm'_ctx L2
H5 : name (X n1)
============================
 exists X1, tm' (X n1) = tm' X1 /\ name X1

tm'_ctx_mem < search.
Proof completed.
Abella < Theorem ctx'_to_tm'_ctx : 
forall L Vs, ctx' L -> vars_of_ctx' L Vs ->
  (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs).


============================
 forall L Vs, ctx' L -> vars_of_ctx' L Vs ->
   (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)

ctx'_to_tm'_ctx < induction on 2.

IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
============================
 forall L Vs, ctx' L -> vars_of_ctx' L Vs @ ->
   (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)

ctx'_to_tm'_ctx < intros.

Variables: L Vs
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H1 : ctx' L
H2 : vars_of_ctx' L Vs @
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs

ctx'_to_tm'_ctx < case H2.
Subgoal 1:

IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H1 : ctx' nil
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL nil

Subgoal 2 is:
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (X :: Vs1)

ctx'_to_tm'_ctx < search.
Subgoal 2:

Variables: Vs1 X L1 T
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H1 : ctx' (of' X T :: L1)
H3 : vars_of_ctx' L1 Vs1 *
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (X :: Vs1)

ctx'_to_tm'_ctx < case H1.
Subgoal 2:

Variables: Vs1 T L2
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H3 : vars_of_ctx' L2 (Vs1 n1) *
H4 : ctx' L2
H5 : {is_cty T}
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (n1 :: Vs1 n1)

ctx'_to_tm'_ctx < apply IH to _ H3.
Subgoal 2:

Variables: Vs1 T L2 SL
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H3 : vars_of_ctx' L2 (Vs1 n1) *
H4 : ctx' L2
H5 : {is_cty T}
H6 : tm'_ctx (SL n1)
H7 : vars_of_tm'_ctx (SL n1) (Vs1 n1)
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (n1 :: Vs1 n1)

ctx'_to_tm'_ctx < apply vars_of_ctx'_prune2 to H3.
Subgoal 2:

Variables: T L2 SL Vs'
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H3 : vars_of_ctx' L2 Vs' *
H4 : ctx' L2
H5 : {is_cty T}
H6 : tm'_ctx (SL n1)
H7 : vars_of_tm'_ctx (SL n1) Vs'
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (n1 :: Vs')

ctx'_to_tm'_ctx < apply vars_of_tm'_ctx_prune1 to H7.
Subgoal 2:

Variables: T L2 Vs' L'
IH : forall L Vs, ctx' L -> vars_of_ctx' L Vs * ->
       (exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL Vs)
H3 : vars_of_ctx' L2 Vs' *
H4 : ctx' L2
H5 : {is_cty T}
H6 : tm'_ctx L'
H7 : vars_of_tm'_ctx L' Vs'
============================
 exists SL, tm'_ctx SL /\ vars_of_tm'_ctx SL (n1 :: Vs')

ctx'_to_tm'_ctx < search.
Proof completed.
Abella < Theorem ctx'_tm'_ctx_sync : 
forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
  member (of' M T) L -> member (tm' M) SL.


============================
 forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
   member (of' M T) L -> member (tm' M) SL

ctx'_tm'_ctx_sync < induction on 3.

IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
============================
 forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
   member (of' M T) L @ -> member (tm' M) SL

ctx'_tm'_ctx_sync < intros.

Variables: L Vs SL M T
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H1 : vars_of_ctx' L Vs
H2 : vars_of_tm'_ctx SL Vs
H3 : member (of' M T) L @
============================
 member (tm' M) SL

ctx'_tm'_ctx_sync < case H3.
Subgoal 1:

Variables: Vs SL M T L1
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H1 : vars_of_ctx' (of' M T :: L1) Vs
H2 : vars_of_tm'_ctx SL Vs
============================
 member (tm' M) SL

Subgoal 2 is:
 member (tm' M) SL

ctx'_tm'_ctx_sync < case H1.
Subgoal 1:

Variables: SL M T L1 Vs1
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H2 : vars_of_tm'_ctx SL (M :: Vs1)
H4 : vars_of_ctx' L1 Vs1
============================
 member (tm' M) SL

Subgoal 2 is:
 member (tm' M) SL

ctx'_tm'_ctx_sync < case H2.
Subgoal 1:

Variables: T L1 L' L2
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H4 : vars_of_ctx' (L1 n1) L'
H5 : vars_of_tm'_ctx L2 L'
============================
 member (tm' n1) (tm' n1 :: L2)

Subgoal 2 is:
 member (tm' M) SL

ctx'_tm'_ctx_sync < search.
Subgoal 2:

Variables: Vs SL M T L1 B
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H1 : vars_of_ctx' (B :: L1) Vs
H2 : vars_of_tm'_ctx SL Vs
H4 : member (of' M T) L1 *
============================
 member (tm' M) SL

ctx'_tm'_ctx_sync < case H1.
Subgoal 2:

Variables: SL M T L1 Vs1 X T1
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H2 : vars_of_tm'_ctx SL (X :: Vs1)
H4 : member (of' M T) L1 *
H5 : vars_of_ctx' L1 Vs1
============================
 member (tm' M) SL

ctx'_tm'_ctx_sync < case H2.
Subgoal 2:

Variables: M T L1 T1 L' L2
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H4 : member (of' (M n1) T) (L1 n1) *
H5 : vars_of_ctx' (L1 n1) L'
H6 : vars_of_tm'_ctx L2 L'
============================
 member (tm' (M n1)) (tm' n1 :: L2)

ctx'_tm'_ctx_sync < unfold.
Subgoal 2:

Variables: M T L1 T1 L' L2
IH : forall L Vs SL M T, vars_of_ctx' L Vs -> vars_of_tm'_ctx SL Vs ->
       member (of' M T) L * -> member (tm' M) SL
H4 : member (of' (M n1) T) (L1 n1) *
H5 : vars_of_ctx' (L1 n1) L'
H6 : vars_of_tm'_ctx L2 L'
============================
 member (tm' (M n1)) L2

ctx'_tm'_ctx_sync < backchain IH.
Proof completed.
Abella < Theorem closed_tm'_prune_aux : 
forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)} -> (exists M', M = y\M').


============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)} -> (exists M', M = y\M')

closed_tm'_prune_aux < induction on 2.

IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}@ -> (exists M', M = y\M')

closed_tm'_prune_aux < intros.

Variables: M L
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H2 : {L |- tm' (M n1)}@
============================
 exists M', M = y\M'

closed_tm'_prune_aux < case H2.
Subgoal 1:

Variables: L N
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
============================
 exists M', z1\nat' N = y\M'

Subgoal 2 is:
 exists M', z1\pred' (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus' (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 2:

Variables: L M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
============================
 exists M', z1\pred' (M1 z1) = y\M'

Subgoal 3 is:
 exists M', z1\plus' (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 2:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
============================
 exists M'1, z1\pred' M' = y\M'1

Subgoal 3 is:
 exists M', z1\plus' (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 3:

Variables: L M2 M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M', z1\plus' (M1 z1) (M2 z1) = y\M'

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 3:

Variables: L M2 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M'1, z1\plus' M' (M2 z1) = y\M'1

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 3:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
============================
 exists M'2, z1\plus' M' M'1 = y\M'2

Subgoal 4 is:
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 4:

Variables: L M2 M1 M3
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M3 n1)}*
H4 : {L |- tm' (M1 n1)}*
H5 : {L |- tm' (M2 n1)}*
============================
 exists M', z1\ifz' (M3 z1) (M1 z1) (M2 z1) = y\M'

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 4:

Variables: L M2 M1 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' (M1 n1)}*
H5 : {L |- tm' (M2 n1)}*
============================
 exists M'1, z1\ifz' M' (M1 z1) (M2 z1) = y\M'1

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 4:

Variables: L M2 M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
H5 : {L |- tm' (M2 n1)}*
============================
 exists M'2, z1\ifz' M' M'1 (M2 z1) = y\M'2

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H5.
Subgoal 4:

Variables: L M' M'1 M'2
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
H5 : {L |- tm' M'2}*
============================
 exists M'3, z1\ifz' M' M'1 M'2 = y\M'3

Subgoal 5 is:
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 5:

Variables: L
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
============================
 exists M', z1\unit' = y\M'

Subgoal 6 is:
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 6:

Variables: L M2 M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M', z1\pair' (M1 z1) (M2 z1) = y\M'

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 6:

Variables: L M2 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M'1, z1\pair' M' (M2 z1) = y\M'1

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 6:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
============================
 exists M'2, z1\pair' M' M'1 = y\M'2

Subgoal 7 is:
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 7:

Variables: L M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
============================
 exists M', z1\fst' (M1 z1) = y\M'

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 7:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
============================
 exists M'1, z1\fst' M' = y\M'1

Subgoal 8 is:
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 8:

Variables: L M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
============================
 exists M', z1\snd' (M1 z1) = y\M'

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 8:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
============================
 exists M'1, z1\snd' M' = y\M'1

Subgoal 9 is:
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 9:

Variables: L R M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L, tm' n2 |- tm' (R n1 n2)}*
============================
 exists M', z1\let' (M1 z1) (R z1) = y\M'

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 9:

Variables: L R M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2 |- tm' (R n1 n2)}*
============================
 exists M'1, z1\let' M' (R z1) = y\M'1

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 9:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2 |- tm' (M'1 n2)}*
============================
 exists M'2, z1\let' M' (z2\M'1 z2) = y\M'2

Subgoal 10 is:
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 10:

Variables: L R
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, tm' n2 |- tm' (R n1 n2)}*
============================
 exists M', z1\abs' (R z1) = y\M'

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 10:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, tm' n2 |- tm' (M' n2)}*
============================
 exists M'1, z1\abs' (z2\M' z2) = y\M'1

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 10:

Variables: L M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, tm' n2 |- tm' (M'1 n2)}*
============================
 exists M'2, z1\abs' (z2\M'1 z2) = y\M'2

Subgoal 11 is:
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 11:

Variables: L M2 M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M', z1\app' (M1 z1) (M2 z1) = y\M'

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 11:

Variables: L M2 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M'1, z1\app' M' (M2 z1) = y\M'1

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 11:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
============================
 exists M'2, z1\app' M' M'1 = y\M'2

Subgoal 12 is:
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 12:

Variables: L M2 M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M', z1\clos' (M1 z1) (M2 z1) = y\M'

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 12:

Variables: L M2 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' (M2 n1)}*
============================
 exists M'1, z1\clos' M' (M2 z1) = y\M'1

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 12:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L |- tm' M'1}*
============================
 exists M'2, z1\clos' M' M'1 = y\M'2

Subgoal 13 is:
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 13:

Variables: L R M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L, tm' n2, tm' n3 |- tm' (R n1 n2 n3)}*
============================
 exists M', z1\open' (M1 z1) (R z1) = y\M'

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H3.
Subgoal 13:

Variables: L R M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2, tm' n3 |- tm' (R n1 n2 n3)}*
============================
 exists M'1, z1\open' M' (R z1) = y\M'1

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < apply IH to _ H4.
Subgoal 13:

Variables: L M' M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2, tm' n3 |- tm' (M'1 n3 n2)}*
============================
 exists M'2, z1\open' M' (z2\z3\M'1 z3 z2) = y\M'2

Subgoal 14 is:
 exists M', M = y\M'

closed_tm'_prune_aux < search.
Subgoal 14:

Variables: M L F
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [F n1] |- tm' (M n1)}*
H4 : member (F n1) L
============================
 exists M', M = y\M'

closed_tm'_prune_aux < apply tm'_ctx_mem to H1 H4.
Subgoal 14:

Variables: M L X
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [tm' (X n1)] |- tm' (M n1)}*
H4 : member (tm' (X n1)) L
H5 : name (X n1)
============================
 exists M', M = y\M'

closed_tm'_prune_aux < case H3.
Subgoal 14:

Variables: M L
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H4 : member (tm' (M n1)) L
H5 : name (M n1)
============================
 exists M', M = y\M'

closed_tm'_prune_aux < apply member_prune to H4.
Subgoal 14:

Variables: L M'1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H4 : member (tm' M'1) L
H5 : name M'1
============================
 exists M', z1\M'1 = y\M'

closed_tm'_prune_aux < search.
Proof completed.
Abella < Theorem closed_tm'_prune : 
forall M, nabla x, {tm' (M x)} -> (exists M', M = y\M').


============================
 forall M, nabla x, {tm' (M x)} -> (exists M', M = y\M')

closed_tm'_prune < intros.

Variables: M
H1 : {tm' (M n1)}
============================
 exists M', M = y\M'

closed_tm'_prune < apply closed_tm'_prune_aux to _ H1.

Variables: M'
H1 : {tm' M'}
============================
 exists M'1, z1\M' = y\M'1

closed_tm'_prune < search.
Proof completed.
Abella < Theorem of'_to_tm' : 
forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
  vars_of_tm'_ctx CL Vs -> {L |- of' M T} -> {CL |- tm' M}.


============================
 forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of' M T} -> {CL |- tm' M}

of'_to_tm' < induction on 5.

IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
============================
 forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of' M T}@ -> {CL |- tm' M}

of'_to_tm' < intros.

Variables: L Vs CL M T
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H5 : {L |- of' M T}@
============================
 {CL |- tm' M}

of'_to_tm' < case H5.
Subgoal 1:

Variables: L Vs CL N
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
============================
 {CL |- tm' (nat' N)}

Subgoal 2 is:
 {CL |- tm' (pred' M1)}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 2:

Variables: L Vs CL M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
============================
 {CL |- tm' (pred' M1)}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 2.1:

Variables: L Vs CL M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
============================
 {CL |- tm' M1}

Subgoal 2 is:
 {CL |- tm' (pred' M1)}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 2:

Variables: L Vs CL M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {CL |- tm' M1}
============================
 {CL |- tm' (pred' M1)}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 3:

Variables: L Vs CL M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {L |- of' M2 tnat}*
============================
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 3.1:

Variables: L Vs CL M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {L |- of' M2 tnat}*
============================
 {CL |- tm' M1}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 3:

Variables: L Vs CL M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {L |- of' M2 tnat}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M2}.
Subgoal 3.2:

Variables: L Vs CL M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {L |- of' M2 tnat}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' M2}

Subgoal 3 is:
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 3:

Variables: L Vs CL M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 tnat}*
H7 : {L |- of' M2 tnat}*
H8 : {CL |- tm' M1}
H9 : {CL |- tm' M2}
============================
 {CL |- tm' (plus' M1 M2)}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 4:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
============================
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 4.1:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
============================
 {CL |- tm' M1}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 4:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
H9 : {CL |- tm' M1}
============================
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M2}.
Subgoal 4.2:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
H9 : {CL |- tm' M1}
============================
 {CL |- tm' M2}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 4:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
H9 : {CL |- tm' M1}
H10 : {CL |- tm' M2}
============================
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M3}.
Subgoal 4.3:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
H9 : {CL |- tm' M1}
H10 : {CL |- tm' M2}
============================
 {CL |- tm' M3}

Subgoal 4 is:
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 4:

Variables: L Vs CL T M2 M1 M3
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M3 tnat}*
H7 : {L |- of' M1 T}*
H8 : {L |- of' M2 T}*
H9 : {CL |- tm' M1}
H10 : {CL |- tm' M2}
H11 : {CL |- tm' M3}
============================
 {CL |- tm' (ifz' M3 M1 M2)}

Subgoal 5 is:
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 5:

Variables: L Vs CL
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
============================
 {CL |- tm' unit'}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 6:

Variables: L Vs CL T2 M2 T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L |- of' M2 T2}*
============================
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 6.1:

Variables: L Vs CL T2 M2 T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L |- of' M2 T2}*
============================
 {CL |- tm' M1}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 6:

Variables: L Vs CL T2 M2 T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L |- of' M2 T2}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M2}.
Subgoal 6.2:

Variables: L Vs CL T2 M2 T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L |- of' M2 T2}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' M2}

Subgoal 6 is:
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 6:

Variables: L Vs CL T2 M2 T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L |- of' M2 T2}*
H8 : {CL |- tm' M1}
H9 : {CL |- tm' M2}
============================
 {CL |- tm' (pair' M1 M2)}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 7:

Variables: L Vs CL T T2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T T2)}*
============================
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 7.1:

Variables: L Vs CL T T2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T T2)}*
============================
 {CL |- tm' M1}

Subgoal 7 is:
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 7:

Variables: L Vs CL T T2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T T2)}*
H7 : {CL |- tm' M1}
============================
 {CL |- tm' (fst' M1)}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 8:

Variables: L Vs CL T T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T1 T)}*
============================
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 8.1:

Variables: L Vs CL T T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T1 T)}*
============================
 {CL |- tm' M1}

Subgoal 8 is:
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 8:

Variables: L Vs CL T T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (prod T1 T)}*
H7 : {CL |- tm' M1}
============================
 {CL |- tm' (snd' M1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 9:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
============================
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 9.1:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
============================
 {CL |- tm' M1}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 9:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < apply of'_is_cty to _ H6.
Subgoal 9:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
H8 : {CL |- tm' M1}
H9 : {is_cty T1}
============================
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL, tm' n1 |- tm' (R n1)}.
Subgoal 9.2:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
H8 : {CL |- tm' M1}
H9 : {is_cty T1}
============================
 {CL, tm' n1 |- tm' (R n1)}

Subgoal 9 is:
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH with L = of' n1 T1 :: L.
Subgoal 9:

Variables: L Vs CL T R T1 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of' (R n1) T}*
H8 : {CL |- tm' M1}
H9 : {is_cty T1}
H10 : {CL, tm' n1 |- tm' (R n1)}
============================
 {CL |- tm' (let' M1 R)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 10:

Variables: L Vs CL T1 T2 R
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T1 |- of' (R n1) T2}*
H7 : {L |- is_cty T1}*
============================
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL, tm' n1 |- tm' (R n1)}.
Subgoal 10.1:

Variables: L Vs CL T1 T2 R
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T1 |- of' (R n1) T2}*
H7 : {L |- is_cty T1}*
============================
 {CL, tm' n1 |- tm' (R n1)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < apply is_cty_str to _ H7.
Subgoal 10.1:

Variables: L Vs CL T1 T2 R
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T1 |- of' (R n1) T2}*
H7 : {L |- is_cty T1}*
H8 : {is_cty T1}
============================
 {CL, tm' n1 |- tm' (R n1)}

Subgoal 10 is:
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH with L = of' n1 T1 :: L.
Subgoal 10:

Variables: L Vs CL T1 T2 R
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T1 |- of' (R n1) T2}*
H7 : {L |- is_cty T1}*
H8 : {CL, tm' n1 |- tm' (R n1)}
============================
 {CL |- tm' (abs' R)}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 11:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr' T1 T)}*
H7 : {L |- of' M2 T1}*
============================
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 11.1:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr' T1 T)}*
H7 : {L |- of' M2 T1}*
============================
 {CL |- tm' M1}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 11:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr' T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M2}.
Subgoal 11.2:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr' T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' M2}

Subgoal 11 is:
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 11:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr' T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
H9 : {CL |- tm' M2}
============================
 {CL |- tm' (app' M1 M2)}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 12:

Variables: L Vs CL TL E T2 T1 F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H7 : {L |- of' E TL}*
============================
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' F}.
Subgoal 12.1:

Variables: L Vs CL TL E T2 T1 F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H7 : {L |- of' E TL}*
============================
 {CL |- tm' F}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 12:

Variables: L Vs CL TL E T2 T1 F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H7 : {L |- of' E TL}*
H8 : {CL |- tm' F}
============================
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' E}.
Subgoal 12.2:

Variables: L Vs CL TL E T2 T1 F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H7 : {L |- of' E TL}*
H8 : {CL |- tm' F}
============================
 {CL |- tm' E}

Subgoal 12 is:
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 12:

Variables: L Vs CL TL E T2 T1 F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' F (arr' (prod (arr T1 T2) (prod T1 TL)) T2)}*
H7 : {L |- of' E TL}*
H8 : {CL |- tm' F}
H9 : {CL |- tm' E}
============================
 {CL |- tm' (clos' F E)}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 13:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr T1 T)}*
H7 : {L |- of' M2 T1}*
============================
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M1}.
Subgoal 13.1:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr T1 T)}*
H7 : {L |- of' M2 T1}*
============================
 {CL |- tm' M1}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 13:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < assert {CL |- tm' M2}.
Subgoal 13.2:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm' M2}

Subgoal 13 is:
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain IH.
Subgoal 13:

Variables: L Vs CL T T1 M2 M1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 (arr T1 T)}*
H7 : {L |- of' M2 T1}*
H8 : {CL |- tm' M1}
H9 : {CL |- tm' M2}
============================
 {CL |- tm' (open' M1 (f\e\app' f (pair' M1 (pair' M2 e))))}

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < search.
Subgoal 14:

Variables: L Vs CL M T F
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, [F] |- of' M T}*
H7 : member F L
============================
 {CL |- tm' M}

of'_to_tm' < apply ctx'_mem to _ H7.
Subgoal 14:

Variables: L Vs CL M T M1 T1
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, [of' M1 T1] |- of' M T}*
H7 : member (of' M1 T1) L
H8 : name M1
H9 : {is_cty T1}
============================
 {CL |- tm' M}

of'_to_tm' < case H6.
Subgoal 14:

Variables: L Vs CL M T
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H7 : member (of' M T) L
H8 : name M
H9 : {is_cty T}
============================
 {CL |- tm' M}

of'_to_tm' < assert member (tm' M) CL.
Subgoal 14.1:

Variables: L Vs CL M T
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H7 : member (of' M T) L
H8 : name M
H9 : {is_cty T}
============================
 member (tm' M) CL

Subgoal 14 is:
 {CL |- tm' M}

of'_to_tm' < backchain ctx'_tm'_ctx_sync.
Subgoal 14:

Variables: L Vs CL M T
IH : forall L Vs CL M T, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of' M T}* -> {CL |- tm' M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H7 : member (of' M T) L
H8 : name M
H9 : {is_cty T}
H10 : member (tm' M) CL
============================
 {CL |- tm' M}

of'_to_tm' < search.
Proof completed.
Abella < Theorem of''_body_to_tm'' : 
forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
  vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T} -> {CL |- tm''_body M}.


============================
 forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T} -> {CL |- tm''_body M}

of''_body_to_tm'' < induction on 5.

IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
============================
 forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}@ -> {CL |- tm''_body M}

of''_body_to_tm'' < intros.

Variables: L Vs CL M T TE
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H5 : {L |- of''_body TE M T}@
============================
 {CL |- tm''_body M}

of''_body_to_tm'' < case H5.
Subgoal 1:

Variables: L Vs CL T M1
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T}*
============================
 {CL |- tm''_body (hbase M1)}

Subgoal 2 is:
 {CL |- tm''_body (habs R)}

Subgoal 3 is:
 {CL |- tm''_body M}

of''_body_to_tm'' < apply of'_to_tm' to _ _ _ _ H6.
Subgoal 1:

Variables: L Vs CL T M1
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T}*
H7 : {CL |- tm' M1}
============================
 {CL |- tm''_body (hbase M1)}

Subgoal 2 is:
 {CL |- tm''_body (habs R)}

Subgoal 3 is:
 {CL |- tm''_body M}

of''_body_to_tm'' < search.
Subgoal 2:

Variables: L Vs CL T T2 R TE1
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H7 : {L |- is_cty T2}*
============================
 {CL |- tm''_body (habs R)}

Subgoal 3 is:
 {CL |- tm''_body M}

of''_body_to_tm'' < apply is_cty_str to _ H7.
Subgoal 2:

Variables: L Vs CL T T2 R TE1
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H7 : {L |- is_cty T2}*
H8 : {is_cty T2}
============================
 {CL |- tm''_body (habs R)}

Subgoal 3 is:
 {CL |- tm''_body M}

of''_body_to_tm'' < apply IH to _ _ _ _ H6 with Vs = n1 :: Vs.
Subgoal 2:

Variables: L Vs CL T T2 R TE1
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, of' n1 T2 |- of''_body TE1 (R n1) T}*
H7 : {L |- is_cty T2}*
H8 : {is_cty T2}
H9 : {CL, tm' n1 |- tm''_body (R n1)}
============================
 {CL |- tm''_body (habs R)}

Subgoal 3 is:
 {CL |- tm''_body M}

of''_body_to_tm'' < search.
Subgoal 3:

Variables: L Vs CL M T TE F
IH : forall L Vs CL M T TE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of''_body TE M T}* ->
       {CL |- tm''_body M}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, [F] |- of''_body TE M T}*
H7 : member F L
============================
 {CL |- tm''_body M}

of''_body_to_tm'' < apply ctx'_focus_inv to _ _ H6.
Proof completed.
Abella < Theorem of''_to_tm'' : 
forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
  vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T} ->
  {CL |- tm'' (htm FE M)}.


============================
 forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T} ->
   {CL |- tm'' (htm FE M)}

of''_to_tm'' < induction on 5.

IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
============================
 forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
   vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}@ ->
   {CL |- tm'' (htm FE M)}

of''_to_tm'' < intros.

Variables: L Vs CL M T FE
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H5 : {L |- of'' (htm FE M) T}@
============================
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < case H5.
Subgoal 1:

Variables: L Vs CL T M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T}*
============================
 {CL |- tm'' (htm nil (hbase M1))}

Subgoal 2 is:
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < apply of'_to_tm' to _ _ _ _ H6.
Subgoal 1:

Variables: L Vs CL T M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T}*
H7 : {CL |- tm' M1}
============================
 {CL |- tm'' (htm nil (hbase M1))}

Subgoal 2 is:
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < search.
Subgoal 2:

Variables: L Vs CL T R L1 T1 M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
============================
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < apply of'_to_tm' to _ _ _ _ H6.
Subgoal 2:

Variables: L Vs CL T R L1 T1 M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H8 : {CL |- tm' M1}
============================
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < apply of'_is_cty to _ H6.
Subgoal 2:

Variables: L Vs CL T R L1 T1 M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H8 : {CL |- tm' M1}
H9 : {is_cty T1}
============================
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < apply IH to _ _ _ _ H7 with Vs = n1 :: Vs.
Subgoal 2:

Variables: L Vs CL T R L1 T1 M1
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L |- of' M1 T1}*
H7 : {L, of' n1 T1 |- of'' (htm L1 (R n1)) T}*
H8 : {CL |- tm' M1}
H9 : {is_cty T1}
H10 : {CL, tm' n1 |- tm'' (htm L1 (R n1))}
============================
 {CL |- tm'' (htm (M1 :: L1) (habs R))}

Subgoal 3 is:
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < search.
Subgoal 3:

Variables: L Vs CL M T FE F
IH : forall L Vs CL M T FE, ctx' L -> vars_of_ctx' L Vs -> tm'_ctx CL ->
       vars_of_tm'_ctx CL Vs -> {L |- of'' (htm FE M) T}* ->
       {CL |- tm'' (htm FE M)}
H1 : ctx' L
H2 : vars_of_ctx' L Vs
H3 : tm'_ctx CL
H4 : vars_of_tm'_ctx CL Vs
H6 : {L, [F] |- of'' (htm FE M) T}*
H7 : member F L
============================
 {CL |- tm'' (htm FE M)}

of''_to_tm'' < apply ctx'_focus_inv to _ _ H6.
Proof completed.
Abella < Theorem closed_tm''_prune_aux : 
forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)} -> (exists M', M = y\M').


============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)} -> (exists M', M = y\M')

closed_tm''_prune_aux < induction on 2.

IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}@ ->
   (exists M', M = y\M')

closed_tm''_prune_aux < intros.

Variables: M L
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H2 : {L |- tm'' (M n1)}@
============================
 exists M', M = y\M'

closed_tm''_prune_aux < case H2.
Subgoal 1:

Variables: L M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
============================
 exists M', z1\htm nil (hbase (M1 z1)) = y\M'

Subgoal 2 is:
 exists M', z1\htm (M1 z1 :: L1 z1) (habs (R z1)) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_prune_aux < apply closed_tm'_prune_aux to _ H3.
Subgoal 1:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
============================
 exists M'1, z1\htm nil (hbase M') = y\M'1

Subgoal 2 is:
 exists M', z1\htm (M1 z1 :: L1 z1) (habs (R z1)) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_prune_aux < search.
Subgoal 2:

Variables: L R L1 M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
H4 : {L, tm' n2 |- tm'' (htm (L1 n1) (R n1 n2))}*
============================
 exists M', z1\htm (M1 z1 :: L1 z1) (habs (R z1)) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_prune_aux < apply closed_tm'_prune_aux to _ H3.
Subgoal 2:

Variables: L R L1 M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2 |- tm'' (htm (L1 n1) (R n1 n2))}*
============================
 exists M'1, z1\htm (M' :: L1 z1) (habs (R z1)) = y\M'1

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_prune_aux < apply IH to _ H4.
Subgoal 2:

Variables: L M' M'3 M'2
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
H4 : {L, tm' n2 |- tm'' (htm M'2 (M'3 n2))}*
============================
 exists M'1, z1\htm (M' :: M'2) (habs (z2\M'3 z2)) = y\M'1

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_prune_aux < search.
Subgoal 3:

Variables: M L F
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [F n1] |- tm'' (M n1)}*
H4 : member (F n1) L
============================
 exists M', M = y\M'

closed_tm''_prune_aux < apply tm'_ctx_mem to H1 H4.
Subgoal 3:

Variables: M L X
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm'' (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [tm' (X n1)] |- tm'' (M n1)}*
H4 : member (tm' (X n1)) L
H5 : name (X n1)
============================
 exists M', M = y\M'

closed_tm''_prune_aux < case H3.
Proof completed.
Abella < Theorem closed_tm''_prune : 
forall M, nabla x, {tm'' (M x)} -> (exists M', M = y\M').


============================
 forall M, nabla x, {tm'' (M x)} -> (exists M', M = y\M')

closed_tm''_prune < intros.

Variables: M
H1 : {tm'' (M n1)}
============================
 exists M', M = y\M'

closed_tm''_prune < apply closed_tm''_prune_aux to _ H1.

Variables: M'
H1 : {tm'' M'}
============================
 exists M'1, z1\M' = y\M'1

closed_tm''_prune < search.
Proof completed.
Abella < Theorem closed_tm''_body_prune_aux : 
forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)} ->
  (exists M', M = y\M').


============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)} ->
   (exists M', M = y\M')

closed_tm''_body_prune_aux < induction on 2.

IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
============================
 forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}@ ->
   (exists M', M = y\M')

closed_tm''_body_prune_aux < intros.

Variables: M L
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H2 : {L |- tm''_body (M n1)}@
============================
 exists M', M = y\M'

closed_tm''_body_prune_aux < case H2.
Subgoal 1:

Variables: L M1
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' (M1 n1)}*
============================
 exists M', z1\hbase (M1 z1) = y\M'

Subgoal 2 is:
 exists M', z1\habs (R z1) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_body_prune_aux < apply closed_tm'_prune_aux to _ H3.
Subgoal 1:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L |- tm' M'}*
============================
 exists M'1, z1\hbase M' = y\M'1

Subgoal 2 is:
 exists M', z1\habs (R z1) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_body_prune_aux < search.
Subgoal 2:

Variables: L R
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, tm' n2 |- tm''_body (R n1 n2)}*
============================
 exists M', z1\habs (R z1) = y\M'

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_body_prune_aux < apply IH to _ H3.
Subgoal 2:

Variables: L M'
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, tm' n2 |- tm''_body (M' n2)}*
============================
 exists M'1, z1\habs (z2\M' z2) = y\M'1

Subgoal 3 is:
 exists M', M = y\M'

closed_tm''_body_prune_aux < search.
Subgoal 3:

Variables: M L F
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [F n1] |- tm''_body (M n1)}*
H4 : member (F n1) L
============================
 exists M', M = y\M'

closed_tm''_body_prune_aux < apply tm'_ctx_mem to H1 H4.
Subgoal 3:

Variables: M L X
IH : forall M L, nabla x, tm'_ctx L -> {L |- tm''_body (M x)}* ->
       (exists M', M = y\M')
H1 : tm'_ctx L
H3 : {L, [tm' (X n1)] |- tm''_body (M n1)}*
H4 : member (tm' (X n1)) L
H5 : name (X n1)
============================
 exists M', M = y\M'

closed_tm''_body_prune_aux < case H3.
Proof completed.
Abella < Theorem closed_tm''_body_prune : 
forall M, nabla x, {tm''_body (M x)} -> (exists M', M = y\M').


============================
 forall M, nabla x, {tm''_body (M x)} -> (exists M', M = y\M')

closed_tm''_body_prune < intros.

Variables: M
H1 : {tm''_body (M n1)}
============================
 exists M', M = y\M'

closed_tm''_body_prune < apply closed_tm''_body_prune_aux to _ H1.

Variables: M'
H1 : {tm''_body M'}
============================
 exists M'1, z1\M' = y\M'1

closed_tm''_body_prune < search.
Proof completed.
Abella <