The above question has been a long-standing source of debate. ‘Discovered’ means that the structures of mathematics exist objectively and independently while ‘invented’ implies that mathematics is the free creation of the human mind. The same debate exists in science.
An article profiles a mathematician Sergiu Klainerman who is convinced that it is discovered.
The equations that govern black holes were true before there were black holes. That claim is hotly contested, and cuts through one of the deepest fault lines in the philosophy of mathematics. On one side are those who hold that mathematical structures, including well-established principles and basic geometric shapes like the tetrahedron, exist independently of human thought – not as a language we invented to describe reality, but rather as the substrate of reality itself. On the other side of the debate are those who argue that mathematics is the product of human labours, imposed on a world that would be wholly indifferent to it were we not here.

