That is a great question. According to dialectical monism, the universe is teleological; the universe is evolving to seek a desired end point. Considering this, mathematics is the only way to handle ordering reality so there is a dialectical evolution of mathematics. Mathematics, in terms of its ontological existence, is constantly evolving to higher and higher states. So, if we go back in time far enough, the universe was in a state of pure potential which seeks to become pure actualization with mathematics governing that process.
This is a relevant excerpt from the Mike Hockney Book “The God Factory”. “If you want to comprehend reality you must realize that mathematics doesn’t reflect reality; mathematics IS reality. Ontology, the study of existence, is ultimately the understanding that mathematics alone determines everything that can and cannot exist. Anything incompatible with mathematics is impossible.”
Hockney, Mike (2011-08-19). The God Factory (The God Series) (Kindle Locations 100-102). Hyperreality Books. Kindle Edition.
This full text can be read free on scribd.