  In 1837, Dirichlet proved that there are infinitely many primes in any
arithmetic progression in which the terms do not all share a common factor.
Modern presentations of the proof are explicitly higher-order, in that they
involve quantifying over and summing over Dirichlet characters, which are
certain types of functions. The notion of a character is only implicit in
Dirichlet's original proof, and the subsequent history shows a very gradual
transition to the modern mode of presentation.
  In this essay, we describe an approach to the philosophy of mathematics in
which it is an important task to understand the roles of our ontological posits
and assess the extent to which they enable us to achieve our mathematical
goals. We use the history of Dirichlet's theorem to understand some of the
reasons that functions are treated as ordinary objects in contemporary
mathematics, as well as some of the reasons one might want to resist such
treatment. We also use these considerations to illuminate the formal treatment
of functions and objects in Frege's logical foundation, and we argue that his
philosophical and logical decisions were influenced by many of the same
factors.
