Tutorials › Real Analysis › Open and Closed Intervals

Number Systems · Tutorial 104 of 1000

Open and Closed Intervals

Learn to read open and closed interval notation and prove the corresponding openness or closedness properties.

Beginner 9 min read

What You'll Learn

  • Distinguish included and excluded endpoints from the brackets in interval notation
  • Define open and closed subsets of the real line using neighborhoods and complements
  • Prove that an open interval is an open set and a closed interval is a closed set
  • Explain why a nondegenerate half-open interval is neither open nor closed
  • Handle singleton and unbounded intervals without confusing their endpoint notation

Endpoint Brackets and Interval Types

In the previous tutorial, intervals were defined by the between-points property, and bracket notation recorded whether specified endpoints belong to an interval. This tutorial focuses on two important forms: open intervals, which exclude both finite endpoints, and closed intervals, which include both. We will also connect these names to the broader ideas of open and closed sets on the real line.

The distinction is useful, but it requires care. An open interval is an open set, and a closed interval is a closed set. However, the words “open” and “closed” can describe properties of arbitrary sets, not just intervals. We will define those properties precisely and prove the connection rather than relying only on the appearance of the brackets.

Definition (Open and closed intervals). For real numbers \(a<b\), the open interval \((a,b)\) is the set \(\{x\in\mathbb{R}:a<x<b\}\). The closed interval \([a,b]\) is the set \(\{x\in\mathbb{R}:a\leq x\leq b\}\). Thus \((a,b)\) excludes both endpoints, while \([a,b]\) includes both.

A parenthesis marks an excluded endpoint, while a square bracket marks an included endpoint. For example, in \((a,b)\), neither \(a\) nor \(b\) belongs to the set. In \([a,b]\), both do. The points strictly between \(a\) and \(b\) belong to both intervals.

The notation \((a,a)\) describes the empty set, since no real number satisfies \(a<x<a\). By contrast, \([a,a]=\{a\}\). Although a singleton is an interval by the between-points definition, it is not an open interval in the usual notation \((a,b)\) with \(a<b\). It is a closed interval with equal endpoints.

Open and Closed Sets

To state what it means for a set to be open, we use the usual distance on the real line, \(d(x,y)=|x-y|\). A neighborhood of \(x\) with radius \(\varepsilon>0\) is the open interval \((x-\varepsilon,x+\varepsilon)\). A set is open if every one of its points has some neighborhood contained entirely in the set.

Definition (Open set). A set \(U\subseteq\mathbb{R}\) is open if, for every \(x\in U\), there exists \(\varepsilon>0\) such that \((x-\varepsilon,x+\varepsilon)\subseteq U\).

The radius may depend on the point \(x\). An endpoint of an interval matters here: a point just inside an excluded endpoint can be close to that endpoint, but it still has some positive distance from it and can have a sufficiently small neighborhood contained in the interval.

Definition (Closed set). A set \(F\subseteq\mathbb{R}\) is closed if its complement \(\mathbb{R}\setminus F\) is open.

These definitions concern neighborhoods and complements, not the shape of the brackets in a formula. In particular, “closed” does not mean simply that a set is bounded, and “open” does not mean that a set has no endpoints in every possible sense. The following results explain why the familiar open and closed intervals have their names.

Open Intervals Are Open Sets

Theorem (An open interval is open). If \(a<b\), then \((a,b)\) is an open subset of \(\mathbb{R}\).

Proof. Let \(x\in(a,b)\). Then \(a<x<b\), so both \(x-a\) and \(b-x\) are positive. Set \(\varepsilon=\frac12\min\{x-a,b-x\}\), which is positive. If \(y\in(x-\varepsilon,x+\varepsilon)\), then \(|y-x|<\varepsilon\), and therefore

$$ x-\varepsilon<y<x+\varepsilon. $$

