Homotopy class of maps from torus to BG for a group G [closed]

I find a statement that the set of pairs of commuting elements in a group G is bijective to the set of homotopy classes of maps from torus to BG, the classifying space in the paper Elliptic cohomology I was wondering whether there is a simple proof or some other references for this statement.

closed as off-topic by Franz Lemmermeyer, Wolfgang, abx, john mangual, Ryan BudneySep 13 '16 at 20:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question does not appear to be about research level mathematics within the scope defined in the help center." – Franz Lemmermeyer, Wolfgang, abx, john mangual, Ryan Budney
If this question can be reworded to fit the rules in the help center, please edit the question.

• This is true only if $G$ is discrete, see math.stackexchange.com/questions/36488/… and use that $G\sim \Omega BG$, so $\pi_1(BG)=\pi_0(G),\pi_2(BG)=\pi_1(G)$. – SashaP Sep 13 '16 at 6:29
• Note that the set of pairs of commuting elements in $G$ is in bijections with $\text{Hom}(\mathbb{Z}^2,G)$. – Uri Bader Sep 13 '16 at 12:48
• Could you fix your link? Even after inserting a colon after the http, Numdam said that the document wasn't found. – S. Carnahan Sep 13 '16 at 13:08
• The claim is slightly incorrect as stated; either you should take pointed homotopy or you should quotient by conjugation by $G$. – Qiaochu Yuan Sep 13 '16 at 16:27

For discrete groups $\Gamma, G$ it is true that $${\pi_1}_{\ast}\colon [B\Gamma,BG] \to \text{Hom}(\Gamma,G)$$ is a bijection, see e.g. the first chapter of Mosher-Tangora.
In particular, for $\Gamma = \mathbb Z^2$ we get $$[T^2,BG] \cong \text{Hom}(\mathbb Z^2,G) = \{g,h \in G : gh = hg\}.$$ For $G$ non-discrete however, this fails to be true; take e.g. $G = S^1$ so that $BG = \mathbb CP^{\infty}$. Then $$[T^2,BS^1] = [T^2,S^2] = \mathbb Z,$$ but the space of commuting elements in $G$ is $S^1 \times S^1 = T^2$.