 thus two paths from a term $M$ to itself: ${\ensuremath{\mathrm{ref} \left( {M} \right)}}$ and $M \{\}$. There are not always equal; for example, $(\lambda x:A.x) \{\} \equiv {\ensuremath{\lambda \!\! \lambda \!\! \lambda}}e : x =_A y. e$, which (after we define the reduction relation) will not be convertible with ${\ensuremath{\mathrm{ref} \left( {\lambda x:A.x} \right)}}$.

The following lemma shows how substitution and path substitution interact.

\[lm:subpathsub\] Let $\vec{y}$ be a sequences of variables and $x$ a distinct variable. Then

1.  \[lm:subpathsubi\] $ \begin{aligned}[t]
    & M [ x:= N ] \{ \vec{y} := \vec{P} : \vec{L} = \vec{L'} \} \\
    & \equiv M \{ x := N \{ \vec{y} := \vec{P} : \vec{L} = \vec{L'} \} : N [ \vec{y}:= \vec{L} ] = N [ \vec{y} := \vec{L'} ], \vec{y} := \vec{P} : \vec{L} = \vec{L'} \}
    \end{aligned} $

2.  \[lm:subpathsubii\] $ \begin{aligned}[t]
    & M \{ \vec{y} := \vec{P} : \vec{L} = \vec{L'} \} [ x := N ] \\
    & \equiv M \{ \vec{y} := \vec{P} [x := N] : \vec{L} [x := N] = \vec{L'} [x := N], x := {\ensuremath{\mathrm{ref} \left( {N} \right)}} : N = N \}
    \end{aligned} $

An easy induction on $M$ in all cases.

The familiar substitution lemma also holds as usual: $t [\vec{z_1} := \vec{s_1}] [\vec{z_2} := \vec{s_2}] \equiv t [\vec{z_1} := \vec{
thus two paths from a term $ M$ to itself: $ { \ensuremath{\mathrm{ref } \left ({ M } \right)}}$ and $ M \{\}$. There are not constantly adequate; for example, $ (\lambda x: A.x) \{\ } \equiv { \ensuremath{\lambda \!\! \lambda \!\! \lambda}}e: x = _ A y. e$, which (after we define the decrease relation) will not be convertible with $ { \ensuremath{\mathrm{ref } \left ({ \lambda x: A.x } \right)}}$. 

 The stick to lemma shows how substitution and path substitution interact. 

 \[lm: subpathsub\ ] permit $ \vec{y}$ be a sequences of variables and $ x$ a discrete variable. Then 

 1.   \[lm: subpathsubi\ ] $ \begin{aligned}[t ] 
     & M [ x:= N ] \ { \vec{y }: = \vec{P }: \vec{L } = \vec{L' } \ } \\ 
     & \equiv M \ { x: = N \ { \vec{y }: = \vec{P }: \vec{L } = \vec{L' } \ }: N [ \vec{y}:= \vec{L } ] = N [ \vec{y }: = \vec{L' } ], \vec{y }: = \vec{P }: \vec{L } = \vec{L' } \ } 
     \end{aligned } $ 

 2.   \[lm: subpathsubii\ ] $ \begin{aligned}[t ] 
     & M \ { \vec{y }: = \vec{P }: \vec{L } = \vec{L' } \ } [ x: = N ] \\ 
     & \equiv M \ { \vec{y }: = \vec{P } [ x: = N ]: \vec{L } [ x: = N ] = \vec{L' } [ x: = N ], x: = { \ensuremath{\mathrm{ref } \left ({ N } \right) } }: N = N \ } 
     \end{aligned } $ 

 An easy trigger on $ M$ in all cases. 

 The familiar substitution lemma besides holds as usual: $ t [ \vec{z_1 }: = \vec{s_1 } ] [ \vec{z_2 }: = \vec{s_2 } ] \equiv t [ \vec{z_1 }: = \vec {
 thks two paths from a term $M$ to itself: ${\ensuremati{\mathrm{def} \left( {M} \right)}}$ and $M \{\}$. There are nov alqays tzual; for example, $(\lxmbda x:A.x) \{\} \equiv {\wnsucemath{\lambda \!\! \lambda \!\! \lambda}}e : w =_A y. x$, which (after wg define the reduction reldtkou) will not be convertible with ${\ensurqmath{\mayhgm{ref} \left( {\lamfda q:A.v} \rifht)}}$.

The following lemma shows how shbstituuion and path subsyitution interact.

\[lm:subpathdub\] Pet $\vec{y}$ be a sequfnces of vatjabjws and $x$ a dkstinct vagnable. Then

1.  \[lm:subpathsubi\] $ \begin{aligned}[t]
    & M [ x:= N ] \{ \vec{i} := \vfw{P} : \vec{L} = \vxc{L'} \} \\
    & \equiv M \{ x := N \{ \vac{y} := \vev{P} : \vec{L} = \vec{L'} \} : I [ \vwc{y}:= \vec{L} ] = N [ \vec{y} := \vxc{L'} ], \vec{y} := \vec{P} : \vec{J} = \vec{L'} \}
    \end{aligned} $

2.  \[lm:sybpathsobii\] $ \begkb{alkgntd}[t]
    & M \{ \gec{b} := \vec{P} : \ved{L} = \vec{L'} \} [ z := N ] \\
    & \equiv M \{ \vqb{u} := \vec{P} [x := N] : \vec{L} [x := N] = \vec{L'} [x := N], x := {\ensuremath{\mathrm{ref} \ltft( {N} \right)}} : N = N \}
    \end{alitned} $

An easy inductioj on $M$ in all cases.

The familiar substitution lemma also honds aa usbql: $t [\xwc{x_1} := \vec{s_1}] [\vec{z_2} := \vec{s_2}] \equiv t [\vec{z_1} := \vec{
thus two paths from a term $M$ ${\ensuremath{\mathrm{ref} {M} \right)}}$ $M \{\}$. There example, x:A.x) \{\} \equiv \!\! \lambda \!\! : x =_A y. e$, which we define the reduction relation) will not be convertible with ${\ensuremath{\mathrm{ref} \left( {\lambda \right)}}$. The following lemma shows how substitution and path substitution interact. \[lm:subpathsub\] Let be sequences variables $x$ a distinct variable. Then 1. \[lm:subpathsubi\] $ \begin{aligned}[t] & M [ x:= N ] \{ := \vec{P} : \vec{L} = \vec{L'} \} \\ \equiv M \{ x N \{ \vec{y} := \vec{P} \vec{L} \vec{L'} \} N \vec{y}:= ] = N \vec{y} := \vec{L'} ], \vec{y} := \vec{P} : \vec{L} = \vec{L'} \} \end{aligned} $ 2. \[lm:subpathsubii\] $ & M := \vec{P} \vec{L} \vec{L'} [ x := \\ & \equiv M \{ \vec{y} := N] : \vec{L} [x := N] = [x := x := {\ensuremath{\mathrm{ref} \left( {N} \right)}} N = N \} \end{aligned} $ An easy on $M$ in all cases. The familiar substitution lemma also holds as usual: $t [\vec{z_1} [\vec{z_2} := \vec{s_2}] \equiv [\vec{z_1} := \vec{
 thus two paths from a term $M$ to iTself: ${\ensurEmath{\MatHrm{ReF} \lefT( {M} \riGht)}}$ and $M \{\}$. There arE Not aLways equal; for example, $(\laMbda x:a.x) \{\} \EQuiv {\ENsUremaTh{\lambdA \!\! \LaMBDa \!\! \lAmBdA}}e : x =_a y. E$, WhIch (afTer We definE the reductIon ReLation) will noT Be ConvertiblE wiTh ${\ensuremath{\MatHrm{ref} \LeFt( {\lAMbda x:a.x} \rIght)}}$.

THe follOWing leMma shows hOw SUbstitUTion and PATh SubsTitution interact.

\[lM:SuBPathsub\] Let $\vec{y}$ Be a seqUeNCeS OF vaRiaBles and $x$ a dIsTinct VAriable. tHeN

1.  \[LM:SubPAthsubi\] $ \begin{aLigned}[t]
    & M [ x:= N ] \{ \vEC{y} := \vEc{P} : \vec{l} = \vEc{L'} \} \\
    & \EQuiv M \{ x := n \{ \vec{y} := \VeC{p} : \veC{L} = \vec{L'} \} : N [ \vec{y}:= \Vec{L} ] = n [ \vec{y} := \vec{L'} ], \Vec{y} := \veC{p} : \vec{L} = \veC{l'} \}
    \end{aliGned} $

2.  \[lm:SubPatHsubII\] $ \bEgIn{aLiGNed}[T]
    & m \{ \vEc{y} := \VEc{P} : \Vec{L} = \vec{L'} \} [ X := N ] \\
    & \EqUiv M \{ \vEc{y} := \vEC{p} [X := n] : \vec{l} [x := N] = \Vec{L'} [X := N], x := {\enSuremath{\mathrM{reF} \lefT( {n} \riGht)}} : N = N \}
    \End{alIgneD} $

AN easy InductIon on $m$ iN all cases.

The famIliaR substituTioN lEmmA aLso hoLDs as usUal: $T [\veC{z_1} := \vec{s_1}] [\vEc{z_2} := \vec{s_2}] \EQuiV t [\VEC{Z_1} := \vEc{
 thus two paths from a ter m $M$ to i tself : $ {\e ns urem ath{ \mathrm{ref} \ l eft(  {M} \right)}}$ and $M  \{\} $. Ther e  a re no t alway s  e q u al;  f or  ex am p le , $(\ lam bda x:A .x) \{\} \ equ iv  {\ensuremat h {\ lambda \!\ ! \ lambda \!\!\la mbda}} e: x =_A y . e $, wh ich (a f ter we  define t he reduct i on rela t i on ) wi ll not be convert i bl e  with ${\ensur emath{ \m a th r m {re f}\left( {\l am bda x : A.x} \r i gh t ) } }$. 
The followin g lemma sho w s h ow sub st itu t ion an d pat hs ubs titution in tera ct.

\[lm :subpa t hsub\]L et $\ve c{y}$bea s eque n ce sofva r iab l es  an d  $x $ a dist in ct  vari able . T h en
1. \[l m:sub pathsubi\] $\be gin{ a lig ned}[ t]
   &M[ x:=  N ] \ { \ve c{ y} := \vec{P} :  \ve c{L} = \v ec{ L' } \ }\\
  & \eq uiv  M\{ x :=  N \{ \ v ec{ y} : =  \ vec{P} : \vec{L} =  \ v e c{ L'} \} :  N [ \ v ec {y } := \vec{ L}  ]= N[ \vec{ y} : =  \ vec{L'}], \ve c {y }:= \vec {P } : \v ec {L}  =\vec{ L '} \ }
   \end{ali gned} $

2.  \[lm:su b pathsubii\] $ \b e g in { alig ned }[t]
    &M \{ \vec {y}: =\ve c {P} :  \vec {L }  = \vec{L'} \} [ x :=N] \\
   &\equiv M \{ \ vec{y} :=\ v e c{P} [x:= N ]  : \vec{L} [x :=N] =\vec{L'} [ x  := N],x :={\ensure math{\mat h r m{ref} \ lef t({N}  \r i g ht )}} : N = N \ }    \e nd{alig ned } $

An  ea syind uct io n on $M$in all c as es .
T hefamil i ar subst it uti on  le mma a l so hol ds as  usu al :$ t [ \vec{z_ 1 }: =  \ve c{ s_ 1}][\v ec {z_2}  :=\ vec {s_2}]\equiv t[\v e c{z_ 1}  : = \vec{ 
 thus_two paths_from a term $M$_to itself:_${\ensuremath{\mathrm{ref}_\left( {M}_\right)}}$_and $M \{\}$._There are not_always equal; for example,_$(\lambda x:A.x) \{\}_\equiv_{\ensuremath{\lambda \!\! \lambda \!\! \lambda}}e : x =_A y. e$, which (after we define_the_reduction relation)_will_not_be convertible with ${\ensuremath{\mathrm{ref} \left(_{\lambda x:A.x} \right)}}$.

The following lemma_shows how_substitution and path substitution interact.

\[lm:subpathsub\] Let $\vec{y}$ be_a_sequences of variables_and $x$ a distinct variable. Then

1.  \[lm:subpathsubi\] $_\begin{aligned}[t]
    & M_[ x:= N_]_\{_\vec{y} := \vec{P} :_\vec{L} = \vec{L'} \} \\
 _  & \equiv M \{_x := N \{ \vec{y} := \vec{P}_: \vec{L} = \vec{L'} \} :_N [ \vec{y}:= \vec{L} ]_= N_[ \vec{y} := \vec{L'} ],_\vec{y} := \vec{P}_: \vec{L}_= \vec{L'} \}
_   \end{aligned} $

2. _\[lm:subpathsubii\] $ \begin{aligned}[t]
_   & M \{_\vec{y}_:= \vec{P} :_\vec{L}_=_\vec{L'} \}_[ x :=_N_] \\
__  & \equiv M \{_\vec{y}_:= \vec{P} [x := N] : \vec{L}_[x := N] =_\vec{L'}_[x := N], x_:= {\ensuremath{\mathrm{ref} \left( {N} \right)}}_: N = N \}
 _ _\end{aligned} $

An_easy induction on $M$ in all cases.

The familiar substitution lemma also_holds as usual: $t [\vec{z_1} :=_\vec{s_1}] [\vec{z_2} := \vec{s_2}]_\equiv t_[\vec{z_1}_:= \vec{