### - Art Gallery -

In measure theory (a branch of mathematical analysis), a property holds almost everywhere if, in a technical sense, the set for which the property holds takes up nearly all possibilities. The notion of "almost everywhere" is a companion notion to the concept of measure zero, and is analogous to the notion of "almost surely" in probability—a field which is largely based on measure theory.

More specifically, a property holds almost everywhere if it holds for all elements in a set except a subset of measure zero,[1][2][3] or equivalently, if the set of elements for which the property holds is conull. In cases where the measure is not complete, it is sufficient that the set be contained within a set of measure zero. When discussing sets of real numbers, the Lebesgue measure is usually assumed unless otherwise stated.

The term almost everywhere is abbreviated a.e.;[4] in older literature p.p. is used, to stand for the equivalent French language phrase presque partout.[5]

A set with full measure is one whose complement is of measure zero. In probability theory, the terms almost surely, almost certain and almost always refer to events with probability 1 not necessarily including all of the outcomes.[1] These are exactly the sets of full measure in a probability space.

Occasionally, instead of saying that a property holds almost everywhere, it is said that the property holds for almost all elements (though the term almost all can also have other meanings).

Definition

If $${\displaystyle (X,\Sigma ,\mu )}$$ is a measure space, a property P is said to hold almost everywhere in X if there exists a set $${\displaystyle N\in \Sigma }$$ with $${\displaystyle \mu (N)=0}$$, and all $${\displaystyle x\in X\setminus N}$$ have the property P.[6] Another common way of expressing the same thing is to say that "almost every point satisfies $$P\,$$ ", or that "for almost every } x, $${\displaystyle P(x)}$$holds".

It is not required that the set $${\displaystyle \{x\in X:\neg P(x)\}}$$ has measure 0; it may not belong to $$\Sigma \_. By the above definition, it is sufficient that \( {\displaystyle \{x\in X:\neg P(x)\}}$$ be contained in some set N that is measurable and has measure 0.
Properties

If property P holds almost everywhere and implies property Q, then property Q holds almost everywhere. This follows from the monotonicity of measures.
If $${\displaystyle (P_{n})}$$ is a finite or a countable sequence of properties, each of which holds almost everywhere, then their conjunction $${\displaystyle \forall nP_{n}}$$ holds almost everywhere. This follows from the countable sub-additivity of measures.
By contrast, if ($${\displaystyle (P_{x})_{x\in \mathbf {R} }}$$ is an uncountable family of properties, each of which holds almost everywhere, then their conjunction $${\displaystyle \forall xP_{x}}$$ does not necessarily hold almost everywhere. For example, if $$\mu$$ is Lebesgue measure on X = R {\displaystyle X=\mathbf {R} } {\displaystyle X=\mathbf {R} } and $${\displaystyle P_{x}}$$ is the property of not being equal to x (i.e. $${\displaystyle P_{x}(y)}$$ is true if and only if $${\displaystyle y\neq x})$$, then each $${\displaystyle P_{x}}$$ holds almost everywhere, but the conjunction $${\displaystyle \forall xP_{x}}$$ does not hold anywhere.

As a consequence of the first two properties, it is often possible to reason about "almost every point" of a measure space as though it were an ordinary point rather than an abstraction. This is often done implicitly in informal mathematical arguments. However, one must be careful with this mode of reasoning because of the third bullet above: universal quantification over uncountable families of statements is valid for ordinary points but not for "almost every point".
Examples

If f : R → R is a Lebesgue integrable function and $${\displaystyle f(x)\geq 0}$$almost everywhere, then
$$\int _{a}^{b}f(x)\,dx\geq 0$$
for all real numbers $${\displaystyle a<b}$$ with equality if and only if f f(x)=0 almost everywhere.
If f : [a, b] → R is a monotonic function, then f is differentiable almost everywhere.
If f : R → R is Lebesgue measurable and
$$\int _{a}^{b}|f(x)|\,dx<\infty$$

for all real numbers $${\displaystyle a<b}$$, then there exists a set E (depending on f) such that, if x is in E, the Lebesgue mean
$${\frac {1}{2\epsilon }}\int _{{x-\epsilon }}^{{x+\epsilon }}f(t)\,dt$$
converges to f(x) as ϵ {\displaystyle \epsilon } \epsilon decreases to zero. The set E is called the Lebesgue set of f. Its complement can be proved to have measure zero. In other words, the Lebesgue mean of f converges to f almost everywhere.
A bounded function f : [a, b] → R is Riemann integrable if and only if it is continuous almost everywhere.
As a curiosity, the decimal expansion of almost every real number in the interval [0, 1] contains the complete text of Shakespeare's plays, encoded in ASCII; similarly for every other finite digit sequence, see Normal number.

Definition using ultrafilters

Outside of the context of real analysis, the notion of a property true almost everywhere is sometimes defined in terms of an ultrafilter. An ultrafilter on a set X is a maximal collection F of subsets of X such that:

If U ∈ F and U ⊆ V then V ∈ F
The intersection of any two sets in F is in F
The empty set is not in F

A property P of points in X holds almost everywhere, relative to an ultrafilter F, if the set of points for which P holds is in F.

For example, one construction of the hyperreal number system defines a hyperreal number as an equivalence class of sequences that are equal almost everywhere as defined by an ultrafilter.

The definition of almost everywhere in terms of ultrafilters is closely related to the definition in terms of measures, because each ultrafilter defines a finitely-additive measure taking only the values 0 and 1, where a set has measure 1 if and only if it is included in the ultrafilter.

Dirichlet's function, a function that is equal to 0 almost everywhere.

References

"The Definitive Glossary of Higher Mathematical Jargon — Almost". Math Vault. 2019-08-01. Retrieved 2019-11-19.
Weisstein, Eric W. "Almost Everywhere". mathworld.wolfram.com. Retrieved 2019-11-19.
Halmos, Paul R. (1974). Measure theory. New York: Springer-Verlag. ISBN 0-387-90088-8.
"Definition of almost everywhere | Dictionary.com". www.dictionary.com. Retrieved 2019-11-19.
Ursell, H. D. (1932-01-01). "On the Convergence Almost Everywhere of Rademacher's Series and of the Bochnerfejér Sums of a Function almost Periodic in the Sense of Stepanoff". Proceedings of the London Mathematical Society. s2-33 (1): 457–466. doi:10.1112/plms/s2-33.1.457. ISSN 0024-6115.

"Properties That Hold Almost Everywhere - Mathonline". mathonline.wikidot.com. Retrieved 2019-11-19.