Given a topological group, say $G$, it is well known that the classifying space $BG$ classifies $G$ principal bundles. Under some mild assumption on $G$, one model of $BG$ is the geometric realization of the nerve of the one object groupoid $G⇉\*$.


Let $P\to M$ be a $G$ principal bundle. We can form the action groupoid $P\rtimes G=\{P\times G⇉ P\}$, whose nerve is also the bar construction. There are natural groupoid morphisms $P\rtimes G\to G⇉\*$, and $P\rtimes G\to \underline{M}$, where $\underline{M}$ is the trivial groupoid.


Taking the nerve and then taking geometric realization, we obtain a map


$$|N\_\bullet （P\rtimes G）|\to BG.$$


Notice that $N\_\bullet (P\rtimes G)\to N\_\bullet \underline{M}$ is acyclic, thus we have a map
$$M\to BG$$
up to homotopy. 


My question is that: whether this map is the classifying map for the $G$-principal bundle $P\to M$? 


Since all the maps are so natural, I would expect the answer should be yes. However, I did not find the relevant relevant reference.


Thanks a lot.



Classifying map of a principal bundle
If $M$ is paracompact, or more generally $P$ is trivialised over a [numerable open cover](http://ncatlab.org/nlab/show/numerable+open+cover), this map is indeed the classifying map for $P\to M$. Note that the universal bundle $EG \to BG$ is given by the geometric realisation of $G\rtimes G \to \ast \rtimes G$, since you are assuming $G$ well-pointed (so that $|N (\ast \rtimes G)| \simeq BG$). 


So to show that $M\to BG$ as you give is the classifying map, it is enough to show that $P\times\_M N \simeq c^\ast EG$, where $N:= |N(P\rtimes G)|$ and $c\colon N\to BG$. Since $M$ is paracompact, $N\to M$ is [shrinkable](http://ncatlab.org/nlab/show/shrinkable+map), and hence a homotopy equivalence. Thus given a section, pulling $P\times\_M N$ back along this section gives a bundle isomorphic to $P$, as pullback along homotopic maps (in case the identity, and pulling up then back down) gives isomorphic bundles, which gives the result that $M\to BG$ classifies $P$.


Now assuming that we use the k-space product, or that all the spaces involved are locally compact weak Hausdorff, then geometric realisation of simplicial spaces preserves pullbacks. Thus $c^\ast EG$ is given by the geometric realisation of the nerve of $(P\rtimes G) \times\_{(\ast\rtimes G)} (G\rtimes G)$, and $P\times\_M N$ by the geometric realisation of the nerve of $\underline{P}\times\_\underline{M}(P\rtimes G)$. Thus we only need to show that there is an isomorphism of groupoids
$$
(P\rtimes G) \times\_{(\ast\rtimes G)} (G\rtimes G) \simeq (P\times G) \rtimes G \to \underline{P}\times\_\underline{M}(P\rtimes G) \simeq (P\times\_M P) \rtimes G,
$$
where the action in $(P\times G) \rtimes G$ is diagonal, and the action in $(P\times\_M P) \rtimes G$ is on the right factor of $P$ only.


The map on the level of objects is just 
$$
P\times G \to P\times\_M P,
$$
sending $(p,g) \mapsto (p,pg)$, and by principality of the action this is an isomorphism. The map on the level of arrows is 
$$
P\times G \times G \to P\times\_M P \times G
$$
sending $(p,g\_1,g\_2) \mapsto (p,pg\_1,g\_2)$, again an isomorphism. It is not too difficult to see that this is funtorial, and so we get an isomorphism of geometric realisations as desired.


As far as a reference is concerned, Segal's paper *Classifying spaces and spectral sequences*, Publications Mathématiques de l'IHÉS, 34 (1968), p. 105-112 ([Numdam](http://www.numdam.org/item?id=PMIHES_1968__34__105_0)) is probably the best, though he doesn't give the direct argument from above, using instead cocycles for an open cover (if you think of the space P as a cover over which the bundle P trivialises, then his argument can be applied to recover the above).


