Where did the math come from?
If I understand your question (and it depends a lot on the word “the” in there) I’m not sure it makes sense.
Math is a methodology human beings to model reality. It came from our brains. I wouldn’t call it a separate creation, per-se, any more than language. It’s a natural result of us being able to think logically and coming up with a logical modeling tool to help us do things.