Exterior derivative on principal bundle In Nakahara's Geometry, Topology and Physics on page 375, he constructs a Lie-algebra-valued one-form $\omega$ on a principal bundle $P$ by "lifting" a Lie-algebra-valued one-form $\mathcal A_i$ on an open covering $\{U_i\}$ on the base manifold $M$. Given a $\mathfrak{g}$-valued one-form $\mathcal{A}_i$ on $U_i$ and a local section $\sigma_i:U_i\to\pi^{-1}(U_i)$, he defines the connection one-form $\omega$ like this:
$$
\omega_i := g_i^{-1}\pi^*\mathcal A_i g_i + g_i^{-1}\mathrm{d}_Pg_i
$$
Here, $\mathrm{d}_P$ denotes the exterior derivative on $P$ and $g_i$ is the canonical local trivialization such that $\phi_i^{-1}(u)=(p,g_i)$ and $u=\sigma_i(p)g_i$. Later he proves that $\sigma_i^*\omega_i=\mathcal A_i$, where he uses the fact that $\mathrm{d}_Pg_i({\sigma_i}_*X)=0$ because of $g\equiv e$ along ${\sigma_i}_*X$.
I don't understand the notation used here.


*

*I know that $G$ acts from the right on $u\in P$. I think that's the operation meant in $\sigma_i(p)g_i$.

*There's the adjoint action of the group $G$ on its Lie algebra $\mathfrak g$. I think that's what's meant with $g_i^{-1}\pi^*\mathcal A_i g_i + g_i^{-1}\mathrm{d}_Pg_i$, because $\omega_i$'s values should be in $\mathfrak g$.

*But what is $\mathrm{d}_Pg_i({\sigma_i}_*X)$ and why does it vanish? How does $g_i$ act on the exterior derivative on $P$?

*And how does $\mathrm{d}_P$ produce a one-form? I thought $\mathrm{d}_P$ maps $p$-forms onto $(p+1)$-forms, so it needs a 0-form (function) as input to produce a one-form.


Thanks for any hints.
 A: For what follows, I will denote with $p$ the points of $P$ and with $u$ the points of $U_i$, otherwise I will get confused. But be careful that what you have written in the question (which probably comes from the book) is the other way around! For example, $\sigma_i$ is a function on $U_i$, so it takes $u$ as an argument, and not $p$...and so on!
