I've been reading Nakahara's book on topology and geometry for physicists and got stuck on the proof of definition of the local connection form $\omega $.
So, given a Lie-algebra-valued one form $\mathcal{A}_i$ and a local section $\sigma:U_i\rightarrow\pi^{-1}(U_i)$, there exists a connection one-form $\omega$ such that $\sigma^{*}_i\omega=\mathcal{A}_i$. He states that $\omega$ is a Lie-algebra-valued one-form defined by $$\omega_i=g^{-1}_i\pi^{*}\mathcal{A}_ig_i+g^{-1}_id_pg_i$$, where $d_p$ is the exterior derivative and $g_i$ is the group element appearing in the definition of the canonical local trivialization. So for an $X\in T_pM$ $$\sigma^{*}_i\omega_i(X)=\omega_i(\sigma_{i*}X)=\pi^{*}\mathcal{A}_i(\sigma_{i*}X)+d_pg_i(\sigma_{i*}X)...$$. and goes on to the end of the proof. My question is about the step above: what happened to $g_i$ and $g^{-1}_i$ in the first term and to $g^{-1}_i$ in the second term? How did they disappear? The second is, since $\mathcal{A}_i$ is defined in the base manifold $M$ and $\sigma_{i*}\in T_{\sigma_i}P$, then how is the object $\mathcal{A}_i(\sigma_{i*}X)$ well defined?