Solution (source code)

= Solution

The <contraction principle for large deviations> says that if $X^L$ has a <large deviation principle> in $E$ with <good rate function> $I$, and $f:E\to H$ is a <continuous map> between <Hausdorff spaces>, then $f(X^L)$ has the same <large-deviation speed> and <good rate function>
$$
J(y)=\inf_{f(x)=y}I(x).
$$
For an <open set> $G\subset H$, its inverse image is open, so the input lower bound gives
$$
\liminf_L a_L^{-1}\log\mathbb P(f(X^L)\in G)
\ge-\inf_{f^{-1}(G)}I=-\inf_GJ.
$$
For a <closed set> $F\subset H$, its inverse image is closed, giving the corresponding upper bound with $-\inf_FJ$.

It remains to prove goodness, including the endpoint issue in the infimum. Each fibre $f^{-1}(\{y\})$ is closed. If $J(y)<\infty$, compact <sublevel sets> and <lower semicontinuity> make $I$ attain its infimum on that fibre: intersect it with the compact set $\{I\le J(y)+1\}$ and use the closed nested sublevels tending down to $J(y)$. Hence for each finite $r$,
$$
\{y:J(y)\le r\}=f(\{x:I(x)\le r\}).
$$
The right-hand side is compact, being a continuous image of a <compact set>, and is closed because the target is <Hausdorff>. Thus $J$ is lower semicontinuous and good, completing the proof.