There are 2 main views about the relationship between mathematics and reality. One view states that we *can* know mathematical truths without any prior experience from reality. The other view states that we *cannot* know mathematical truths unless we have prior experience with reality.
I will argue in favor of the second view. Proponents of the first view might advance an argument like this: “What “prior experience” goes into my knowledge that every natural number is the sum of four squares or the knowledge that every natural number can be uniquely factored into primes?”

Here is my response:

Math is ultimately dependent on direct experience with reality because (1) math is dependent on numbers, (2) numbers are concepts, and (3) concepts are ultimately dependent on perceiving reality.

Reality causes our sensations. A perception is a group of sensations automatically retained and integrated by the brain of a living organism. We simply perceive too many objects to remember every individual thing. We mitigate this problem through conceptualizing our perceptions. A concept is cognitive unit of meaning—a symbol that refers to objects in reality. Humans can form concepts because we can recognize similarities and differences among objects in reality. We summarize these similarities or differences through a process of abstraction.

Example: Green is a concept. Green does not exist by itself just floating somewhere in reality. There is no “greenness” that one can point to. But we can see a green mango, a green car, and a green turtle. These each have the property green. Green does not exist apart from green objects, but we can abstract the concept of green and talk about the concept of green independently of objects.

Numbers are the same way. There is no number 5 running naked in the wild. We derive the the concept of 5 by observing 5 fingers, or 5 mangos, or 5 turtles. From these experiences we can create the concept of “5 units”. We also observe that 2 units + 3 units = 5 units. Once we understand the number-concepts and how they integrate together, we can reapply mathematical concepts and rules back on the concepts themselves. Through this process we can gain knowledge without having further experiences. As Wittgenstein said, “From the given, I can construct what is not given.”

The “prior experiences” that lead to the knowledge that every natural number is the sum of four squares is not some experience about natural numbers and squares running around in the wild. The prior experiences were the perceptions in one's youth that led to the creation of concepts of numbers. The prior experiences also include hearing your teachers tell you how to integrate these number-concepts correctly.

This process of integrating concepts concepts directly is simply called reason. Reason is the ability to integrate concepts as derived from the senses. Our sensations are sensations about reality. Therefore, claiming that mathematics is an exercise in pure reason already presupposes necessary experience with reality.