The term number is not defined mathematically, but is a common language generic term for various mathematical concepts. Therefore, in the mathematical sense, there is no set of all numbers or the like. When mathematics deals with numbers, it always talks about certain well-defined number ranges, i.e. only about certain objects of our thinking with fixed properties, all of which are casually referred to as numbers. Since the end of the 19th century, numbers have been defined in mathematics purely by means of logic, independently of ideas of space and time. The foundations for this were laid by Richard Dedekind and Giuseppe Peano with their axiomatization of the natural numbers (see Peano axioms). Dedekind writes about this new approach:
"What is provable should not be believed in science without proof. As plausible as this demand may seem, it is still, as I believe, by no means to be regarded as fulfilled even in the justification of the simplest science, namely that part of logic which deals with the doctrine of numbers, even according to the most recent representations. [...] Numbers are free creations of the human mind; they serve as a means of comprehending the diversity of things more easily and more sharply. Through the purely logical structure of the science of numbers and through the constant realm of numbers obtained in it, we are only put in a position to examine our ideas of space and time precisely by relating them to this realm of numbers created in our spirit."
- Richard Dedekind: What are and what are the numbers for? Preface to the first edition.
Axiomatic definitions are to be distinguished from set-theoretic definitions of numbers: In the former case, the existence of certain objects with links defined on them with certain properties is postulated in the form of axioms, as for instance also in the early axiomatizations of the natural and the real numbers by Peano and Dedekind. Following the development of set theory by Georg Cantor, one proceeded to try to restrict oneself to set-theoretic axioms, as is common in mathematics today, for example, with the Zermelo-Fraenkel set theory (ZFC). The existence of certain sets of numbers and relations over them with certain properties is then inferred from these axioms. Sometimes a number range is defined as a certain class. Axiomatic set theory attempts to be a single, unified formal foundation for all of mathematics. Within it, number domains can be dealt with in rich ways. As a rule, it is formulated in first-level predicate logic, which determines the structure of mathematical propositions as well as the possibilities of inference from axioms.
An elementary example of a set-theoretic definition of a set of numbers is the definition of the natural numbers introduced by John von Neumann as the smallest inductive set, whose existence is postulated by the infinity axiom in the context of Zermelo-Fraenkel set theory.
As set-theoretic concepts, ordinal and cardinal numbers are usually defined in set-theoretic terms, as is the generalization of surreal numbers.
The Peano axioms, for example, and the definition of the real numbers going back to Dedekind are, in contrast to ZFC, based on second-level predicate logic. While first-stage predicate logic provides a clear, generally accepted answer as to how valid inferences are to be made, whereby these can be systematically computed, attempts to clarify this for second-stage predicate logic usually lead to the need to introduce a complex metatheory, which in turn introduces set-theoretic notions meta-linguistically, and on the details of which depend the possibilities of inference in second-stage predicate logic that are subsequently opened up. ZFC is a candidate for such a theory. These limitations make second-level predicate logic seem unsuitable to be used at a fundamental level in part of the philosophy of mathematics. First-level predicate logic, on the other hand, is insufficient to formulate and (when considering these in a set-theoretic metatheory, say, due to Löwenheim-Skolem's theorem, countability) ensure certain important intuitive properties of the natural numbers.