[step:Construct the flat bundle associated to a representation]Let
\begin{align*}
\rho:\pi_1(M,x)\to G
\end{align*}
be a Lie group homomorphism. Define a right action of $\pi_1(M,x)$ on $\widetilde M\times G$ by
\begin{align*}
(\tilde m,g)\cdot\alpha=(\alpha^{-1}\tilde m,\rho(\alpha)^{-1}g).
\end{align*}
This is a right action: for $\alpha,\beta\in\pi_1(M,x)$,
\begin{align*}
\bigl((\tilde m,g)\cdot\alpha\bigr)\cdot\beta=(\beta^{-1}\alpha^{-1}\tilde m,\rho(\beta)^{-1}\rho(\alpha)^{-1}g).
\end{align*}
Since $\rho$ is a homomorphism, $\rho(\alpha\beta)^{-1}=\rho(\beta)^{-1}\rho(\alpha)^{-1}$, so this is exactly
\begin{align*}
(\tilde m,g)\cdot(\alpha\beta)=((\alpha\beta)^{-1}\tilde m,\rho(\alpha\beta)^{-1}g).
\end{align*}
The identity element acts as the identity because $\rho(e)=e$. The action is smooth, free, and proper because the deck action on $\widetilde M$ is smooth, free, and proper; hence the standard quotient theorem for smooth free proper actions gives a smooth quotient manifold. Let
\begin{align*}
P_{\rho}:=(\widetilde M\times G)/\pi_1(M,x)
\end{align*}
be the quotient by this right action, and write $[\tilde m,g]$ for the equivalence class of $(\tilde m,g)$.
The projection
\begin{align*}
\pi_{\rho}:P_{\rho}\to M,\qquad [\tilde m,g]\mapsto q(\tilde m)
\end{align*}
is well-defined because $q(\alpha^{-1}\tilde m)=q(\tilde m)$ for every deck transformation $\alpha$. The right action
\begin{align*}
P_{\rho}\times G \to P_{\rho},\qquad ([\tilde m,g],h)\mapsto [\tilde m,gh]
\end{align*}
is well-defined because
\begin{align*}
(\tilde m,gh)\cdot\alpha
=
(\alpha^{-1}\tilde m,\rho(\alpha)^{-1}gh)
\end{align*}
is obtained from $(\tilde m,g)\cdot\alpha$ by right multiplication by $h$. Therefore $P_{\rho}$ is a smooth principal right $G$-bundle over $M$.
On the product bundle $\widetilde M\times G\to\widetilde M$, take the product connection whose horizontal subspace at $(\tilde m,g)$ is
\begin{align*}
H_{(\tilde m,g)}:=T_{\tilde m}\widetilde M\oplus \{0\}\subset T_{\tilde m}\widetilde M\oplus T_gG.
\end{align*}
For each $\alpha\in\pi_1(M,x)$, denote by
\begin{align*}
R_{\alpha}:\widetilde M\times G\to \widetilde M\times G
\end{align*}
the smooth map defining the right action,
\begin{align*}
R_{\alpha}(\tilde m,g)=(\alpha^{-1}\tilde m,\rho(\alpha)^{-1}g).
\end{align*}
The differential of $R_{\alpha}$ sends
\begin{align*}
T_{\tilde m}\widetilde M\oplus\{0\}
\end{align*}
onto
\begin{align*}
T_{\alpha^{-1}\tilde m}\widetilde M\oplus\{0\}.
\end{align*}
Hence the horizontal distribution is invariant under $\pi_1(M,x)$ and descends by the standard descent criterion for invariant Ehresmann connections to a smooth principal connection on $P_{\rho}$. Since the product horizontal distribution is integrable and has zero curvature, the descended connection is flat.[/step]