Connected subset (source code)

= Connected subset

A <subset> $A$ of a <topological space> $X$ is a <connected subset> when $A$, with the <subspace topology> inherited from $X$, is a <connected space>. Thus <connectedness> is tested inside $A$: a forbidden <separation of a topological space> consists of nonempty <subsets>
$$
U=A\cap O_1,\qquad V=A\cap O_2,\qquad A=U\cup V,\qquad U\cap V=\varnothing,
$$
where $O_1,O_2$ are <open sets> in $X$. The ambient <open sets> need not be disjoint outside $A$.

For example, in the <real line> with its usual <topology>, $[0,2]$ is a <connected subset>, whereas $\{0,2\}$ is not: its two <singleton sets> are <open> in its <subspace topology>. A <subset> of a <connected space> need not be <connected>. Conversely, $[-2,-1]$ is a <connected subset> of the disconnected <topological space> $[-2,-1]\cup[1,2]$. The ambient <topological space> need not itself be <connected>.

A <finite set> of distinct points in the <real line> inherits the <discrete topology>: a sufficiently small <open interval> around each point isolates that point. Its only nonempty <connected subsets> are <singleton sets>. This depends on the <topology>: a nonempty <finite set> with the <indiscrete topology> is a <connected space>, since its only <open sets> are itself and the <empty set>. Here, as in the definition of <connected space>, the <empty set> is also <connected> because it admits no <separation of a topological space>.<Point-Set Topology by Romyar Sharifi/Chapter 3: Connected and compact spaces>[Definition 3.1.1 and Example 3.1.3: connectedness and discrete spaces]{ref}

The distinction matters when finding <connected components>: we search among <connected subsets> of the specified <topological space>, rather than judging whether the surrounding drawing looks like one piece.