Discovery is different from invention, because discovery is something that's naturally existing but unknown, then was later found out as a result of man's research.
But invention is something that's non existence before but actually created and carved out by the genuiuity of man.
In other words mathematics was invented by man, one of earliest mathematicians was abacus he invented the first sophisticated counting and calculating algorithm.
People like Pythagoras too invented the relationship between the length of a triangle.
In other words these are all invented so mathematics is invented not discovered