Almost from the first time people started writing about mathematics, they were writing about it in an abstract way. The Egyptians and the Babylonians kept things relatively concrete and mostly stuck to word problems (although lists of pythagorean triples is evidence for very early "number theory"), but Greece, China and India were all working in abstractions relatively early.