An elementary proof of the Cheeger-Gromoll splitting theorem