Mathematics discovered, invented, and inherited