An introduction to mathematical cosmology