system
Given the following post, respond as if you're commenting on Reddit:
human
Why does kant insist that math are a priori? Why can't math be both necessary and a posteriori?

It seems that philosophers who dont agree with Kant on the  a priori nature of math, either hold that mathematics are just the working out of definitions, or (like Mill) that they are inductive generalisations and thus uncertain. Why is it wrong to hold like Locke, that arithmetic at the very least is a generalisation of experience and that we acquire the concept of numbers by counting off the objects that are around us and abstracting them in our head. If you have counted four objects you're in a position to concusively say that 2+2=4 simply by bringing the image of two and two objects together in your mind. There is nothing to porhibit you from just repeatig and repeating these images to get bigger numbers.

I haven't seen this being adressed anywhere so i feel like i am missing something, from the way I see it its perefectly reasonable to suppose that math at the same time come from experience and are necessary.
gpt
>Why is it wrong to hold like Locke, that arithmetic at the very least is a generalisation of experience and that we acquire the concept of numbers by counting off the objects that are around us and abstracting them in our head

The kantian notion of the a priori *strictly* concerns the manner of justification of a proposition and *never* its origin. In other words, Kant's theory is perfectly compatible with a roughly Lockean theory of the *origin* of mathematical concepts. This conflation between a priori justification and the origins of our ideas was popular in early modern philosophy and led to a lot of confusions. 

The question is: can a theory of the origin of mathematical concepts provide a *justification* of, say, arithmetical propositions? This seems less obvious. After all, we don't justify propositions like 1+1=2 as we do in grade school where we put one cookie next to another cookie and then proclaim that we now have two cookies. The theorems of arithmetic involve *no reference whatsoever* to empirical objects. What I've sketched is roughly the Millean view but your own "Lockean" alternative seems to vaccilate between this and something that's closer to the Kantian view. 

Kant's claim is that mathematical propositions require a "construction in intuition", specifically an *a priori* intuition, as an empirical intuition would not be able to ground the generality of these propositions.