The classifying space of a gauge group Let $G$ be a Lie group and $P \to M$ a principal $G$-bundle over a closed Riemann surface. The gauge group $\mathcal{G}$ is defined by
$$\mathcal{G}=\lbrace f : P \to G \mid f(p \cdot g) = g^{-1}f(p)g\ (\forall g \in G, p \in P) \rbrace.$$
I want to understand the following statement which I found in Atiyah-Bott (Roy. Soc. London Ser. A 308).

PROPOSITION 2.4. Let $BG$ be the classifying space for $G$. Then in homotopy theory
  $$B\mathcal{G} = \mathrm{Map}_P(M,BG).$$ Here the subscript $P$
  denotes the component of a map of $M$ into $BG$ which induces $P$.

This is proved by showing that $\pi:\mathrm{Map}_G(P,EG) \to \mathrm{Map}_P(M,BG)$ is a universal $\mathcal{G}$-bundle. 
My questions: 


*

*Why is $\mathrm{Map}_G(P,EG)$ contractible? 

*How do we see that $\pi:\mathrm{Map}_G(P,EG) \to \mathrm{Map}_P(M,BG)$ is locally trivial? Here for a $G$-equivariant map $f:P \to EG$, $\pi(f)$ is the map $P/G \to EG/G$ which is canonically induced by $f$. 


Notes:


*

*It is easy to see that $\mathrm{Map}(P,EG)$ is contractible, because $EG$ is contractible. But, because of the $G$-actions, it does not seem that we can apply the same discussion to $\mathrm{Map}_G(P,EG)$.

*For the second question, Atiyah and Bott say the following. But I can not understand it and I want to understand the details.

If $BG$ is paracompact and locally contractible, which is easily arranged, $\pi$ will be a locally trivial principal fibring, as follows easily from the homotopy properties of fibrings.


*If there is a good exposition of this problem, please let me know.
 A: A nice proof of a related proposition is given in Section 5.1 of Donaldson-Kronheimer's book, The Geometry of 4-manifolds.  See Prop. 5.1.4, which gives the homotopy type of the classifying space for the based gauge group.  This classifying space is related to the one you asked about by the so-called base-point fibration; you might have to do a little work to get the Atiyah-Bott proposition.
A: Actually, $EG$ has more structure that just being contractible. You can endow it with a continuous group multiplication (for the compactly generated topology on the product) and there is a contraction $F\colon [0,1]\times EG\to EG$ such that each $F_t$ is a group homomorphisms. Moreover, $G$ is a closed subgroup and we have $F_t(g)\cdot F_t(x)\cdot F_t(g)^{-1}=g\cdot F_t(x)\cdot g^{-1}$. Putting this together you see that you can apply this contraction to get a contraction of the space of equivariant maps $C(P,EG)^G$. 
However, this is limited to locally contractible $G$ and spelling out the details is a bit involved since you have to use different models of $EG$ that are not entirely compatible with each other. For instance, the claimed equalities can be checked when considering $EG$ as left continuous step functions from $[0,1]$ to $G$ (cf. Brown-Morris "Embeddings in contractible or compact objects", ), but the topology is the one from taking $EG=|\mathcal{E}G|$ for $\mathcal{E}G$ the nerve of the pair groupoid of $G$ (cf. Segal "Classifying spaces and spectral sequences" and "Cohomology of topological groups"). These between these models there exists a bijection that you can use to verify the assertions.
A: Proof of (1): 
(a). Suppose $X$ and $Y$ are $G$-spaces, the action of $G$ on $X$ is free, and $X\to X/G$ is
a principal bundle,  then the space of $G$-equivariant maps 
$$
F(X,Y)^G
$$
is the same thing as the space of sections of the fibration $X\times_G Y \to X/G$.
(b). If $E\to B$ is a Hurewicz fibration, with $B$ connected and the fiber contractible, then the space of sections is again contractible. This can be seen as follows: the adjunction property shows that 
$$
\text{sec}(E \to B) \to F(B,E) \to F(B,B)
$$
is a fibration (the displayed fiber is the space of sections---it's the fiber over the basepoint of $F(B,B)$ given by the identity map of $B$---and the other two spaces are function spaces). Since $F$ is contractible the map $E\to B$ is a homotopy equivalence and therefore so is $F(B,E) \to F(B,B)$. Hence $\text{sec}(E\to B)$ is contractible.
(c). It follows from (a) and (b) that the space of sections of $X\times_G Y \to X/G$ is contractible whenever $Y$ is.
(d). In your case, $X = P$ and $Y = EG$. Hence, $F(P,EG)^G$ is contractible.
Proof of (2):
I'll prove something slightly less, which is enough for what 
you wish to have: 
I claim that 
if $X \to X/G$ and $Y \to Y/G$ are principal $G$-bundles then the map
$$
F(X,Y)^G \to F(X/G,Y/G)
$$
is a Hurewicz fibration. This is the same thing as the map
$$
\text{sec}(X\times_G Y\to X/G) \to \text{sec}(X/G\times Y/G\to X/G)
$$
induced by the fibration $X\times_G Y \to X/G \times Y/G$.
This map of section spaces is the map of fibers which is induced by a map of fibrations
over a common base space: the first fibration is $F(X/G, X\times_G Y) \to F(X/G,X/G)$ and the second one is
$F(X/G, X/G\times Y/G) \to F(X/G,X/G)$. Since the map $F(X/G, X\times_G Y) \to F(X/G, X/G\times Y/G)$ is a fibration, it is formal to show that the
map of section spaces is too. 
In your situation we take $X = P$ and $Y = EG$. Then we see that the map
$$
F(P,EG)^G \to F(P/G,BG)
$$
is a fibration. The fiber at the point of $F(P/G,BG)$ defined by the classifying map for $P \to  P/G$ is then
your gauge group $\cal G$.
