Consider a stochastic optimal problem, where $$\mathrm dx_t = b(t,x_t,u_t)\,\mathrm dt + \sigma (t,x_t,u_t)\,\mathrm dB_t, \qquad x_0=x,$$ with cost functional $$J(u) = E \left[ \int_0^T f(t,x_t,u_t)\,\mathrm dt + h(x_T) \right] .$$ Its Hamiltonian system is $$\begin{cases} \mathrm dx_t = b(t,x_t,u_t)\,\mathrm dt + \sigma (t,x_t,u_t)\,\mathrm dB_t, \qquad x_0=x,\\ \mathrm dy_t = -H_x(t,x_t,u_t,y_t,z_t)\,\mathrm dt + z_t\,\mathrm dB_t, \qquad y_T = -h_x(x_T). \end{cases} $$ where $$H(t,x,u,y,z) = yb(t,x,u)+z\sigma(t,x,u) - f(t,x,u).$$ Given optimal control $(x^*,u^*)$, there exists a solution$ (x_t^*,u_t^*,y_t^*,z_t^*) $.
Define $\bar{H}$ as $$\bar{H}(t,x,y,z) = \max_{u} \{ yb(t,x,u)+z\sigma(t,x,u) - f(t,x,u) \}.$$ Thus, $(x^*_t,y^*_t,z^*_t)$ is the solution of Hamiltonian system $$\begin{cases} \mathrm dx_t = \bar{H}_y(t,x_t,y_t,z_t)\,\mathrm dt + \bar{H}_z (t,x_t,y_t,z_t)\,\mathrm dB_t, \qquad x_0=x,\\ \mathrm dy_t = -\bar{H}_x(t,x_t,y_t,z_t)\,\mathrm dt + z_t\,\mathrm dB_t, \qquad y_T = -h_x(x_T), \end{cases} $$ Is it right? Is there any reference or papers?