Solution (source code)

= Solution

Fix the maturity horizon. Since $YB$ is a nonnegative <local martingale> and $r$ is bounded, $\mathbb EY_T<\infty$: $B_T\geq B_0e^{-\|r\|_\infty T}$ and $\mathbb E(Y_TB_T)\leq B_0$. The bounded nonnegative payoff thus makes $Y_T\xi_T$ integrable. Set
$$
N_t=\mathbb E[Y_T\xi_T\mid\mathcal F_t],\qquad X_t=\frac{N_t}{Y_t}.
$$
The <Brownian martingale representation theorem> yields $N_t=N_0+\int_0^t\zeta_s\,dW_s$, using its locally <square-integrable> version for an integrable terminal <random variable>. The <Itô formula> for $N/Y$ gives
$$
dX_t=\bigl(r_tX_t+\lambda_t(\zeta_t/Y_t+\lambda_tX_t)\bigr)dt+(\zeta_t/Y_t+\lambda_tX_t)\,dW_t.
$$
Choose the <replicating strategy>
$$
\boxed{\theta_t=\frac{\zeta_t/Y_t+\lambda_tX_t}{S_t\sigma_t},\qquad\eta_t=\frac{X_t-\theta_tS_t}{B_t}.}
$$
Its <self-financing portfolio> equation has exactly the displayed <drift> and diffusion, because $\mu-r=\sigma\lambda$. All coefficients are locally integrable after stopping; the holdings are <predictable> in the augmented <natural Brownian filtration>. This construction has $X_t\geq0$ and $X_T=\xi_T$, so it is an admissible <replicating strategy> under the question's nonnegative-wealth convention.

For any other nonnegative <self-financing portfolio> $\widehat X$ replicating the same payoff, part (b) implies $\widehat X_0\geq\mathbb E[Y_T\xi_T]$. The constructed strategy attains equality, since $Y_0=1$ and $N_0=\mathbb E[Y_T\xi_T]$ in the augmented <natural Brownian filtration>. Hence
$$
\boxed{\text{minimal initial cost}=\mathbb E[Y_T\xi_T].}
$$
This is <deflator-based claim replication>; it does not require upgrading the <local martingale deflator> to a true <martingale> density.