When I prove a mathematical theorem using a paper and a pen (I dislike using pencils for this), I constantly rely on empirical data: I look back to facts that I have already established, and work from them. That's partly an a posteriori process of reasoning: I look at stuff on the page. Now for simpler theorems, and likewise for more complex ones if I were smarter, I can do it all in my head. When I do it all in my head, my memory and imagination replace the paper and pen. But why doesn't the use of memory to remember to recall that I've proved a lemma and the use of imagination to present myself with visual images of formulae an a posteriori process?
The memory case might be answered thus. I needn't remember anything about myself--say, having proved a lemma. In an idealized case of proving a theorem without relying on empirical data, instead of remembering having proved the lemma that p, maybe I would simply have acquired the belief that p when I proved it, and then relied on the fact that p--and not the empirical fact that I believe that p--later in the proof. That might work. And perhaps the use of imagination is merely heuristic.
But now notice a somewhat interesting thing: gaining a piece of a priori knowledge and a piece of a posteriori knowledge can be internally exactly similar. In both cases, I might come to believe that q on the basis of the fact that p and logic. In both cases, I need only have the knowledge that p--I need not have any beliefs about how I acquired the knowledge that p, for instance. If I did need to have such beliefs for knowledge, then there would no such thing as a priori knowledge, since beliefs about how I acquired a piece of knowledge are empirical. And in fact there needn't have even been any differences in my own life. Imagine that my knowledge that p was innate--we evolved to have that piece of knowledge. Then whether my knowledge that q, and that p for that matter, is a priori seems to depend on the precise evolutionary forces that shaped my ancestors, not on anything in my life.