Solution (source code)

= Solution

The <product large-deviation principle> states that independent families satisfying <large deviation principles> at the same speed with <good rate functions> $J$ and $I$ have joint <good rate function> $J(b)+I(z)$. The <contraction principle for large deviations> states that a <continuous map> $f$ sends such a principle to one with <good rate function> $\inf_{f(u)=x}I(u)$. Apply these results to $(B/L,S_L/L)$ and addition. The resulting <infimal convolution> is
$$
K(x)=\inf_{b\geq0}\left\{\lambda b+\frac{(x-b-\mu)^2}{2\sigma^2}\right\}.
$$
For $\sigma^2>0$, the unconstrained stationary point is $b=x-\mu-\lambda\sigma^2$. <Convexity> gives the constrained minimum at $b_*=(x-\mu-\lambda\sigma^2)^+$, so
$$
\boxed{K(x)=\begin{cases}\dfrac{(x-\mu)^2}{2\sigma^2},&x\leq\mu+\lambda\sigma^2,\\\lambda(x-\mu)-\dfrac{\lambda^2\sigma^2}{2},&x\geq\mu+\lambda\sigma^2.\end{cases}}
$$
The two branches agree in value and first derivative at their junction. Both tails tend to infinity, giving a <good rate function>. This is the <fixed exponential perturbation of a Gaussian empirical mean>.

There is a reason to use the <product large-deviation principle> rather than invoke the supplied <Gärtner–Ellis theorem> without checking its hypotheses. The limiting scaled <cumulant-generating function> here is
$$
\Lambda(\theta)=\begin{cases}\mu\theta+\sigma^2\theta^2/2,&\theta<\lambda,\\+\infty,&\theta\geq\lambda.\end{cases}
$$
At $\lambda$ it is neither <lower semicontinuous> nor steep from the left: its left derivative tends to the finite value $\mu+\lambda\sigma^2$. Its <Legendre-Fenchel transform> still equals $K$, but the stated <Gärtner–Ellis theorem> does not establish the full lower bound on the linear branch. The <product large-deviation principle> and <contraction principle for large deviations> do establish it. In the degenerate case $\sigma^2=0$, the answer is $K(x)=\lambda(x-\mu)$ for $x\geq\mu$, and infinity otherwise.