In homotopy theory (a branch of mathematics), the Whitehead theorem states that if a continuous mapping f between CW complexes X and Y induces isomorphisms on all homotopy groups, then f is a homotopy equivalence. This result was proved by J. H. C. Whitehead in two landmark papers from 1949, and provides a justification for working with the concept of a CW complex that he introduced there. It is a model result of algebraic topology, in which the behavior of certain algebraic invariants (in this case, homotopy groups) determines a topological property of a mapping.

Statement 

In more detail, let X and Y be topological spaces. Given a continuous mapping

and a point x in X, consider for any n ≥ 1 the induced homomorphism

where πn(X,x) denotes the n-th homotopy group of X with base point x. (For n = 0, π0(X) just means the set of path components of X.) A map f is a weak homotopy equivalence if the function

is bijective, and the homomorphisms f* are bijective for all x in X and all n ≥ 1. (For X and Y path-connected, the first condition is automatic, and it suffices to state the second condition for a single point x in X.) The Whitehead theorem states that a weak homotopy equivalence from one CW complex to another is a homotopy equivalence. (That is, the map f: X → Y has a homotopy inverse g: Y → X, which is not at all clear from the assumptions.) This implies the same conclusion for spaces X and Y that are homotopy equivalent to CW complexes.

Combining this with the Hurewicz theorem yields a useful corollary: a continuous map  between simply connected CW complexes that induces an isomorphism on all integral homology groups is a homotopy equivalence.

Spaces with isomorphic homotopy groups may not be homotopy equivalent 

A word of caution: it is not enough to assume πn(X) is isomorphic to πn(Y) for each n in order to conclude that X and Y are homotopy equivalent. One really needs a map  f : X → Y inducing an isomorphism on homotopy groups. For instance, take X= S2 × RP3 and Y= RP2 × S3. Then X and Y have the same fundamental group, namely the cyclic group Z/2, and the same universal cover, namely S2 × S3;  thus, they have isomorphic homotopy groups. On the other hand their homology groups are different (as can be seen from the Künneth formula); thus, X and Y are not homotopy equivalent. 

The Whitehead theorem does not hold for general topological spaces or even for all subspaces of Rn. For example, the Warsaw circle, a compact subset of the plane, has all homotopy groups zero, but the map from the Warsaw circle to a single point is not a homotopy equivalence. The study of possible generalizations of Whitehead's theorem to more general spaces is part of the subject of shape theory.

Generalization to model categories 
In any model category, a weak equivalence between cofibrant-fibrant objects is a homotopy equivalence.

References
 J. H. C. Whitehead, Combinatorial homotopy. I., Bull. Amer. Math. Soc., 55 (1949), 213–245
 J. H. C. Whitehead, Combinatorial homotopy. II., Bull. Amer. Math. Soc., 55 (1949), 453–496 
 A. Hatcher, Algebraic topology, Cambridge University Press, Cambridge, 2002. xii+544 pp.  and   (see Theorem 4.5)

Theorems in homotopy theory