  We prove pathwise large deviation principles of slow variables in slow-fast
systems in the limit of time-scale separation tending to infinity. In the limit
regime we consider, the convergence of the slow variable to its deterministic
limit and the convergence of the fast variable to equilibrium are competing at
the same scale. The large deviation principle is proven by relating the large
deviation problem to solutions of Hamilton-Jacobi-Bellman equations, for which
well-posedness was established in the companion paper [arXiv:1912.06579].
  We cast the rate functions in action-integral form and interpret the
Lagrangians in two ways. First, in terms of a double-optimization problem of
the slow variable's velocity and the fast variable's distribution, similar in
spirit to what one obtains from the contraction principle. Second, in terms of
a principal-eigenvalue problem associated to the slow-fast system. The first
representation proves in particular useful in the derivation of averaging
principles from the large deviations principles.
  As main example of our general results, we consider empirical measure-flux
pairs coupled to a fast diffusion on a compact manifold. We prove large
deviations and use the Lagrangian in double-optimization form to demonstrate
the validity of the averaging principle in this system.
