A question about flat connection Let $E\to X$ be a complex flat vector bundle, and say $\nabla_0$ and $\nabla_1$ are two flat connections on it. Let $p:X\times[0, 1]\to X$ denote the projection onto the first factor. Is there a way to construct a flat connection $\tilde{\nabla}$ on $p^*E\to X\times[0, 1]$ such that $\tilde{\nabla}|_{X\times 0}=\nabla_0$ and $\tilde{\nabla}|_{X\times 1}=\nabla_1$?
If this is impossible, then is it possible to construct a (not necessarily flat) connection $\nabla'$ on $p^*E\to X\times[0, 1]$ such that $\tilde{\nabla}|_{X\times 0}=\nabla_0$, $\tilde{\nabla}|_{X\times 1}=\nabla_1$ and $\textrm{ch}(\nabla')=$ the rank of $p^*E\to X\times[0, 1]$? Here $\textrm{ch}(\nabla')$ is the Chern character form of $\nabla'$.
Thanks.
 A: The answer to your first question is of course no. For a counter example, it is enough to consider ordinary closed 1-forms, and you see that a necessary condition for the positive answer would be that all periods of both forms are the same. In the higher rank case, periods are replaced by the monodromy.
More concretely (after Anton Petrunin's comment):
Consider the case of $S^1=\mathbb R/2\pi\mathbb Z$ and the trivial line bundle over it with connections $\nabla_0=d$ and $\nabla_1=d+d\varphi.$
Consider also a connection $\tilde\nabla=d+\omega$ on $\mathbb C\to S^1\times [0;1]=:\tilde M$ which restricts to $\nabla_0$ respectively $\nabla_1.$
Then, the curvature of $\tilde\nabla$ is $d\omega$, and by Stokes theorem we get
$$2\pi=\int_{\partial\tilde M}\omega=\int_M d\omega.$$
Hence, the curvature of $\tilde\nabla$ does not vanish identically.
A: The second question leads to secondary characteristic classes. Assuming $\nabla'=\tilde\nabla$ is any connection on $X\times[0,1]$ restricting to $\nabla_i$ on $X\times\{i\}$, $i\in\{0,1\}$, its Chern-Simons form is defined as
$$\widetilde{\mathrm{ch}}(\tilde\nabla)=\int_0^1\mathrm{ch}(\tilde\nabla)\in\Omega^{\mathrm{odd}}(X;\mathbb C)\;.$$
It is closed if $\nabla_0$, $\nabla_1$ are flat. In this case, its cohomology class $\widetilde{\mathrm{ch}}(\nabla^0,\nabla^1)=[\widetilde{\mathrm{ch}}(\tilde\nabla)]\in H^{\mathrm{odd}}(X;\mathbb C)$ is independent of the choice of $\tilde\nabla$ (subject only to the boundary conditions above). If $\widetilde{\mathrm{ch}}(\nabla^0,\nabla^1)$ does not vanish, the answer to your second question is no. If it does vanish, there could still be other obstructions.
