Let \(n\geq 1\) and let \(G\) be a group, abelian if \(n\geq 2\). An Eilenberg–MacLane space \(K(G, n)\) is a path connected CW complex \(X\) with homotopy groups \[ \pi_i(X)\cong \begin{cases} G & i = n, \\ 0 & i\neq n. \end{cases} \]
Let \(n\geq 1\) and \(G\) a group, abelian if \(n\geq 2\). A CW complex \(K(G, n)\) exists, and any two are homotopy equivalent. If \(G\) is abelian, then for every CW complex \(X\) there is a natural bijection \[ H^n(X; G)\cong\langle X, K(G, n)\rangle \] with the set of basepoint-preserving homotopy classes of basepoint-preserving maps \(X\to K(G, n)\).
The circle \(S^1\) is a \(K(\ZZ, 1)\), \(\CP^\infty\) is a \(K(\ZZ, 2)\), and \(\RP^\infty\) is a \(K(\ZZ/2, 1)\).
[@Hat02].