Solution (source code)

= Solution

Write $S_L=\sum_{i=1}^LA_i$ and $Z_L=S_L/L$. The <cumulant-generating function> of one <normal random variable> is
$$
\kappa(\theta)=\log\mathbb E e^{\theta A_1}=\mu\theta+\frac{\sigma^2\theta^2}{2},\qquad \theta\in\mathbb R.
$$
<Cramér's theorem> states that empirical means of <independent and identically distributed random variables> whose <moment-generating function> is finite on a neighborhood of zero satisfy a <large deviation principle> at the sample-size <large-deviation speed>, with <good rate function> equal to the <Legendre-Fenchel transform> of their <cumulant-generating function>. Here that gives
$$
I(x)=\sup_{\theta\in\mathbb R}\left\{\theta(x-\mu)-\frac{\sigma^2\theta^2}{2}\right\}.
$$
For $\sigma^2>0$, differentiation gives the maximizing parameter $\theta=(x-\mu)/\sigma^2$, and hence
$$
\boxed{I(x)=\frac{(x-\mu)^2}{2\sigma^2}.}
$$
This <rate function> tends to infinity as $|x|\to\infty$, so its finite <sublevel sets> are <compact>. Equivalently, the <Gärtner–Ellis theorem> applies because the limiting scaled <cumulant-generating function> is finite and differentiable everywhere; it is <lower semicontinuous> and <essentially smooth>, with no finite domain boundary at which to check steepness. If $\sigma^2=0$ is permitted, $Z_L=\mu$ deterministically and the <rate function> is zero at $\mu$ and infinity elsewhere.