Topology of the Real Line

1. Open Intervals and Open Sets

Definition
An open interval in the real line is a set of the form
\[ (a,b) := \{ x \in {\mathbb R} \ : \ a < x \text{ and } x < b \}\]
for any extended real numbers \(a < b\). (Here the inequalities \(-\infty < x\) and \(x < \infty\) are understood as being satisfied by all real numbers \(x\).)

An open set \(U \subset {\mathbb R}\) is any set with the property that every point \(x \in U\) has the property that it is contained in some open interval \((a,b)\) which is itself contained in \(U\), i.e., \(x \in (a,b) \subset U\).

An open set \(U\) which contains a particular number \(p \in {\mathbb R}\) is often called a neighborhood of \(p\).

Note that we take the convention that the empty set \(\emptyset\) is open because there is no point \(x \in \emptyset\) which fails to belong to an interval \((a,b) \subset \emptyset\).
Proposition
A nonempty set \(U \subset {\mathbb R}\) is an open set if and only if there exists some collection of open intervals \(\{I_\lambda\}_{\lambda \in \Lambda}\) such that \(U = \bigcup_{\lambda \in \Lambda} I_\lambda\). Note in particular that the index set \(\Lambda\) can have any cardinality (e.g., may be uncountable).
Proof
Meta (Main Idea)
If \(U\) is open, we may take the index set \(\Lambda\) to simply equal \(U\) and may let \(I_\lambda\) be some open interval containing \(\lambda\) which is contained in \(U\). Clearly each point \(\lambda \in U\) belongs to \(I_\lambda\) and consequently to the union \(\bigcup_{\lambda \in \Lambda} I_{\lambda}\). Conversely, every point \(x\) in this union belongs to some interval \(I_\lambda\) which is contained in \(U\).

On the flip side, if \(U := \bigcup_{\lambda \in \Lambda} I_{\lambda}\), every point \(x \in U\) belongs to some open interval \(I_\lambda\) which is entirely contained in \(U\). We often summarize this idea by saying that the open intervals are a basis for the collection of open sets in \({\mathbb R}\).
Example
The set \({\mathbb R} \setminus {\mathbb Z}\) is open.
Proof
We may write \({\mathbb R} \setminus {\mathbb Z} = \bigcup_{t \in {\mathbb Z}} (t,t+1)\).

2. Topological Formulation of Convergence

A key fact about open intervals is the following: Given any open interval \((a,b)\) and any point \(x \in (a,b)\), there is some \(\epsilon > 0\) such that \((x-\epsilon,x+\epsilon) \subset (a,b)\). If both \(a\) and \(b\) are finite, one can see this by taking \(\epsilon = \min \{ |x-a|,|x-b| \}\). If one or both of \(a\) and \(b\) is infinite, suitable adjustments can be made to identify an appropriate \(\epsilon\). From this simple fact, we have a third characterization of open sets:
Proposition
A nonempty set \(U \subset {\mathbb R}\) is open if and only if for every \(x \in U\), there is some \(\epsilon > 0\) such that \((x-\epsilon,x+\epsilon) \subset U\).
Proposition
Let \(\{x_n\}_{n=1}^\infty\) be a sequence of real numbers. The sequence converges to \(L \in {\mathbb R}\) if and only if for every open set \(U\) containing \(L\), there is some natural number \(N\) such that \(x_n \in U\) for all \(n > N\).

In other words, the sequence \(\{x_n\}_{n=1}^{\infty}\) converges to \(L\) if and only if every neighborhood \(U\) of \(L\) contains \(x_n\) for all but at most finitely many values of \(n\) (depending on \(U\)).
Proof
Meta (Main Idea)
If \(\{x_n\}_{n=1}^\infty\) converges to \(L\) and \(U\) is a neighborhood of \(L\), then there is some \(\epsilon\) such that \((L-\epsilon,L+\epsilon) \subset U\). By convergence, there is some \(N\) such that \(n > N\) guarantees \(|x_n - L| < \epsilon\), meaning that \(x_n \in (L-\epsilon,L+\epsilon)\) for all \(n > N\). Thus \(x_n \in U\) for all \(n > N\).

In the converse direction, the interval \((L-\epsilon,L+\epsilon)\) is certainly an open set (as it is a union of open intervals), so if \(\{x_n\}_{n=1}^\infty\) belongs to it for all \(n > N\), this means \(|x_n - L| <\epsilon\) holds for all \(n > N\).

3. Closed Sets

Definition
A closed set \(E \subset {\mathbb R}\) is any set whose complement is open.
Example
The integers \({\mathbb Z}\) are a closed subset of \({\mathbb R}\).
Example
Any closed interval
\[ [a,b] := \{ x \in {\mathbb R} \ : \ a \leq x \leq b \}\]
for real numbers \(a<b\) is a closed set because its complement is \((-\infty,a) \cup (b,\infty)\), a union of open intervals.
Important
Open and closed are not exhaustive or mutually exclusive concepts. Sets need not be open or closed. The empty set and \({\mathbb R}\) are open and closed. The rational numbers \(\mathbb Q\) are neither open nor closed.

4. Properties of Open and Closed Sets

In practical terms, the most important properties of open and closed sets are as follows:
  1. The empty set \(\emptyset\) and the real line \({\mathbb R}\) are both open and closed sets.
  2. Arbitrary unions of open sets are open. Arbitrary intersections of closed sets are closed.
  3. Finite intersections of open sets are open. Finite unions of closed sets are closed.
    Proof
    By De Morgan's Law, it suffices to show that finite intersections of open sets are open. Let \(U_1,\ldots,U_N\) be open and let \(U := \bigcap_{n=1}^N U_n\). If \(x \in U\), then \(x \in U_n\) for each \(n\), meaning that each \(n\) admits some \(\epsilon_n > 0\) such that \(x \in (x-\epsilon_n,x+\epsilon_n) \subset U_n\). If \(\epsilon = \min \{\epsilon_1,\ldots,\epsilon_n\}\), then this means that \((x-\epsilon,x+\epsilon) \subset U\).
Note that the finiteness assumption matters: if there were infinitely many open \(U_n\), the minimum would need to be replaced by an infimum, but it may be possible in that case that the infimum of the \(\epsilon_n\)'s is zero (which is not allowed) even though none of the particular \(\epsilon_n\)'s vanish.
Exercises
  1. Prove the proposition above: A set \(U \subset {\mathbb R}\) is open if and only if for every \(x \in U\), there is some \(\epsilon > 0\) such that \((x-\epsilon,x+\epsilon) \subset U\).
  2. Prove that the rational numbers are neither open nor closed.