Correspondence $\{$principal $G$-bundles on $M\}\leftrightarrow\{$conjugacy classes of homomorphisms $\pi_1(M)\to G\}$ Context. I'm reading Qiaochu's short note Surfaces and the representation theory of finite groups which aims to prove Mednykh's formula inspired by ideas from topological quantum field theory. On page five, equation (19) seems to suggest (more or less) that principal $G$-bundles on an oriented $n$-manifold without boundary yield homomorphisms $\pi_1(M)\to G$ defined uniquely up to pointwise conjugation by elements of $G$ (a finite group), and conversely.
Question. How exactly does a principal $G$-bundle over $M$ give rise to a (conjugacy class of) group homomorphism(s) $\pi_1(M)\to G$? (And ditto for the converse.)
Initial thoughts: Pick a point $m\in M$ and consider its fiber $F=p^{-1}(m)$ with respect to the covering map $p:\overline{M}\to M$. Pick a particular lift $\overline{m}\in F$ too. Given a $\gamma\in\pi_1(M,m)$, the monodromy action gives us another element $\overline{m}\cdot\gamma$ of $F$. Since $G$ acts regularly on $F$, there is a unique $g\in G$ which sends $\overline{m}$ to $\overline{m}\cdot\gamma$, but this might depend on $\gamma$ so we'll call it $g(\gamma)$. This gives a function $\pi_1(M,m)\to G$ defined by $\gamma\mapsto g(\gamma)$.
However I am not convinced this function is a group homomorphism! In particular, even though I've defined $g(\gamma)$ to do the same thing to $\overline{m}$ that $\gamma$ does, I don't believe $\gamma$ and $g(\gamma)$ necessarily act the same way on $F$. In fact, according to my current understanding, principal $G$-bundles over $\mathbb{S}^1$ (the classification mentioned by Qiaochu on page two as an example) provide counterexamples.
Addendum. My understanding of principal $G$-bundles over $M=\mathbb{S}^1$:
Use the same notation as above. Since $F\cong G$ are isomorphic as $G$-sets, we can without loss of generality label the points of $F$ by elements of $G$. This labelling respects the group action (but is not canonical). Let $\gamma\in\pi_1(\mathbb{S}^1,m)$ be the once-around loop along the circle's orientation. Then we may define the next-door neighbor $g=e\cdot\gamma$.
Note $\overline{M}$ must be a disjoint union of circles. Let $C$ be the connected component containing $e$ and $g$. Since applying $g\in G$ to the point $e\in C$ yields the point $g\in C$, we conclude $g\in G$ must map $C$ to itself, and in particular should be a simple rotation. Thus, the spokes on the wheel $F\cap C$ should be labelled by $\langle g\rangle$ cyclically. Let $D$ be a different connected component and $x\in F\cap D$. Applying $x\in G$ to the point $e\in C$ yields $x\in D$, and so $x$ must map $C$ to $D$. Thus the spokes on the wheel $F\cap D$ should be $x\langle g\rangle$ again cyclically.
The covering $\overline{M}\to \Bbb S^1$ and the action of $G$ can actually be constructed from $g\in G$ alone. One takes the cycle representation of $g$ acting on $G$ by the right regular representation, form the associated directed graph, interpret that as an oriented manifold, then map to $\mathbb{S}^1$ by taking every vertex to $m\in\mathbb{S}^1$ and wrapping every directed edge around the circle along its orientation. There is a left regular action of $G$ on itself, inducing graph automorphisms and subsequently covering space automorphisms.
In other words: the left cosets $x\langle g\rangle$ create circles and their disjoint union forms a covering space for $\mathbb{S}^1$ in which $G$'s left action on itself induces covering space automorphisms. An element of $g\in G$ is equivalent to a homomorphism $\mathbb{Z}\to G$, and $\pi_1(\mathbb{S}^1,m)\cong\mathbb{Z}$, so there's that. Suppose we pick a different lift of $m$ besides $e\in F$ (but keep the same labeling). We know every point looks like $xg^k$, so let's call it that. Then define $h\in G$ to be the thing that sends $xg^k$ to its next-door neighbor $xg^{k+1}$. One solves $h=xgx^{-1}$ which is in general not equal to $g$. This means the group element defined in this process depends on which lift is used; as we vary the choice of lift, this process traces out a conjugacy class in $G$.
In particular, notice that $\gamma$ acts by rotating all the circles, so in particular it does not permute $\pi_0(\overline{M})$ nontrivially. Applying the group element $g$ (associated to a choice of lift) on the other hand does generally permute $\pi_0(\overline{M})$ nontrivially, since $g$ sends $x\langle g\rangle\mapsto (gxg^{-1})\langle g\rangle$.
Extra question. The functor $A_G:\mathsf{Man}\to\mathsf{FinGpd}$, which assigns to a manifold the groupoid of principal $G$-bundles on $M$ with automorphisms, is extended to a functor $\mathsf{nCob}\to\mathsf{Span(FinGpd)}$, but I am wary of the example given at the end of page four when $M$ is without boundary. If $M$ is without boundary, does that mean it's a morphism from some kind of "empty manifold" to itself? And I guess there's exactly one $G$-bundle over the empty manifold $\varnothing$, which is $\varnothing$ itself?
 A: Your attempt at producing the homomorphism (which I would call the holonomy homomorphism, though I guess some would call the monodromy homomorphism) is perfectly correct. If $\gamma, \eta$ are two loops based at $m$ and $\bar \gamma$ etc their lifts starting at $\bar m$, suppose $\bar \gamma(0) = h_1m$ and $\bar \eta(0) = h_2m$. Then $\gamma * \eta$ (meaning do $\gamma$, then $\eta)$ lifts to $\bar \gamma * (h_1\bar\eta)$, which ends at $h_1\eta(1) = h_1h_2m$, so your homomorphism has $g(\gamma * \eta) = g(\gamma) g(\eta)$ as desired.
Changing the basepoint upstairs to $hm$ conjugates your homomorphism $g$ by $h$.
You are correct that $g(\gamma)$ and $\gamma$ needn't act the same way on $F$. In fact, they won't. If you pick a different point $hm \in F$, you see that $h\tilde \gamma(1) = hg(\gamma)$ while of course $g(\gamma)h$ is usually not that. The key point that you've identified here is that while $G$ acts on $F$ from the left, $\pi_1(M,m)$ acts on $F$ from the right.
Yes, it is standard in TQFT to allow the empty manifold to be considered a manifold of dimension $n$ so that you can allow closed manifolds as cobordisms. Here you assign to the empty manifold the empty $G$-bundle (with empty groupoid). Then the cobordism map just assigns to the closed manifold to a span where two of the objects are empty; eg it just sends the closed manifold to a groupoid itself. (There are some instantiations of TQFT where you don't actually know what to assign to the empty set, so you just delete two balls and cobord between the spheres you get. That is not the case here, of course.)
