The empirical sciences, like physics and chemistry, are partially invented and partially discovered. Although the empirical observations are surely discovered, the models that describe them are invented through human ingenuity. But what about mathematics which is based on pure thought? Are its results invented or discovered?
Not surprisingly there are different views on this topic. Some people maintain that mathematical results are invented, others claim that they are discovered. Is there a universe of mathematical results just waiting to be discovered or are mathematical results invented by the mathematician and would disappear, like a fairy tale, when mathematicians vanish in the heat death of universe when all the available energy is used up? Invented or discovered? Perhaps some results are invented and others discovered. There is, however, a third view, namely that mathematics is game played by manipulating symbols according to well defined rules. At some level this is probably true. All those who prefer Monopoly,® put up your hands!
What are the foundations of logic? Bertrand Russell (1872 – 1970) and Alfred Whitehead (1861 – 1947) tried to derive mathematics from logic. The result was the book: Principia Mathematica (1910), a real tour de force. Their derivation still required axioms or assumptions beyond pure logic and it has been questioned on other grounds. An alternate to this approach is set theory, in particular based on the Zermelo–Fraenkel axioms, with the axiom of choice. And an alternate to that is category theory. Whatever all that is. It is certainly very technical. The quest for foundations of mathematics and even logic, like the quest for the Holy Grail, is probably never ending. But the question remains: Was logic and set (category) theory, themselves, invented or discovered?
Let us look at things more simply. Historically, mathematics probably arose empirically: two stones plus two stones equals one stone plus three stones. Then it was realized that this holds for any tokens, stones, bushels of wheat or sheep. The generalization from specific examples to the generic 2+2=1+3 could be considered an early example of the scientific method: generalizing from specific examples to a general rule. But one plus one does not always equal two. Consider a litre of liquid plus a litre of liquid. If one is water and the other alcohol, the result is less than two litres if they are put in the same container. Adding one litre of water to one litre of concentrated sulfuric acid is even more interesting.
Multiplication is also easy to demonstrate with counters. Division is a bit more problematic but if we think of dividing a bushel of wheat into equal parts the idea of fractions is quite natural. Dividing a sheep is messier. Subtraction however leads to a problem: negative numbers. Naively, we cannot have fewer than zero stones but subtraction can lead to that idea. So were negative numbers invented or discovered? We can finesse the problem of negative numbers by saying that negative numbers correspond to what we owe. If I have minus three stones it means I owe someone three stones.
Thus thinking of stones and bushels of wheat, we can understand the rational numbers, numbers written as the ratio of two whole numbers. The Pythagoreans in ancient Greece would have claimed that is all there is. Then can the thorny problem of the square root of two? This arises in connection with the Patagonian theorem. Some poor sod showed that the square root of two could not be written as the ratio of two whole numbers and was thus irrational. He was thrown into the sea for his efforts. The square root of two does not exist in the universe of numbers discovered using stones, sheep, and bushels of wheat. Is it possible to have square root of two stones? Was it invented to make the Patagonian theorem work or was it discovered?
The example of the square root of minus one is even more perplexing. We can think of the square root of two as an extra number inserted between 1.414 and 1.415. But there is no place to insert the square root of minus one. So again the question arises: Was it invented or discovered? Perhaps it is best to say it was assumed: Assume the square root of minus one can be treated like a normal number and see what happens. A lot of good things as it turned out but does that mean it exists in any real sense. Perhaps it is just a useful fiction.
Nevertheless, mathematics has developed, discovering or inventing new results. As a phenomenologist, I would say we do not have enough information to assert if mathematics was invented or discovered. If we could contact extra-terrestrial mathematicians, it would be interesting to see if their mathematics was different or the same as ours. If it was different, that would be a strong indication that mathematics is invented. Or less black and white, the difference between terrestrial and extra-terrestrial mathematics would tell us the extent to which mathematics is discovered or invented.
In any event mathematics is a very interesting game, whether based on set theory or category theory, whether discovered or invented, and certainly more profitable than Monopoly® in the long run.
 Do not try this at home.
 At least that is the legend.
 √(-1)+√(-1) = 2 √(-1) , etc.
 On the other hand, oligarchy, as any large multinationals will tell you, is very profitable.