[guided]The lower-bound part of the proof used only that the actual control is one candidate in the infimum. For the feedback control, we assume something stronger: along the closed-loop trajectory, the chosen feedback value actually attains the infimum in the Hamiltonian.
Let $x^*: [t,T]\to \mathbb{R}^n$ be the solution of the closed-loop equation and let $u^*: [t,T]\to U$ be the induced control
\begin{align*}
u^*(s)=a^*(s,x^*(s)).
\end{align*}
The hypotheses state that $u^*\in\mathcal{A}[t,T]$ and that its cost $J_{t,x}[u^*]$ is finite, so this control is a legitimate competitor in the value problem.
When $t=T$, the equality follows immediately from the terminal condition:
\begin{align*}
W(T,x)=g(x)=J_{T,x}[u^*].
\end{align*}
Assume now that $t<T$. The Hamiltonian attainment hypothesis says that, for every $s\in[t,T)$, the value $u^*(s)$ realizes the same quantity as the infimum:
\begin{align*}
\ell(x^*(s),u^*(s))+\nabla_x W(s,x^*(s))\cdot f(x^*(s),u^*(s))=\inf_{a\in U}\{\ell(x^*(s),a)+\nabla_x W(s,x^*(s))\cdot f(x^*(s),a)\}.
\end{align*}
The HJB equation at the point $(s,x^*(s))$ is
\begin{align*}
\partial_t W(s,x^*(s))+\inf_{a\in U}\{\ell(x^*(s),a)+\nabla_x W(s,x^*(s))\cdot f(x^*(s),a)\}=0.
\end{align*}
Substituting the attained value of the infimum gives an equality, not merely an inequality:
\begin{align*}
\partial_t W(s,x^*(s))+\nabla_x W(s,x^*(s))\cdot f(x^*(s),u^*(s))+\ell(x^*(s),u^*(s))=0.
\end{align*}
Now define the real-valued function
\begin{align*}
q_*: [t,T]\to \mathbb{R}, \qquad q_*(s):=W(s,x^*(s)).
\end{align*}
The chain-rule hypothesis applies to the admissible control $u^*$ and the corresponding trajectory $x^*$, so
\begin{align*}
q_*'(s)=\partial_t W(s,x^*(s))+\nabla_x W(s,x^*(s))\cdot f(x^*(s),u^*(s)).
\end{align*}
Combining this identity with the preceding equality yields
\begin{align*}
q_*'(s)+\ell(x^*(s),u^*(s))=0.
\end{align*}
Integrating this equality over $[t,T]$ with respect to $\mathcal{L}^1$ gives
\begin{align*}
q_*(t)-q_*(T)=\int_{[t,T]}\ell(x^*(s),u^*(s))\,d\mathcal{L}^1(s).
\end{align*}
Finally, $q_*(t)=W(t,x)$ because $x^*(t)=x$, and $q_*(T)=W(T,x^*(T))=g(x^*(T))$ by the terminal condition. Therefore
\begin{align*}
W(t,x)=\int_{[t,T]}\ell(x^*(s),u^*(s))\,d\mathcal{L}^1(s)+g(x^*(T))=J_{t,x}[u^*].
\end{align*}
The feedback condition has converted the verification inequality into an exact identity along the closed-loop path.[/guided]