Since \(\varepsilon\leq\frac{x-a}{2}\), we have \(x-\varepsilon\geq\frac{x+a}{2}>a\). Since \(\varepsilon\leq\frac{b-x}{2}\), we have \(x+\varepsilon\leq\frac{x+b}{2}<b\). It follows that \(a<y<b\), so \(y\in(a,b)\). Thus every \(x\in(a,b)\) has a neighborhood contained in \((a,b)\), proving that the interval is open. \(\square\)

The choice of radius is the key technique: take a positive radius no larger than the distance from \(x\) to either endpoint. Using half the smaller distance makes both strict bounds immediate. The radius can vary with \(x\); there is no requirement that one radius work for every point in the interval.

Worked Example: Finding a Neighborhood Inside an Open Interval

Consider \(x=2\) in the open interval \((-3,5)\). Its distances from the endpoints are \(2-(-3)=5\) and \(5-2=3\). Taking \(\varepsilon=\frac12\min\{5,3\}=\frac32\), the neighborhood is

$$ \left(2-\frac32,2+\frac32\right)=\left(\frac12,\frac72\right). $$

Every \(y\) in this neighborhood satisfies \(\frac12<y<\frac72\), which implies \(-3<y<5\). Thus this entire neighborhood lies inside \((-3,5)\). A larger radius might also work for this point, but the chosen radius follows the general proof and guarantees that neither endpoint is crossed.

Closed Intervals Are Closed Sets

For a closed interval, the useful test is its complement. If \(a\leq b\), the points outside \([a,b]\) lie either to the left of \(a\) or to the right of \(b\). We show that every such point has a neighborhood that stays outside the interval.

Theorem (A closed interval is closed). If \(a\leq b\), then \([a,b]\) is a closed subset of \(\mathbb{R}\).

Proof. Let \(x\in\mathbb{R}\setminus[a,b]\). By the definition of \([a,b]\), either \(x<a\) or \(x>b\). If \(x<a\), choose \(\varepsilon=(a-x)/2>0\). For any \(y\) with \(|y-x|<\varepsilon\), we have

$$ y<x+\varepsilon=\frac{x+a}{2}<a. $$

Thus \(y\notin[a,b]\). If instead \(x>b\), choose \(\varepsilon=(x-b)/2>0\). Then \(|y-x|<\varepsilon\) implies

$$ y>x-\varepsilon=\frac{x+b}{2}>b, $$

so again \(y\notin[a,b]\). Every point in the complement therefore has a neighborhood contained in the complement. Hence \(\mathbb{R}\setminus[a,b]\) is open, and \([a,b]\) is closed by definition. This proof also covers \(a=b\): a point outside the singleton \(\{a\}\) lies either below or above \(a\). \(\square\)

This argument illustrates why it is useful to define closedness by the complement. To prove that a set is closed, it is enough to show that points outside it have neighborhoods that remain outside. No assumption that the set has positive length is needed.

Worked Example: Checking the Closedness of a Singleton

The interval \([4,4]\) is the singleton \(\{4\}\). Its complement consists of all real numbers below \(4\) together with all real numbers above \(4\). Take any \(x\neq4\). If \(x<4\), set \(\varepsilon=(4-x)/2\); then every \(y\) with \(|y-x|<\varepsilon\) satisfies \(y<(x+4)/2<4\). If \(x>4\), set \(\varepsilon=(x-4)/2\); then every such \(y\) satisfies \(y>(x+4)/2>4\). In either case the neighborhood avoids \(4\). The complement is open, so \(\{4\}=[4,4]\) is closed.

This example shows why the case of equal endpoints should not be discarded. A singleton is a closed interval and a closed set, even though it contains no nontrivial interval around its point.

Half-Open Intervals and a Common Pitfall

An interval with one included endpoint and one excluded endpoint is called half-open (or half-closed). The next tutorial will examine these intervals further. Here, one distinction is important: when \(a<b\), \([a,b)\) is neither an open set nor a closed set. Its endpoint notation records which boundary point belongs to it, but it does not make the set open or closed.

