Algebraic Topology

CW Complexes: Building Spaces by Attaching Cells

Almost every space a topologist cares about — spheres, projective spaces, Grassmannians, classifying spaces, the geometric realization of any simplicial set — can be built by starting with a discrete set of points and repeatedly gluing in disks along their boundaries. That recipe is a CW complex, and its payoff is enormous: once a space has a CW structure, its homology, cohomology, and homotopy become computable by a finite (or at least combinatorial) bookkeeping of cells and attaching maps.

Precisely: a CW complex is a Hausdorff space X built as the union of an increasing sequence of skeleta X⁰ ⊂ X¹ ⊂ X² ⊂ ⋯, where Xⁿ is obtained from Xⁿ⁻¹ by attaching n-cells eⁿ via maps φ: Sⁿ⁻¹ → Xⁿ⁻¹, and X carries the weak topology determined by all the cells. The letters stand for Closure-finiteness and the Weak topology — the two axioms, isolated by J. H. C. Whitehead in 1949, that make the theory work.

  • FieldAlgebraic topology
  • Introduced byJ. H. C. Whitehead, 1949
  • Core ideaBuild spaces by attaching n-disks along their boundary spheres
  • The two axiomsClosure-finiteness (C) + Weak topology (W)
  • Key payoffCellular homology: chain groups free on the n-cells
  • GeneralizesSimplicial complexes; realized by simplicial sets and Δ-complexes

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The precise definition: skeleta, attaching maps, and the CW axioms

A CW complex is a Hausdorff space X together with a filtration by skeleta X⁰ ⊆ X¹ ⊆ X² ⊆ ⋯ with X = ⋃ₙ Xⁿ, constructed inductively:

  • X⁰ is a discrete set of points (the 0-cells).
  • Xⁿ is formed from Xⁿ⁻¹ by attaching a collection of n-cells {eⁿ_α}: pick attaching maps φ_α: Sⁿ⁻¹ → Xⁿ⁻¹ and set Xⁿ = (Xⁿ⁻¹ ⊔ ⨆_α Dⁿ_α) / (x ∼ φ_α(x) for x ∈ ∂Dⁿ_α = Sⁿ⁻¹).

Each n-cell comes with a characteristic map Φ_α: Dⁿ_α → X restricting to φ_α on the boundary and to a homeomorphism onto the open cell eⁿ_α on the interior. The two defining conditions are: (C) closure-finiteness — the closure of each cell meets only finitely many cells; and (W) weak topology — a set A ⊆ X is closed iff A ∩ Φ_α(Dⁿ_α) is closed for every cell. When there are finitely many cells (a finite CW complex), (C) and (W) are automatic and X is compact.

The picture: growing a space one dimension at a time

Think of it as sculpting. You start with a scatter of dots (X⁰). You glue in arcs — each 1-cell is an interval whose two endpoints are slapped onto existing dots — turning the space into a graph (X¹). Then you fill in membranes: each 2-cell is a disk whose rim is wrapped around a loop in the graph. A 3-cell is a solid ball whose boundary sphere is mapped into the 2-skeleton, and so on.

The freedom lives entirely in the attaching maps. Wrapping a 2-cell's boundary once around a circle gives a disk (contractible); wrapping it twice around gives ℝP², the real projective plane; wrapping it around a figure-eight along the word aba⁻¹b⁻¹ gives the torus. Same cells, different glue, wildly different topology.

The weak topology axiom is what lets you test continuity cell by cell: a map out of X is continuous exactly when its restriction to each closed cell is continuous. This is the engine behind nearly every construction of maps out of CW complexes.

The key mechanism: induction over skeleta and cellular approximation

Almost every theorem about CW complexes is proved by induction on the skeleta, using one structural fact repeatedly: attaching an n-cell is a pushout. The square with ⨆ Sⁿ⁻¹ → Xⁿ⁻¹ and ⨆ Sⁿ⁻¹ ↪ ⨆ Dⁿ giving Xⁿ is a pushout of topological spaces, and because Sⁿ⁻¹ ↪ Dⁿ is a cofibration, so is every inclusion Xⁿ⁻¹ ↪ Xⁿ — hence every subcomplex inclusion A ↪ X.

The second engine is the Cellular Approximation Theorem (Whitehead): any continuous map f: X → Y between CW complexes is homotopic to a cellular map (one sending Xⁿ into Yⁿ). The proof pushes the image off the interiors of high-dimensional cells using the fact that a map Dⁿ → Dᵏ with n < k, being smooth after approximation, must miss a point of the open k-cell, and one deformation-retracts away from that point. This is why πₙ(Sᵏ) = 0 for n < k — the cells force it. Skeletal induction plus cellular approximation reduce homotopy-theoretic questions to finite combinatorics of cells and degrees.

Worked example: the CW structures on the sphere Sⁿ

The sphere illustrates how the same space admits very different, equally valid CW structures.

  • Two-cell model. Give Sⁿ one 0-cell and one n-cell: Sⁿ = e⁰ ∪ eⁿ, with the n-cell's boundary Sⁿ⁻¹ crushed to the single point by the constant attaching map. Concretely Sⁿ = Dⁿ / ∂Dⁿ. This is the minimal CW structure — just two cells.
  • Equatorial model. Alternatively, in each dimension 0 ≤ k ≤ n put two k-cells (upper and lower hemispheres), attaching each along the equator Sᵏ⁻¹. This exhibits the tower S⁰ ⊂ S¹ ⊂ ⋯ ⊂ Sⁿ and generalizes to the infinite-dimensional S^∞ = ⋃ Sⁿ.

