[step:Handle the variable rule by separating variables before at and after the substitution point]Suppose the final rule of the derivation is a variable rule. There are three cases.
First, let the variable be the distinguished variable $x$. The original conclusion is
\begin{align*}
\Gamma,x:A,\Theta \vdash x:A.
\end{align*}
After substitution, this judgment becomes
\begin{align*}
\Gamma,\Theta[a/x]\vdash a:A.
\end{align*}
The derivation $\mathcal A:\Gamma\vdash a:A$ is given. Since the simultaneous context-formation induction has established that $\Gamma,\Theta[a/x]$ is a well-formed extension of $\Gamma$, the admissible use of a derivation over an earlier context inside a well-formed later context gives
\begin{align*}
\Gamma,\Theta[a/x]\vdash a:A.
\end{align*}
Second, let the variable $y$ be declared in $\Gamma$. Its type $B$ is declared before $x$, so $B[a/x]=B$. The original variable rule gives
\begin{align*}
\Gamma,x:A,\Theta \vdash y:B.
\end{align*}
Since $y:B$ is still an entry of the prefix $\Gamma$ in the substituted context $\Gamma,\Theta[a/x]$, the variable rule gives
\begin{align*}
\Gamma,\Theta[a/x]\vdash y:B.
\end{align*}
Third, let the variable $y$ be declared in the tail $\Theta$. Write the relevant decomposition of the tail as
\begin{align*}
\Theta=\Theta_0,y:B,\Theta_1,
\end{align*}
where $B$ is a type over $\Gamma,x:A,\Theta_0$. The variable rule in the original context gives
\begin{align*}
\Gamma,x:A,\Theta_0,y:B,\Theta_1 \vdash y:B.
\end{align*}
By the context-substitution part of the simultaneous induction, the substituted context
\begin{align*}
\Gamma,\Theta_0[a/x],y:B[a/x],\Theta_1[a/x]
\end{align*}
is well formed. Applying the variable rule in this context gives
\begin{align*}
\Gamma,\Theta_0[a/x],y:B[a/x],\Theta_1[a/x]\vdash y:B[a/x].
\end{align*}
This is precisely the substituted judgment.[/step]