# Limit superior and limit inferior

In mathematics, the limit inferior and limit superior of a sequence can be thought of as limiting bounds on the sequence. (See limit of a function.)

The limit inferior (or lower limit) of a sequence (xn) is defined as

$\displaystyle \liminf_{n\rightarrow\infty}x_n=\sup_{n\geq 0}\,\inf_{k\geq n}x_k=\sup\{\,\inf\{\,x_k:k\geq n\,\}:n\geq 0\,\}.$

or

$\displaystyle \liminf_{n\rightarrow\infty}x_n=\lim_{n\rightarrow\infty}\left(\inf_{m\geq n}x_m\right).$

Similarly, the limit superior (or upper limit) of (xn) is defined as

$\displaystyle \limsup_{n\rightarrow\infty}x_n=\inf_{n\geq 0}\,\sup_{k\geq n}x_k=\inf\{\,\sup\{\,x_k:k\geq n\,\}:n\geq 0\,\}.$

or

$\displaystyle \limsup_{n\rightarrow\infty}x_n=\lim_{n\rightarrow\infty}\left(\sup_{m\geq n}x_m\right).$

These definitions make sense in any partially ordered set, provided the suprema and infima exist. In a complete lattice, the suprema and infima always exist, and so in this case every sequence has a limit superior and a limit inferior.

Whenever lim inf xn and lim sup xn both exist, then

$\displaystyle \liminf_{n\rightarrow\infty}x_n\leq\limsup_{n\rightarrow\infty}x_n.$

Limits inferior/superior are related to big-O notation in that they bound a sequence only "in the limit"; the sequence may exceed the bound. However, with big-O notation the sequence can only exceed the bound in a finite prefix of the sequence, whereas the limit superior of a sequence like e-n may actually be less than all elements of the sequence. The only promise made is that some tail of the sequence can be bounded by the limit superior (inferior) plus (minus) an arbitrarily small positive constant.

## Sequences of real numbers

In calculus, the case of sequences in R (the real numbers) is important. R itself is not a complete lattice, but positive and negative infinities can be added to give the complete totally ordered set [-∞,∞]. Then (xn) in [-∞,∞] converges if and only if lim inf xn = lim sup xn, in which case lim xn is equal to their common value. (Note that when working just in R, convergence to -∞ or ∞ would not be considered as convergence.)

As an example, consider the sequence given by xn = sin(n). Using the fact that pi is irrational, one can show that lim inf xn = −1 and lim sup xn = +1.

If I = lim inf xn and S = lim sup xn, then the interval [I, S] need not contain any of the numbers xn, but every slight enlargement [I − ε, S + ε] (for arbitrarily small ε > 0) will contain xn for all but finitely many indices n. In fact, the interval [I, S] is the smallest closed interval with this property.

An example from number theory is

$\displaystyle \liminf_n(p_{n+1}-p_n),$

where pn is the n-th prime number. The value of this limit inferior is conjectured to be 2 - this is the twin prime conjecture - but as yet has not even been proved finite.

## Functions from metric and topololgical spaces to the real numbers

There is a notion of lim sup and lim inf for real-valued functions defined on a metric space whose relationship to limits of real-valued functions mirrors that of the relation between the lim sup, liminf, and the limit of a real sequence. Given a metric space X, a subspace E contained in X, and f : ER we define, for a any point in the closure of E:

$\displaystyle \limsup_{x \to a} f(x) = \lim_{\epsilon \to 0} \sup \{ f(x) : x \in E \cap B(a;\epsilon) \}$

and

$\displaystyle \liminf_{x \to a} f(x) = \lim_{\epsilon \to 0} \inf \{ f(x) : x \in E \cap B(a;\epsilon) \}$

where B(a,ε) denotes the metric ball of radius ε about a. As in the case for sequences, these are always well-defined if we allow the values +∞ and -∞, and if both are equal then the limit exists and is equal to their common value (again possibly including the infinties). For example, given f(x) = sin(1/x), we have lim supx0 f(x) = 1 and lim infx0 f(x) = -1. The difference between the two is a rough measure of how "wildly" the function oscillates, and in observation of this fact, it is called the oscillation of f at a. This idea of oscillation is sufficient to, for example, characterize Riemann-integrable functions as continuous except on a set of measure zero: points of nonzero oscillation i.e. points at which f is "badly behaved" are confined to a negligible set.

Note that as ε shrinks, the supremum of the function over the ball is monotone decreasing, so we have

$\displaystyle \limsup_{x\to a} f(x) = \inf_{\epsilon > 0} (\sup \{ f(x) : x \in E \cap B(a;\epsilon) \})$

and similarly

$\displaystyle \liminf_{x\to a} f(x) = \sup_{\epsilon > 0}(\inf \{ f(x) : x \in E \cap B(a;\epsilon) \}).$

This finally motivates the definitions for general topological spaces, for X, E and a as before, but now X only a topological space, we replace balls with neighborhoods:

$\displaystyle \limsup_{x\to a} f(x) = \inf \{ \sup \{ f(x) : x \in E \cap U \} : U\ \mathrm{open}, a \in U \}$
$\displaystyle \liminf_{x\to a} f(x) = \sup \{ \inf \{ f(x) : x \in E \cap U \} : U\ \mathrm{open}, a \in U \}$

(there is a way to write the formula using a lim using nets and the neighborhood filter). This version is often useful in discussions of semi-continuity which crop up in analysis quite often. An interesting note is that this version subsumes the sequential version by considering sequences as functions from the natural numbers as a topological subspace of the extended real line, into the space (the closure of N in [-∞, ∞] is N ∪ {∞}.)

## Sequences of sets

The power set P(X) of a set X is a complete lattice, and it is sometimes useful to consider limits superior and inferior of sequences in P(X), that is, sequences of subsets of X. If Xn is such a sequence, then an element a of X belongs to lim inf Xn if and only if there exists a natural number n0 such that a is in Xn for all n > n0. The element a belongs to lim sup Xn if and only if for every natural number n0 there exists an index n > n0 such that a is in Xn. In other words, lim sup Xn consists of those elements which are in Xn for infinitely many n, while lim inf Xn consists of those elements which are in Xn for all but finitely many n.

Using the standard parlance of set theory, the infimum of a sequence of sets is the countable intersection of the sets, the largest set included in all of the sets:

$\displaystyle \inf\left\{\,x_n : n=1,2,3,\dots\,\right\}={\bigcap_{n=1}^\infty}x_n$

The sequence of n=1,2,3,...,In, where In is the infimum of set n, is non-decreasing, because InIn+1. Therefore, the countable union of infimum from 1 to n is equal to the nth infimum. Taking this sequence of sets to the limit:

$\displaystyle \liminf_{n\rightarrow\infty}x_n={\bigcup_{n=1}^\infty}\left({\bigcap_{m=n}^\infty}x_m\right).$

The limsup can be defined as the opposite. The supremum of a sequence of sets is the smallest set containing all the sets, i.e., the countable union of the sets.

$\displaystyle \sup\left\{\,x_n : n=1,2,3,\dots\,\right\}={\bigcup_{n=1}^\infty}x_n$

The limsup is the countable intersection of this non-increasing (each supremum is a subset of the previous supremum) sequence of sets.

$\displaystyle \limsup_{n\rightarrow\infty}x_n={\bigcap_{n=1}^\infty}\left({\bigcup_{m=n}^\infty}x_m\right).$

See Borel-Cantelli lemma for an example.