At UBC (University of British Columbia), I learned that math is typically invented first in the abstract. A mathematician makes up a few rules then explores what happens in a make-believe world where those rules are true. A hundred years later, somebody discovers something in the physical world that is following those rules (e.g. rotations of crystals), and poof there is a complete set of math (group theory) ready to go.
Newton was a brilliant exception. He had to invent calculus to check out his F=ma and gravity theories. I think actually Leibniz beat him to it by a bit, but word did not get around that fast back then.~ Roedy (1948-02-04 age:70)