  We consider the non linear wave equation (NLW) on the d-dimensional torus
with a smooth nonlinearity of order at least two at the origin. We prove that,
for almost any mass, small and smooth solutions of high Sobolev indices are
stable up to arbitrary long times with respect to the size of the initial
data.To prove this result we use a normal form transformation decomposing the
dynamics into low and high frequencies with weak interactions. While the low
part of the dynamics can be put under classical Birkhoff normal form, the high
modes evolve according to a time dependent linear Hamiltonian system. We then
control the global dynamics by using polynomial growth estimates for high modes
and the preservation of Sobolev norms for the low modes. Our general strategy
applies to any semi-linear Hamiltonian PDEs whose linear frequencies satisfy a
very general non resonance condition.The (NLW) equation on a torus is a good
example since the standard Birkhoff normal form applies only when d=1 while our
strategy applies in any dimension.
