Is mathematics invented or discovered

One esteemed poster wrote in 2011:

So I say math was discovered and endorse this view…

…but I confess I struggle with the idea of non-material things existing outside of somebody’s mind. A good starting point for myself might involve a taxonomy of stuff that exists, eg., things made of matter, ideas of one person, shared ideas, viral ideas. Then work in math (various types?) and logic.