We prove the Almost Sure Invariance Principle (ASIP) with close to optimal
error rates for nonuniformly hyperbolic maps. We do not assume exponential
contraction along stable leaves, therefore our result covers in particular
slowly mixing invertible dynamical systems as Bunimovich flowers, billiards
with flat points as in Chernov and Zhang (2005) and Wojtkowski' (1990) system
of two falling balls. For these examples, the ASIP is a new result, not covered
by prior works for various reasons, notably because in absence of exponential
contraction along stable leaves, it is challenging to employ the so-called
Sinai's trick (Sinai 1972, Bowen 1975) of reducing a nonuniformly hyperbolic
system to a nonuniformly expanding one. Our strategy follows our previous
papers on the ASIP for nonuniformly expanding maps, where we build a
semiconjugacy to a specific renewal Markov shift and adapt the argument of
Berkes, Liu and Wu (2014). The main difference is that now the Markov shift is
two-sided, the observables depend on the full trajectory, both the future and
the past