I have encountered two definitions of connection in two different setting namely in vector bundle and principal bundle and I don't see the equivalence in these two setting.
In vector bundle setting: Let $M$ be a smooth manifold, $E$ be a vector bundle on it, and $TM$ be the tangent bundle of $M$. Define a connection $\triangledown $ be a function from $\Gamma(TM,M) \times \Gamma(E,M) \rightarrow \Gamma(E,M)$. Here $\Gamma(-,M)$ is a functor from Vector bundle to its set of global section. So we can think of $\triangledown$ as a function from $\Gamma(E,M)$ to $\Omega^1(M)\otimes \Gamma(E,M)$. Here $\Omega^1(M)$ is the set of differential 1-from on $M$.
Let $\pi:P\rightarrow M$ be our principal $G$-bundle. In principal $G$- bundle setting, we can think of connection as a set of subspace $H_p\subset T_pP$ which has dim equals to $\dim M$ or equivalently a connection form $\omega\in \Omega^1(M)\otimes \frak{g}$, where $\frak{g}$ is the lie algebra of the $G$.
I guess the definition of connection of principal $G$- bundle is more general since every vector bundle is equivalent to a principal $GL_n(\mathbb{F})$ (Here $\mathbb{F}$ can be $\mathbb{R}$ or $\mathbb{C}$). Can someone explain to me that why these two definition are equivalent when $G=GL(n)$?
Thank you!
Let us be a bit more careful. I will just expand a bit on Willie Wong's comments if you guys don't mind. Given a principal $G$-bundle $P$ on a base manifold $M$, and a linear representation space $V$ of $G$, with representation $\rho: G \to GL(V)$, where say the dimension of $V$ is $r$, there is a construction, called the associated fibre construction, which associates to $P$ and $\rho$ a vector bundle $E$ on the same base manifold $M$, of rank $r$ (the rank of a vector bundle is the dimension of each fibre).
On the other hand, given a fibre bundle $E$ on $M$ of rank $r$, its frame bundle is a principal $G$-bundle $P$ on $M$, where $G=GL(r,\mathbb{R})$. One can recover $E$ from $P$ by using the associated fibre bundle construction with representation $\rho: G \to GL(\mathbb{R}^r)$ being the identity map (remember, in this case, $G = GL(r,\mathbb{R})$).
So already, we see that principal bundles and vector bundles are not exactly equivalent (but are very closely related). It is similar to the following situation in representation theory. Given a representation $\rho: G \to GL(V)$, by just knowing the vector space $V$, one cannot a priori reconstruct $G$ and $\rho$ (all we know is that a homomorphic image of $G$ is a subgroup of $GL(V)$). However, in the case where $\rho$ is injective (faithful representation), so that $G$ is isomorphic to a subgroup of $GL(V)$, one can often add extra structure to $V$, and recover $G$ as the group of all linear automorphisms of $V$ preserving that extra structure.
Let us now talk about connections. Given a connection on a vector bundle $E$, this gives the notion of parallel transport of frames of $E$ along curves in $M$. Thus, at a point $p \in M$, given a vector $v \in T_p(M)$, there is a well defined notion of a horizontal lift of $v$ to a tangent vector $\bar{v} \in T_{\bar{p}}(P)$, where $\bar{p}$ is a point in $P$ lying in the fibre over $p$ (in other words $\bar{p}$ represents a frame at $p$). This gives a choice of horizontal subspace at each point $\bar{p}$, which can be checked to yield a connection on $P$.
On the other hand, given a connection $\omega$ on a principal $G$-bundle $P$ over $M$, and a representation $\rho: G \to GL(V)$, there is an induced connection on the vector bundle $E$ associated to $P$ and $\rho$. Indeed, choose a local frame on $M$, which is basically a local section $s$ of the bundle map $P \to M$. Then $s^*(\omega)$ is a local $1$-form with values in the Lie algebra $\mathfrak{g}$. Composing then this $1$-form with the Lie algebra map $\rho_*: \mathfrak{g} \to \mathfrak{gl}(r,\mathbb{R})$, gives a local $1$-form with values in $\mathfrak{gl}(r,\mathbb{R})$. One can then check that these local $1$-forms glue to give a global connection on $E$. I hope this helps.