So, we have an open region $U_i$ of $M$. $U_i$ can be seen as the projection onto $M$ of a region $\pi^{-1}(U_i)\subseteq P$ which "looks" like $U_i\times G$, but only locally, i.e. only over $U_i$, and not over the whole $M$. 
What does it mean that it "looks" like $U_i\times G$? $U_i\times G$ has a distinguished section, namely, the identity section $U_i\times {e}$. Instead, $\pi^{-1}(U_i)$ has no distinguished section. A local trivialization is a choice of such a special section, i.e. a map $\sigma_i:U_i\to \pi^{-1}(U_i)$ whose image corresponds to $U_i\times {e}$. Of course there is no canonical choice of such a section (unless the bundle is trivial), and on different open sets $U_i$ we will have to choose another section, since they don't glue together nicely (unless the bundle is trivial). But locally, only over $U_i$, we can choose out $\sigma_i$, and this will make $\pi^{-1}(U_i)$ look like $U_i\times G$, i.e. locally trivial. The map $\phi_i:U_i\times G\to \pi^{-1}(U_i)$ makes this explicit: $\phi(u,e)=\sigma_i(u)$ for any $u\in U_i$, and $\phi(u,g)=\sigma_i(u)g$.
Thanks to the map $\phi_i$, each point $p\in \pi^{-1}(U_i)$ can be seen as an element in the form $(u,g)\in U_i\times G$. In fact, any point in the image of $\sigma_i$ will look like $(u,e)$, and any other point $p\in \pi^{-1}(U_i)$ will be obtained with right mutiplication by some element $g$. So, every element $p\in \pi^{-1}(U_i)$ can be written uniquely (given a section $\sigma_i$) as $\sigma_i(u)g_i$, for some $g_i$. This $g_i$ depends of course on $p$, and it does so smoothly: there is a function $g_i:\pi^{-1}(U_i)\to G$ mapping $p\in \pi^{-1}(U_i)$ to the unique $g_i(p)$ such that $p=\phi_i(\pi(p),g_i(p))$.
So, $g_i$ is actually a smooth function on $\pi^{-1}(U_i)\subseteq P$. We can derive it, and we denote its differential by $d_P g_i$, to emphasize that it is derived as a function on $\pi^{-1}(U_i)\subseteq P$, and not on $U_i\subseteq M$. 
In particular, $g_i:\pi^{-1}(U_i)\to G$, so at some point $p$, the differential is a map $(d_P g_i)_p: T_pP\to T_{g_i(p)}G$. The target is then a tangent vector to $G$, but not at the identity, i.e. we don't have directly an element of the Lie algebra (viewing the Lie algebra as the tangent space at the identity). However, as you probably know, at any $g\in G$ there is a canonical isomorphism $T_gG\to T_eG$ given by the differential of the left-translation: $g^{-1}:G\to G$, seen as a function on $G$, which maps $g'\mapsto g^{-1}g'$, and $(dg^{-1})_{g'}:T_{g'}G\to T_{g^{-1}g'}G$. This $dg^{-1}$ at each point $g'\in G$ is then an action on vector fields on $G$ (= the Lie algebra), which we write simply as a left action. So: $g^{-1} v$, for $v$ tangent vector field, will mean $(dg^{-1})_{g'}v_{g'}$ at each $g'$.
In particular $(dg^{-1})_g:T_gG\to T_eG$, so we can write: $g^{-1}v_g\in T_eG$.
Now, we do this with $g_i(p)\in G$ at each point $p$.
We have: $(dg_i(p)^{-1})_{g_i(p)}:T_{g_i(p)}G\to T_eG$, and we write this map simply as $g_i(p)^{-1}:T_{g_i(p)}G\to T_eG$. Composing $d_Pg_i$ with this map we get:
$$
g_i(p)^{-1} (d_Pg_i)_p:T_pP\to T_eG\;,
$$
which is a linear map from $T_pP$ to $T_eG$, in other words, a differential form on (an open set of) $P$ with values in the Lie algebra.
The term you have $g_i^{-1} d_P g_i$ is exactly this! 
The other term, $g_i^{-1} \pi^* A_i g_i$ is indeed simply the adjoint action on a form $\pi^* A_i$ on (an open set of) $P$ with values in the Lie algebra. The sum $g_i^{-1} \pi^* A_i g_i + g_i^{-1} d_P g_i$ is then the sum of two 1-forms on an open set of $P$ with values in the Lie algebra.
The big result is that while both terms can change if we change local trivialization, their sum will not! Therefore we can define the object globally as a Lie-algebra-valued 1-form on $P$.
I hope this answers your questions. In particular


*

*$\sigma_i g_i$ is the right action of $G$ on $P$: yes.

*$g_i^{-1} \pi^* A_i g_i$ is the adjoint: yes. And by the way, $\pi^*A$ is the pullback of a 1-form on $U_i$.

*What is $d_P g_i$ and why it is a 1-form: should be explained above.

*How does $g_i^{-1}$ act on $d_Pg_i$: should be explained above.

*Here is why $(d_p g_i)({\sigma_i}_*X) = 0$:


Since $\phi(u,e)=\sigma_i(u)$, by definition of the function $g_i$, 
$g_i(\sigma_i(u))=g_i(\phi(u,e))=e$, so that the composite function $g_i\circ\sigma_i:U_i\to G$ is constant, and therefore it has differential zero: for any vector $X$ tangent to $U_i$:
$$
0=d(g_i\circ\sigma_i)X = (d_p g_i)({\sigma_i}_*X) \;.
$$
