The question is posed
here. I vote for "discovered"; certainly, no one has
invented particular mathematical laws and theorems just as no one has invented laws of physics, economics, or biology. These are phenomena that are independent of the human mind and require human cogitation to be revealed and explained to human beings. Fermat didn't invent his famous Last Theorem. He discovered it, couldn't write down the proof and left it for future generations to discover it. Mathematicians ought to be applauded for having done the necessary detective work to figure out the theorem. No one made stuff up to either pose the question the theorem answered or to spell out the answer itself.