Let $G$ be a finite group, $BG$ its classifying space and M a manifold. Then it is mentioned in https://arxiv.org/abs/1705.05171 (Remark 2.3 d) that there is an equivalence of categories $$ \Pi (M,BG) \cong PBun_G(M) $$ between the groupoid of maps from $M$ to $BG$ (with homotopy-classes of homotopies as morphisms) and the groupoid of principal $G$-bundles over $M$. How can one prove that? Where in the litterature can I find a proof of that?
Yet I could only find proofs that homotopy classes of maps correspond to isomorphism classes of principal bundles. But in order to prove that it gives an equivalence of categories I also need that the morphisms correspond to each other.
That they correspond to each other is also mentioned in https://www.uni-due.de/~hm0002/stacks.pdf (In the beginning of chapter 1), but no proof is given.
Thank you in advance for your help
To have an equivalence of groupoids we need an equivalence on components and on automorphism groups of each component. The equivalence on components is the classical story. The reference I like best for this is Stephen Mitchell's notes https://www3.nd.edu/~mbehren1/18.906/prin.pdf
To get equivalence on automorphism groups is not difficult. Suppose $H: X \times I \rightarrow BG$ is a homotopy from the map $f: X \rightarrow BG$ to itself. Then this can instead be written as $H: X \times S^1 \rightarrow BG$ with the restriction to $X \times \{*\}$ equal to $f$.
We may pull back the universal bundle to get a vector bundle over $X \times S^1$. Because our group is discrete, by going in the counter-clockwise direction we have a unique path associated to $x \in X$ starting at $(x,\{*\})$ and returning to $(x',\{*\})$ for some $x' \in X$. Think about what happens on the boundary of the Mobius strip.
This assignment $x \rightarrow x'$ then gives an automorphism of the pullback bundle along $f$. Hence, we have a map from the self homotopies of a map to the automorphism group of the pullback bundle. To see that this is an isomorphism, we construct the inverse map.
Given an automorphism of the principal bundle $P \rightarrow X$, pullback along the projection to get a principal bundle over $X \times I$. Now we may glue along the automorphism to get a principal bundle over $X \times S^1$. This is classified by a map $X \times S^1 \rightarrow BG$ which gives rise to a self homotopy of the map classifying $P \rightarrow X$. It is not hard to check these are inverse.
Notably, the first map requires discreteness and the second does not.