Theorem on space of maps to Eilenberg-Maclane space I was reading the classic paper of Atiyah-Bott on Yang-Mills equations on Riemann surfaces. They mention a theorem attributed to Thom saying that if $X$ is a finite CW complex, then 
\begin{equation}
\text{Map} (X, K(G,n)) = \prod_q K(H^q(X, G), n-q)
\end{equation}
(assuming they mean homotopy equivalent)
Could someone help me find a reference to this theorem, or at least explain how to obtain the right map between these spaces?
 A: I assume $G$ is discrete here. It's easy to at least compute that the RHS has the correct homotopy groups: writing $[X, Y]$ for the space of maps between $X$ and $Y$ and $B^n G$ for $K(G, n)$, observe that
$$\pi_k [X, B^n G] \cong \pi_0 \Omega^k [X, B^n G] \cong \pi_0 [X, \Omega^k B^n G] \cong \pi_0 [X, B^{n-k} G] \cong H^{n-k}(X, G).$$
It's more interesting to explain why $[X, B^n G]$ is the simplest possible space with those homotopy groups. One way to say it is the following: 


*

*There is a model of the functor $G \mapsto BG$ sending a topological group to its classifying space such that if $G$ is a topological abelian group, then so is $BG$; by induction, $B^n G$ can always be modeled by a topological abelian group.

*If $B^n G$ is a topological abelian group, then so is $[X, B^n G]$.

*Any topological abelian group $A$ is homotopy equivalent to a product $\prod B^n \pi_n(A)$ of Eilenberg-MacLane spaces. Equivalently, its Postnikov invariants vanish. 
I don't know a reference for this, unfortunately. 
A: I stumbled upon this question while participating on a reading seminar on the paper. I'll provide another proof (which I believe is correct).
We show that both spaces $\operatorname{Map}(X, K(G,n))$ and $\prod_q K(H^q(X;G), n-q)$ represent(homotopically) the functor $Z \mapsto \bigoplus_qH^{n-q}(Z; H^q(X;G))$, where $Z$ is a CW-complex. Indeed
\begin{align}
[Z, \prod_q K(H^q(X;G), n-q)] &\cong \bigoplus_q [Z, K(H^q(X;G), n-q)]
\cong \bigoplus_q H^{n-q}(Z; H^q(X;G))
\end{align}
On the other hand,
$$
[Z, \operatorname{Map}(X, K(G,n))] \cong [Z \times X, K(G,n)] \cong H^n(Z\times X, G).
$$
The last identity heavily relies on the fact that $X$ is a finite CW-complex in order to guarantee that the product $Z \times X$ is also a CW-complex. Now, one can show (for instance by means of Serre spectral sequence of the trivial fibration $X \to Z \times X \to Z$)
$$
H^n(Z\times X, G) \cong \bigoplus_q H^{n-q}(Z; H^q(X;G)).
$$
Since both spaces represent the same functor in the homotopy category of CW-complexes, they must be homotopically equivalent. 
