# Hyperreal number

In mathematics, hyperreal numbers are an extension of the real numbers to include certain classes of infinite and infinitesimal numbers. A hyperreal number $x$ is said to be finite if, and only if, $|x|<n$ for some integer $n$. $x$ is said to be infinitesimal if, and only if, $|x|<1/n$ for all positive integers $n$. The term "hyper-real" was introduced by Edwin Hewitt in 1948.
The hyperreal numbers satisfy the transfer principle, a rigorous version of Leibniz's heuristic law of continuity. The transfer principle states that true first-order statements about R are also valid in *R. For example, the commutative law of addition, x + y = y + x, holds for the hyperreals just as it does for the reals; since R is a real closed field, so is *R. Since $\sin({\pi n})=0$ for all integers n, one also has $\sin({\pi H})=0$ for all hyperintegers $H$. The transfer principle for ultrapowers is a consequence of Łoś's theorem of 1955.
Concerns about the soundness of arguments involving infinitesimals date back to ancient Greek mathematics, with Archimedes replacing such proofs with ones using other techniques such as the method of exhaustion. In the 1960s, Abraham Robinson proved that the hyperreals were logically consistent if and only if the reals were. This put to rest the fear that any proof involving infinitesimals might be unsound, provided that they were manipulated according to the logical rules that Robinson delineated.
The application of hyperreal numbers and in particular the transfer principle to problems of analysis is called nonstandard analysis. One immediate application is the definition of the basic concepts of analysis such as the derivative and integral in a direct fashion, without passing via logical complications of multiple quantifiers. Thus, the derivative of f(x) becomes $f'(x)=\operatorname {st} \left({\frac {f(x+\Delta x)-f(x)}{\Delta x}}\right)$ for an infinitesimal $\Delta x$, where st(⋅) denotes the standard part function, which "rounds off" each finite hyperreal to the nearest real. Similarly, the integral is defined as the standard part of a suitable infinite sum.

## Transfer principle

The idea of the hyperreal system is to extend the real numbers R to form a system *R that includes infinitesimal and infinite numbers, but without changing any of the elementary axioms of algebra. Any statement of the form "for any number x ..." that is true for the reals is also true for the hyperreals. For example, the axiom that states "for any number x, x + 0 = x" still applies. The same is true for quantification over several numbers, e.g., "for any numbers x and y, xy = yx." This ability to carry over statements from the reals to the hyperreals is called the transfer principle. However, statements of the form "for any set of numbers S ..." may not carry over. The only properties that differ between the reals and the hyperreals are those that rely on quantification over sets, or other higher-level structures such as functions and relations, which are typically constructed out of sets. Each real set, function, and relation has its natural hyperreal extension, satisfying the same first-order properties. The kinds of logical sentences that obey this restriction on quantification are referred to as statements in first-order logic.
The transfer principle, however, does not mean that R and *R have identical behavior. For instance, in *R there exists an element ω such that
    $1<\omega ,\quad 1+1<\omega ,\quad 1+1+1<\omega ,\quad 1+1+1+1<\omega ,\ldots .$
but there is no such number in R. (In other words, *R is not Archimedean.) This is possible because the nonexistence of ω cannot be expressed as a first-order statement.

## Use in analysis

Informal notations for non-real quantities have historically appeared in calculus in two contexts: as infinitesimals, like dx, and as the symbol ∞, used, for example, in limits of integration of improper integrals.
As an example of the transfer principle, the statement that for any nonzero number x, 2x ≠ x, is true for the real numbers, and it is in the form required by the transfer principle, so it is also true for the hyperreal numbers. This shows that it is not possible to use a generic symbol such as ∞ for all the infinite quantities in the hyperreal system; infinite quantities differ in magnitude from other infinite quantities, and infinitesimals from other infinitesimals.
Similarly, the casual use of 1/0 = ∞ is invalid, since the transfer principle applies to the statement that zero has no multiplicative inverse. The rigorous counterpart of such a calculation would be that if ε is a non-zero infinitesimal, then 1/ε is infinite.
For any finite hyperreal number x, the standard part, st(x), is defined as the unique closest real number to x; it necessarily differs from x only infinitesimally. The standard part function can also be defined for infinite hyperreal numbers as follows: If x is a positive infinite hyperreal number, set st(x) to be the extended real number $+\infty$, and likewise, if x is a negative infinite hyperreal number, set st(x) to be $-\infty$ (the idea is that an infinite hyperreal number should be smaller than the "true" absolute infinity but closer to it than any real number is).

