An interval is a subset of the real numbers that contains every number lying between any two of its elements. Intervals may be bounded or unbounded, and their finite endpoints may be included or excluded. They provide a basic language for expressing inequalities, specifying domains of functions, and describing continuous ranges of values in mathematical analysis, geometry, probability, and numerical computation.
Definition
A set is an interval if, whenever and , it follows that . Equivalently,
Thus an interval has no gaps: it cannot contain two numbers while omitting a number between them.
For example, the set of all real numbers satisfying is an interval. The set is not, because it omits numbers between 1 and 3. The rational numbers are not an interval of the real line either: between two distinct rational numbers there are irrational numbers that do not belong to that set.
Under this definition, a singleton and the empty set are intervals, since neither violates the defining condition. Some treatments reserve “interval” for nonempty sets, or “nondegenerate interval” for intervals containing more than one point.
Types and notation
Bounded intervals
For real numbers , there are four bounded intervals with endpoints and :
| Type | Notation | Definition |
|---|---|---|
| Open | ||
| Closed | ||
| Left-closed, right-open | ||
| Left-open, right-closed |
Square brackets indicate that an endpoint belongs to the interval; parentheses indicate that it does not. The last two forms are called half-open or half-closed intervals.
An alternative notation, used in some countries and texts, writes
for , , and , respectively.
If , then is a degenerate interval. The other three forms with equal endpoints are empty. Under their set-builder definitions, these expressions are also empty when . This differs from the convention for an oriented definite integral, where reversing the limits changes its sign.
Unbounded intervals
Intervals extending indefinitely in one or both directions are written as follows:
| Notation | Definition |
|---|---|
The symbols and indicate unboundedness; they are not real numbers. Consequently, infinity always receives a parenthesis in ordinary real-interval notation. Intervals such as require a different setting in which infinity is itself an element.
Endpoints, bounds, and length
Every nonempty interval bounded below has an infimum, or greatest lower bound; every nonempty interval bounded above has a supremum, or least upper bound. These exist because of the completeness of the real numbers.
For each of the four nondegenerate bounded intervals with endpoints and ,
Whether these bounds are attained depends on endpoint inclusion:
- The infimum is a minimum exactly when the left endpoint belongs to the interval.
- The supremum is a maximum exactly when the right endpoint belongs to the interval.
For example, has infimum 0 but no minimum, while its maximum is 1.
The length of a bounded interval with endpoints is
regardless of endpoint inclusion. In Lebesgue measure, single points have measure zero, so , , , and all have the same measure. Every unbounded interval has infinite measure.
Topological and geometric properties
Openness, closedness, and compactness
In the usual topology of the real line, is an open set and is a closed set. A nondegenerate bounded half-open interval is neither open nor closed in .
These terms should not be confused with boundedness:
- is closed but unbounded.
- is open and unbounded.
- and the empty set are both open and closed.
Openness and closedness also depend on the ambient space. For example, is not open in , but it is open relative to with its subspace topology.
By the Heine–Borel theorem, a subset of is compact exactly when it is closed and bounded. Thus every interval with finite endpoints is a compact space, whereas a nonempty bounded open interval is not compact.
Connectedness and convexity
A subset of is connected exactly when it is an interval, with the empty set included under the usual convention. This characterizes intervals as the connected subsets of the real line; connectedness is understood using the topology inherited from .
An equivalent geometric characterization is that intervals are precisely the convex subsets of . For any and ,
The expression on the left describes every point on the line segment joining and . In higher dimensions, convexity and connectedness are different properties: a connected set need not be convex.
Operations on intervals
The intersection of any nonempty family of intervals is an interval, although it may be empty. If two points belong to every interval in the family, every point between them also belongs to every interval.
Unions behave differently. For example,
is not an interval. Nor is
because the point 1 is missing. By contrast,
More generally, a union of intervals is an interval precisely when it has no gap in the defining sense. A nonempty family of nonempty intervals with a common point always has an interval as its union.
Nested intervals
The nested interval theorem states that a decreasing sequence of nonempty closed bounded intervals,
has a nonempty intersection. If their lengths tend to zero, the intersection contains exactly one point.
The hypotheses are important. Nested open intervals may have empty intersection:
Closed intervals without a boundedness assumption may also have empty intersection:
Intervals and functions
Intervals commonly serve as the domains of real-valued functions. Their lack of gaps underlies several central results of calculus.
The intermediate value theorem states that a continuous function on an interval takes every value between any two of its values. Equivalently, its image is also an interval. That image need not have the same endpoint type as the domain: for example, the continuous function maps onto .
The extreme value theorem guarantees that a continuous real-valued function on a nonempty closed bounded interval attains both a minimum and a maximum. This need not hold on an open interval: on attains neither.
The mean value theorem uses continuity on and differentiability on . The distinction allows continuity to be required at the endpoints without requiring two-sided derivatives there.
Intervals also provide domains of integration. A Riemann integral over a bounded closed interval is constructed using partitions into subintervals. Half-open intervals are useful when a partition must assign each boundary point to exactly one piece.
Applications and related meanings
Probability and statistics
For a real-valued random variable , intervals define events such as
If is its cumulative distribution function, then
Endpoint inclusion matters when an endpoint has positive probability. It does not affect the probability for a distribution with no point masses.
A confidence interval or credible interval is a statistical construction whose reported result is typically an interval. Its statistical meaning comes from how it is constructed, not from interval notation alone.
Interval arithmetic
Interval arithmetic replaces individual numerical values with intervals enclosing possible values. For bounded closed intervals, exact range formulas include
and
Implementations using floating-point arithmetic can round lower bounds downward and upper bounds upward to preserve enclosure. This supports verified numerical calculations and rigorous error bounds.
Repeated occurrences of the same uncertain quantity can cause overestimation. If , direct interval subtraction gives
although the expression is always zero. The interval calculation does not retain the dependence between the two occurrences of .
Generalizations
The interval concept extends to any totally ordered set by using the same “between” condition. For example, an interval of integers contains every integer between any two of its elements; it need not contain the real numbers between them.
In a partially ordered set, one commonly defines
provided . Such order intervals need not resemble line segments geometrically.
In higher-dimensional Euclidean space, a Cartesian product of real intervals is an axis-aligned box, sometimes called an interval vector or multidimensional interval. It is a generalization of a real interval, not an interval of the real line.