Definition:Real Interval

The set of all real numbers between any two given real numbers $$a$$ and $$b$$ is called a (real) interval.

An arbitrary interval is frequently denoted $$\mathbb{I}$$, although some sources use just $$I$$.

Endpoints
The numbers $$a, b \in \mathbb{R}$$ are known as the endpoints (or end points) of the interval.

$$a$$ is sometimes called the left hand endpoint and $$b$$ the right hand end point of the interval.

Length
The difference $$\left|{a - b}\right|$$ between the endpoints is called the length of the interval.

Midpoint
The midpoint of an interval is the number $$\frac {a + b} 2$$.

Property Defining an Interval
An interval has the property $$x, y \in \mathbb{I}, x \le z \le y \Longrightarrow z \in \mathbb{I}$$.

That is, if two numbers belong to an interval, then so does every number in between them.

Definitions of Interval Types
It is usual to define intervals in terms of inequalities.

These are in the form of a pair of brackets, either round or square, enclosing the two end points of the interval separated by two dots.

Whether the bracket at either end is round or square depends on whether the end point is inside or outside the interval, as specified in the following.

Suppose $$a, b \in \mathbb{R}$$.

Open Interval
The open interval from $$a$$ to $$b$$ is defined as:

$$\left ({a \, . \, . \, b} \right) = \left\{{x \in \reals: a < x < b}\right\}$$

Half Open Interval
There are two half open intervals from $$a$$ to $$b$$, defined as:


 * $$\left [{a \, . \, . \, b} \right) = \left\{{x \in \reals: a \le x < b}\right\}$$


 * $$\left ({a \, . \, . \, b} \right] = \left\{{x \in \reals: a < x \le b}\right\}$$

Closed Interval
The closed interval from $$a$$ to $$b$$ is defined as:

$$\left [{a \,. \, . \, b} \right] = \left\{{x \in \reals: a \le x \le b}\right\}$$

Such an interval can also be referred to as compact.

Unbounded Half Open Interval
There are two unbounded half open intervals involving a real number $$a$$, defined as:


 * $$\left [{a \, . \, . \, \infty} \right) = \left\{{x \in \reals: a \le x}\right\}$$


 * $$\left ({-\infty \, . \, . \, a} \right] = \left\{{x \in \reals: x \le a}\right\}$$

Unbounded Open Interval
There are two unbounded open intervals involving a real number $$a$$, defined as:


 * $$\left ({a \, . \, . \, \infty} \right) = \left\{{x \in \reals: a < x}\right\}$$


 * $$\left ({-\infty \, . \, . \, a} \right) = \left\{{x \in \reals: x < a}\right\}$$

Using the same symbology, the set $$\mathbb{R}$$ can be represented as an unbounded open interval with no end points:

$$\left ({-\infty \, . \, . \, \infty} \right) = \left\{{x \in \reals}\right\}$$

Higher Dimensional Intervals
An interval in $$\mathbb{R}^n$$ is the cartesian product:

$$\mathbb{I}_1 \times \mathbb{I}_2 \times \cdots \times \mathbb{I}_n$$

where $$\mathbb{I}_1, \ldots, \mathbb{I}_n$$ are intervals in $$\mathbb{R}$$.

Notation
The notation as used here is a fairly recent innovation, and was introduced by C. A. R. Hoare and Lyle Ramshaw.

These are the notations usually seen for intervals:


 * $$\left ( {a, b} \right )$$ for $$\left ({a \, . \, . \, b} \right)$$;
 * $$\left [ {a, b} \right )$$ for $$\left [{a \, . \, . \, b} \right)$$;
 * $$\left ( {a, b} \right ]$$ for $$\left ({a \, . \, . \, b} \right]$$;
 * $$\left [ {a, b} \right ]$$ for $$\left [{a \, . \, . \, b} \right]$$.

... but they can be confused with other usages for these (in particular, we have the danger of taking $$\left({a, b}\right)$$ to mean an ordered pair and goodness knows what else).

Some authors try to get around this ambiguity problem by using the following notations for open and half-open intervals:


 * $$\left ] {a, b} \right [$$ for $$\left ({a \, . \, . \, b} \right)$$;
 * $$\left [ {a, b} \right [$$ for $$\left [{a \, . \, . \, b} \right)$$;
 * $$\left ] {a, b} \right ]$$ for $$\left ({a \, . \, . \, b} \right]$$.

... but these are both ugly and confusing, and not many people like those either.

The "double dots" notation used to denote an interval has a worthy precedent in the sphere of computer languages. For example, Pascal uses the same notation for a closed interval.

Comment
Compare the definition of a Closed Interval on a general totally ordered set.

Note that only in the case of the closed interval are both endpoints actually included in the interval.