Mathematics is often taken as a kind of path to true. But its methods are not as simple as is popularly made out.
Although mathematical systems are often described axiomatically, this is not how these systems are born. Its often their final form, or rather the form that they are expressed in to bring out their most important properties and to make it look as though they are almost inevitable. Though this is as much psychological for a certain kind of mind.
An example is calculus: Archimedes investigated integration synthetically but could not put it on a formal axiomatic system ala euclid. Its development stalled until Newton/Leibniz utilised the coordinitisation of geometry to begin to fully realise its capability. It was of course noticed that these 'fluzions' were not fully rigorous, and Berkelys criticism of 'ghosts of departed quantities' stung. It wasn't until Cauchy developed the idea of a limit that the foundations of calculus began to be put on a rigourous basis. Now there are a plethora of different axiomatics for the calculus: Synthetic Differential Geometry, Nonstandard Analysis, Diffeological Spaces. Which one of these is the one true & correct axiomatic framework?
Similarly with the more well-known story for Euclidean geometry. The fabric of space-time is much better modelled by Lorentzian geometry.
One could argue, that the axioms are derived empirically, by understanding what important questions can be cast into this kind of language, but surely logic remains a priori.
Again, this is not so simple. We have classical logic from the time of Aristotle which affirmed the law of the excluded middle, (but he noted that this didn't hold for future events), this was eventually formalised as boolean logic, but Brouwer advocated intuitionistic logic that doesn't (his supervisor advised him to establish his reputation in some traditional area before advocating such startling views). People are now researching logics where the law of non-contradiction doesn't hold, where time and modality is taken into account, and so on.
The nature of mathematical truth is not simple. Nor has it shown to be always true. There is a great deal of truth to what social constructivists maintain, that mathematical truth is socially constructed, but that doesn't mean to say that it is solely that, and that it doe not have some sophisticated relation to reality too.
This is what Felix Klein had to say (he was a mathematician famous for
formulating the Erlangen program amongst others):
Quite often you may hear non-mathematicians, especially philosophers, say that mathematics need only draw conclusions from clearly given premisses and that it is irrelevant whether those premisses are true or false – provided they don’t contradict themselves. Anybody who works productively in mathematics, however, will talk in a completely different manner. In fact, those people base their judgements on the crystallized form in which mathematical theories are presented once they’ve been worked out. The research scientist, like any other scientist, does not work in a strictly deductive way but essentially makes use of his imagination and moves forward inductively with the help of heuristic aids.