Brains model patterns in signals, math could be described as the brain's language for expressing higher order manipulations on all those models with communicable symbols. So it's kind of both real and invented, because brains invent, and brains are also just real objects and any models they form came from somewhere.