Constructing a connection $1$-form from local forms. I am following Section $10.1.3$ of Geometry, Topology and Physics by Nakahara, and have ran in to an issue regarding local connection forms.
Consider a principal $G$-bundle, $P(M,G)$, and an open cover $\{U_{i}\}$ for $M$. Let $\mathcal{A}_{i}\in\mathfrak{g}\otimes\Omega^{1}(U_{i})$ be a Lie algebra valued $1$-form on $U_{i}$, and let $\sigma_{i}:U_{i}\to\pi^{-1}(U_{i})$ be a local section of $P$. I wish to show that there exists a connection $1$-form $\omega$ such that $\mathcal{A}_{i}=\sigma^{*}_{i}\omega$.
The candidate form is given locally by:
$$
\omega_{i}=g_{i}^{-1}\pi^{*}\mathcal{A}_{i}g_{i}+g_{i}^{-1}d_{P}g_{i}
$$
where $g_{i}$ is the canonical local trivialisation, define by $\phi_{i}^{-1}(u)=(p,g_{i})$ for $u=\sigma_{i}(p)g_{i}$.
I have been able to show that indeed $\mathcal{A}_{i}=\sigma_{i}^{*}\omega_{i}$, but for this to be a connection $1$-form, I must additionally show that:
$$
\omega_{i}(A^{\#})=A
$$
where $A\in\mathfrak{g}$, and $A^{\#}$ is the fundamental vector field, defined by:
$$
A^{\#}f(u)
=
\frac{d}{dt}f(ue^{tA})|_{t=0}
$$
for $f:P\to\mathbb{R}$ and $u\in P$.
I was able to show that indeed $(g_{i}^{-1}\pi^{*}\mathcal{A}_{i}g_{i})(A^{\#})=0$, but I am struggling with the second term. The calculation in Nakahara goes like:
$$
(g_{i}^{-1}d_{P}g_{i})(A^{\#})
=
g_{i}^{-1}(u)
\frac{dg(ue^{tA})}{dt}\biggr|_{t=0}
=
g_{i}^{-1}(u)g_{i}(u)\left(\frac{d}{dt}e^{tA}\right)\biggr|_{t=0}
=
A
$$
but I am unable to follow. I am very new to this topic, and any help would be much appreciated.
 A: After thinking about this over the weekend, I think I have a solution to my problem.
Essentially by definition, we have that:
$$
d_{P}g_{i}(A^{\#})
=
\frac{d}{dt}\left(g_{i}(\gamma(t))\right)\biggr|_{t=0}
$$
where $\gamma(t)$ is a curve in $P$ passing through $u$ with tangent vector $A^{\#}$ at $u$. But we already have one such curve, again essentially by definition. Namely $c(t):=ue^{tA}$. This gives the first equality:
$$
d_{P}g_{i}(A^{\#})
=
\frac{dg_{i}(ue^{tA})}{dt}\biggr|_{t=0}
$$
For the next equality, we use the canonical local trivialisation condition and the fact that the right action of $G$ on $P$ is associative to deduce that:
$$
ue^{tA}=\sigma_{i}(g_{i}(u)e^{tA})
$$
On the other hand, using that $\pi(ue^{tA})=\pi(u)=p$, we have:
$$
ue^{tA}=\sigma_{i}(p)g_{i}(ue^{tA})
$$
Using the uniqueness of the canonical local trivialisation, we then have that:
$$
g_{i}(ue^{tA})=g_{i}(u)e^{tA}
$$
From here, the result follows by smoothness of the group multiplication.
I will leave this up for a while without accepting the answer in case I've made any obvious mistakes.
A: Define $\mathfrak{g}$ valued 1-form $\omega$ on $P$
\begin{equation}
  \omega_i \equiv g_i^{-1} \pi^* A_i g_i + g_i^{-1} d_P g_i 
\end{equation}
Then for the $d_P$ exterior derivative on $P$
$g_i$ canonical local trivialization $\Phi_i^{-1}(u) = (p,g_i)$ , $u = \sigma_i(p)g_i $
then for $X \in T_pM$,
\begin{gathered}
  \sigma_i^*\omega_i(X) = \omega_i(\sigma_{i*}X) = g_i^{-1} \pi^* A_i g_i(\sigma_{i*} X) + g_i^{-1} d_P g_i(\sigma_{i*}X) = \\
  = \pi^*A_i(\sigma_{i*} X) + d_Pg_i(\sigma_{i*}X) = A_i(\pi_* \sigma_{i*}X) + d_Pg_i(\sigma_{i*} X)\quad \quad \quad \text{Q.E.D}
\end{gathered}
