Let G be a Lie group and M a smooth manifold. Suppose that P is a principal G-bundle over M. Then by Yoneda, this corresponds to a smooth map $p:M \to [G]$, where $[G]$ is the differentiable stack associated to G. If P is equipped with a connection, how does this fit in this picture?


I was thinking of using the fact that we can obtain $P$ as the weak pullback of the classifying map p along the universal principal G-bundle $\* \to [G]$, and then using that the tangent functor preserves finite weak limits. Then, if we are given a connection in terms of a G-invariant subbundle of $TP$, we could express its inclusion map $H \to TP$ as a map $H \to TM$ together with a certain 2-cell between the composite of the canonical map $H \to [TG]$ (the universal TG-bundle composed with the unique map to the terminal object) and T(p) composed with $H \to TM$. But then of course, we need to put conditions on our map $H \to TM$ to make sure that the induced map $H \to TP$ is an inclusion of vector bundles that moreover defines a G-invariant Ehresmann connection. Maybe this is not the way to go...


Does anyone know of a nice way of encoding a connection in this stacky language?



Connections on principal bundles via stacks?
The only thing which has to be replaced in the representation of a principal bundle as a suitable class of a maps $M\to [\*/G]$ in order to introduce a flat connection is to replace $M$ by its fundamental 1-groupoid $\Pi\_1(M)$, or, if the connection is not flat, by the thin homotopy version $P\_1(M)$ of it, cf. [nlab:path groupoid](http://ncatlab.org/nlab/show/path+groupoid). The same way it works for higher categorical generalizations, see [Schreiber:differential nonabelian cohomology](http://ncatlab.org/schreiber/show/Differential+Nonabelian+Cohomology) and for details also Sec. 7.4 (from page 27 on in version 1) in [arxiv/1004.2472](http://arxiv.org/abs/1004.2472).


