[step:Glue the local products using the transition maps]
Define a set
\begin{align*}
E := \left(\coprod_{i\in I} U_i\times \mathbb R^k\right)\big/\sim,
\end{align*}
where the [equivalence relation](/page/Equivalence%20Relation) $\sim$ is generated by
\begin{align*}
(j,x,v)\sim (i,x,g_{ij}(x)v)
\end{align*}
for all $i,j\in I$, all $x\in U_{ij}$, and all $v\in\mathbb R^k$. The cocycle identities prove that this relation is compatible on triple overlaps and hence that $\sim$ is transitive after passing through any chain of overlapping trivializations. Define $\pi:E\to M$ by
\begin{align*}
\pi([(i,x,v)]):=x.
\end{align*}
For each $i\in I$, define the local trivialization $\Psi_i:\pi^{-1}(U_i)\to U_i\times \mathbb R^k$ by
\begin{align*}
\Psi_i([(j,x,v)]):=(x,g_{ij}(x)v).
\end{align*}
This map is well-defined because the cocycle identity gives the same value after replacing $(j,x,v)$ by an equivalent representative. Its inverse is the map from $U_i\times \mathbb R^k$ to $\pi^{-1}(U_i)$ sending $(x,v)$ to $[(i,x,v)]$.
The standard vector-bundle gluing theorem applies exactly to an open cover, smooth transition maps into $GL(k,\mathbb R)$, and the identities $g_{ii}=I_k$ and $g_{ij}g_{j\ell}=g_{i\ell}$ on triple overlaps; these hypotheses were verified in the previous two steps. Therefore equip $E$ with the unique topology and smooth structure for which each $\Psi_i$ is a homeomorphism and a smooth chart over $U_i$. On $U_{ij}$, the transition map between these charts is the map from $U_{ij}\times \mathbb R^k$ to $U_{ij}\times \mathbb R^k$ sending $(x,v)$ to $(x,g_{ij}(x)v)$. This map is smooth because $g_{ij}:U_{ij}\to GL(k,\mathbb R)$ is smooth, and its inverse sends $(x,v)$ to $(x,g_{ji}(x)v)$, which is smooth for the same reason. Thus the charts are smoothly compatible, the projection $\pi$ is locally the projection $U_i\times\mathbb R^k\to U_i$, and the vector space operations are smooth because in each chart they are the standard operations on $\mathbb R^k$. These charts define a smooth rank $k$ real vector bundle $\pi:E\to M$.
[/step]