# Connections on principal bundles via stacks?

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 \left\[G\right]$, where $\left\[G\right]$ 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 \left\[G\right]$, 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 \left\[TG\right]$ (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?

-
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. The same way it works for higher categorical generalizations, see Schreiber:differential nonabelian cohomology and for details also Sec. 7.4 (from page 27 on in version 1) in arxiv/1004.2472.
So, this $P_1(M)$ guy gives us stack on Diff which admits an epimorphism from a diffeological space (in particular a sheaf on Diff), and maps from its associated stack to $\left[G\right]$ classify principal bundles on G with connection? (and then a connection is a choice of factorization of the map $M \to \left[G\right]$ through $M -> \left[P_1(M\right)\right]$?) –  David Carchedi Apr 20 '10 at 17:40