I investigate the relationship between physics and mathematics. I argue that physics can shed light on the proper foundations of mathematics, and that the nature of number can constrain the nature of physical reality. I show that requiring the joint mathematical consistency of the Standard Model of particle physics and the DeWitt–Feynman–Weinberg theory of quantum gravity can resolve the horizon, flatness and isotropy problems of cosmology. Joint mathematical consistency naturally yields a scale-free, Gaussian, adiabatic perturbation spectrum, and more matter than antimatter. I show that consistency requires the universe to begin at an initial singularity with a pure SU(2)L gauge field. I show that quantum mechanics requires this field to have a Planckian spectrum whatever its temperature. If this field has managed to survive thermalization to the present day, then it would be the cosmic microwave background radiation (CMBR). If so, then we would have a natural explanation for the dark matter and the dark energy. I show that isotropic ultrahigh energy cosmic rays are explained if the CMBR is a pure SU(2)L gauge field. The SU(2)L nature of the CMBR may have been seen in the Sunyaev–Zel'dovich effect. I propose several simple experiments to test the hypothesis.