Proof of the gradient conjecture of R. Thom