Proposition (A nondegenerate half-open interval is neither open nor closed). If \(a<b\), then \([a,b)\) is neither an open subset nor a closed subset of \(\mathbb{R}\).

Proof. The point \(a\) belongs to \([a,b)\). For any \(\varepsilon>0\), the point \(y=a-\varepsilon/2\) satisfies \(|y-a|=\varepsilon/2<\varepsilon\), but \(y<a\), so \(y\notin[a,b)\). Thus no neighborhood of \(a\) is contained in \([a,b)\), and the set is not open.

To show that the set is not closed, consider its complement and the point \(b\), which belongs to that complement because the right endpoint is excluded. For any \(\varepsilon>0\), choose \(\delta=\frac12\min\{\varepsilon,b-a\}>0\) and let \(y=b-\delta\). Then \(|y-b|=\delta<\varepsilon\), while \(a<y<b\), so \(y\in[a,b)\). Thus every neighborhood of \(b\) meets \([a,b)\), and no neighborhood of \(b\) is contained in the complement. The complement is not open, so \([a,b)\) is not closed. \(\square\)

The proof checks both properties separately. To disprove openness, it finds a point of the set with no neighborhood contained in the set. To disprove closedness, it finds a point of the complement with no neighborhood contained in the complement. A failure of one property alone would not establish failure of the other.

Worked Example: Why \([1,6)\) Is Neither Open nor Closed

At the included endpoint \(1\), any neighborhood extends to the left. Given \(\varepsilon>0\), the point \(1-\varepsilon/2\) is within distance \(\varepsilon\) of \(1\), but it is not in \([1,6)\). Hence the interval is not open.

The excluded endpoint \(6\) belongs to the complement. Given any \(\varepsilon>0\), let \(\delta=\frac12\min\{\varepsilon,5\}\) and take \(y=6-\delta\). Since \(0<\delta\leq 5/2<5\), we have \(1<y<6\), so \(y\in[1,6)\), while \(|y-6|=\delta<\varepsilon\). Every neighborhood of \(6\) therefore meets the interval, which means the complement is not open. Thus \([1,6)\) is not closed either.

Unbounded Intervals and Endpoint Conventions

The same endpoint distinction applies to intervals that extend indefinitely. The symbols \(\infty\) and \(-\infty\) are not real numbers that can belong to an interval, so they are always written with parentheses. For example, \((c,\infty)=\{x\in\mathbb{R}:x>c\}\) is open: for any \(x>c\), a radius smaller than \(x-c\) keeps a neighborhood to the right of \(c\). The ray \([c,\infty)=\{x\in\mathbb{R}:x\geq c\}\) is closed, since its complement \((-\infty,c)\) is open.

A common pitfall is to infer open or closed status from boundedness. The interval \((c,\infty)\) is unbounded but open, while \([c,\infty)\) is unbounded but closed. Conversely, a bounded half-open interval such as \([1,6)\) is neither. Boundedness and openness or closedness are different properties.

Key takeaway. For finite \(a<b\), \((a,b)\) is open because each of its points has a neighborhood inside it, and \([a,b]\) is closed because its complement is open. Half-open intervals require separate checks; for \(a<b\), \([a,b)\) is neither open nor closed.

Check Your Understanding

Use the endpoint notation and the definitions of open and closed sets to answer each question.

  1. Which endpoints belong to \((2,9)\), and which belong to \([2,9]\)?
  2. For \(x\in(a,b)\), what positive radius can be chosen in the proof that \((a,b)\) is open?
  3. Why does showing that the complement of \([a,b]\) is open prove that \([a,b]\) is closed?
  4. For \(a<b\), explain why the included endpoint \(a\) prevents \([a,b)\) from being open.
  5. Is \(\{7\}=[7,7]\) open, closed, both, or neither as a subset of \(\mathbb{R}\)? Justify your answer using the definitions.