Solution (source code)

= Solution

Fix a finite $r\geq0$ and choose $M>r$. By <exponential tightness>, choose a <compact set> $K_M$ with outside probability having upper exponential rate strictly below $-M$. A <compact set> in a <Hausdorff space> is closed, so its complement is an <open set>. The lower bound of the <weak large deviation principle> gives
$$
-\inf_{x\notin K_M}I(x)
\leq\liminf_L\frac1L\log\mathbb P(X_L\notin K_M)
\leq\limsup_L\frac1L\log\mathbb P(X_L\notin K_M)<-M.
$$
Consequently $\inf_{K_M^c}I>M$, and $\{I\leq r\}\subset K_M$. <Lower semicontinuity> makes this <sublevel set> closed in $E$, hence a closed subset of a <compact set>. Thus it is <compact>. \b[Every finite sublevel set is compact, so $I$ is a good rate function.]