Solution (source code)

= Solution

Use the primitive $U(c)=c^{1-R}/(1-R)$, as in Question 3, and the usual positive <spot volatility> convention $\sigma>0$. An additive <utility function> constant shifts both agents' <value functions> equally and does not affect their policies or the comparison. Set
$$
h(x)=a\tanh(ax),\qquad b(x)=\mu-r+\sigma h(x).
$$
The <Itô formula> applied to the <stock> price and the <binary Brownian drift filter> gives
$$
\frac{dS_t}{S_t}=\sigma d\widehat W_t+[\mu+\sigma h(X_t)]dt.
$$
Let $\theta_t$ denote the dollar <stock> holding. The separated state equations are
$$
dw_t=[rw_t+\theta_tb(X_t)-c_t]dt+\sigma\theta_t\,d\widehat W_t,
\qquad
dX_t=h(X_t)dt+d\widehat W_t.
$$
Both states use the same observed <Brownian motion>. In particular, their <quadratic covariation> is $d[w,X]_t=\sigma\theta_tdt$.

Let $J(w,x)$ be the Bayesian <value function>. Its <Hamilton-Jacobi-Bellman equation> is
$$
\rho J=\sup_{c>0,\,\theta}\left\{\frac{c^{1-R}}{1-R}+(rw+\theta b(x)-c)J_w+h(x)J_x
+\frac12J_{xx}+\frac12\sigma^2\theta^2J_{ww}+\sigma\theta J_{wx}\right\}.
$$
The cross derivative is necessary: learning and <portfolio wealth> are correlated through the same observation shock. At a smooth, finite, strictly <concave> value, the optimal <consumption> and <stock> holding are
$$
\boxed{c^*=(J_w)^{-1/R},\qquad
\theta^*=-\frac{b(x)J_w+\sigma J_{wx}}{\sigma^2J_{ww}}.}
$$
The number of shares is $\theta^*/S$, and the wealth fraction is $\theta^*/w$.

More explicitly, <homogeneity> gives $J(w,x)=K(x)w^p/p$, where $p=1-R$. Then
$$
\boxed{c^*=K(x)^{-1/R}w,\qquad
\pi^*(x)=\frac{b(x)+\sigma K'(x)/K(x)}{R\sigma^2}.}
$$
The additional term is the <learning hedge in a binary-drift investment model>, a form of <intertemporal hedging demand>. Merely putting the <Bayesian posterior> mean <drift> into a constant-coefficient investment formula would omit it. Eliminating the controls gives the coefficient equation
$$
\frac12K''+hK'+(pr-\rho)K+RK^{1-1/R}
+\frac{p(bK+\sigma K')^2}{2R\sigma^2K}=0.
$$
The economic solution is selected by admissibility and the infinite-horizon value condition, rather than by an arbitrary solution of this <ordinary differential equation>.

For the comparison, now suppose $0<R<1$ and $\mu>r$. Write $m=\mu-r>0$, $b_+=m+\sigma a$, and
$$
\gamma_+=\frac{\rho-(1-R)\left(r+\frac{b_+^2}{2R\sigma^2}\right)}{R}.
$$
When $\gamma_+>0$, the informed agent's <Merton consumption-investment problem> has value
$$
V_+(w)=\frac{\gamma_+^{-R}w^{1-R}}{1-R},
\qquad
\pi_+=\frac{b_+}{R\sigma^2},\qquad c_+=\gamma_+w.
$$
These are the policies available to an agent who knows the true <drift> is $+a$.

For any admissible Bayesian policy, not only its optimum, define
$$
Y_t=\int_0^t e^{-\rho s}U(c_s)ds+e^{-\rho t}V_+(w_t).
$$
The integration variable is $s$ throughout the accumulated <utility function>. Applying the <Itô formula> in the Bayesian observation <filtration> gives
$$
dY_t=e^{-\rho t}H_{b(X_t)}(w_t,c_t,\theta_t)dt
+e^{-\rho t}\sigma\theta_tV_+'(w_t)d\widehat W_t,
$$
where
$$
H_b(w,c,\theta)=U(c)-\rho V_+(w)+(rw+\theta b-c)V_+'(w)
+\frac12\sigma^2\theta^2V_+''(w).
$$
The informed-agent <Hamilton-Jacobi-Bellman equation> says $\sup_{c,\theta}H_{b_+}=0$. Maximizing the <stock> term at any excess <drift> $b$ gives
$$
\sup_\theta\left\{\theta bV_+'+\frac12\sigma^2\theta^2V_+''\right\}
=-\frac{b^2(V_+')^2}{2\sigma^2V_+''}.
$$
Since $V_+''<0$, this maximum increases with $b^2$. The <binary Brownian drift filter> satisfies $|h(x)|\leq a$, and therefore
$$
|b(x)|=|m+\sigma h(x)|\leq m+\sigma a=b_+.
$$
It follows that $H_{b(x)}(w,c,\theta)\leq\sup_{c,\theta}H_{b(x)}\leq\sup_{c,\theta}H_{b_+}=0$. Thus $Y$ is a <local supermartingale>. Because $0<R<1$, both accumulated <utility function> and $V_+$ are nonnegative. A nonnegative <local supermartingale> is a genuine <supermartingale>, by localization and the conditional <Fatou lemma>. This proves the requested assertion under the Bayesian probability law, without conditioning that law on the favorable <drift>.

Consequently
$$
E\int_0^t e^{-\rho s}U(c_s)ds\leq E[Y_t]\leq Y_0=V_+(w_0).
$$
The <monotone convergence theorem> lets $t$ tend to infinity. Taking the supremum over Bayesian policies proves the <maximal squared Sharpe ratio value bound>
$$
\boxed{J(w,x)\leq V_+(w).}
$$
In particular this holds at the equal-prior state $x=0$. No vanishing-terminal-value assumption is needed for this upper bound, because the terminal term is nonnegative and can simply be dropped.

The finite-value assumption $\gamma_+>0$ is missing from the printed comparison. Without it, $V_+=+\infty$ and the value inequality is trivial, but $Y$ is not a finite <supermartingale>. For a concrete allowed example, take $r=0$, $\mu=1$, $\sigma=a=1$, $R=1/2$ and $\rho=1$. Then $b_+=2$ and $\gamma_+=-2$. For the informed agent, the constant <stock> fraction $\pi=4$ and <consumption> $c=w/2$ give
$$
E[e^{-t}U(c_t)]=\sqrt2\,w_0^{1/2}e^{3t/4}.
$$
The time integral diverges, so his value is infinite. This is why the nontrivial finite-supermartingale proof above needs the stated qualification.