### Differentiation

One of the key uses of the hyperreal number system is to give a precise meaning to the differential operator d as used by Leibniz to define the derivative and the integral.
For any real-valued function $f,$ the differential $df$ is defined as a map which sends every ordered pair $(x,dx)$ (where $x$ is real and $dx$ is nonzero infinitesimal) to an infinitesimal
    $df(x,dx):=\operatorname {st} \left({\frac {f(x+dx)-f(x)}{dx}}\right)\ dx.$
Note that the very notation "$dx$" used to denote any infinitesimal is consistent with the above definition of the operator $d,$ for if one interprets $x$ (as is commonly done) to be the function $f(x)=x,$ then for every $(x,dx)$ the differential $d(x)$ will equal the infinitesimal $dx$.
A real-valued function $f$ is said to be differentiable at a point $x$ if the quotient
    ${\frac {df(x,dx)}{dx}}=\operatorname {st} \left({\frac {f(x+dx)-f(x)}{dx}}\right)$
is the same for all nonzero infinitesimals $dx.$ If so, this quotient is called the derivative of $f$ at $x$.
For example, to find the derivative of the function $f(x)=x^{2}$, let $dx$ be a non-zero infinitesimal. Then,
    ${\frac {df(x,dx)}{dx}}$ $=\operatorname {st} \left({\frac {f(x+dx)-f(x)}{dx}}\right)$ $=\operatorname {st} \left({\frac {x^{2}+2x\cdot dx+(dx)^{2}-x^{2}}{dx}}\right)$ $=\operatorname {st} \left({\frac {2x\cdot dx+(dx)^{2}}{dx}}\right)$ $=\operatorname {st} \left({\frac {2x\cdot dx}{dx}}+{\frac {(dx)^{2}}{dx}}\right)$ $=\operatorname {st} \left(2x+dx\right)$ $=2x$
The use of the standard part in the definition of the derivative is a rigorous alternative to the traditional practice of neglecting the square of an infinitesimal quantity. Dual numbers are a number system based on this idea. After the third line of the differentiation above, the typical method from Newton through the 19th century would have been simply to discard the dx$^2$ term. In the hyperreal system, dx$^2$ ≠ 0, since dx is nonzero, and the transfer principle can be applied to the statement that the square of any nonzero number is nonzero. However, the quantity dx$^2$ is infinitesimally small compared to dx; that is, the hyperreal system contains a hierarchy of infinitesimal quantities.
Using hyperreal numbers for differentiation allows for a more algebraically manipulable approach to derivatives. In standard differentiation, partial differentials and higher-order differentials are not independently manipulable through algebraic techniques. However, using the hyperreals, a system can be established for doing so, though resulting in a slightly different notation.

### Integration

Another key use of the hyperreal number system is to give a precise meaning to the integral sign ∫ used by Leibniz to define the definite integral.
For any infinitesimal function$\ \varepsilon (x),\$one may define the integral $\int (\varepsilon )\$as a map sending any ordered triple $(a,b,dx)$ (where$\ a\$and$\ b\$are real, and$\ dx\$is infinitesimal of the same sign as $\,b-a$) to the value
    $\int _{a}^{b}(\varepsilon ,dx):=\operatorname {st} \left(\sum _{n=0}^{N}\varepsilon (a+n\ dx)\right),$
where$\ N\$is any hyperinteger number satisfying$\ \operatorname {st} (N\ dx)=b-a.$
A real-valued function $f$ is then said to be integrable over a closed interval$\ [a,b]\$if for any nonzero infinitesimal$\ dx,\$the integral
    $\int _{a}^{b}(f\ dx,dx)$
is independent of the choice of$\ dx.$ If so, this integral is called the definite integral (or antiderivative) of $f$ on$\ [a,b].$
This shows that using hyperreal numbers, Leibniz's notation for the definite integral can actually be interpreted as a meaningful algebraic expression (just as the derivative can be interpreted as a meaningful quotient).

## Properties

