= Connected subset of the real line
In the usual <subspace topology> from the <real line>, a <subset> $A\subseteq\mathbb R$ is <connected> exactly when it has the defining property of a <real interval>:
$$
a,b\in A,\qquad a<c<b\quad\Longrightarrow\quad c\in A.
$$
Every <real number> between two members must be present. Thus <open intervals>, <closed intervals>, intervals with only one endpoint included, and unbounded <real intervals> are <connected>. <Singleton sets> are <connected> too. With the no-<separation of a topological space> convention used here, the <empty set> satisfies the same property; some texts reserve the word <connected> for nonempty <topological spaces>.<General Topology by Tom Leinster>[p. 68, and Proposition C2.6, p. 73: the nonempty convention and the interval characterization]{ref}
Removing an interior point changes the answer:
$$
[-2,2]\setminus\{0\}=[-2,0)\cup(0,2].
$$
These two <real intervals> are exactly its <connected components> and its <path components>. Removing an endpoint instead leaves a <real interval>, for example $[-2,2]\setminus\{2\}=[-2,2)$, which stays <connected>. This is why an interior point of a <closed interval> is a <cut point>, whereas an endpoint is not. A nonempty <finite set> of points in the <real line> is <connected> exactly when it is a <singleton set>.
Proof outline: if $a,b\in A$ but $c\in(a,b)$ is missing, the <subsets>
$$
A\cap(-\infty,c),\qquad A\cap(c,\infty)
$$
give a <separation of a topological space>, since the two <open intervals> make both pieces <open> in $A$. Conversely, a nonempty <real interval> contains the <continuous path> $t\mapsto(1-t)a+tb$ between any two of its points, so it is <path-connected> and hence <connected>. Together with <continuous image of a connected space>, this characterization gives the <intermediate value theorem>: a <continuous function> on a <real interval> cannot jump over a value lying between two attained values.
Back to article page