On his way to inventing modern predicate logic, modern philosophy of language, and modern philosophy of math, Gottlob Frege made an ingenious move defining each and every (finite) cardinal number and proving that there are infinity of them. The original elegant trick is in The Foundations of Arithmetic from 1884; I’ll do a far more rough explanation here.

Consider an impossible condition: x != x. That’s a violation of the Law of Identity, and it is never true; there is no x for which x is not x (in plain English, there does not exist anything that is not equal to itself).

Now consider the concept of all x's for which x != x. This concept applies to nothing. It has an empty extension. (For the sake of clear exposition, we can give this concept a name — let’s call it c-nil.)

We can now go ahead and associate 0 with that concept. And that’s the brilliant move. Once we have “0”, the rest of the finite numbers can be easily derived.

Consider the concept of all x's for which x is c-nil. Let “1” be defined as this concept. (For ease, we’ll name this concept c-one.) There is only one such thing: the concept we just defined as “0”. As Frege wrote: “1 is the number which belongs to the concept ‘identical with 0’”.

You may be thinking successor function, especially if you’re a programmer, and that’s just about right. Consider the concept of all x's for which x is c-nil or c-one. Let that be defined as “2”. We can continue: for “3” we’ll have c-nil or c-one or c-two, and so on, forever.

Frege’s incisive and precise clarity of thought here and elsewhere was far beyond his contemporaries. I could go on and on about a thousand other contributions, but consider just this. When dealing more closely with the metaphysics of numbers, Frege was sharply against the ancient view that a number stood for “a number of things” (that is, to speak of the number “4” was to speak of, roughly, “There are 4 ‘somethings’ here”).

Frege was also against contemporary “psychological views” of numbers (that a number should be associated with some sort of mental picture of that number). Frege offered absolutely devastating arguments against both views in the The Foundations of Arithmetic (read the book). In the wake of Frege’s arguments, and the work by those that came soon after, these views essentially disappeared from mainstream analytic philosophical thought for most of the 20th century.

Thanks for Mark Eli Kalderon for some clarifying notes.