The hyperreals *R form an ordered field containing the reals R as a subfield. Unlike the reals, the hyperreals do not form a standard metric space, but by virtue of their order they carry an order topology.
The use of the definite article the in the phrase the hyperreal numbers is somewhat misleading in that there is not a unique ordered field that is referred to in most treatments. However, a 2003 paper by Vladimir Kanovei and Saharon Shelah shows that there is a definable, countably saturated (meaning ω-saturated but not countable) elementary extension of the reals, which therefore has a good claim to the title of the hyperreal numbers. Furthermore, the field obtained by the ultrapower construction from the space of all real sequences, is unique up to isomorphism if one assumes the continuum hypothesis.
The condition of being a hyperreal field is a stronger one than that of being a real closed field strictly containing R. It is also stronger than that of being a superreal field in the sense of Dales and Woodin.

## Development

The hyperreals can be developed either axiomatically or by more constructively oriented methods. The essence of the axiomatic approach is to assert (1) the existence of at least one infinitesimal number, and (2) the validity of the transfer principle. In the following subsection we give a detailed outline of a more constructive approach. This method allows one to construct the hyperreals if given a set-theoretic object called an ultrafilter, but the ultrafilter itself cannot be explicitly constructed.

### From Leibniz to Robinson

When Newton and (more explicitly) Leibniz introduced differentials, they used infinitesimals and these were still regarded as useful by later mathematicians such as Euler and Cauchy. Nonetheless these concepts were from the beginning seen as suspect, notably by George Berkeley. Berkeley's criticism centered on a perceived shift in hypothesis in the definition of the derivative in terms of infinitesimals (or fluxions), where dx is assumed to be nonzero at the beginning of the calculation, and to vanish at its conclusion (see Ghosts of departed quantities for details). When in the 1800s calculus was put on a firm footing through the development of the (ε, δ)-definition of limit by Bolzano, Cauchy, Weierstrass, and others, infinitesimals were largely abandoned, though research in non-Archimedean fields continued (Ehrlich 2006).
However, in the 1960s Abraham Robinson showed how infinitely large and infinitesimal numbers can be rigorously defined and used to develop the field of nonstandard analysis. Robinson developed his theory nonconstructively, using model theory; however it is possible to proceed using only algebra and topology, and proving the transfer principle as a consequence of the definitions. In other words hyperreal numbers per se, aside from their use in nonstandard analysis, have no necessary relationship to model theory or first order logic, although they were discovered by the application of model theoretic techniques from logic. Hyper-real fields were in fact originally introduced by Hewitt (1948) by purely algebraic techniques, using an ultrapower construction.

### Ultrapower construction

We are going to construct a hyperreal field via sequences of reals. In fact we can add and multiply sequences componentwise; for example:
    $(a_{0},a_{1},a_{2},\ldots )+(b_{0},b_{1},b_{2},\ldots )=(a_{0}+b_{0},a_{1}+b_{1},a_{2}+b_{2},\ldots )$
and analogously for multiplication. This turns the set of such sequences into a commutative ring, which is in fact a real algebra A. We have a natural embedding of R in A by identifying the real number r with the sequence (r, r, r, …) and this identification preserves the corresponding algebraic operations of the reals. The intuitive motivation is, for example, to represent an infinitesimal number using a sequence that approaches zero. The inverse of such a sequence would represent an infinite number. As we will see below, the difficulties arise because of the need to define rules for comparing such sequences in a manner that, although inevitably somewhat arbitrary, must be self-consistent and well defined. For example, we may have two sequences that differ in their first n members, but are equal after that; such sequences should clearly be considered as representing the same hyperreal number. Similarly, most sequences oscillate randomly forever, and we must find some way of taking such a sequence and interpreting it as, say, $7+\epsilon$, where $\epsilon$ is a certain infinitesimal number.
Comparing sequences is thus a delicate matter. We could, for example, try to define a relation between sequences in a componentwise fashion:
    $(a_{0},a_{1},a_{2},\ldots )\leq (b_{0},b_{1},b_{2},\ldots )\iff (a_{0}\leq b_{0})\wedge (a_{1}\leq b_{1})\wedge (a_{2}\leq b_{2})\ldots$
