Connected Components

lean4-prooftopologyvisualization
X=xCx,Cx closedX = \bigsqcup_{x} C_x, \quad C_x \text{ closed}

Statement

For any topological space XX and any point xXx \in X, the connected component of xx is the union of all connected subsets containing xx:

Cx={SX:xS,S connected}.C_x = \bigcup \{S \subseteq X : x \in S,\, S \text{ connected}\}.

Three key facts hold simultaneously:

  1. Each CxC_x is connected (the union of connected sets sharing a point is connected).
  2. The components partition XX: distinct components are disjoint, and every point belongs to exactly one component.
  3. Each CxC_x is closed in XX.

A space is totally disconnected if every component is a singleton (e.g. Q\mathbb{Q}).

Visualization

Example 1 — R{0}\mathbb{R} \setminus \{0\} has two components:

     C₋ = (-∞, 0)          C₊ = (0, +∞)
  ←──────────────────) 0 (──────────────────→
        component            component
        of -1                of 1

  Any path from -1 to 1 must cross 0, which is missing.
  So no connected set straddles the gap.

Example 2 — Q\mathbb{Q} is totally disconnected:

Rational qqComponent CqC_qSize
00{0}\{0\}singleton
1/21/2{1/2}\{1/2\}singleton
2\sqrt{2}(irrational, not in Q\mathbb{Q})

Between any two rationals p<qp < q lies an irrational rr. The open sets (,r)Q(-\infty, r) \cap \mathbb{Q} and (r,)Q(r, \infty) \cap \mathbb{Q} disconnect any interval, so no two rationals share a component.

Closure: In R\mathbb{R}, the component (,0)(-\infty, 0) is open, and also closed (its complement (0,)(0, \infty) is open). In general, components need not be open — but they are always closed.

Proof Sketch

  1. Connectedness of CxC_x: Write Cx=αSαC_x = \bigcup_{\alpha} S_\alpha where each SαS_\alpha contains xx. Any two points of CxC_x lie in some SαS_\alpha and SβS_\beta both containing xx; the union SαSβS_\alpha \cup S_\beta is connected (overlapping connected sets sharing a point). A union of connected sets with a common point is connected by induction.

  2. Partition: If CxCyC_x \cap C_y \ne \emptyset, then CxCyC_x \cup C_y is a connected set containing both xx and yy, so it is contained in CxC_x and in CyC_y, forcing Cx=CyC_x = C_y.

  3. Closedness of CxC_x: The closure Cx\overline{C_x} is connected (closure of a connected set is connected in any topological space). Since CxC_x is the maximal connected set containing xx, and Cx\overline{C_x} contains xx and is connected, we must have CxCx\overline{C_x} \subseteq C_x, i.e. CxC_x is closed.

Connections

  • Heine–Borel TheoremHeine–Borel TheoremKRn  compact    K  closed and boundedK \subseteq \mathbb{R}^n \;\text{compact} \iff K \;\text{closed and bounded}In ℝⁿ, a subset is compact if and only if it is closed and boundedRead more → — in Rn\mathbb{R}^n the connected components of an open set are open; Heine–Borel implies each compact connected component is closed and bounded.
  • Tychonoff's TheoremTychonoff's TheoremiIXi compact    i,  Xi compact\prod_{i \in I} X_i \text{ compact} \iff \forall i,\; X_i \text{ compact}An arbitrary product of compact spaces is compact in the product topologyRead more → — the product of connected spaces is connected; equivalently, products of spaces with one component each have one component.
  • Bolzano–Weierstrass TheoremBolzano–Weierstrass Theorembounded (xn)Rn    convergent subsequence\text{bounded } (x_n) \subseteq \mathbb{R}^n \implies \exists\, \text{convergent subsequence}Every bounded sequence in ℝⁿ has a convergent subsequenceRead more → — the real line is connected precisely because every bounded sequence has a convergent subsequence; total disconnectedness of Q\mathbb{Q} is the obstruction Bolzano–Weierstrass cures by passing to R\mathbb{R}.

Lean4 Proof

import Mathlib.Topology.Connected.Basic

/-- Each connected component is a closed set. -/
theorem connectedComponent_is_closed
    {X : Type*} [TopologicalSpace X] (x : X) :
    IsClosed (connectedComponent x) :=
  isClosed_connectedComponent

/-- Two points share a component iff one is in the component of the other. -/
theorem same_component_iff
    {X : Type*} [TopologicalSpace X] {x y : X} :
    connectedComponent x = connectedComponent y  y  connectedComponent x :=
  connectedComponent_eq_iff_mem