Solution (source code)

= Solution

The <contraction principle for large deviations> states that if <random elements> $X^L$ in a space $E$ satisfy a <large deviation principle> with speed $a_L\to\infty$ and <good rate function> $I$, and $f:E\to F$ is <continuous>, then $f(X^L)$ satisfies a <large deviation principle> at the same speed with
$$
\boxed{J(y)=\inf\{I(x):f(x)=y\},\qquad \inf\varnothing=+\infty.}
$$
For example, take $E,F$ to be <Polish spaces>. The <rate function> $J$ is good: its finite <sublevel sets> are the <continuous> images $f(\{I\leq r\})$ of compact sublevel sets. Compactness and <lower semicontinuity> ensure that a finite fibre infimum relevant to such a sublevel set is attained. The probability bounds follow by taking preimages of open and closed sets.