but here we run into trouble, since some entries of the first sequence may be bigger than the corresponding entries of the second sequence, and some others may be smaller. It follows that the relation defined in this way is only a partial order. To get around this, we have to specify which positions matter. Since there are infinitely many indices, we don't want finite sets of indices to matter. A consistent choice of index sets that matter is given by any free ultrafilter U on the natural numbers; these can be characterized as ultrafilters that do not contain any finite sets. (The good news is that Zorn's lemma guarantees the existence of many such U; the bad news is that they cannot be explicitly constructed.) We think of U as singling out those sets of indices that "matter": We write (a$_0$, a$_1$, a$_2$, ...) ≤ (b$_0$, b$_1$, b$_2$, ...) if and only if the set of natural numbers { n : a$_n$ ≤ b$_n$ } is in U.
This is a total preorder and it turns into a total order if we agree not to distinguish between two sequences a and b if a ≤ b and b ≤ a. With this identification, the ordered field *R of hyperreals is constructed. From an algebraic point of view, U allows us to define a corresponding maximal ideal I in the commutative ring A (namely, the set of the sequences that vanish in some element of U), and then to define *R as A/I; as the quotient of a commutative ring by a maximal ideal, *R is a field. This is also notated A/U, directly in terms of the free ultrafilter U; the two are equivalent. The maximality of I follows from the possibility of, given a sequence a, constructing a sequence b inverting the non-null elements of a and not altering its null entries. If the set on which a vanishes is not in U, the product ab is identified with the number 1, and any ideal containing 1 must be A. In the resulting field, these a and b are inverses.
The field A/U is an ultrapower of R. Since this field contains R it has cardinality at least that of the continuum. Since A has cardinality
    $(2^{\aleph _{0}})^{\aleph _{0}}=2^{\aleph _{0}^{2}}=2^{\aleph _{0}},$
it is also no larger than $2^{\aleph _{0}}$, and hence has the same cardinality as R.
One question we might ask is whether, if we had chosen a different free ultrafilter V, the quotient field A/U would be isomorphic as an ordered field to A/V. This question turns out to be equivalent to the continuum hypothesis; in ZFC with the continuum hypothesis we can prove this field is unique up to order isomorphism, and in ZFC with the negation of continuum hypothesis we can prove that there are non-order-isomorphic pairs of fields that are both countably indexed ultrapowers of the reals.
For more information about this method of construction, see ultraproduct.

### An intuitive approach to the ultrapower construction

The following is an intuitive way of understanding the hyperreal numbers. The approach taken here is very close to the one in the book by Goldblatt. Recall that the sequences converging to zero are sometimes called infinitely small. These are almost the infinitesimals in a sense; the true infinitesimals include certain classes of sequences that contain a sequence converging to zero.
Let us see where these classes come from. Consider first the sequences of real numbers. They form a ring, that is, one can multiply, add and subtract them, but not necessarily divide by a non-zero element. The real numbers are considered as the constant sequences, the sequence is zero if it is identically zero, that is, a$_n$ = 0 for all n.
In our ring of sequences one can get ab = 0 with neither a = 0 nor b = 0. Thus, if for two sequences $a,b$ one has ab = 0, at least one of them should be declared zero. Surprisingly enough, there is a consistent way to do it. As a result, the equivalence classes of sequences that differ by some sequence declared zero will form a field, which is called a hyperreal field. It will contain the infinitesimals in addition to the ordinary real numbers, as well as infinitely large numbers (the reciprocals of infinitesimals, including those represented by sequences diverging to infinity). Also every hyperreal that is not infinitely large will be infinitely close to an ordinary real, in other words, it will be the sum of an ordinary real and an infinitesimal.
This construction is parallel to the construction of the reals from the rationals given by Cantor. He started with the ring of the Cauchy sequences of rationals and declared all the sequences that converge to zero to be zero. The result is the reals. To continue the construction of hyperreals, consider the zero sets of our sequences, that is, the $z(a)=\{i:a_{i}=0\}$, that is, $z(a)$ is the set of indexes $i$ for which $a_{i}=0$. It is clear that if $ab=0$, then the union of $z(a)$ and $z(b)$ is N (the set of all natural numbers), so:
* One of the sequences that vanish on two complementary sets should be declared zero.
* If $a$ is declared zero, $ab$ should be declared zero too, no matter what $b$ is.
* If both $a$ and $b$ are declared zero, then $a+b$ should also be declared zero.
Now the idea is to single out a bunch U of subsets X of N and to declare that $a=0$ if and only if $z(a)$ belongs to U. From the above conditions one can see that:
* From two complementary sets one belongs to U.
* Any set having a subset that belongs to U, also belongs to U.
* An intersection of any two sets belonging to U belongs to U.
* Finally, we do not want the empty set to belong to U because then everything would belong to U, as every set has the empty set as a subset.
Any family of sets that satisfies (2–4) is called a filter (an example: the complements to the finite sets, it is called the Fréchet filter and it is used in the usual limit theory). If (1) also holds, U is called an ultrafilter (because you can add no more sets to it without breaking it). The only explicitly known example of an ultrafilter is the family of sets containing a given element (in our case, say, the number 10). Such ultrafilters are called trivial, and if we use it in our construction, we come back to the ordinary real numbers. Any ultrafilter containing a finite set is trivial. It is known that any filter can be extended to an ultrafilter, but the proof uses the axiom of choice. The existence of a nontrivial ultrafilter (the ultrafilter lemma) can be added as an extra axiom, as it is weaker than the axiom of choice.
Now if we take a nontrivial ultrafilter (which is an extension of the Fréchet filter) and do our construction, we get the hyperreal numbers as a result.
If $f$ is a real function of a real variable $x$ then $f$ naturally extends to a hyperreal function of a hyperreal variable by composition:
    $f(\{x_{n}\})=\{f(x_{n})\}$
