In Mathematics, the phrase **almost all** has two main specialised uses:

1) If P(x) is a property of real numbers and the set of x for which P(x) does not hold is null then P(x) is said to hold for almost all x or **almost everywhere**.

For example, a theorem about Lebesgue integration says that if {f_{n}} is an increasing sequence of step functions for which the sequence {integral of f_{n}} converges, then {f_{n}} converges almost everywhere. This means that the set of x for which the sequence {f_{n}(x)} diverges is null.

2) If P(n) is a property of positive integers, if Q(n) denotes the number of positive integers <=n for which P(x) fails to hold and if Q(n)/n tends to 0 as n tends to oo, then we say that P(n) holds for almost all positive integers n. For example, the Prime Number Theorem states that the number of prime numbers less than or equal to x is asymptotically equal to x/ln x. Therefore the proportion of prime integers is roughly 1/ln x, which tends to 0. Thus, almost all positive integers are composite.