The two-cell model makes cellular homology trivial to read off: the chain complex is ℤ (degree 0) → 0 → ⋯ → 0 → ℤ (degree n) with all boundary maps zero, giving H₀ = Hₙ = ℤ and Hₖ = 0 otherwise — exactly the homology of Sⁿ, computed with essentially no work. Real projective space ℝPⁿ = e⁰ ∪ e¹ ∪ ⋯ ∪ eⁿ (one cell per dimension) yields the famous complex ⋯ →2→ ℤ →0→ ℤ →2→ ℤ, recovering its ℤ/2 torsion.

Why the axioms matter: what breaks without C and W

Both letters are load-bearing. Drop the weak topology (W) and pathologies appear. The classic case is the Hawaiian earring — nested circles of radius 1/n through a common point, with the subspace topology from ℝ². It is not a CW complex: a genuine countable wedge of circles ⋁ₙ S¹ (the CW version) has the weak topology, in which every neighborhood of the basepoint contains all but finitely many whole circles only if... precisely the opposite holds — the two spaces have different topologies and non-isomorphic fundamental groups (the earring's π₁ is uncountable and not free).

Drop closure-finiteness (C) and the local structure can degenerate: a cell's closure meeting infinitely many other cells can destroy local contractibility. With both axioms, one proves the crucial regularity facts: every CW complex is normal, compactly generated, locally contractible, and paracompact; compact subsets meet only finitely many cells (the 'compactly supported' lemma); and every CW pair (X, A) has the homotopy extension property — i.e. is a cofibration. These are exactly the hypotheses later theorems silently rely on.

Significance: Whitehead's theorem and what CW structure unlocks

CW complexes are the native habitat of homotopy theory. The headline result is Whitehead's Theorem (1949): a map f: X → Y between connected CW complexes that induces isomorphisms on all homotopy groups πₙ(f) is a homotopy equivalence. This is spectacularly false for general spaces (a weak homotopy equivalence need not be an equivalence), so restricting to CW complexes is what makes 'same homotopy groups ⇒ same homotopy type' true.

Everything downstream leans on it:

  • Cellular homology gives chain groups free on the cells, matching singular homology — the standard practical computation tool.
  • CW approximation: every space admits a weak equivalence from a CW complex, so homotopy-invariant functors lose nothing by working with CW complexes.
  • Obstruction theory, Eilenberg–MacLane spaces K(π,n), classifying spaces BG, spectra, and Postnikov towers are all built cell by cell.
  • The Whitehead product, cofiber sequences, and the entire model-category structure on Top take CW/cofibrant objects as their well-behaved core.

In short: CW structure converts topology into algebra you can actually compute with.

CW complexes versus neighboring notions of 'built from pieces'
NotionBuilding blockGluing ruleTopology / regularity
Simplicial complexSimplices (n-dim triangles)Faces meet along common subfaces; a simplex is determined by its verticesCombinatorially rigid; every space needs many simplices
Δ-complexSimplices with ordered verticesAttach via affine face maps; faces may be identifiedFewer cells than simplicial; still simplex-shaped cells
CW complexCells eⁿ ≅ open n-disksAttach n-cell by any continuous φ: Sⁿ⁻¹ → Xⁿ⁻¹Weak topology; closure-finite; Hausdorff
Arbitrary quotient of disksDisksAny identification whatsoeverCan fail Hausdorff / weak-topology axioms — not a CW complex

Frequently asked questions

What do the letters 'C' and 'W' actually stand for?

They abbreviate the two axioms Whitehead imposed. 'C' is closure-finiteness: the closure of each cell meets only finitely many cells. 'W' is the weak topology: a subset is closed exactly when its intersection with each closed cell is closed. Together they force the space to be built genuinely 'cell by cell' with good local behavior.

How is a CW complex different from a simplicial complex?

A simplicial complex is built from simplices that must meet along common faces and are pinned down by their vertices, which is rigid and cell-expensive. A CW complex allows cells to be attached by any continuous map of the boundary sphere, so you can build the same space with far fewer cells (Sⁿ needs 2 cells as a CW complex versus many simplices). Every simplicial complex is a CW complex, but not conversely in a canonical simplicial way.

Why is the Hawaiian earring not a CW complex?

The Hawaiian earring carries the subspace topology from the plane, in which every neighborhood of the common point meets infinitely many circles. A CW wedge ⋁ S¹ instead uses the weak topology, which is strictly finer, so the two spaces are not homeomorphic. Concretely their fundamental groups differ: the earring's π₁ is uncountable and not free, while the CW wedge's is a free group.

Does every topological space have a CW structure?

No — a CW complex must be Hausdorff, locally contractible, and compactly generated, so any space lacking these (e.g. an infinite-dimensional space with bad local topology, or a non-Hausdorff space) cannot be one. However, every space admits a CW approximation: a CW complex mapping to it by a weak homotopy equivalence. That is enough for essentially all of homotopy theory, which only sees weak equivalence type.

Why does Whitehead's theorem require CW complexes?

For general spaces, inducing isomorphisms on all homotopy groups (a weak homotopy equivalence) does not imply a homotopy equivalence — the Warsaw circle versus a point is a standard counterexample. The CW hypothesis supplies the homotopy extension property and skeletal induction needed to build the inverse map and the homotopies explicitly. Drop 'CW' and the conclusion genuinely fails.

What is the difference between an open cell, a closed cell, and the characteristic map?

The open n-cell eⁿ is the homeomorphic image of the open disk interior; it is a cell of the complex and the eⁿ partition X. The closed cell is its closure, which may not be a disk (its boundary can be badly folded by the attaching map). The characteristic map Φ: Dⁿ → X is the continuous map from the whole closed disk that restricts to a homeomorphism on the interior and to the attaching map φ: Sⁿ⁻¹ → Xⁿ⁻¹ on the boundary.