where $\{\dots \}$ means "the equivalence class of the sequence $\dots$ relative to our ultrafilter", two sequences being in the same class if and only if the zero set of their difference belongs to our ultrafilter.
All the arithmetical expressions and formulas make sense for hyperreals and hold true if they are true for the ordinary reals. It turns out that any finite (that is, such that $|x|<a$ for some ordinary real $a$) hyperreal $x$ will be of the form $y+d$ where $y$ is an ordinary (called standard) real and $d$ is an infinitesimal. It can be proven by bisection method used in proving the Bolzano-Weierstrass theorem, the property (1) of ultrafilters turns out to be crucial.

## Properties of infinitesimal and infinite numbers

The finite elements F of *R form a local ring, and in fact a valuation ring, with the unique maximal ideal S being the infinitesimals; the quotient F/S is isomorphic to the reals. Hence we have a homomorphic mapping, st(x), from F to R whose kernel consists of the infinitesimals and which sends every element x of F to a unique real number whose difference from x is in S; which is to say, is infinitesimal. Put another way, every finite nonstandard real number is "very close" to a unique real number, in the sense that if x is a finite nonstandard real, then there exists one and only one real number st(x) such that x – st(x) is infinitesimal. This number st(x) is called the standard part of x, conceptually the same as x to the nearest real number. This operation is an order-preserving homomorphism and hence is well-behaved both algebraically and order theoretically. It is order-preserving though not isotonic; i.e. $x\leq y$ implies $\operatorname {st} (x)\leq \operatorname {st} (y)$, but $x<y$ does not imply $\operatorname {st} (x)<\operatorname {st} (y)$.
* We have, if both x and y are finite, $\operatorname {st} (x+y)=\operatorname {st} (x)+\operatorname {st} (y)$ $\operatorname {st} (xy)=\operatorname {st} (x)\operatorname {st} (y)$
* If x is finite and not infinitesimal. $\operatorname {st} (1/x)=1/\operatorname {st} (x)$
* x is real if and only if $\operatorname {st} (x)=x$
The map st is continuous with respect to the order topology on the finite hyperreals; in fact it is locally constant.

## Hyperreal fields

Suppose X is a Tychonoff space, also called a T$_{3.5}$ space, and C(X) is the algebra of continuous real-valued functions on X. Suppose M is a maximal ideal in C(X). Then the factor algebra A = C(X)/M is a totally ordered field F containing the reals. If F strictly contains R then M is called a hyperreal ideal (terminology due to Hewitt (1948)) and F a hyperreal field. Note that no assumption is being made that the cardinality of F is greater than R; it can in fact have the same cardinality.
An important special case is where the topology on X is the discrete topology; in this case X can be identified with a cardinal number κ and C(X) with the real algebra R$^κ$ of functions from κ to R. The hyperreal fields we obtain in this case are called ultrapowers of R and are identical to the ultrapowers constructed via free ultrafilters in model theory.